| 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 22 matching lines...) Expand all Loading... |
| 33 external_decoder_(decoder), | 33 external_decoder_(decoder), |
| 34 samples_per_ms_(CodecSampleRateHz(codec) / 1000), | 34 samples_per_ms_(CodecSampleRateHz(codec) / 1000), |
| 35 frame_size_samples_(kFrameSizeMs * samples_per_ms_), | 35 frame_size_samples_(kFrameSizeMs * samples_per_ms_), |
| 36 rtp_generator_(new test::RtpGenerator(samples_per_ms_)), | 36 rtp_generator_(new test::RtpGenerator(samples_per_ms_)), |
| 37 input_(new int16_t[frame_size_samples_]), | 37 input_(new int16_t[frame_size_samples_]), |
| 38 // Payload should be no larger than input. | 38 // Payload should be no larger than input. |
| 39 encoded_(new uint8_t[2 * frame_size_samples_]), | 39 encoded_(new uint8_t[2 * frame_size_samples_]), |
| 40 payload_size_bytes_(0), | 40 payload_size_bytes_(0), |
| 41 last_send_time_(0), | 41 last_send_time_(0), |
| 42 last_arrival_time_(0) { | 42 last_arrival_time_(0) { |
| 43 // Init() will trigger external_decoder_->Init(). | |
| 44 EXPECT_CALL(*external_decoder_, Init()); | |
| 45 // NetEq is not allowed to delete the external decoder (hence Times(0)). | 43 // NetEq is not allowed to delete the external decoder (hence Times(0)). |
| 46 EXPECT_CALL(*external_decoder_, Die()).Times(0); | 44 EXPECT_CALL(*external_decoder_, Die()).Times(0); |
| 47 Init(); | 45 Init(); |
| 48 | 46 |
| 49 const std::string file_name = | 47 const std::string file_name = |
| 50 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"); | 48 webrtc::test::ResourcePath("audio_coding/testfile32kHz", "pcm"); |
| 51 input_file_.reset(new test::InputAudioFile(file_name)); | 49 input_file_.reset(new test::InputAudioFile(file_name)); |
| 52 } | 50 } |
| 53 | 51 |
| 54 virtual ~NetEqExternalDecoderUnitTest() { | 52 virtual ~NetEqExternalDecoderUnitTest() { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 kStartSeqeunceNumber, | 452 kStartSeqeunceNumber, |
| 455 kStartTimestamp, | 453 kStartTimestamp, |
| 456 kJumpFromTimestamp, | 454 kJumpFromTimestamp, |
| 457 kJumpToTimestamp)); | 455 kJumpToTimestamp)); |
| 458 | 456 |
| 459 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. | 457 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. |
| 460 EXPECT_EQ(kRecovered, test_state_); | 458 EXPECT_EQ(kRecovered, test_state_); |
| 461 } | 459 } |
| 462 | 460 |
| 463 } // namespace webrtc | 461 } // namespace webrtc |
| OLD | NEW |