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

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

Issue 1435293003: Improved error handling in iOS ADM to avoid race during init (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback from pbos@ Created 5 years, 1 month 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 8f8ba0a9c53ce7c6cd059885f3e241829bf01dea..132396782a49b9907e8b8fdcd6939937db74fc45 100644
--- a/webrtc/modules/audio_device/ios/audio_device_ios.h
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.h
@@ -13,7 +13,9 @@
#include <AudioUnit/AudioUnit.h>
+#include "webrtc/base/criticalsection.h"
pbos-webrtc 2015/11/18 18:51:48 Move to .cc file
henrika_webrtc 2015/11/19 12:04:19 Done.
#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/thread_annotations.h"
pbos-webrtc 2015/11/18 18:51:48 Move to .cc file
henrika_webrtc 2015/11/19 12:04:19 Done.
#include "webrtc/base/thread_checker.h"
#include "webrtc/modules/audio_device/audio_device_generic.h"
@@ -155,6 +157,9 @@ class AudioDeviceIOS : public AudioDeviceGeneric {
// audio device buffer (ADB) about our internal audio parameters.
void UpdateAudioDeviceBuffer();
+ bool ActivateAudioSession();
+ bool DeactivateAudioSession();
+
// Registers observers for the AVAudioSessionRouteChangeNotification and
// AVAudioSessionInterruptionNotification notifications.
void RegisterNotificationObservers();
@@ -182,7 +187,10 @@ class AudioDeviceIOS : public AudioDeviceGeneric {
bool InitPlayOrRecord();
// Closes and deletes the voice-processing I/O unit.
- bool ShutdownPlayOrRecord();
+ void 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.

Powered by Google App Engine
This is Rietveld 408576698