OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_)); | 426 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_)); |
427 } | 427 } |
428 }; | 428 }; |
429 | 429 |
430 class AudioDecoderOpusTest : public AudioDecoderTest { | 430 class AudioDecoderOpusTest : public AudioDecoderTest { |
431 protected: | 431 protected: |
432 AudioDecoderOpusTest() : AudioDecoderTest() { | 432 AudioDecoderOpusTest() : AudioDecoderTest() { |
433 codec_input_rate_hz_ = 48000; | 433 codec_input_rate_hz_ = 48000; |
434 frame_size_ = 480; | 434 frame_size_ = 480; |
435 data_length_ = 10 * frame_size_; | 435 data_length_ = 10 * frame_size_; |
436 decoder_ = new AudioDecoderOpus(1); | 436 decoder_ = new AudioDecoderOpusImpl(1); |
437 AudioEncoderOpusConfig config; | 437 AudioEncoderOpusConfig config; |
438 config.frame_size_ms = static_cast<int>(frame_size_) / 48; | 438 config.frame_size_ms = static_cast<int>(frame_size_) / 48; |
439 config.application = AudioEncoderOpusConfig::ApplicationMode::kVoip; | 439 config.application = AudioEncoderOpusConfig::ApplicationMode::kVoip; |
440 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); | 440 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); |
441 } | 441 } |
442 }; | 442 }; |
443 | 443 |
444 class AudioDecoderOpusStereoTest : public AudioDecoderOpusTest { | 444 class AudioDecoderOpusStereoTest : public AudioDecoderOpusTest { |
445 protected: | 445 protected: |
446 AudioDecoderOpusStereoTest() : AudioDecoderOpusTest() { | 446 AudioDecoderOpusStereoTest() : AudioDecoderOpusTest() { |
447 channels_ = 2; | 447 channels_ = 2; |
448 delete decoder_; | 448 delete decoder_; |
449 decoder_ = new AudioDecoderOpus(2); | 449 decoder_ = new AudioDecoderOpusImpl(2); |
450 AudioEncoderOpusConfig config; | 450 AudioEncoderOpusConfig config; |
451 config.frame_size_ms = static_cast<int>(frame_size_) / 48; | 451 config.frame_size_ms = static_cast<int>(frame_size_) / 48; |
452 config.num_channels = 2; | 452 config.num_channels = 2; |
453 config.application = AudioEncoderOpusConfig::ApplicationMode::kAudio; | 453 config.application = AudioEncoderOpusConfig::ApplicationMode::kAudio; |
454 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); | 454 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); |
455 } | 455 } |
456 }; | 456 }; |
457 | 457 |
458 TEST_F(AudioDecoderPcmUTest, EncodeDecode) { | 458 TEST_F(AudioDecoderPcmUTest, EncodeDecode) { |
459 int tolerance = 251; | 459 int tolerance = 251; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb)); | 685 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb)); |
686 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb)); | 686 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb)); |
687 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz)); | 687 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz)); |
688 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz)); | 688 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz)); |
689 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary)); | 689 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary)); |
690 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus)); | 690 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus)); |
691 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch)); | 691 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch)); |
692 } | 692 } |
693 | 693 |
694 } // namespace webrtc | 694 } // namespace webrtc |
OLD | NEW |