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