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

Unified Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 1762003003: If MSID is encoded in both ways, make the SSRC-level one take priority. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding unit test. Created 4 years, 9 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/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/webrtcsdp_unittest.cc
diff --git a/webrtc/api/webrtcsdp_unittest.cc b/webrtc/api/webrtcsdp_unittest.cc
index 39b7cdd3dbc5cfb5bb1a3008d79e6f7a4b598e19..95597016420f54d14acde1e60c8f7a5004f75a14 100644
--- a/webrtc/api/webrtcsdp_unittest.cc
+++ b/webrtc/api/webrtcsdp_unittest.cc
@@ -412,6 +412,91 @@ static const char kPlanBSdpFullString[] =
"a=ssrc:6 mslabel:local_stream_2\r\n"
"a=ssrc:6 label:video_track_id_3\r\n";
+// Plan B SDP reference string, with 2 streams, 2 audio tracks and 3 video
+// tracks, but with the unified plan "a=msid" attribute.
+static const char kPlanBSdpFullStringWithMsid[] =
+ "v=0\r\n"
+ "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
+ "s=-\r\n"
+ "t=0 0\r\n"
+ "a=msid-semantic: WMS local_stream_1 local_stream_2\r\n"
+ "m=audio 2345 RTP/SAVPF 111 103 104\r\n"
+ "c=IN IP4 74.125.127.126\r\n"
+ "a=rtcp:2347 IN IP4 74.125.127.126\r\n"
+ "a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 1234 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/1 2 udp 2130706432 192.168.1.5 1235 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/2 1 udp 2130706432 ::1 1238 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/2 2 udp 2130706432 ::1 1239 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/3 1 udp 2130706432 74.125.127.126 2345 typ srflx "
+ "raddr 192.168.1.5 rport 2346 "
+ "generation 2\r\n"
+ "a=candidate:a0+B/3 2 udp 2130706432 74.125.127.126 2347 typ srflx "
+ "raddr 192.168.1.5 rport 2348 "
+ "generation 2\r\n"
+ "a=ice-ufrag:ufrag_voice\r\na=ice-pwd:pwd_voice\r\n"
+ "a=mid:audio_content_name\r\n"
+ "a=msid:local_stream_1 audio_track_id_1\r\n"
+ "a=sendrecv\r\n"
+ "a=rtcp-mux\r\n"
+ "a=rtcp-rsize\r\n"
+ "a=crypto:1 AES_CM_128_HMAC_SHA1_32 "
+ "inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32 "
+ "dummy_session_params\r\n"
+ "a=rtpmap:111 opus/48000/2\r\n"
+ "a=rtpmap:103 ISAC/16000\r\n"
+ "a=rtpmap:104 ISAC/32000\r\n"
+ "a=ssrc:1 cname:stream_1_cname\r\n"
+ "a=ssrc:1 msid:local_stream_1 audio_track_id_1\r\n"
+ "a=ssrc:1 mslabel:local_stream_1\r\n"
+ "a=ssrc:1 label:audio_track_id_1\r\n"
+ "a=ssrc:4 cname:stream_2_cname\r\n"
+ "a=ssrc:4 msid:local_stream_2 audio_track_id_2\r\n"
+ "a=ssrc:4 mslabel:local_stream_2\r\n"
+ "a=ssrc:4 label:audio_track_id_2\r\n"
+ "m=video 3457 RTP/SAVPF 120\r\n"
+ "c=IN IP4 74.125.224.39\r\n"
+ "a=rtcp:3456 IN IP4 74.125.224.39\r\n"
+ "a=candidate:a0+B/1 2 udp 2130706432 192.168.1.5 1236 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 1237 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/2 2 udp 2130706432 ::1 1240 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/2 1 udp 2130706432 ::1 1241 typ host "
+ "generation 2\r\n"
+ "a=candidate:a0+B/4 2 udp 2130706432 74.125.224.39 3456 typ relay "
+ "generation 2\r\n"
+ "a=candidate:a0+B/4 1 udp 2130706432 74.125.224.39 3457 typ relay "
+ "generation 2\r\n"
+ "a=ice-ufrag:ufrag_video\r\na=ice-pwd:pwd_video\r\n"
+ "a=mid:video_content_name\r\n"
+ "a=msid:local_stream_1 video_track_id_1\r\n"
+ "a=sendrecv\r\n"
+ "a=crypto:1 AES_CM_128_HMAC_SHA1_80 "
+ "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32\r\n"
+ "a=rtpmap:120 VP8/90000\r\n"
+ "a=ssrc-group:FEC 2 3\r\n"
+ "a=ssrc:2 cname:stream_1_cname\r\n"
+ "a=ssrc:2 msid:local_stream_1 video_track_id_1\r\n"
+ "a=ssrc:2 mslabel:local_stream_1\r\n"
+ "a=ssrc:2 label:video_track_id_1\r\n"
+ "a=ssrc:3 cname:stream_1_cname\r\n"
+ "a=ssrc:3 msid:local_stream_1 video_track_id_1\r\n"
+ "a=ssrc:3 mslabel:local_stream_1\r\n"
+ "a=ssrc:3 label:video_track_id_1\r\n"
+ "a=ssrc:5 cname:stream_2_cname\r\n"
+ "a=ssrc:5 msid:local_stream_2 video_track_id_2\r\n"
+ "a=ssrc:5 mslabel:local_stream_2\r\n"
+ "a=ssrc:5 label:video_track_id_2\r\n"
+ "a=ssrc:6 cname:stream_2_cname\r\n"
+ "a=ssrc:6 msid:local_stream_2 video_track_id_3\r\n"
+ "a=ssrc:6 mslabel:local_stream_2\r\n"
+ "a=ssrc:6 label:video_track_id_3\r\n";
+
// Unified Plan SDP reference string, with 2 streams, 2 audio tracks and 3 video
// tracks.
static const char kUnifiedPlanSdpFullString[] =
@@ -2976,6 +3061,20 @@ TEST_F(WebRtcSdpTest, SerializePlanBSessionDescription) {
TestSerialize(jdesc_, false);
}
+// Some WebRTC endpoints include the msid in both the Plan B and Unified Plan
+// ways, to make SDP that's compatible with both Plan B and Unified Plan (to
+// some extent). If we parse this, the Plan B msid attribute (which is more
+// specific, since it's at the SSRC level) should take priority.
+TEST_F(WebRtcSdpTest, DeserializePlanBSessionDescriptionWithMsid) {
+ MakePlanBDescription();
+
+ JsepSessionDescription deserialized_description(kDummyString);
+ EXPECT_TRUE(
+ SdpDeserialize(kPlanBSdpFullStringWithMsid, &deserialized_description));
+
+ EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description));
+}
+
TEST_F(WebRtcSdpTest, DeserializeUnifiedPlanSessionDescription) {
MakeUnifiedPlanDescription();
« no previous file with comments | « webrtc/api/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698