Index: webrtc/modules/audio_device/ios/audio_device_ios.h |
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.h b/webrtc/modules/audio_device/ios/audio_device_ios.h |
index 8f8ba0a9c53ce7c6cd059885f3e241829bf01dea..3061aef9f77faf791a38ba93effb47f7d23a0e7b 100644 |
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h |
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h |
@@ -13,6 +13,7 @@ |
#include <AudioUnit/AudioUnit.h> |
+#include "webrtc/base/criticalsection.h" |
#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/modules/audio_device/audio_device_generic.h" |
@@ -184,6 +185,9 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
// Closes and deletes the voice-processing I/O unit. |
bool ShutdownPlayOrRecord(); |
+ // Helper method for destroying the existing audio unit. |
+ void DisposeAudioUnit(); |
+ |
// Callback function called on a real-time priority I/O thread from the audio |
// unit. This method is used to signal that recorded audio is available. |
static OSStatus RecordedDataIsAvailable( |
@@ -211,6 +215,16 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
UInt32 in_number_frames, |
AudioBufferList* io_data); |
+ // Counts number of times setActive:YES has been called on the singleton |
+ // AVAudioSession instance. Used to ensure that we don't disable an audio |
+ // session when it is still in used by other instances of this object. |
+ // Member is static to ensure that the value is counted for all instances |
+ // and not per instance. |
+ static int audio_session_activation_count_; |
pbos-webrtc
2015/11/18 12:54:22
Put GUARDED_BY(lock_) between "count_" and ";"
henrika_webrtc
2015/11/18 16:05:32
Done.
|
+ |
+ // Protects |audio_session_activation_count_|. |
+ static rtc::GlobalLockPod lock_; |
+ |
// Ensures that methods are called from the same thread as this object is |
// created on. |
rtc::ThreadChecker thread_checker_; |