| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // object (ExternalPcm16B wrapped in MockExternalPcm16B, both defined above). | 168 // object (ExternalPcm16B wrapped in MockExternalPcm16B, both defined above). |
| 169 // The test verifies that the output from both instances match. | 169 // The test verifies that the output from both instances match. |
| 170 class NetEqExternalVsInternalDecoderTest : public NetEqExternalDecoderUnitTest, | 170 class NetEqExternalVsInternalDecoderTest : public NetEqExternalDecoderUnitTest, |
| 171 public ::testing::Test { | 171 public ::testing::Test { |
| 172 protected: | 172 protected: |
| 173 static const size_t kMaxBlockSize = 480; // 10 ms @ 48 kHz. | 173 static const size_t kMaxBlockSize = 480; // 10 ms @ 48 kHz. |
| 174 | 174 |
| 175 NetEqExternalVsInternalDecoderTest() | 175 NetEqExternalVsInternalDecoderTest() |
| 176 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16Bswb32kHz, | 176 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16Bswb32kHz, |
| 177 32000, | 177 32000, |
| 178 new MockExternalPcm16B), | 178 new MockExternalPcm16B(32000)), |
| 179 sample_rate_hz_(32000) { | 179 sample_rate_hz_(32000) { |
| 180 NetEq::Config config; | 180 NetEq::Config config; |
| 181 config.sample_rate_hz = sample_rate_hz_; | 181 config.sample_rate_hz = sample_rate_hz_; |
| 182 neteq_internal_.reset( | 182 neteq_internal_.reset( |
| 183 NetEq::Create(config, CreateBuiltinAudioDecoderFactory())); | 183 NetEq::Create(config, CreateBuiltinAudioDecoderFactory())); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void SetUp() override { | 186 void SetUp() override { |
| 187 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType( | 187 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType( |
| 188 NetEqDecoder::kDecoderPCM16Bswb32kHz, | 188 NetEqDecoder::kDecoderPCM16Bswb32kHz, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 kInitialPhase, | 241 kInitialPhase, |
| 242 kNormalPhase, | 242 kNormalPhase, |
| 243 kExpandPhase, | 243 kExpandPhase, |
| 244 kFadedExpandPhase, | 244 kFadedExpandPhase, |
| 245 kRecovered | 245 kRecovered |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 LargeTimestampJumpTest() | 248 LargeTimestampJumpTest() |
| 249 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16B, | 249 : NetEqExternalDecoderUnitTest(NetEqDecoder::kDecoderPCM16B, |
| 250 8000, | 250 8000, |
| 251 new MockExternalPcm16B), | 251 new MockExternalPcm16B(8000)), |
| 252 test_state_(kInitialPhase) { | 252 test_state_(kInitialPhase) { |
| 253 EXPECT_CALL(*external_decoder(), HasDecodePlc()) | 253 EXPECT_CALL(*external_decoder(), HasDecodePlc()) |
| 254 .WillRepeatedly(Return(false)); | 254 .WillRepeatedly(Return(false)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 virtual void UpdateState(AudioFrame::SpeechType output_type) { | 257 virtual void UpdateState(AudioFrame::SpeechType output_type) { |
| 258 switch (test_state_) { | 258 switch (test_state_) { |
| 259 case kInitialPhase: { | 259 case kInitialPhase: { |
| 260 if (output_type == AudioFrame::kNormalSpeech) { | 260 if (output_type == AudioFrame::kNormalSpeech) { |
| 261 test_state_ = kNormalPhase; | 261 test_state_ = kNormalPhase; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 kStartSeqeunceNumber, | 446 kStartSeqeunceNumber, |
| 447 kStartTimestamp, | 447 kStartTimestamp, |
| 448 kJumpFromTimestamp, | 448 kJumpFromTimestamp, |
| 449 kJumpToTimestamp)); | 449 kJumpToTimestamp)); |
| 450 | 450 |
| 451 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. | 451 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. |
| 452 EXPECT_EQ(kRecovered, test_state_); | 452 EXPECT_EQ(kRecovered, test_state_); |
| 453 } | 453 } |
| 454 | 454 |
| 455 } // namespace webrtc | 455 } // namespace webrtc |
| OLD | NEW |