| 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> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "webrtc/common_types.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 #include "webrtc/modules/include/module_common_types.h" | 16 #include "webrtc/modules/include/module_common_types.h" |
| 16 #include "webrtc/test/gmock.h" | 17 #include "webrtc/test/gmock.h" |
| 17 | 18 |
| 18 namespace webrtc { | 19 namespace webrtc { |
| 19 namespace test { | 20 namespace test { |
| 20 | 21 |
| 21 using ::testing::_; | 22 using ::testing::_; |
| 22 using ::testing::SetArgPointee; | 23 using ::testing::SetArgPointee; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 expects.stats_ref.expand_rate = 16384; | 298 expects.stats_ref.expand_rate = 16384; |
| 298 expects.stats_ref.speech_expand_rate = 5324; | 299 expects.stats_ref.speech_expand_rate = 5324; |
| 299 RunTest(10, expects); // Lost 10 * 20ms in a row. | 300 RunTest(10, expects); // Lost 10 * 20ms in a row. |
| 300 } | 301 } |
| 301 | 302 |
| 302 private: | 303 private: |
| 303 MockAudioDecoder* external_decoder_; | 304 MockAudioDecoder* external_decoder_; |
| 304 const int samples_per_ms_; | 305 const int samples_per_ms_; |
| 305 const size_t frame_size_samples_; | 306 const size_t frame_size_samples_; |
| 306 std::unique_ptr<test::RtpGenerator> rtp_generator_; | 307 std::unique_ptr<test::RtpGenerator> rtp_generator_; |
| 307 WebRtcRTPHeader rtp_header_; | 308 RTPHeader rtp_header_; |
| 308 uint32_t last_lost_time_; | 309 uint32_t last_lost_time_; |
| 309 uint32_t packet_loss_interval_; | 310 uint32_t packet_loss_interval_; |
| 310 AudioFrame output_frame_; | 311 AudioFrame output_frame_; |
| 311 }; | 312 }; |
| 312 | 313 |
| 313 TEST(NetEqNetworkStatsTest, DecodeFec) { | 314 TEST(NetEqNetworkStatsTest, DecodeFec) { |
| 314 MockAudioDecoder decoder(48000, 1); | 315 MockAudioDecoder decoder(48000, 1); |
| 315 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); | 316 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); |
| 316 test.DecodeFecTest(); | 317 test.DecodeFecTest(); |
| 317 EXPECT_CALL(decoder, Die()).Times(1); | 318 EXPECT_CALL(decoder, Die()).Times(1); |
| 318 } | 319 } |
| 319 | 320 |
| 320 TEST(NetEqNetworkStatsTest, StereoDecodeFec) { | 321 TEST(NetEqNetworkStatsTest, StereoDecodeFec) { |
| 321 MockAudioDecoder decoder(48000, 2); | 322 MockAudioDecoder decoder(48000, 2); |
| 322 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); | 323 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); |
| 323 test.DecodeFecTest(); | 324 test.DecodeFecTest(); |
| 324 EXPECT_CALL(decoder, Die()).Times(1); | 325 EXPECT_CALL(decoder, Die()).Times(1); |
| 325 } | 326 } |
| 326 | 327 |
| 327 TEST(NetEqNetworkStatsTest, NoiseExpansionTest) { | 328 TEST(NetEqNetworkStatsTest, NoiseExpansionTest) { |
| 328 MockAudioDecoder decoder(48000, 1); | 329 MockAudioDecoder decoder(48000, 1); |
| 329 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); | 330 NetEqNetworkStatsTest test(NetEqDecoder::kDecoderOpus, 48000, &decoder); |
| 330 test.NoiseExpansionTest(); | 331 test.NoiseExpansionTest(); |
| 331 EXPECT_CALL(decoder, Die()).Times(1); | 332 EXPECT_CALL(decoder, Die()).Times(1); |
| 332 } | 333 } |
| 333 | 334 |
| 334 } // namespace test | 335 } // namespace test |
| 335 } // namespace webrtc | 336 } // namespace webrtc |
| OLD | NEW |