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

Unified Diff: media/audio/audio_output_controller.h

Issue 3185022: Share one thread between all AudioOutputControllers instead of creating one per stream. (Closed)
Patch Set: - Created 10 years, 4 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
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index 10e3d032ed2cd1ddb174055cb3fb57b49ea4a51d..460006722c39ab6a2abc8ddfdd23b198b48656fb 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -8,11 +8,13 @@
#include "base/lock.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
-#include "base/thread.h"
#include "base/time.h"
#include "media/audio/audio_io.h"
+#include "media/audio/audio_manager.h"
#include "media/audio/simple_sources.h"
+class MessageLoop;
+
// An AudioOutputController controls an AudioOutputStream and provides data
// to this output stream. It has an important function that it executes
// audio operations like play, pause, stop, etc. on a separate thread,
@@ -138,9 +140,9 @@ class AudioOutputController
// has effect when the stream is paused.
void Flush();
- // Closes the audio output stream and shutdown the audio controller thread.
- // This method returns only after all operations are completed. This
- // controller cannot be used after this method is called.
+ // Closes the audio output stream. It changes state to kClosed and returns
+ // right away. The physical resources are freed on the audio thread if
+ // neccessary.
//
// It is safe to call this method more than once. Calls after the first one
// will have no effect.
@@ -203,8 +205,8 @@ class AudioOutputController
// SyncReader is used only in low latency mode for synchronous reading.
SyncReader* sync_reader_;
- // The audio controller thread that this object runs on.
- base::Thread thread_;
+ // The message loop of audio thread that this object runs on.
+ MessageLoop* message_loop_;
DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
};
« no previous file with comments | « media/audio/audio_manager_base.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698