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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 InsertOnePacketOfSilence(kCodecId[n]); | 258 InsertOnePacketOfSilence(kCodecId[n]); |
259 for (int k = 0; k < num_10ms_frames; ++k) { | 259 for (int k = 0; k < num_10ms_frames; ++k) { |
260 EXPECT_EQ(0, receiver_->GetAudio(kOutSampleRateHz, &frame)); | 260 EXPECT_EQ(0, receiver_->GetAudio(kOutSampleRateHz, &frame)); |
261 } | 261 } |
262 EXPECT_EQ(std::min(32000, codecs_[kCodecId[n]].plfreq), | 262 EXPECT_EQ(std::min(32000, codecs_[kCodecId[n]].plfreq), |
263 receiver_->current_sample_rate_hz()); | 263 receiver_->current_sample_rate_hz()); |
264 ++n; | 264 ++n; |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
268 // Verify that the playout mode is set correctly. | |
269 TEST_F(AcmReceiverTest, DISABLED_ON_ANDROID(PlayoutMode)) { | |
270 receiver_->SetPlayoutMode(voice); | |
271 EXPECT_EQ(voice, receiver_->PlayoutMode()); | |
272 | |
273 receiver_->SetPlayoutMode(streaming); | |
274 EXPECT_EQ(streaming, receiver_->PlayoutMode()); | |
275 | |
276 receiver_->SetPlayoutMode(fax); | |
277 EXPECT_EQ(fax, receiver_->PlayoutMode()); | |
278 | |
279 receiver_->SetPlayoutMode(off); | |
280 EXPECT_EQ(off, receiver_->PlayoutMode()); | |
281 } | |
282 | |
283 TEST_F(AcmReceiverTest, DISABLED_ON_ANDROID(PostdecodingVad)) { | 268 TEST_F(AcmReceiverTest, DISABLED_ON_ANDROID(PostdecodingVad)) { |
284 receiver_->EnableVad(); | 269 receiver_->EnableVad(); |
285 EXPECT_TRUE(receiver_->vad_enabled()); | 270 EXPECT_TRUE(receiver_->vad_enabled()); |
286 | 271 |
287 const int id = ACMCodecDB::kPCM16Bwb; | 272 const int id = ACMCodecDB::kPCM16Bwb; |
288 ASSERT_EQ(0, receiver_->AddCodec(id, codecs_[id].pltype, codecs_[id].channels, | 273 ASSERT_EQ(0, receiver_->AddCodec(id, codecs_[id].pltype, codecs_[id].channels, |
289 codecs_[id].plfreq, NULL)); | 274 codecs_[id].plfreq, NULL)); |
290 const int kNumPackets = 5; | 275 const int kNumPackets = 5; |
291 const int num_10ms_frames = codecs_[id].pacsize / (codecs_[id].plfreq / 100); | 276 const int num_10ms_frames = codecs_[id].pacsize / (codecs_[id].plfreq / 100); |
292 AudioFrame frame; | 277 AudioFrame frame; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 EXPECT_EQ(kCodecId[n], receiver_->last_audio_codec_id()); | 355 EXPECT_EQ(kCodecId[n], receiver_->last_audio_codec_id()); |
371 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); | 356 EXPECT_EQ(0, receiver_->LastAudioCodec(&codec)); |
372 EXPECT_TRUE(CodecsEqual(codecs_[kCodecId[n]], codec)); | 357 EXPECT_TRUE(CodecsEqual(codecs_[kCodecId[n]], codec)); |
373 ++n; | 358 ++n; |
374 } | 359 } |
375 } | 360 } |
376 | 361 |
377 } // namespace acm2 | 362 } // namespace acm2 |
378 | 363 |
379 } // namespace webrtc | 364 } // namespace webrtc |
OLD | NEW |