Diff
Modified: trunk/LayoutTests/ChangeLog (245828 => 245829)
--- trunk/LayoutTests/ChangeLog 2019-05-28 22:41:05 UTC (rev 245828)
+++ trunk/LayoutTests/ChangeLog 2019-05-28 23:13:55 UTC (rev 245829)
@@ -1,3 +1,14 @@
+2019-05-28 Youenn Fablet <[email protected]>
+
+ createAnswer() SDP Rejected by setLocalDescription()
+ https://bugs.webkit.org/show_bug.cgi?id=195930
+ <rdar://problem/49030489>
+
+ Reviewed by Eric Carlson.
+
+ * webrtc/h264-packetization-mode-expected.txt: Added.
+ * webrtc/h264-packetization-mode.html: Added.
+
2019-05-28 Shawn Roberts <[email protected]>
Unreviewed, rolling out r245475.
Added: trunk/LayoutTests/webrtc/h264-packetization-mode-expected.txt (0 => 245829)
--- trunk/LayoutTests/webrtc/h264-packetization-mode-expected.txt (rev 0)
+++ trunk/LayoutTests/webrtc/h264-packetization-mode-expected.txt 2019-05-28 23:13:55 UTC (rev 245829)
@@ -0,0 +1,6 @@
+
+PASS Make sure packetization mode 1 is offered
+PASS Offer without explicit H264 packetization mode
+PASS Offer with explicit H264 packetization mode 0
+PASS Offer with explicit H264 packetization mode 1
+
Added: trunk/LayoutTests/webrtc/h264-packetization-mode.html (0 => 245829)
--- trunk/LayoutTests/webrtc/h264-packetization-mode.html (rev 0)
+++ trunk/LayoutTests/webrtc/h264-packetization-mode.html 2019-05-28 23:13:55 UTC (rev 245829)
@@ -0,0 +1,70 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Testing H264 packetization mode</title>
+ <script src=""
+ <script src=""
+ </head>
+ <body>
+ <script>
+promise_test(async t => {
+ const pc = new RTCPeerConnection;
+ pc.addTransceiver("video");
+ const offer = await pc.createOffer();
+
+ assert_true(offer.sdp.indexOf("packetization-mode=1;profile-level-id=42e01f") !== -1, "baseline, packetization mode 1");
+ assert_false(offer.sdp.indexOf("packetization-mode=0") !== -1, "packetization mode 0 is not offered");
+}, "Make sure packetization mode 1 is offered");
+
+const sdpStart = `v=0
+o=- 3761869441 3761869441 IN IP4 0.0.0.0
+s=test
+c=IN IP4 0.0.0.0
+t=0 0
+a=group:BUNDLE video0
+m=video 1 RTP/SAVPF 99
+a=setup:actpass
+a=rtcp:9 IN IP4 0.0.0.0
+a=rtcp-mux
+a=recvonly
+a=mid:video0
+a=rtpmap:99 H264/90000
+a=ssrc:3599710107 cname:test-cname
+a=ice-ufrag:ZLgu
+a=ice-pwd:3/gb3GZYQ2wgxAHnFRT1bf
+a=fingerprint:sha-256 5A:08:09:0D:E9:1C:78:20:65:64:95:6E:FE:29:91:E1:CC:6E:47:F1:A4:7A:8E:F9:6F:4D:A4:7A:7A:A2:76:BF`;
+
+promise_test(async t => {
+ const sdp = sdpStart +`
+`;
+ const pc = new RTCPeerConnection();
+ await pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'})).then(() => {
+ assert_unreached();
+ }, (e) => {
+ assert_equals(e.name, "InvalidAccessError");
+ assert_equals(e.message, "Failed to set remote offer sdp: Failed to set remote video description send parameters.");
+ });
+}, "Offer without explicit H264 packetization mode");
+
+promise_test(async t => {
+ const sdp = sdpStart +`
+a=fmtp:99 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=0
+`;
+ const pc = new RTCPeerConnection();
+ await pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'})).then(() => {
+ assert_unreached();
+ }, (e) => {
+ assert_equals(e.name, "InvalidAccessError");
+ assert_equals(e.message, "Failed to set remote offer sdp: Failed to set remote video description send parameters.");
+ });
+}, "Offer with explicit H264 packetization mode 0");
+
+promise_test(async t => {
+ const sdp = sdpStart +`
+a=fmtp:99 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
+`;
+ const pc = new RTCPeerConnection;
+ return pc.setRemoteDescription(new RTCSessionDescription({sdp: sdp, type: 'offer'}));
+}, "Offer with explicit H264 packetization mode 1");
+</script>
Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (245828 => 245829)
--- trunk/Source/ThirdParty/libwebrtc/ChangeLog 2019-05-28 22:41:05 UTC (rev 245828)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog 2019-05-28 23:13:55 UTC (rev 245829)
@@ -1,3 +1,16 @@
+2019-05-28 Youenn Fablet <[email protected]>
+
+ createAnswer() SDP Rejected by setLocalDescription()
+ https://bugs.webkit.org/show_bug.cgi?id=195930
+ <rdar://problem/49030489>
+
+ Reviewed by Eric Carlson.
+
+ Make sure to check packetization mode parameter when matching H264 video codec.
+
+ * Source/webrtc/media/base/codec.cc:
+ * WebKit/0001-fix-195930.patch: Added.
+
2019-05-09 Andy Estes <[email protected]>
Fix 32-bit watchOS engineering builds after r244726.
Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc (245828 => 245829)
--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc 2019-05-28 22:41:05 UTC (rev 245828)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc 2019-05-28 23:13:55 UTC (rev 245829)
@@ -383,7 +383,7 @@
return false;
// For every format besides H264 and VP9, comparing names is enough.
if (absl::EqualsIgnoreCase(name1, kH264CodecName))
- return webrtc::H264::IsSameH264Profile(params1, params2);
+ return webrtc::H264::IsSameH264Profile(params1, params2) && IsSameH264PacketizationMode(params1, params2);
if (absl::EqualsIgnoreCase(name1, kVp9CodecName))
return webrtc::IsSameVP9Profile(params1, params2);
return true;
Added: trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-195930.patch (0 => 245829)
--- trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-195930.patch (rev 0)
+++ trunk/Source/ThirdParty/libwebrtc/WebKit/0001-fix-195930.patch 2019-05-28 23:13:55 UTC (rev 245829)
@@ -0,0 +1,25 @@
+From b6477d2493b4cf0875838ddcd725ed40a8725cc2 Mon Sep 17 00:00:00 2001
+From: Youenn Fablet <[email protected]>
+Date: Tue, 28 May 2019 09:58:04 -0700
+Subject: [PATCH] fix-195930
+
+---
+ Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc
+index 0a1c7156af8..c4cd02d8db4 100644
+--- a/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc
++++ b/Source/ThirdParty/libwebrtc/Source/webrtc/media/base/codec.cc
+@@ -383,7 +383,7 @@ bool IsSameCodec(const std::string& name1,
+ return false;
+ // For every format besides H264 and VP9, comparing names is enough.
+ if (absl::EqualsIgnoreCase(name1, kH264CodecName))
+- return webrtc::H264::IsSameH264Profile(params1, params2);
++ return webrtc::H264::IsSameH264Profile(params1, params2) && IsSameH264PacketizationMode(params1, params2);
+ if (absl::EqualsIgnoreCase(name1, kVp9CodecName))
+ return webrtc::IsSameVP9Profile(params1, params2);
+ return true;
+--
+2.20.1 (Apple Git-117)
+