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 73208864d245a71d157138179004ed3dc6d275a3..82163e3fbdabee19c23128a5c20ddf11bf041404 100644 |
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h |
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h |
@@ -15,9 +15,12 @@ |
#include <AudioUnit/AudioUnit.h> |
+#include "webrtc/base/objc/RTCMacros.h" |
#include "webrtc/base/thread_checker.h" |
#include "webrtc/modules/audio_device/audio_device_generic.h" |
+RTC_FWD_DECL_OBJC_CLASS(RTCAudioSessionDelegateAdapter); |
+ |
namespace webrtc { |
class FineAudioBuffer; |
@@ -151,16 +154,16 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
void ClearRecordingWarning() override {} |
void ClearRecordingError() override {} |
+ // These methods should be called in response to audio events. |
henrika_webrtc
2016/03/15 08:53:44
Any restrictions on the calling thread?
tkchin_webrtc
2016/03/15 20:14:58
Done.
|
+ void OnInterruptionBegin(); |
+ void OnInterruptionEnd(); |
+ void OnValidRouteChange(); |
+ |
private: |
// Uses current |playout_parameters_| and |record_parameters_| to inform the |
// audio device buffer (ADB) about our internal audio parameters. |
void UpdateAudioDeviceBuffer(); |
- // Registers observers for the AVAudioSessionRouteChangeNotification and |
- // AVAudioSessionInterruptionNotification notifications. |
- void RegisterNotificationObservers(); |
- void UnregisterNotificationObservers(); |
- |
// Since the preferred audio parameters are only hints to the OS, the actual |
// values may be different once the AVAudioSession has been activated. |
// This method asks for the current hardware parameters and takes actions |
@@ -286,9 +289,11 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
// Set to true after successful call to InitPlayout(), false otherwise. |
bool play_is_initialized_; |
+ // Set to true if audio session is interrupted, false otherwise. |
+ bool is_interrupted_; |
+ |
// Audio interruption observer instance. |
- void* audio_interruption_observer_; |
- void* route_change_observer_; |
+ RTCAudioSessionDelegateAdapter* audio_session_observer_; |
// Contains the audio data format specification for a stream of audio. |
AudioStreamBasicDescription application_format_; |