Skip to content

Commit

Permalink
CoreAudio iOS/tvOS: Use AVFoundation instead of AudioSession. Fixes a…
Browse files Browse the repository at this point in the history
…udio on tvOS.

Note that linking with AVFoundation is now required if you don't disable SDL_audio compilation on iOS and tvOS.
  • Loading branch information
slime73 committed Sep 15, 2016
1 parent dbe2997 commit 4209a1f
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 47 deletions.
20 changes: 20 additions & 0 deletions Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
Expand Up @@ -31,6 +31,14 @@
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */; };
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D71D8B5E7700915323 /* AVFoundation.framework */; };
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FABA34D31D8B5E5600915323 /* AVFoundation.framework */; };
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAE0E9691BAF96A00098DFA4 /* GameController.framework */; };
Expand Down Expand Up @@ -213,6 +221,8 @@
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FA30DE961BBF59D9009C397F /* Happy-TV.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Happy-TV.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; };
FABA34D31D8B5E5600915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
FABA34D71D8B5E7700915323 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.0.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; };
FAE0E9691BAF96A00098DFA4 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; };
FD15FCB20E086866003BDF25 /* Happy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Happy.app; sourceTree = BUILT_PRODUCTS_DIR; };
FD1B48920E313154007AB34E /* SDL.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SDL.xcodeproj; path = ../SDL/SDL.xcodeproj; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -253,6 +263,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D41D8B5E5600915323 /* AVFoundation.framework in Frameworks */,
FD1B48DD0E313255007AB34E /* libSDL2.a in Frameworks */,
FAE0E96A1BAF96A00098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA31967070A00F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -270,6 +281,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D81D8B5E7700915323 /* AVFoundation.framework in Frameworks */,
FA30DEB71BBF5BB8009C397F /* libSDL2.a in Frameworks */,
FA30DEC81BBF5C14009C397F /* GameController.framework in Frameworks */,
FA30DEC91BBF5C14009C397F /* AudioToolbox.framework in Frameworks */,
Expand All @@ -286,6 +298,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D61D8B5E5A00915323 /* AVFoundation.framework in Frameworks */,
FD1B49980E313261007AB34E /* libSDL2.a in Frameworks */,
FAE0E96C1BAF96A90098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA41967071300F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -303,6 +316,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34D91D8B5E7B00915323 /* AVFoundation.framework in Frameworks */,
FD1B499C0E313269007AB34E /* libSDL2.a in Frameworks */,
FAE0E96D1BAF96AF0098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA51967071A00F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -320,6 +334,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DD1D8B5E8D00915323 /* AVFoundation.framework in Frameworks */,
FDB652000E43D1F300F688B5 /* libSDL2.a in Frameworks */,
FAE0E9711BAF96BB0098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA91967073D00F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -337,6 +352,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DA1D8B5E7F00915323 /* AVFoundation.framework in Frameworks */,
FD1B499E0E31326C007AB34E /* libSDL2.a in Frameworks */,
FAE0E96E1BAF96B10098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA61967072100F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -354,6 +370,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DC1D8B5E8900915323 /* AVFoundation.framework in Frameworks */,
FD1B49A20E313273007AB34E /* libSDL2.a in Frameworks */,
FAE0E9701BAF96B80098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA81967073400F8EB7C /* CoreMotion.framework in Frameworks */,
Expand All @@ -371,6 +388,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FABA34DB1D8B5E8500915323 /* AVFoundation.framework in Frameworks */,
FD1B49A00E313270007AB34E /* libSDL2.a in Frameworks */,
FAE0E96F1BAF96B50098DFA4 /* GameController.framework in Frameworks */,
FA8B4BA71967072800F8EB7C /* CoreMotion.framework in Frameworks */,
Expand Down Expand Up @@ -428,6 +446,8 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
FABA34D71D8B5E7700915323 /* AVFoundation.framework */,
FABA34D31D8B5E5600915323 /* AVFoundation.framework */,
FAE0E9691BAF96A00098DFA4 /* GameController.framework */,
FA8B4BA21967070A00F8EB7C /* CoreMotion.framework */,
FDF0D7220E12D31800247964 /* AudioToolbox.framework */,
Expand Down
12 changes: 6 additions & 6 deletions Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
Expand Up @@ -74,7 +74,7 @@
56A6703818565E760007D20F /* SDL_dynapi.h in Headers */ = {isa = PBXBuildFile; fileRef = 56A6703418565E760007D20F /* SDL_dynapi.h */; };
56C181DF17C44D5E00406AE3 /* SDL_filesystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */; };
56C181E217C44D7A00406AE3 /* SDL_sysfilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */; };
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
56EA86FC13E9EC2B002E47EB /* SDL_coreaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */; };
56ED04E1118A8EE200A56AA6 /* SDL_power.c in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E0118A8EE200A56AA6 /* SDL_power.c */; };
56ED04E3118A8EFD00A56AA6 /* SDL_syspower.m in Sources */ = {isa = PBXBuildFile; fileRef = 56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */; };
Expand Down Expand Up @@ -147,7 +147,7 @@
FA1DC2731C62BE65008F99A0 /* SDL_uikitclipboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FA1DC2711C62BE65008F99A0 /* SDL_uikitclipboard.m */; };
FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8912E23B8D00BA343D /* SDL_atomic.c */; };
FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */ = {isa = PBXBuildFile; fileRef = 04FFAB8A12E23B8D00BA343D /* SDL_spinlock.c */; };
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */; };
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */; };
FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B91D0DD52EDC00FB1D6B /* SDL_dummyaudio.c */; };
FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9440DD52EDC00FB1D6B /* SDL_audio.c */; };
FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */ = {isa = PBXBuildFile; fileRef = FD99B9460DD52EDC00FB1D6B /* SDL_audiocvt.c */; };
Expand Down Expand Up @@ -368,7 +368,7 @@
56A6703418565E760007D20F /* SDL_dynapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_dynapi.h; path = ../../src/dynapi/SDL_dynapi.h; sourceTree = "<group>"; };
56C181DE17C44D5E00406AE3 /* SDL_filesystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_filesystem.h; sourceTree = "<group>"; };
56C181E117C44D7A00406AE3 /* SDL_sysfilesystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_sysfilesystem.m; path = ../../src/filesystem/cocoa/SDL_sysfilesystem.m; sourceTree = "<group>"; };
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_coreaudio.c; path = coreaudio/SDL_coreaudio.c; sourceTree = "<group>"; };
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_coreaudio.m; path = coreaudio/SDL_coreaudio.m; sourceTree = "<group>"; };
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_coreaudio.h; path = coreaudio/SDL_coreaudio.h; sourceTree = "<group>"; };
56ED04E0118A8EE200A56AA6 /* SDL_power.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SDL_power.c; path = ../../src/power/SDL_power.c; sourceTree = SOURCE_ROOT; };
56ED04E2118A8EFD00A56AA6 /* SDL_syspower.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDL_syspower.m; path = ../../src/power/uikit/SDL_syspower.m; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -683,7 +683,7 @@
56EA86F813E9EBF9002E47EB /* coreaudio */ = {
isa = PBXGroup;
children = (
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.c */,
56EA86F913E9EC2B002E47EB /* SDL_coreaudio.m */,
56EA86FA13E9EC2B002E47EB /* SDL_coreaudio.h */,
);
name = coreaudio;
Expand Down Expand Up @@ -1255,7 +1255,7 @@
files = (
FAB5981D1BB5C31500BE72C5 /* SDL_atomic.c in Sources */,
FAB5981E1BB5C31500BE72C5 /* SDL_spinlock.c in Sources */,
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.c in Sources */,
FAB5981F1BB5C31500BE72C5 /* SDL_coreaudio.m in Sources */,
FAB598211BB5C31500BE72C5 /* SDL_dummyaudio.c in Sources */,
FAB598231BB5C31500BE72C5 /* SDL_audio.c in Sources */,
FAB598251BB5C31500BE72C5 /* SDL_audiocvt.c in Sources */,
Expand Down Expand Up @@ -1441,7 +1441,7 @@
0402A85812FE70C600CECEE3 /* SDL_render_gles2.c in Sources */,
0402A85912FE70C600CECEE3 /* SDL_shaders_gles2.c in Sources */,
04BAC09D1300C1290055DE28 /* SDL_log.c in Sources */,
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.c in Sources */,
56EA86FB13E9EC2B002E47EB /* SDL_coreaudio.m in Sources */,
93CB792613FC5F5300BD3E05 /* SDL_uikitviewcontroller.m in Sources */,
AA628ADB159369E3005138DD /* SDL_rotate.c in Sources */,
AA126AD51617C5E7005ABC8F /* SDL_uikitmodes.m in Sources */,
Expand Down

0 comments on commit 4209a1f

Please sign in to comment.