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

Unified Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 2023913002: RFC 3984 sprop-parameter-sets SDP unit test (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: code review: comment + null ptr check Created 4 years, 7 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 | « no previous file | 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 5c69d50c984815a33b537eb19188eb33d2931cac..10ff0aef2505cf037499d7139b98888e6edd3cc6 100644
--- a/webrtc/api/webrtcsdp_unittest.cc
+++ b/webrtc/api/webrtcsdp_unittest.cc
@@ -2915,6 +2915,42 @@ TEST_F(WebRtcSdpTest, DeserializeVideoFmtp) {
EXPECT_EQ(found->second, "40");
}
+TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSprops) {
+ JsepSessionDescription jdesc_output(kDummyString);
+
+ const char kSdpWithFmtpString[] =
+ "v=0\r\n"
+ "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
+ "s=-\r\n"
+ "t=0 0\r\n"
+ "m=video 49170 RTP/AVP 98\r\n"
+ "a=rtpmap:98 H264/90000\r\n"
+ "a=fmtp:98 profile-level-id=42A01E; "
+ "sprop-parameter-sets=Z0IACpZTBYmI,aMljiA==\r\n";
+
+ // Deserialize.
+ SdpParseError error;
+ EXPECT_TRUE(
+ webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error));
+
+ const ContentInfo* vc = GetFirstVideoContent(jdesc_output.description());
+ ASSERT_TRUE(vc != NULL);
+ const VideoContentDescription* vcd =
+ static_cast<const VideoContentDescription*>(vc->description);
+ ASSERT_TRUE(vcd != NULL);
+ ASSERT_FALSE(vcd->codecs().empty());
+ cricket::VideoCodec h264 = vcd->codecs()[0];
+ EXPECT_EQ("H264", h264.name);
+ EXPECT_EQ(98, h264.id);
+ cricket::CodecParameterMap::const_iterator found =
+ h264.params.find("profile-level-id");
+ ASSERT_TRUE(found != h264.params.end());
+ EXPECT_EQ(found->second, "42A01E");
+ found = h264.params.find("sprop-parameter-sets");
+ ASSERT_TRUE(found != h264.params.end());
+ EXPECT_EQ(found->second, "Z0IACpZTBYmI,aMljiA==");
+}
+
TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSpace) {
JsepSessionDescription jdesc_output(kDummyString);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698