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

Unified Diff: media/audio/audio_manager_base.h

Issue 9692038: stopping the audio thread before destroying the AudioManager<Platform> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and fixed the speech recognition unittest Created 8 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: media/audio/audio_manager_base.h
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index ea9c78a870965d95fb99608697280504473fe724..ba272217afcccd2906e48f3b45c460d9865d35b1 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -59,11 +59,6 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
void IncreaseActiveInputStreamCount();
void DecreaseActiveInputStreamCount();
- // Shuts down the audio thread and releases all the audio output dispatchers
- // on the audio thread. All AudioOutputProxy instances should be freed before
- // Shutdown is called.
- void Shutdown();
-
// Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy
// name is also from |AUDIO_PCM_LINEAR|.
virtual AudioOutputStream* MakeLinearOutputStream(
@@ -89,6 +84,12 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
AudioParameters::Compare>
AudioOutputDispatchersMap;
+ // Shuts down the audio thread and releases all the audio output dispatchers
+ // on the audio thread. All audio streams should be freed before
+ // Shutdown is called.
+ // This must be called in the destructor of the AudioManager<Platform>.
+ void Shutdown();
+
void ShutdownOnAudioThread();
void SetMaxOutputStreamsAllowed(int max) { max_num_output_streams_ = max; }
@@ -111,9 +112,15 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
// SetMaxOutputStreamsAllowed().
int max_num_output_streams_;
+ // Max number of open input streams.
+ int max_num_input_streams_;
+
// Number of currently open output streams.
int num_output_streams_;
+ // Number of currently open input streams.
+ int num_input_streams_;
+
DISALLOW_COPY_AND_ASSIGN(AudioManagerBase);
};

Powered by Google App Engine
This is Rietveld 408576698