Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tvOS - Apple TV OS Feature - Updated Again! #4831

Merged
merged 76 commits into from
Feb 20, 2016

Conversation

danoli3
Copy link
Member

@danoli3 danoli3 commented Feb 17, 2016

Split PR of changes for tvOS

Previous PR: #4477


Updated PR from #4413

Working version of openframeWorks for AppleTVOS tvOS

Requirements:

  • Xcode 7.1+

Changes:

  • Added Seperate ofxtvOS.h
  • Added Seperate ofxtvOSAppDelegate / ofxtvOSViewController
  • Added New Seperate tvOS+OFLib static project file for tvOS (as it is quite different from iOS)
  • Added tvOS template project
  • Recompiled all libraries with embedded bitcode
  • Changes to ofConstants.h to add tvOS definitions
  • Changed #ifdef TARGET_OS_IOS to ``#if TARGET_OS_IOS`
    • (as it is defined in tvOS sdk however defined as 0, so #if works / #ifdef doesn't not.)
  • Using #if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)
  • Changes to a lot of ofxiOS files

Testing:

  • tvOS Empty Example (Working on AppleTV 4 AppleTV Simulator ).
  • tvOS Static Lib (Building successfully for AppleTV 4 and AppleTV Simulator)
  • iOS Examples (All working! Regression Test)

Changes made include modifications to ofxiOS with some pre-processor defines to not expose certain functions that are not in the tvOS SDK (such as video grabber, mapkit, orientation code etc).


Pre-Requisites (Apothecary library builds) (WORK IN PROGRESS) - BITCODE = YES.

  • ./apothecary -t tvos update FreeImage
  • ./apothecary -t tvos update openssl
  • ./apothecary -t tvos update poco
  • ./apothecary -t tvos update freetype
  • ./apothecary -t tvos update tess2
  • ./apothecary -t tvos update ofxAssimpModelLoader

- [x] ./apothecary -t tvos update ofxOpenCV Removed.

Library Changes.

  • Requires Poco *1.6.1 + (tvOS support). (SHA=f8dee428ab61499753e9b2f81f8a5b9ea1dc74e4)
  • Removed ofxOpenCV (no vision).

@danoli3
Copy link
Member Author

danoli3 commented Feb 17, 2016

@arturoc @ofTheo I think this is good to merge!!

Note: This is missing the libraries for tvOS (however anyone wanting to test, just run the apothecary scripts listed above).

@arturoc
Copy link
Member

arturoc commented Feb 17, 2016

looks good to me, @ofTheo if you want to take a look, otherwise i think we can merge it

// need to configure set the audio category, and override to it route the audio to the speaker
if([audioSession respondsToSelector:@selector(setCategory:withOptions:error:)]) {
// we're on iOS 6 or greater, so use the AVFoundation API
if(![audioSession setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker
withOptions:AVAudioSessionCategoryOptionMixWithOthers
error:&err]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danoli3 - curious about this change. Does that mean for all iOS apps going forward they want capture exclusive audio out? ( I know this is in the input stream - but I remember there being some issues related to this way back )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the issue you had before! #2187 Seems to be related to that withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker not been in iOS 5.

In regards to what does it mean for capturing exclusive audio out... I'm not entirely sure, I think it should be fine, mix with others just allows that whole multi audio app design in iOS 9. If a developer wanted to silence that, they can with a AudioSession command regardless. So I think it should be fine.

This is the internals of the commands: tvOS prohibited so didn't have much option unless this command is really important then I could pre-processor around it if needed.

typedef NS_OPTIONS(NSUInteger, AVAudioSessionCategoryOptions)
{
    /* MixWithOthers is only valid with AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryPlayback, and  AVAudioSessionCategoryMultiRoute */
    AVAudioSessionCategoryOptionMixWithOthers           = 0x1,
    /* DuckOthers is only valid with AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryPlayback, and AVAudioSessionCategoryMultiRoute */
    AVAudioSessionCategoryOptionDuckOthers              = 0x2,
    /* AllowBluetooth is only valid with AVAudioSessionCategoryRecord and AVAudioSessionCategoryPlayAndRecord */
    AVAudioSessionCategoryOptionAllowBluetooth  __TVOS_PROHIBITED       = 0x4,
    /* DefaultToSpeaker is only valid with AVAudioSessionCategoryPlayAndRecord */
    AVAudioSessionCategoryOptionDefaultToSpeaker __TVOS_PROHIBITED      = 0x8,
    /* InterruptSpokenAudioAndMixWithOthers is only valid with AVAudioSessionCategoryPlayAndRecord, AVAudioSessionCategoryPlayback, and AVAudioSessionCategoryMultiRoute */
    AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers NS_AVAILABLE_IOS(9_0)  = 0x11
} NS_AVAILABLE_IOS(6_0);

@ofTheo
Copy link
Member

ofTheo commented Feb 17, 2016

@danoli3 - apart from that one comment this looks good to me!
excited to see this being brought in! :)

@danoli3
Copy link
Member Author

danoli3 commented Feb 18, 2016

@ofTheo Check my reply to your comments. Just realised it wasn't tagged.

After that keen to merge this so I keep working on the iOS sector without merge issues.

@danoli3 danoli3 added this to the 0.10.0 milestone Feb 18, 2016
@danoli3
Copy link
Member Author

danoli3 commented Feb 20, 2016

@ofTheo if we need to make that change back, after this merge I'll fix it with a default type based on target if needed. MIX seems to hit all targets though so should be a better solution.

…ge/Feature

# Conflicts:
#	scripts/templates/ios/Project.xcconfig
#	scripts/templates/ios/emptyExample.xcodeproj/project.pbxproj
@danoli3
Copy link
Member Author

danoli3 commented Feb 20, 2016

Okay I'm going to merge once Travis gives clear

@danoli3
Copy link
Member Author

danoli3 commented Feb 20, 2016

danoli3 added a commit that referenced this pull request Feb 20, 2016
tvOS - Apple TV OS Feature - Updated Again!
@danoli3 danoli3 merged commit 367f6b2 into openframeworks:master Feb 20, 2016
@danoli3 danoli3 deleted the tvOS/Merge/Feature branch February 20, 2016 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants