| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 11 matching lines...) Expand all Loading... |
| 22 decoder_(decoder), | 22 decoder_(decoder), |
| 23 sample_rate_hz_(CodecSampleRateHz(codec_)), | 23 sample_rate_hz_(CodecSampleRateHz(codec_)), |
| 24 channels_(static_cast<int>(decoder_->Channels())) { | 24 channels_(static_cast<int>(decoder_->Channels())) { |
| 25 NetEq::Config config; | 25 NetEq::Config config; |
| 26 config.sample_rate_hz = sample_rate_hz_; | 26 config.sample_rate_hz = sample_rate_hz_; |
| 27 neteq_.reset(NetEq::Create(config)); | 27 neteq_.reset(NetEq::Create(config)); |
| 28 printf("%d\n", channels_); | 28 printf("%d\n", channels_); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void NetEqExternalDecoderTest::Init() { | 31 void NetEqExternalDecoderTest::Init() { |
| 32 ASSERT_EQ(NetEq::kOK, neteq_->RegisterExternalDecoder( | 32 ASSERT_EQ(NetEq::kOK, |
| 33 decoder_, codec_, kPayloadType, sample_rate_hz_)); | 33 neteq_->RegisterExternalDecoder(decoder_, codec_, name_, |
| 34 kPayloadType, sample_rate_hz_)); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void NetEqExternalDecoderTest::InsertPacket( | 37 void NetEqExternalDecoderTest::InsertPacket( |
| 37 WebRtcRTPHeader rtp_header, | 38 WebRtcRTPHeader rtp_header, |
| 38 rtc::ArrayView<const uint8_t> payload, | 39 rtc::ArrayView<const uint8_t> payload, |
| 39 uint32_t receive_timestamp) { | 40 uint32_t receive_timestamp) { |
| 40 ASSERT_EQ(NetEq::kOK, | 41 ASSERT_EQ(NetEq::kOK, |
| 41 neteq_->InsertPacket(rtp_header, payload, receive_timestamp)); | 42 neteq_->InsertPacket(rtp_header, payload, receive_timestamp)); |
| 42 } | 43 } |
| 43 | 44 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 55 output_type)); | 56 output_type)); |
| 56 EXPECT_EQ(channels_, num_channels); | 57 EXPECT_EQ(channels_, num_channels); |
| 57 EXPECT_EQ(static_cast<size_t>(kOutputLengthMs * sample_rate_hz_ / 1000), | 58 EXPECT_EQ(static_cast<size_t>(kOutputLengthMs * sample_rate_hz_ / 1000), |
| 58 samples_per_channel); | 59 samples_per_channel); |
| 59 EXPECT_EQ(sample_rate_hz_, neteq_->last_output_sample_rate_hz()); | 60 EXPECT_EQ(sample_rate_hz_, neteq_->last_output_sample_rate_hz()); |
| 60 return samples_per_channel; | 61 return samples_per_channel; |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace test | 64 } // namespace test |
| 64 } // namespace webrtc | 65 } // namespace webrtc |
| OLD | NEW |