Commit c8a1817d authored by Benjamin REIS's avatar Benjamin REIS

rename aqsnd.c -> aqsnd.m + use AVAudioSession up to date API

parent b8c0491e
......@@ -13,7 +13,7 @@
* - Alsa (Linux): src/audiofilters/alsa.c
* - Android native sound (libmedia): src/android/androidsound.cpp
* - Android sound (deprecated): src/android/androidsound_depr.cpp
* - Audio Queue Service (Mac OS X): src/audiofilters/aqsnd.c
* - Audio Queue Service (Mac OS X): src/audiofilters/aqsnd.m
* - Audio Unit Service (Mac OS X): src/audiofilters/msiounit.m
* - Arts (Linux): src/audiofilters/arts.c
* - DirectSound (Windows): src/audiofilters/winsndds.cpp
......
......@@ -224,7 +224,7 @@ if(ENABLE_MACSND)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/macsnd.c)
endif()
if(ENABLE_MACAQSND)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/aqsnd.c)
list(APPEND VOIP_SOURCE_FILES_OBJC audiofilters/aqsnd.m)
endif()
if(ENABLE_OSS)
list(APPEND VOIP_SOURCE_FILES_C audiofilters/oss.c)
......
......@@ -219,7 +219,7 @@ libmediastreamer_voip_la_SOURCES+= audiofilters/aac-eld.c
endif
if BUILD_MACAQSND
libmediastreamer_voip_la_SOURCES+= audiofilters/aqsnd.c
libmediastreamer_voip_la_SOURCES+= audiofilters/aqsnd.m
endif
if BUILD_PULSEAUDIO
......
......@@ -55,7 +55,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#import <AVFoundation/AVAudioSession.h>
#include <AudioToolbox/AudioToolbox.h>
#if !TARGET_OS_IPHONE
#include <CoreAudio/AudioHardware.h>
......@@ -784,8 +784,7 @@ static void aq_stop_r(MSFilter * f)
AudioQueueDispose(d->readQueue, true);
#if TARGET_OS_IPHONE
OSStatus aqresult = AudioSessionSetActiveWithFlags(false, kAudioSessionSetActiveFlag_NotifyOthersOnDeactivation);
check_aqresult(aqresult,"AudioSessionSetActive(false)");
[[AVAudioSession sharedInstance] setActive:FALSE withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];
#endif
}
}
......@@ -796,14 +795,8 @@ static void aq_start_w(MSFilter * f)
if (d->write_started == FALSE) {
OSStatus aqresult;
#if TARGET_OS_IPHONE
UInt32 audioCategory;
audioCategory= kAudioSessionCategory_AmbientSound;
ms_message("AQ: Configuring audio session for playback");
aqresult =AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(audioCategory), &audioCategory);
check_aqresult(aqresult,"Configuring audio session ");
aqresult = AudioSessionSetActive(true);
check_aqresult(aqresult,"AudioSessionSetActive");
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
[[AVAudioSession sharedInstance] setActive:TRUE error:nil];
#endif
d->writeAudioFormat.mSampleRate = d->rate;
d->writeAudioFormat.mFormatID = kAudioFormatLinearPCM;
......@@ -884,8 +877,7 @@ static void aq_stop_w(MSFilter * f)
AudioQueueDispose(d->writeQueue, true);
#if TARGET_OS_IPHONE
OSStatus aqresult = AudioSessionSetActiveWithFlags(false, kAudioSessionSetActiveFlag_NotifyOthersOnDeactivation);
check_aqresult(aqresult,"AudioSessionSetActive(false)");
[[AVAudioSession sharedInstance] setActive:FALSE withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment