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 63f3cab7e272f0d8e64886d978f9158d81e7a406..8f8ba0a9c53ce7c6cd059885f3e241829bf01dea 100644 |
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h |
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h |
@@ -155,6 +155,11 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
// 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 |
@@ -168,6 +173,10 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
// This method also initializes the created audio unit. |
bool SetupAndInitializeVoiceProcessingAudioUnit(); |
+ // Restarts active audio streams using a new sample rate. Required when e.g. |
+ // a BT headset is enabled or disabled. |
+ bool RestartAudioUnitWithNewFormat(float sample_rate); |
+ |
// Activates our audio session, creates and initializes the voice-processing |
// audio unit and verifies that we got the preferred native audio parameters. |
bool InitPlayOrRecord(); |
@@ -202,7 +211,6 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
UInt32 in_number_frames, |
AudioBufferList* io_data); |
- private: |
// Ensures that methods are called from the same thread as this object is |
// created on. |
rtc::ThreadChecker thread_checker_; |
@@ -276,6 +284,10 @@ class AudioDeviceIOS : public AudioDeviceGeneric { |
// Audio interruption observer instance. |
void* audio_interruption_observer_; |
+ void* route_change_observer_; |
+ |
+ // Contains the audio data format specification for a stream of audio. |
+ AudioStreamBasicDescription application_format_; |
}; |
} // namespace webrtc |