Chromium Code Reviews| Index: media/audio/audio_device_thread.h |
| diff --git a/media/audio/audio_device_thread.h b/media/audio/audio_device_thread.h |
| index 61e5e8724ddc24b289c01c364e3491b137779462..d81606b27494a8b2a8627222762c082b73b64163 100644 |
| --- a/media/audio/audio_device_thread.h |
| +++ b/media/audio/audio_device_thread.h |
| @@ -75,13 +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, |
| - bool synchronized_buffers); |
| + // Starts the audio thread and puts into wait mode. Play() 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. |
| // The method can stop the thread synchronously or asynchronously. |
| @@ -94,10 +93,21 @@ 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 Play(AudioDeviceThread::Callback* callback, |
|
Henrik Grunell
2016/04/29 14:34:55
For output, we could now set the callback once in
Henrik Grunell
2016/05/03 13:34:55
Actually, it's not possible - this is the callback
|
| + base::SyncSocket::Handle socket); |
| + |
| + // Puts the thread in the wait mode and shuts down the socket. |
| + // It can be resumed again with Play(). |
| + void Pause(); |
| + |
| // Returns true if the thread is stopped or stopping. |
| bool IsStopped(); |
| private: |
| + // Not sure if we need this extra class and extra lock? |
|
Henrik Grunell
2016/04/29 14:34:55
This was Olga's addition.
|
| // Our own private SimpleThread override. We implement this in a |
| // private class so that we get the following benefits: |
| // 1) AudioDeviceThread doesn't expose SimpleThread methods. |