Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: webrtc/modules/audio_device/ios/audio_device_ios.h

Issue 1401963002: Adds support for Bluetooth headsets to the iOS audio layer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nit Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « webrtc/modules/audio_device/fine_audio_buffer.cc ('k') | webrtc/modules/audio_device/ios/audio_device_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698