Chromium Code Reviews| Index: media/audio/win/audio_low_latency_output_win.h |
| diff --git a/media/audio/win/audio_low_latency_output_win.h b/media/audio/win/audio_low_latency_output_win.h |
| index 1584a4603df01eb13de4a3363a12753352327762..cc160c17cb86b7fe6be74c9493d3ceb662712d37 100644 |
| --- a/media/audio/win/audio_low_latency_output_win.h |
| +++ b/media/audio/win/audio_low_latency_output_win.h |
| @@ -157,7 +157,10 @@ class MEDIA_EXPORT WASAPIAudioOutputStream : |
| // Checks available amount of space in the endpoint buffer and reads |
| // data from the client to fill up the buffer without causing audio |
| // glitches. |
| - bool RenderAudioFromSource(UINT64 device_frequency); |
| + bool RenderAudioFromSource(UINT64 device_frequency, |
| + IAudioClient* thread_audio_client, |
| + IAudioRenderClient* thread_audio_render_client, |
| + IAudioClock* thread_audio_clock); |
| // Called when the device will be opened in exclusive mode and use the |
| // application specified format. |
| @@ -172,6 +175,12 @@ class MEDIA_EXPORT WASAPIAudioOutputStream : |
| // |source_| is set to NULL. |
| void StopThread(); |
| + // Handles sharing of COM pointers between the audio and render threads. |
| + bool MarshalComPointers(); |
| + bool UnmarshalComPointers(IAudioClient** audio_client, |
| + IAudioRenderClient** audio_render_client, |
| + IAudioClock** audio_clock); |
| + |
| // Contains the thread ID of the creating thread. |
| base::PlatformThreadId creating_thread_id_; |
| @@ -221,6 +230,18 @@ class MEDIA_EXPORT WASAPIAudioOutputStream : |
| // Pointer to the client that will deliver audio samples to be played out. |
| AudioSourceCallback* source_; |
| + // ------------------------------------------------------ |
| + // Warning: COM pointers must be marshaled from the audio thread to be used |
| + // on any other thread. Do not use any of these interfaces on a thread other |
| + // than the audio thread. See MarshalComPointers() and UnmarshalComPointers() |
| + // for marshaling pointers to the render thread. |
| + |
| + // Stream into which the COM pointers below are marshaled so that they can |
| + // be used on another thread. |
| + IStream* com_stream_; |
|
tommi (sloooow) - chröme
2015/04/20 18:23:38
ScopedComPtr
|
| + |
| + // Windows Audio Session API (WASAPI) interfaces. |
| + |
| // An IAudioClient interface which enables a client to create and initialize |
| // an audio stream between an audio application and the audio engine. |
| base::win::ScopedComPtr<IAudioClient> audio_client_; |
| @@ -229,6 +250,9 @@ class MEDIA_EXPORT WASAPIAudioOutputStream : |
| // data to a rendering endpoint buffer. |
| base::win::ScopedComPtr<IAudioRenderClient> audio_render_client_; |
| + base::win::ScopedComPtr<IAudioClock> audio_clock_; |
| + // ------------------------------------------------------ |
| + |
| // The audio engine will signal this event each time a buffer becomes |
| // ready to be filled by the client. |
| base::win::ScopedHandle audio_samples_render_event_; |
| @@ -239,8 +263,6 @@ class MEDIA_EXPORT WASAPIAudioOutputStream : |
| // Container for retrieving data from AudioSourceCallback::OnMoreData(). |
| scoped_ptr<AudioBus> audio_bus_; |
| - base::win::ScopedComPtr<IAudioClock> audio_clock_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); |
| }; |