diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 23:18:48 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 23:18:48 +0000 |
commit | 2f6d086da79c737bc2a0ee3023ca80c608c75d19 (patch) | |
tree | 6943204cb1c9c7d7cbe722f91a64a1c326601fef /media/audio/fake_audio_input_stream.cc | |
parent | 87949cc2b85979964ca9de9483ba1ba2758e0b81 (diff) | |
download | chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.zip chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.gz chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.bz2 |
Add AudioParameters struct. Use it everywhere.
BUG=None
TEST=unittests
Review URL: http://codereview.chromium.org/3226012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/fake_audio_input_stream.cc')
-rw-r--r-- | media/audio/fake_audio_input_stream.cc | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc index d631fb8..c0e4529 100644 --- a/media/audio/fake_audio_input_stream.cc +++ b/media/audio/fake_audio_input_stream.cc @@ -7,21 +7,18 @@ using base::Time; using base::TimeDelta; -AudioInputStream* FakeAudioInputStream::MakeFakeStream(int channels, - int bits_per_sample, - int sampling_rate, +AudioInputStream* FakeAudioInputStream::MakeFakeStream(AudioParameters params, int samples_per_packet) { - return new FakeAudioInputStream(channels, bits_per_sample, sampling_rate, - samples_per_packet); + return new FakeAudioInputStream(params, samples_per_packet); } -FakeAudioInputStream::FakeAudioInputStream(int channels, int bits_per_sample, - int sampling_rate, +FakeAudioInputStream::FakeAudioInputStream(AudioParameters params, int samples_per_packet) : callback_(NULL), - buffer_size_((channels * bits_per_sample * samples_per_packet) / 8), + buffer_size_((params.channels * params.bits_per_sample * + samples_per_packet) / 8), thread_("FakeAudioRecordingThread"), - callback_interval_ms_((samples_per_packet * 1000) / sampling_rate) { + callback_interval_ms_((samples_per_packet * 1000) / params.sample_rate) { // This object is ref counted (so that it can be used with Thread, PostTask) // but the caller expects a plain pointer. So we take a reference here and // will Release() ourselves in Close(). |