summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2016-10-18 00:38:18 +0000
committerLiong Sauw Ming <ming@teluu.com>2016-10-18 00:38:18 +0000
commit2679a67077418e48c4e3c60fd63a7b182441d157 (patch)
tree06cb579c66896e6760b04db8e465912ea67b574d
parenta408b29b7180398324d9e69b9925f96e1a675b84 (diff)
Fixed #1941: Disable the setup of audio session in coreaudio_dev. This will allow application to have better control towards its audio session management, which will help to ensure a smoother integration with CallKit features.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5463 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia-audiodev/coreaudio_dev.m10
1 files changed, 9 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m
index b3a4a787..53781b25 100644
--- a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m
+++ b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m
@@ -52,6 +52,12 @@
/* Starting iOS SDK 7, Audio Session API is deprecated. */
#define USE_AUDIO_SESSION_API 0
+
+ /* For better integration with CallKit features (available starting
+ * in iOS 10), let the application setup and manage its own
+ * audio session.
+ */
+ #define SETUP_AV_AUDIO_SESSION 0
#endif
/* For Mac OS 10.5.x and earlier */
@@ -335,6 +341,7 @@ static pj_status_t ca_factory_init(pjmedia_aud_dev_factory *f)
}
#endif
+#if SETUP_AV_AUDIO_SESSION
/* Initialize audio session category and mode */
{
AVAudioSession *sess = [AVAudioSession sharedInstance];
@@ -360,6 +367,7 @@ static pj_status_t ca_factory_init(pjmedia_aud_dev_factory *f)
PJ_LOG(3, (THIS_FILE, "Warning: failed settting audio mode"));
}
}
+#endif
cf_instance = cf;
#endif
@@ -2080,7 +2088,7 @@ static pj_status_t ca_stream_stop(pjmedia_aud_stream *strm)
}
pj_mutex_unlock(stream->cf->mutex);
-#if !COREAUDIO_MAC
+#if !COREAUDIO_MAC && SETUP_AV_AUDIO_SESSION
if (should_deactivate) {
if ([stream->sess
respondsToSelector:@selector(setActive:withOptions:error:)])