Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1073)

Unified Diff: media/filters/audio_renderer_algorithm_base.cc

Issue 157001: Modify OLA to use window size in seconds instead of bytes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/audio_renderer_algorithm_base.h ('k') | media/filters/audio_renderer_algorithm_ola.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_algorithm_base.cc
===================================================================
--- media/filters/audio_renderer_algorithm_base.cc (revision 20385)
+++ media/filters/audio_renderer_algorithm_base.cc (working copy)
@@ -15,6 +15,7 @@
AudioRendererAlgorithmBase::AudioRendererAlgorithmBase()
: channels_(0),
+ sample_rate_(0),
sample_bytes_(0),
playback_rate_(0.0f) {
}
@@ -22,15 +23,22 @@
AudioRendererAlgorithmBase::~AudioRendererAlgorithmBase() {}
void AudioRendererAlgorithmBase::Initialize(int channels,
+ int sample_rate,
int sample_bits,
float initial_playback_rate,
RequestReadCallback* callback) {
DCHECK_GT(channels, 0);
+ DCHECK_LE(channels, 6) << "We only support <=6 channel audio.";
+ DCHECK_GT(sample_rate, 0);
+ DCHECK_LE(sample_rate, 256000)
+ << "We only support sample rates at or below 256000Hz.";
DCHECK_GT(sample_bits, 0);
+ DCHECK_LE(sample_bits, 32) << "We only support 8, 16, 32 bit audio.";
+ DCHECK_EQ(sample_bits % 8, 0) << "We only support 8, 16, 32 bit audio.";
DCHECK(callback);
- DCHECK_EQ(sample_bits % 8, 0) << "We only support 8, 16, 32 bit audio.";
channels_ = channels;
+ sample_rate_ = sample_rate;
sample_bytes_ = sample_bits / 8;
request_read_callback_.reset(callback);
@@ -88,6 +96,10 @@
return channels_;
}
+int AudioRendererAlgorithmBase::sample_rate() {
+ return sample_rate_;
+}
+
int AudioRendererAlgorithmBase::sample_bytes() {
return sample_bytes_;
}
« no previous file with comments | « media/filters/audio_renderer_algorithm_base.h ('k') | media/filters/audio_renderer_algorithm_ola.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698