Chromium Code Reviews| Index: webrtc/call/call_perf_tests.cc |
| diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc |
| index 3ee49d94271f6e8f875faea615416aed4e3b6ede..aaa715435d210b5f47bddbaaea6a950e219bde79 100644 |
| --- a/webrtc/call/call_perf_tests.cc |
| +++ b/webrtc/call/call_perf_tests.cc |
| @@ -26,6 +26,7 @@ |
| #include "webrtc/system_wrappers/include/rtp_to_ntp.h" |
| #include "webrtc/test/call_test.h" |
| #include "webrtc/test/direct_transport.h" |
| +#include "webrtc/test/drifting_clock.h" |
| #include "webrtc/test/encoder_settings.h" |
| #include "webrtc/test/fake_audio_device.h" |
| #include "webrtc/test/fake_decoder.h" |
| @@ -45,7 +46,11 @@ namespace webrtc { |
| class CallPerfTest : public test::CallTest { |
| protected: |
| - void TestAudioVideoSync(bool fec, bool create_audio_first); |
| + void TestAudioVideoSync(bool fec, |
| + bool create_audio_first, |
| + float audio_rt_drift, |
| + float video_rt_drift, |
| + float video_ntp_drift); |
| void TestCpuOveruse(LoadObserver::Load tested_load, int encode_delay_ms); |
| @@ -188,7 +193,11 @@ class VideoRtcpAndSyncObserver : public SyncRtcpObserver, public VideoRenderer { |
| int64_t first_time_in_sync_; |
| }; |
| -void CallPerfTest::TestAudioVideoSync(bool fec, bool create_audio_first) { |
| +void CallPerfTest::TestAudioVideoSync(bool fec, |
| + bool create_audio_first, |
| + float audio_rt_drift, |
| + float video_rt_drift, |
|
stefan-webrtc
2016/02/09 14:02:20
video_rtp_drift?
danilchap
2016/02/09 14:56:49
Done.
|
| + float video_ntp_drift) { |
| const char* kSyncGroup = "av_sync"; |
| const uint32_t kAudioSendSsrc = 1234; |
| const uint32_t kAudioRecvSsrc = 5678; |
| @@ -229,7 +238,7 @@ void CallPerfTest::TestAudioVideoSync(bool fec, bool create_audio_first) { |
| test::ResourcePath("voice_engine/audio_long16", "pcm"); |
| ASSERT_STRNE("", audio_filename.c_str()); |
| test::FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), |
| - audio_filename); |
| + audio_filename, audio_rt_drift); |
| EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr)); |
| Config voe_config; |
| voe_config.Set<VoicePacing>(new VoicePacing(true)); |
| @@ -324,7 +333,12 @@ void CallPerfTest::TestAudioVideoSync(bool fec, bool create_audio_first) { |
| receiver_call_->CreateAudioReceiveStream(audio_recv_config); |
| } |
| - CreateFrameGeneratorCapturer(); |
| + test::DriftingClock drifting_clock(clock_, video_ntp_drift); |
| + if (video_ntp_drift == 0 && video_rt_drift == 0) { |
| + CreateFrameGeneratorCapturer(); |
| + } else { |
| + CreateFrameGeneratorCapturerWithDrift(&drifting_clock, video_rt_drift); |
| + } |
| Start(); |
| @@ -365,15 +379,23 @@ void CallPerfTest::TestAudioVideoSync(bool fec, bool create_audio_first) { |
| } |
| TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioCreatedFirst) { |
| - TestAudioVideoSync(false, true); |
| + TestAudioVideoSync(false, true, 0, 0, 0); |
| } |
| TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoCreatedFirst) { |
| - TestAudioVideoSync(false, false); |
| + TestAudioVideoSync(false, false, 0, 0, 0); |
| } |
| TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithFec) { |
| - TestAudioVideoSync(true, false); |
| + TestAudioVideoSync(true, false, 0, 0, 0); |
| +} |
| + |
| +TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithNtpDrift) { |
| + TestAudioVideoSync(false, true, 0, 0, .02); |
| +} |
| + |
| +TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithRtDrift) { |
|
stefan-webrtc
2016/02/09 14:02:20
Add DISABLED_ in front of failing tests for now so
danilchap
2016/02/09 14:56:49
Done.
pbos-webrtc
2016/02/09 15:14:46
WithRtDrift?
|
| + TestAudioVideoSync(false, true, -.3, .3, 0); |
|
stefan-webrtc
2016/02/09 14:02:20
What about a test case where only audio drifts and
danilchap
2016/02/09 14:56:49
Those are weeker than Audio and Video drifting opp
pbos-webrtc
2016/02/09 15:14:46
What about a case where video is slower than audio
danilchap
2016/02/09 15:28:43
It pass too.
|
| } |
| void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config, |