| Index: media/audio/audio_output_resampler.cc
|
| diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc
|
| index 75b703b2fc62630a63598719e0cf8b8fb52ae913..31b5e4a580b61ab7f5d8df960f54c6aaeb8bcee4 100644
|
| --- a/media/audio/audio_output_resampler.cc
|
| +++ b/media/audio/audio_output_resampler.cc
|
| @@ -24,80 +24,6 @@
|
|
|
| namespace media {
|
|
|
| -class OnMoreDataResampler : public AudioOutputStream::AudioSourceCallback {
|
| - public:
|
| - OnMoreDataResampler(double io_ratio,
|
| - const AudioParameters& input_params,
|
| - const AudioParameters& output_params);
|
| - virtual ~OnMoreDataResampler();
|
| -
|
| - // AudioSourceCallback interface.
|
| - virtual int OnMoreData(AudioBus* dest,
|
| - AudioBuffersState buffers_state) OVERRIDE;
|
| - virtual int OnMoreIOData(AudioBus* source,
|
| - AudioBus* dest,
|
| - AudioBuffersState buffers_state) OVERRIDE;
|
| - virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE;
|
| - virtual void WaitTillDataReady() OVERRIDE;
|
| -
|
| - // Sets |source_callback_|. If this is not a new object, then Stop() must be
|
| - // called before Start().
|
| - void Start(AudioOutputStream::AudioSourceCallback* callback);
|
| -
|
| - // Clears |source_callback_| and flushes the resampler.
|
| - void Stop();
|
| -
|
| - private:
|
| - // Called by MultiChannelResampler when more data is necessary.
|
| - void ProvideInput(AudioBus* audio_bus);
|
| -
|
| - // Called by AudioPullFifo when more data is necessary. Requires
|
| - // |source_lock_| to have been acquired.
|
| - void SourceCallback_Locked(AudioBus* audio_bus);
|
| -
|
| - // Passes through |source| to the |source_callback_| OnMoreIOData() call.
|
| - void SourceIOCallback_Locked(AudioBus* source, AudioBus* dest);
|
| -
|
| - // Ratio of input bytes to output bytes used to correct playback delay with
|
| - // regard to buffering and resampling.
|
| - double io_ratio_;
|
| -
|
| - // Source callback and associated lock.
|
| - base::Lock source_lock_;
|
| - AudioOutputStream::AudioSourceCallback* source_callback_;
|
| -
|
| - // Last AudioBuffersState object received via OnMoreData(), used to correct
|
| - // playback delay by ProvideInput() and passed on to |source_callback_|.
|
| - AudioBuffersState current_buffers_state_;
|
| -
|
| - // Total number of bytes (in terms of output parameters) stored in resampler
|
| - // or FIFO buffers which have not been sent to the audio device.
|
| - int outstanding_audio_bytes_;
|
| -
|
| - // Used to buffer data between the client and the output device in cases where
|
| - // the client buffer size is not the same as the output device buffer size.
|
| - // Bound to SourceCallback_Locked() so must only be used when |source_lock_|
|
| - // has already been acquired.
|
| - scoped_ptr<AudioPullFifo> audio_fifo_;
|
| -
|
| - // Handles resampling.
|
| - scoped_ptr<MultiChannelResampler> resampler_;
|
| -
|
| - // Handles channel transforms. |unmixed_audio_| is a temporary destination
|
| - // for audio data before it goes into the channel mixer.
|
| - scoped_ptr<ChannelMixer> channel_mixer_;
|
| - scoped_ptr<AudioBus> unmixed_audio_;
|
| -
|
| - int output_bytes_per_frame_;
|
| - int input_bytes_per_frame_;
|
| -
|
| - // Since resampling is expensive, figure out if we should downmix channels
|
| - // before resampling.
|
| - bool downmix_early_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(OnMoreDataResampler);
|
| -};
|
| -
|
| // Record UMA statistics for hardware output configuration.
|
| static void RecordStats(const AudioParameters& output_params) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
|
|