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

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

Issue 1822543002: Support delayed AudioUnit initialization. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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/voice_processing_audio_unit.h
diff --git a/webrtc/modules/audio_device/ios/voice_processing_audio_unit.h b/webrtc/modules/audio_device/ios/voice_processing_audio_unit.h
index c1e5cafb4bbc9500c70c172b9a21064217ddb4c5..2f881e77fcdcbb963a95e0a75846cd8bc807090b 100644
--- a/webrtc/modules/audio_device/ios/voice_processing_audio_unit.h
+++ b/webrtc/modules/audio_device/ios/voice_processing_audio_unit.h
@@ -49,6 +49,16 @@ class VoiceProcessingAudioUnit {
~VoiceProcessingAudioUnit();
// TODO(tkchin): enum for state and state checking.
+ enum State : int32_t {
+ // Init() should be called.
+ kInitRequired,
+ // Audio unit created but not initialized.
+ kUninitialized,
+ // Initialized but not started. Equivalent to stopped.
+ kInitialized,
+ // Initialized and started.
+ kStarted,
+ };
// Number of bytes per audio sample for 16-bit signed integer representation.
static const UInt32 kBytesPerSample;
@@ -60,6 +70,8 @@ class VoiceProcessingAudioUnit {
// Does not intialize the audio unit.
bool Init();
+ VoiceProcessingAudioUnit::State GetState() const;
+
// Initializes the underlying audio unit with the given sample rate.
bool Initialize(Float64 sample_rate);
@@ -118,6 +130,7 @@ class VoiceProcessingAudioUnit {
VoiceProcessingAudioUnitObserver* observer_;
AudioUnit vpio_unit_;
+ VoiceProcessingAudioUnit::State state_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698