Chromium Code Reviews| Index: media/audio/win/audio_low_latency_input_win.h |
| diff --git a/media/audio/win/audio_low_latency_input_win.h b/media/audio/win/audio_low_latency_input_win.h |
| index e933a4471303817b75ae38127cf7dd7db51eab39..9161881972c2cb5b95e5953d806b74b26b0d3a66 100644 |
| --- a/media/audio/win/audio_low_latency_input_win.h |
| +++ b/media/audio/win/audio_low_latency_input_win.h |
| @@ -131,6 +131,11 @@ class MEDIA_EXPORT WASAPIAudioInputStream |
| WAVEFORMATEX** device_format, |
| int* effects); |
| + // Handles sharing of COM pointers between the audio and capture threads. |
|
tommi (sloooow) - chröme
2015/04/22 10:31:52
maybe add a note about thread requirements? (these
DaleCurtis
2015/04/22 17:48:54
Done.
|
| + bool MarshalComPointers(); |
| + bool UnmarshalComPointers( |
| + base::win::ScopedComPtr<IAudioCaptureClient>* audio_capture_client); |
| + |
| // Our creator, the audio manager needs to be notified when we close. |
| AudioManagerWin* manager_; |
| @@ -179,8 +184,17 @@ class MEDIA_EXPORT WASAPIAudioInputStream |
| // Pointer to the object that will receive the recorded audio samples. |
| AudioInputCallback* sink_; |
| - // Windows Multimedia Device (MMDevice) API interfaces. |
| + // ------------------------------------------------------ |
| + // 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 capture thread. |
| + |
| + // Stream into which the COM pointers below are marshaled so that they can |
| + // be used on another thread. |
| + base::win::ScopedComPtr<IStream> com_stream_; |
| + // Windows Multimedia Device (MMDevice) API interfaces. |
| // An IMMDevice interface which represents an audio endpoint device. |
| base::win::ScopedComPtr<IMMDevice> endpoint_device_; |
| @@ -198,16 +212,17 @@ class MEDIA_EXPORT WASAPIAudioInputStream |
| // details. |
| base::win::ScopedComPtr<IAudioClient> audio_render_client_for_loopback_; |
| - // The IAudioCaptureClient interface enables a client to read input data |
| - // from a capture endpoint buffer. |
| - base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
| - |
| // The ISimpleAudioVolume interface enables a client to control the |
| // master volume level of an audio session. |
| // The volume-level is a value in the range 0.0 to 1.0. |
| // This interface does only work with shared-mode streams. |
| base::win::ScopedComPtr<ISimpleAudioVolume> simple_audio_volume_; |
| + // The IAudioCaptureClient interface enables a client to read input data |
| + // from a capture endpoint buffer. |
| + base::win::ScopedComPtr<IAudioCaptureClient> audio_capture_client_; |
| + // ------------------------------------------------------ |
| + |
| // The audio engine will signal this event each time a buffer has been |
| // recorded. |
| base::win::ScopedHandle audio_samples_ready_event_; |