Add an output capacity parameter to ACMResampler::Resample10Msec()

Also adding a unit tests to make sure that a desired output frequency
of 0 passed to AudioCodingModule::PlayoutData10Ms() is invalid.

R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14369005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5974 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2014-04-24 19:05:33 +00:00
parent 103657b484
commit 439a4c49f9
6 changed files with 56 additions and 27 deletions

View File

@ -211,8 +211,9 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
int frame_length, int percent_loss) {
AudioFrame audio_frame;
int32_t out_freq_hz_b = out_file_.SamplingFrequency();
int16_t audio[480 * 12 * 2]; // Can hold 120 ms stereo audio.
int16_t out_audio[480 * 12 * 2]; // Can hold 120 ms stereo audio.
const int kBufferSizeSamples = 480 * 12 * 2; // Can hold 120 ms stereo audio.
int16_t audio[kBufferSizeSamples];
int16_t out_audio[kBufferSizeSamples];
int16_t audio_type;
int written_samples = 0;
int read_samples = 0;
@ -257,6 +258,7 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
audio_frame.sample_rate_hz_,
48000,
channels,
kBufferSizeSamples - written_samples,
&audio[written_samples]));
written_samples += 480 * channels;