OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 AudioFrame frame; | 255 AudioFrame frame; |
256 const int kOutSampleRateHz = 8000; // Different than codec sample rate. | 256 const int kOutSampleRateHz = 8000; // Different than codec sample rate. |
257 for (const auto codec_id : kCodecId) { | 257 for (const auto codec_id : kCodecId) { |
258 const CodecIdInst codec(codec_id); | 258 const CodecIdInst codec(codec_id); |
259 const int num_10ms_frames = codec.inst.pacsize / (codec.inst.plfreq / 100); | 259 const int num_10ms_frames = codec.inst.pacsize / (codec.inst.plfreq / 100); |
260 InsertOnePacketOfSilence(codec.id); | 260 InsertOnePacketOfSilence(codec.id); |
261 for (int k = 0; k < num_10ms_frames; ++k) { | 261 for (int k = 0; k < num_10ms_frames; ++k) { |
262 EXPECT_EQ(0, receiver_->GetAudio(kOutSampleRateHz, &frame)); | 262 EXPECT_EQ(0, receiver_->GetAudio(kOutSampleRateHz, &frame)); |
263 } | 263 } |
264 EXPECT_EQ(std::min(32000, codec.inst.plfreq), | 264 EXPECT_EQ(codec.inst.plfreq, receiver_->last_output_sample_rate_hz()); |
265 receiver_->current_sample_rate_hz()); | |
266 } | 265 } |
267 } | 266 } |
268 | 267 |
269 TEST_F(AcmReceiverTestOldApi, DISABLED_ON_ANDROID(PostdecodingVad)) { | 268 TEST_F(AcmReceiverTestOldApi, DISABLED_ON_ANDROID(PostdecodingVad)) { |
270 receiver_->EnableVad(); | 269 receiver_->EnableVad(); |
271 EXPECT_TRUE(receiver_->vad_enabled()); | 270 EXPECT_TRUE(receiver_->vad_enabled()); |
272 const CodecIdInst codec(RentACodec::CodecId::kPCM16Bwb); | 271 const CodecIdInst codec(RentACodec::CodecId::kPCM16Bwb); |
273 ASSERT_EQ( | 272 ASSERT_EQ( |
274 0, receiver_->AddCodec(codec.id, codec.inst.pltype, codec.inst.channels, | 273 0, receiver_->AddCodec(codec.id, codec.inst.pltype, codec.inst.channels, |
275 codec.inst.plfreq, nullptr)); | 274 codec.inst.plfreq, nullptr)); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } | 358 } |
360 EXPECT_EQ(c.id, receiver_->last_audio_codec_id()); | 359 EXPECT_EQ(c.id, receiver_->last_audio_codec_id()); |
361 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); | 360 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); |
362 EXPECT_TRUE(CodecsEqual(c.inst, codec)); | 361 EXPECT_TRUE(CodecsEqual(c.inst, codec)); |
363 } | 362 } |
364 } | 363 } |
365 | 364 |
366 } // namespace acm2 | 365 } // namespace acm2 |
367 | 366 |
368 } // namespace webrtc | 367 } // namespace webrtc |
OLD | NEW |