| 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 2c217ccf976b1e3023ad71fd68f53e3abfd57ce1..5d498560cf8769dc98ca8132d883e9c6bb2b0053 100644
|
| --- a/media/audio/win/audio_low_latency_output_win.h
|
| +++ b/media/audio/win/audio_low_latency_output_win.h
|
| @@ -182,9 +182,19 @@ class MEDIA_EXPORT WASAPIAudioOutputStream
|
| virtual void SetVolume(double volume) OVERRIDE;
|
| virtual void GetVolume(double* volume) OVERRIDE;
|
|
|
| - // Retrieves the stream format that the audio engine uses for its internal
|
| - // processing/mixing of shared-mode streams.
|
| - // This method should not be used in combination with exclusive-mode streams.
|
| + // Retrieves the number of channels the audio engine uses for its internal
|
| + // processing/mixing of shared-mode streams for the default endpoint device.
|
| + static int HardwareChannelCount();
|
| +
|
| + // Retrieves the channel layout the audio engine uses for its internal
|
| + // processing/mixing of shared-mode streams for the default endpoint device.
|
| + // Note that we convert an internal channel layout mask (see ChannelMask())
|
| + // into a Chrome-specific channel layout enumerator in this method, hence
|
| + // the match might not be perfect.
|
| + static ChannelLayout HardwareChannelLayout();
|
| +
|
| + // Retrieves the sample rate the audio engine uses for its internal
|
| + // processing/mixing of shared-mode streams for the default endpoint device.
|
| static int HardwareSampleRate(ERole device_role);
|
|
|
| // Returns AUDCLNT_SHAREMODE_EXCLUSIVE if --enable-exclusive-mode is used
|
| @@ -255,7 +265,14 @@ class MEDIA_EXPORT WASAPIAudioOutputStream
|
| // new default audio device.
|
| bool RestartRenderingUsingNewDefaultDevice();
|
|
|
| - AUDCLNT_SHAREMODE share_mode() const { return share_mode_; }
|
| + // Returns the number of channels the audio engine uses for its internal
|
| + // processing/mixing of shared-mode streams for the default endpoint device.
|
| + int endpoint_channel_count() { return format_.Format.nChannels; }
|
| +
|
| + // TODO(henrika): add comments...
|
| + int channel_factor() const {
|
| + return (format_.Format.nChannels / client_channel_count_);
|
| + }
|
|
|
| // Initializes the COM library for use by the calling thread and sets the
|
| // thread's concurrency model to multi-threaded.
|
| @@ -272,12 +289,14 @@ class MEDIA_EXPORT WASAPIAudioOutputStream
|
| base::DelegateSimpleThread* render_thread_;
|
|
|
| // Contains the desired audio format which is set up at construction.
|
| - WAVEFORMATEX format_;
|
| + // Extended PCM waveform format structure based on WAVEFORMATEXTENSIBLE.
|
| + // Use this for multiple channel and hi-resolution PCM data.
|
| + WAVEFORMATPCMEX format_;
|
|
|
| // Copy of the audio format which we know the audio engine supports.
|
| // It is recommended to ensure that the sample rate in |format_| is identical
|
| // to the sample rate in |audio_engine_mix_format_|.
|
| - base::win::ScopedCoMem<WAVEFORMATEX> audio_engine_mix_format_;
|
| + base::win::ScopedCoMem<WAVEFORMATPCMEX> audio_engine_mix_format_;
|
|
|
| bool opened_;
|
| bool started_;
|
| @@ -316,6 +335,9 @@ class MEDIA_EXPORT WASAPIAudioOutputStream
|
| // where AUDCLNT_SHAREMODE_SHARED is the default.
|
| AUDCLNT_SHAREMODE share_mode_;
|
|
|
| + // TODO(henrika): add comments...
|
| + int client_channel_count_;
|
| +
|
| // Counts the number of audio frames written to the endpoint buffer.
|
| UINT64 num_written_frames_;
|
|
|
|
|