| 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 |
| 11 // Test to verify correct operation for externally created decoders. | 11 // Test to verify correct operation for externally created decoders. |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 | 14 |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" |
| 16 #include "webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h" | 17 #include "webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h" |
| 17 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 18 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
| 18 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h" | 19 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h" |
| 19 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 20 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
| 20 #include "webrtc/modules/include/module_common_types.h" | 21 #include "webrtc/modules/include/module_common_types.h" |
| 21 #include "webrtc/test/testsupport/fileutils.h" | 22 #include "webrtc/test/testsupport/fileutils.h" |
| 22 | 23 |
| 23 namespace webrtc { | 24 namespace webrtc { |
| 24 | 25 |
| 25 using ::testing::_; | 26 using ::testing::_; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 static const size_t kMaxBlockSize = 480; // 10 ms @ 48 kHz. | 172 static const size_t kMaxBlockSize = 480; // 10 ms @ 48 kHz. |
| 172 | 173 |
| 173 NetEqExternalVsInternalDecoderTest() | 174 NetEqExternalVsInternalDecoderTest() |
| 174 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16Bswb32kHz, | 175 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16Bswb32kHz, |
| 175 new MockExternalPcm16B), | 176 new MockExternalPcm16B), |
| 176 sample_rate_hz_( | 177 sample_rate_hz_( |
| 177 CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz)) { | 178 CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz)) { |
| 178 NetEq::Config config; | 179 NetEq::Config config; |
| 179 config.sample_rate_hz = | 180 config.sample_rate_hz = |
| 180 CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz); | 181 CodecSampleRateHz(NetEqDecoder::kDecoderPCM16Bswb32kHz); |
| 181 neteq_internal_.reset(NetEq::Create(config)); | 182 neteq_internal_.reset( |
| 183 NetEq::Create(config, CreateBuiltinAudioDecoderFactory())); |
| 182 } | 184 } |
| 183 | 185 |
| 184 void SetUp() override { | 186 void SetUp() override { |
| 185 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType( | 187 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType( |
| 186 NetEqDecoder::kDecoderPCM16Bswb32kHz, | 188 NetEqDecoder::kDecoderPCM16Bswb32kHz, |
| 187 "pcm16-swb32", kPayloadType)); | 189 "pcm16-swb32", kPayloadType)); |
| 188 } | 190 } |
| 189 | 191 |
| 190 void GetAndVerifyOutput() override { | 192 void GetAndVerifyOutput() override { |
| 191 // Get audio from internal decoder instance. | 193 // Get audio from internal decoder instance. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 kStartSeqeunceNumber, | 445 kStartSeqeunceNumber, |
| 444 kStartTimestamp, | 446 kStartTimestamp, |
| 445 kJumpFromTimestamp, | 447 kJumpFromTimestamp, |
| 446 kJumpToTimestamp)); | 448 kJumpToTimestamp)); |
| 447 | 449 |
| 448 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. | 450 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. |
| 449 EXPECT_EQ(kRecovered, test_state_); | 451 EXPECT_EQ(kRecovered, test_state_); |
| 450 } | 452 } |
| 451 | 453 |
| 452 } // namespace webrtc | 454 } // namespace webrtc |
| OLD | NEW |