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

Unified Diff: talk/media/webrtc/webrtcvideoengine2_unittest.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 | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoengine2_unittest.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2_unittest.cc b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
index 71eebba0b0afd5e6ac95155e38100cb176a497dd..f3d3a542ab77522d6e898110de1414a9a84fd362 100644
--- a/talk/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -168,46 +168,6 @@ class WebRtcVideoEngine2Test : public ::testing::Test {
std::map<int, int> default_apt_rtx_types_;
};
-class WebRtcVideoEngine2VoiceTest : public WebRtcVideoEngine2Test {
- public:
- WebRtcVideoEngine2VoiceTest() : WebRtcVideoEngine2Test(&voice_engine_) {}
-};
-
-TEST_F(WebRtcVideoEngine2VoiceTest, ConfiguresAvSyncForFirstReceiveChannel) {
- FakeCallFactory call_factory;
- engine_.SetCallFactory(&call_factory);
- voice_engine_.Init(rtc::Thread::Current());
- engine_.Init();
-
- rtc::scoped_ptr<VoiceMediaChannel> voice_channel(
- voice_engine_.CreateChannel(cricket::AudioOptions()));
- ASSERT_TRUE(voice_channel.get() != nullptr);
- WebRtcVoiceMediaChannel* webrtc_voice_channel =
- static_cast<WebRtcVoiceMediaChannel*>(voice_channel.get());
- ASSERT_NE(webrtc_voice_channel->voe_channel(), -1);
- rtc::scoped_ptr<VideoMediaChannel> channel(
- engine_.CreateChannel(cricket::VideoOptions(), voice_channel.get()));
-
- FakeCall* fake_call = call_factory.GetCall();
- ASSERT_TRUE(fake_call != nullptr);
-
- webrtc::Call::Config call_config = fake_call->GetConfig();
-
- ASSERT_TRUE(voice_engine_.voe()->engine() != nullptr);
- ASSERT_EQ(voice_engine_.voe()->engine(), call_config.voice_engine);
-
- EXPECT_TRUE(channel->AddRecvStream(StreamParams::CreateLegacy(kSsrc)));
- EXPECT_TRUE(channel->AddRecvStream(StreamParams::CreateLegacy(kSsrc + 1)));
- std::vector<FakeVideoReceiveStream*> receive_streams =
- fake_call->GetVideoReceiveStreams();
-
- ASSERT_EQ(2u, receive_streams.size());
- EXPECT_EQ(webrtc_voice_channel->voe_channel(),
- receive_streams[0]->GetConfig().audio_channel_id);
- EXPECT_EQ(-1, receive_streams[1]->GetConfig().audio_channel_id)
- << "AV sync should only be set up for the first receive channel.";
-}
-
TEST_F(WebRtcVideoEngine2Test, FindCodec) {
const std::vector<cricket::VideoCodec>& c = engine_.codecs();
EXPECT_EQ(cricket::DefaultVideoCodecList().size(), c.size());
@@ -1003,6 +963,20 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test,
uint32 last_ssrc_;
};
+TEST_F(WebRtcVideoChannel2Test, SetsSyncGroupFromSyncLabel) {
+ const uint32 kVideoSsrc = 123;
+ const std::string kSyncLabel = "AvSyncLabel";
+
+ cricket::StreamParams sp = cricket::StreamParams::CreateLegacy(kVideoSsrc);
+ sp.sync_label = kSyncLabel;
+ EXPECT_TRUE(channel_->AddRecvStream(sp));
+
+ EXPECT_EQ(1, fake_call_->GetVideoReceiveStreams().size());
+ EXPECT_EQ(kSyncLabel,
+ fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group)
+ << "SyncGroup should be set based on sync_label";
+}
+
TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) {
EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs()));
EXPECT_TRUE(channel_->SetSend(true));
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698