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 |
| 11 #include <memory> |
| 12 |
11 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "webrtc/base/scoped_ptr.h" | |
13 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h" | 14 #include "webrtc/modules/audio_coding/neteq/tools/neteq_external_decoder_test.h" |
14 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 15 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
15 | 16 |
16 namespace webrtc { | 17 namespace webrtc { |
17 namespace test { | 18 namespace test { |
18 | 19 |
19 using ::testing::_; | 20 using ::testing::_; |
20 using ::testing::SetArgPointee; | 21 using ::testing::SetArgPointee; |
21 using ::testing::Return; | 22 using ::testing::Return; |
22 | 23 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 SetPacketLossRate(1); | 257 SetPacketLossRate(1); |
257 expects.stats_ref.expand_rate = 16384; | 258 expects.stats_ref.expand_rate = 16384; |
258 expects.stats_ref.speech_expand_rate = 5324; | 259 expects.stats_ref.speech_expand_rate = 5324; |
259 RunTest(10, expects); // Lost 10 * 20ms in a row. | 260 RunTest(10, expects); // Lost 10 * 20ms in a row. |
260 } | 261 } |
261 | 262 |
262 private: | 263 private: |
263 MockAudioDecoder* external_decoder_; | 264 MockAudioDecoder* external_decoder_; |
264 const int samples_per_ms_; | 265 const int samples_per_ms_; |
265 const size_t frame_size_samples_; | 266 const size_t frame_size_samples_; |
266 rtc::scoped_ptr<test::RtpGenerator> rtp_generator_; | 267 std::unique_ptr<test::RtpGenerator> rtp_generator_; |
267 WebRtcRTPHeader rtp_header_; | 268 WebRtcRTPHeader rtp_header_; |
268 uint32_t last_lost_time_; | 269 uint32_t last_lost_time_; |
269 uint32_t packet_loss_interval_; | 270 uint32_t packet_loss_interval_; |
270 uint8_t payload_[kPayloadSizeByte]; | 271 uint8_t payload_[kPayloadSizeByte]; |
271 int16_t output_[kMaxOutputSize]; | 272 int16_t output_[kMaxOutputSize]; |
272 }; | 273 }; |
273 | 274 |
274 TEST(NetEqNetworkStatsTest, DecodeFec) { | 275 TEST(NetEqNetworkStatsTest, DecodeFec) { |
275 MockAudioDecoder decoder(1); | 276 MockAudioDecoder decoder(1); |
276 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, &decoder); | 277 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, &decoder); |
(...skipping 14 matching lines...) Expand all Loading... |
291 test.NoiseExpansionTest(); | 292 test.NoiseExpansionTest(); |
292 EXPECT_CALL(decoder, Die()).Times(1); | 293 EXPECT_CALL(decoder, Die()).Times(1); |
293 } | 294 } |
294 | 295 |
295 } // namespace test | 296 } // namespace test |
296 } // namespace webrtc | 297 } // namespace webrtc |
297 | 298 |
298 | 299 |
299 | 300 |
300 | 301 |
OLD | NEW |