Title: [268592] trunk
Revision
268592
Author
[email protected]
Date
2020-10-16 08:38:29 -0700 (Fri, 16 Oct 2020)

Log Message

sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string
https://bugs.webkit.org/show_bug.cgi?id=217818

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.

* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::toRTCRtpCapabilities):
If line is empty, make sure to return a null string instead.

LayoutTests:

* webrtc/video-mute-vp8.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268591 => 268592)


--- trunk/LayoutTests/ChangeLog	2020-10-16 15:27:18 UTC (rev 268591)
+++ trunk/LayoutTests/ChangeLog	2020-10-16 15:38:29 UTC (rev 268592)
@@ -1,3 +1,12 @@
+2020-10-16  Youenn Fablet  <[email protected]>
+
+        sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string
+        https://bugs.webkit.org/show_bug.cgi?id=217818
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video-mute-vp8.html:
+
 2020-10-16  Sam Sneddon  <[email protected]>
 
         Remove redundant baselines in platform/

Modified: trunk/LayoutTests/webrtc/video-mute-vp8.html (268591 => 268592)


--- trunk/LayoutTests/webrtc/video-mute-vp8.html	2020-10-16 15:27:18 UTC (rev 268591)
+++ trunk/LayoutTests/webrtc/video-mute-vp8.html	2020-10-16 15:38:29 UTC (rev 268592)
@@ -20,8 +20,13 @@
         window.internals.clearPeerConnectionFactory();
 
     const codecs = RTCRtpSender.getCapabilities("video").codecs;
-    assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") }), "VP8 is listed as a codec");
+    assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") >= 0 }), "VP8 is listed as a codec");
 
+    codecs.forEach((codec) => {
+       if (codec.mimeType.indexOf("VP8") >=0)
+           assert_equals(codec.sdpFmtpLine, undefined, "VP8 codec.sdpFmtpLine is undefined");
+    });
+
     const pc = new RTCPeerConnection();
     pc.addTransceiver("video");
     const description = await pc.createOffer();

Modified: trunk/Source/WebCore/ChangeLog (268591 => 268592)


--- trunk/Source/WebCore/ChangeLog	2020-10-16 15:27:18 UTC (rev 268591)
+++ trunk/Source/WebCore/ChangeLog	2020-10-16 15:38:29 UTC (rev 268592)
@@ -1,3 +1,16 @@
+2020-10-16  Youenn Fablet  <[email protected]>
+
+        sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string
+        https://bugs.webkit.org/show_bug.cgi?id=217818
+
+        Reviewed by Eric Carlson.
+
+        Covered by updated test.
+
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
+        (WebCore::toRTCRtpCapabilities):
+        If line is empty, make sure to return a null string instead.
+
 2020-10-16  Philippe Normand  <[email protected]>
 
         [GStreamer] Remove unused ElementType values from the registry scanner

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp (268591 => 268592)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2020-10-16 15:27:18 UTC (rev 268591)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp	2020-10-16 15:38:29 UTC (rev 268592)
@@ -404,13 +404,16 @@
 
     capabilities.codecs.reserveInitialCapacity(rtpCapabilities.codecs.size());
     for (auto& codec : rtpCapabilities.codecs) {
-        StringBuilder sdpFmtpLine;
+        StringBuilder sdpFmtpLineBuilder;
         bool hasParameter = false;
         for (auto& parameter : codec.parameters) {
-            sdpFmtpLine.append(hasParameter ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length()));
+            sdpFmtpLineBuilder.append(hasParameter ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length()));
             hasParameter = true;
         }
-        capabilities.codecs.uncheckedAppend(RTCRtpCodecCapability { fromStdString(codec.mime_type()), static_cast<uint32_t>(codec.clock_rate ? *codec.clock_rate : 0), toChannels(codec.num_channels), sdpFmtpLine.toString() });
+        String sdpFmtpLine;
+        if (sdpFmtpLineBuilder.length())
+            sdpFmtpLine = sdpFmtpLineBuilder.toString();
+        capabilities.codecs.uncheckedAppend(RTCRtpCodecCapability { fromStdString(codec.mime_type()), static_cast<uint32_t>(codec.clock_rate ? *codec.clock_rate : 0), toChannels(codec.num_channels), WTFMove(sdpFmtpLine) });
     }
 
     capabilities.headerExtensions.reserveInitialCapacity(rtpCapabilities.header_extensions.size());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to