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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2567333004: Add video send SSRC to RtpParameters, and don't allow changing SSRC. (Closed)
Patch Set: Back out Obj-C and Java changes (were landed separately) Created 3 years, 11 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/media/engine/webrtcvideoengine2.cc ('k') | webrtc/media/engine/webrtcvoiceengine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index b8495b05464e9b8914836d42470e953485e72203..5944883e1c20d68b799e20d7dfcb59b94e7ddb77 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -3661,16 +3661,21 @@ TEST_F(WebRtcVideoChannel2Test,
// for each encoding individually.
AddSendStream();
- // Setting RtpParameters with no encoding is expected to fail.
webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
- parameters.encodings.clear();
- EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters));
- // Setting RtpParameters with exactly one encoding should succeed.
- parameters.encodings.push_back(webrtc::RtpEncodingParameters());
- EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters));
// Two or more encodings should result in failure.
parameters.encodings.push_back(webrtc::RtpEncodingParameters());
EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters));
+ // Zero encodings should also fail.
+ parameters.encodings.clear();
+ EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters));
+}
+
+// Changing the SSRC through RtpParameters is not allowed.
+TEST_F(WebRtcVideoChannel2Test, CannotSetSsrcInRtpSendParameters) {
+ AddSendStream();
+ webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_);
+ parameters.encodings[0].ssrc = rtc::Optional<uint32_t>(0xdeadbeef);
+ EXPECT_FALSE(channel_->SetRtpSendParameters(last_ssrc_, parameters));
}
// Test that a stream will not be sending if its encoding is made inactive
@@ -3753,6 +3758,18 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersCodecs) {
rtp_parameters.codecs[1]);
}
+// Test that RtpParameters for send stream has one encoding and it has
+// the correct SSRC.
+TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersSsrc) {
+ AddSendStream();
+
+ webrtc::RtpParameters rtp_parameters =
+ channel_->GetRtpSendParameters(last_ssrc_);
+ ASSERT_EQ(1u, rtp_parameters.encodings.size());
+ EXPECT_EQ(rtc::Optional<uint32_t>(last_ssrc_),
+ rtp_parameters.encodings[0].ssrc);
+}
+
// Test that if we set/get parameters multiple times, we get the same results.
TEST_F(WebRtcVideoChannel2Test, SetAndGetRtpSendParameters) {
AddSendStream();
@@ -3826,7 +3843,7 @@ TEST_F(WebRtcVideoChannel2Test, DISABLED_GetRtpReceiveFmtpSprop) {
// Test that RtpParameters for receive stream has one encoding and it has
// the correct SSRC.
-TEST_F(WebRtcVideoChannel2Test, RtpEncodingParametersSsrcIsSet) {
+TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersSsrc) {
AddRecvStream();
webrtc::RtpParameters rtp_parameters =
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/media/engine/webrtcvoiceengine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698