summaryrefslogtreecommitdiffstats
path: root/remoting/codec
diff options
context:
space:
mode:
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 04:24:19 +0000
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-21 04:24:19 +0000
commit4187ea43e11dd33ec2d542edd76163d8fc7ed1c1 (patch)
tree142e57255a31a095905e78423279f1fa2f4eb42e /remoting/codec
parent2d115a11ba119dc8d3df465b3fdb96fb94a0e1bc (diff)
downloadchromium_src-4187ea43e11dd33ec2d542edd76163d8fc7ed1c1.zip
chromium_src-4187ea43e11dd33ec2d542edd76163d8fc7ed1c1.tar.gz
chromium_src-4187ea43e11dd33ec2d542edd76163d8fc7ed1c1.tar.bz2
Collapse AudioRendererMixer and OnMoreDataResampler into AudioTransform.
Currently we have roughly equivalent functionality in two places, and the CloudView project will add a third. As such there's a need for a single super class which can handle mixing, resampling, and general conversion from one set of AudioParameters to another. This change introduces the AudioTransform object which collapses the key functionality from AudioRendererMixer and OnMoreDataResampler into a single AudioTransform class which can do everything and is oblivious to the peculiars of RenderCallback vs AudioSourceCallback. It also introduces output_frames_ready() methods to the AudioPullFifo and MultiChannelResampler classes so that buffer delay can be measured accurately without resorting to input vs output byte counting. Due to the bulk of AudioRendererMixer's functionality moving into the new AudioTransform, it made sense to move some decisions into the AudioRendererMixerInput class as well. On my Z600, benchmarking 50000 iterations: Convert() w/ FIFO took 7030.11ms. Convert() w/o FIFO took 5218.83ms. BUG=none TEST=AudioTransform* unittests. TBR=sergeyu Review URL: https://chromiumcodereview.appspot.com/11410012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec')
-rw-r--r--remoting/codec/audio_encoder_opus.cc3
-rw-r--r--remoting/codec/audio_encoder_opus.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/remoting/codec/audio_encoder_opus.cc b/remoting/codec/audio_encoder_opus.cc
index 6ff3056..ab19c94 100644
--- a/remoting/codec/audio_encoder_opus.cc
+++ b/remoting/codec/audio_encoder_opus.cc
@@ -124,7 +124,8 @@ bool AudioEncoderOpus::ResetForPacket(AudioPacket* packet) {
return encoder_ != NULL;
}
-void AudioEncoderOpus::FetchBytesToResample(media::AudioBus* audio_bus) {
+void AudioEncoderOpus::FetchBytesToResample(int resampler_frame_delay,
+ media::AudioBus* audio_bus) {
DCHECK(resampling_data_);
int samples_left = (resampling_data_size_ - resampling_data_pos_) /
kBytesPerSample / channels_;
diff --git a/remoting/codec/audio_encoder_opus.h b/remoting/codec/audio_encoder_opus.h
index b172de2..7f610d4 100644
--- a/remoting/codec/audio_encoder_opus.h
+++ b/remoting/codec/audio_encoder_opus.h
@@ -34,7 +34,8 @@ class AudioEncoderOpus : public AudioEncoder {
void DestroyEncoder();
bool ResetForPacket(AudioPacket* packet);
- void FetchBytesToResample(media::AudioBus* audio_bus);
+ void FetchBytesToResample(int resampler_frame_delay,
+ media::AudioBus* audio_bus);
int sampling_rate_;
AudioPacket::Channels channels_;