Chromium Code Reviews| 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 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 42 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 43 #include "webrtc/voice_engine/include/voe_video_sync.h" | 43 #include "webrtc/voice_engine/include/voe_video_sync.h" |
| 44 | 44 |
| 45 using webrtc::test::DriftingClock; | 45 using webrtc::test::DriftingClock; |
| 46 using webrtc::test::FakeAudioDevice; | 46 using webrtc::test::FakeAudioDevice; |
| 47 | 47 |
| 48 namespace webrtc { | 48 namespace webrtc { |
| 49 | 49 |
| 50 class CallPerfTest : public test::CallTest { | 50 class CallPerfTest : public test::CallTest { |
| 51 protected: | 51 protected: |
| 52 static const bool kWithFEC = true; | |
| 53 static const bool kCreateAudioFirst = true; | |
| 54 static const bool kCreateVideoFirst = !kCreateAudioFirst; | |
| 52 void TestAudioVideoSync(bool fec, | 55 void TestAudioVideoSync(bool fec, |
|
pbos-webrtc
2016/02/15 09:52:28
Make this enum { kWithFec, kWithoutFec } FecMode;
danilchap
2016/02/15 10:03:59
Done.
| |
| 53 bool create_audio_first, | 56 bool create_audio_first, |
|
pbos-webrtc
2016/02/15 09:52:28
enum StreamCreationOrder {kCreateAudioFirst, kCrea
danilchap
2016/02/15 10:03:59
Done.
| |
| 54 float video_ntp_speed, | 57 float video_ntp_speed, |
| 55 float video_rtp_speed, | 58 float video_rtp_speed, |
| 56 float audio_rtp_speed); | 59 float audio_rtp_speed); |
| 57 | 60 |
| 58 void TestCpuOveruse(LoadObserver::Load tested_load, int encode_delay_ms); | 61 void TestCpuOveruse(LoadObserver::Load tested_load, int encode_delay_ms); |
| 59 | 62 |
| 60 void TestMinTransmitBitrate(bool pad_to_min_bitrate); | 63 void TestMinTransmitBitrate(bool pad_to_min_bitrate); |
| 61 | 64 |
| 62 void TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config, | 65 void TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config, |
| 63 int threshold_ms, | 66 int threshold_ms, |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 voe_base->Release(); | 373 voe_base->Release(); |
| 371 voe_codec->Release(); | 374 voe_codec->Release(); |
| 372 voe_network->Release(); | 375 voe_network->Release(); |
| 373 voe_sync->Release(); | 376 voe_sync->Release(); |
| 374 | 377 |
| 375 DestroyCalls(); | 378 DestroyCalls(); |
| 376 | 379 |
| 377 VoiceEngine::Delete(voice_engine); | 380 VoiceEngine::Delete(voice_engine); |
| 378 } | 381 } |
| 379 | 382 |
| 380 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioCreatedFirst) { | |
| 381 TestAudioVideoSync(false, true, DriftingClock::kNoDrift, | |
| 382 DriftingClock::kNoDrift, DriftingClock::kNoDrift); | |
| 383 } | |
| 384 | |
| 385 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoCreatedFirst) { | |
| 386 TestAudioVideoSync(false, false, DriftingClock::kNoDrift, | |
| 387 DriftingClock::kNoDrift, DriftingClock::kNoDrift); | |
| 388 } | |
| 389 | |
| 390 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithFec) { | |
| 391 TestAudioVideoSync(true, false, DriftingClock::kNoDrift, | |
| 392 DriftingClock::kNoDrift, DriftingClock::kNoDrift); | |
| 393 } | |
| 394 | |
| 395 // TODO(danilchap): Reenable after adding support for frame capture clock | 383 // TODO(danilchap): Reenable after adding support for frame capture clock |
| 396 // that is not in sync with local TickTime clock. | 384 // that is not in sync with local TickTime clock. |
| 397 TEST_F(CallPerfTest, DISABLED_PlaysOutAudioAndVideoInSyncWithVideoNtpDrift) { | 385 TEST_F(CallPerfTest, DISABLED_PlaysOutAudioAndVideoInSyncWithVideoNtpDrift) { |
| 398 TestAudioVideoSync(false, true, DriftingClock::PercentsFaster(10.0f), | 386 TestAudioVideoSync(!kWithFEC, kCreateAudioFirst, |
| 387 DriftingClock::PercentsFaster(10.0f), | |
| 399 DriftingClock::kNoDrift, DriftingClock::kNoDrift); | 388 DriftingClock::kNoDrift, DriftingClock::kNoDrift); |
| 400 } | 389 } |
| 401 | 390 |
| 402 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioRtpDrift) { | |
| 403 TestAudioVideoSync(false, true, DriftingClock::kNoDrift, | |
| 404 DriftingClock::kNoDrift, | |
| 405 DriftingClock::PercentsFaster(30.0f)); | |
| 406 } | |
| 407 | |
| 408 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoRtpDrift) { | |
| 409 TestAudioVideoSync(false, true, DriftingClock::kNoDrift, | |
| 410 DriftingClock::PercentsFaster(30.0f), | |
| 411 DriftingClock::kNoDrift); | |
| 412 } | |
| 413 | |
| 414 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioFasterThanVideoDrift) { | 391 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioFasterThanVideoDrift) { |
| 415 TestAudioVideoSync(false, true, DriftingClock::kNoDrift, | 392 TestAudioVideoSync(!kWithFEC, kCreateAudioFirst, DriftingClock::kNoDrift, |
| 416 DriftingClock::PercentsSlower(30.0f), | 393 DriftingClock::PercentsSlower(30.0f), |
| 417 DriftingClock::PercentsFaster(30.0f)); | 394 DriftingClock::PercentsFaster(30.0f)); |
| 418 } | 395 } |
| 419 | 396 |
| 420 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift) { | 397 TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoFasterThanAudioDrift) { |
| 421 TestAudioVideoSync(false, true, DriftingClock::kNoDrift, | 398 TestAudioVideoSync(kWithFEC, kCreateVideoFirst, DriftingClock::kNoDrift, |
| 422 DriftingClock::PercentsFaster(30.0f), | 399 DriftingClock::PercentsFaster(30.0f), |
| 423 DriftingClock::PercentsSlower(30.0f)); | 400 DriftingClock::PercentsSlower(30.0f)); |
| 424 } | 401 } |
| 425 | 402 |
| 426 void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config, | 403 void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config, |
| 427 int threshold_ms, | 404 int threshold_ms, |
| 428 int start_time_ms, | 405 int start_time_ms, |
| 429 int run_time_ms) { | 406 int run_time_ms) { |
| 430 class CaptureNtpTimeObserver : public test::EndToEndTest, | 407 class CaptureNtpTimeObserver : public test::EndToEndTest, |
| 431 public VideoRenderer { | 408 public VideoRenderer { |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 796 int encoder_inits_; | 773 int encoder_inits_; |
| 797 uint32_t last_set_bitrate_; | 774 uint32_t last_set_bitrate_; |
| 798 VideoSendStream* send_stream_; | 775 VideoSendStream* send_stream_; |
| 799 VideoEncoderConfig encoder_config_; | 776 VideoEncoderConfig encoder_config_; |
| 800 } test; | 777 } test; |
| 801 | 778 |
| 802 RunBaseTest(&test); | 779 RunBaseTest(&test); |
| 803 } | 780 } |
| 804 | 781 |
| 805 } // namespace webrtc | 782 } // namespace webrtc |
| OLD | NEW |