Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Unified Diff: webrtc/video/call_perf_tests.cc

Issue 1181653002: Base A/V synchronization on sync_labels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/call.cc ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/call_perf_tests.cc
diff --git a/webrtc/video/call_perf_tests.cc b/webrtc/video/call_perf_tests.cc
index 65e9d96e7b4ffa0eec56a5f679b356cbb4ad2bb6..fd159f54cb4ff6e2e49edea4c08858aacd759b18 100644
--- a/webrtc/video/call_perf_tests.cc
+++ b/webrtc/video/call_perf_tests.cc
@@ -44,7 +44,7 @@ namespace webrtc {
class CallPerfTest : public test::CallTest {
protected:
- void TestAudioVideoSync(bool fec);
+ void TestAudioVideoSync(bool fec, bool create_audio_first);
void TestCpuOveruse(LoadObserver::Load tested_load, int encode_delay_ms);
@@ -189,7 +189,8 @@ class VideoRtcpAndSyncObserver : public SyncRtcpObserver, public VideoRenderer {
int64_t first_time_in_sync_;
};
-void CallPerfTest::TestAudioVideoSync(bool fec) {
+void CallPerfTest::TestAudioVideoSync(bool fec, bool create_audio_first) {
+ const char* kSyncGroup = "av_sync";
class AudioPacketReceiver : public PacketReceiver {
public:
AudioPacketReceiver(int channel, VoENetwork* voe_network)
@@ -269,9 +270,23 @@ void CallPerfTest::TestAudioVideoSync(bool fec) {
}
receive_configs_[0].rtp.nack.rtp_history_ms = 1000;
receive_configs_[0].renderer = &observer;
- receive_configs_[0].audio_channel_id = channel;
-
- CreateStreams();
+ receive_configs_[0].sync_group = kSyncGroup;
+
+ AudioReceiveStream::Config audio_config;
+ audio_config.voe_channel_id = channel;
+ audio_config.sync_group = kSyncGroup;
+
+ AudioReceiveStream* audio_receive_stream = nullptr;
+
+ if (create_audio_first) {
+ audio_receive_stream =
+ receiver_call_->CreateAudioReceiveStream(audio_config);
+ CreateStreams();
+ } else {
+ CreateStreams();
+ audio_receive_stream =
+ receiver_call_->CreateAudioReceiveStream(audio_config);
+ }
CreateFrameGeneratorCapturer();
@@ -302,15 +317,21 @@ void CallPerfTest::TestAudioVideoSync(bool fec) {
DestroyStreams();
+ receiver_call_->DestroyAudioReceiveStream(audio_receive_stream);
+
VoiceEngine::Delete(voice_engine);
}
-TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSync) {
- TestAudioVideoSync(false);
+TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithAudioCreatedFirst) {
+ TestAudioVideoSync(false, true);
+}
+
+TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithVideoCreatedFirst) {
+ TestAudioVideoSync(false, false);
}
TEST_F(CallPerfTest, PlaysOutAudioAndVideoInSyncWithFec) {
- TestAudioVideoSync(true);
+ TestAudioVideoSync(true, false);
}
void CallPerfTest::TestCaptureNtpTime(const FakeNetworkPipe::Config& net_config,
« no previous file with comments | « webrtc/video/call.cc ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698