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

Unified Diff: media/audio/audio_device_thread.h

Issue 1703473002: Make AudioOutputDevice restartable and reinitializable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_mixing
Patch Set: Created 4 years, 10 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_device_thread.h
diff --git a/media/audio/audio_device_thread.h b/media/audio/audio_device_thread.h
index 7ec9d6ea751da51a5919741d71bae378a272f65c..dd7d1cac925d476ba2c5401b38512e66f8dfe100 100644
--- a/media/audio/audio_device_thread.h
+++ b/media/audio/audio_device_thread.h
@@ -75,12 +75,12 @@ class MEDIA_EXPORT AudioDeviceThread {
AudioDeviceThread();
~AudioDeviceThread();
- // Starts the audio thread. The thread must not already be running. If
- // |sychronized_buffers| is set, the browser expects to be notified via the
- // |socket| every time AudioDeviceThread::Process() completes.
- void Start(AudioDeviceThread::Callback* callback,
- base::SyncSocket::Handle socket,
- const char* thread_name,
+ // Starts the audio thread and puts in wait mode. StartRun() must
+ // be called to release it and actually start running. The thread must not
+ // already be started. If |sychronized_buffers| is set, the browser expects
+ // to be notified via the |socket| every time AudioDeviceThread::Process()
+ // completes.
+ void Start(const char* thread_name,
bool synchronized_buffers);
// This tells the audio thread to stop and clean up the data.
@@ -94,6 +94,16 @@ class MEDIA_EXPORT AudioDeviceThread {
// If set to NULL, function will wait for the thread to exit before returning.
void Stop(base::MessageLoop* loop_for_join);
+ // Releases the thread from wait mode so that it starts running with the given
+ // |callback| and |socket|. This will also reset the index used for
+ // sychronized buffers.
+ void StartRun(AudioDeviceThread::Callback* callback,
+ base::SyncSocket::Handle socket);
+
+ // Stops running the thread, puts it in wait mode and shuts down the socket.
+ // It can then be started again with StartRun().
+ void StopRun();
+
// Returns true if the thread is stopped or stopping.
bool IsStopped();

Powered by Google App Engine
This is Rietveld 408576698