Changeset 268592 in webkit


Ignore:
Timestamp:
Oct 16, 2020 8:38:29 AM (4 years ago)
Author:
youenn@apple.com
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:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268589 r268592  
     12020-10-16  Youenn Fablet  <youenn@apple.com>
     2
     3        sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=217818
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/video-mute-vp8.html:
     9
    1102020-10-16  Sam Sneddon  <gsnedders@apple.com>
    211
  • trunk/LayoutTests/webrtc/video-mute-vp8.html

    r253966 r268592  
    2121
    2222    const codecs = RTCRtpSender.getCapabilities("video").codecs;
    23     assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") }), "VP8 is listed as a codec");
     23    assert_true(codecs.some((codec) => { return codec.mimeType.indexOf("VP8") >= 0 }), "VP8 is listed as a codec");
     24
     25    codecs.forEach((codec) => {
     26       if (codec.mimeType.indexOf("VP8") >=0)
     27           assert_equals(codec.sdpFmtpLine, undefined, "VP8 codec.sdpFmtpLine is undefined");
     28    });
    2429
    2530    const pc = new RTCPeerConnection();
  • trunk/Source/WebCore/ChangeLog

    r268590 r268592  
     12020-10-16  Youenn Fablet  <youenn@apple.com>
     2
     3        sdpFmtLine should be missing from RTCRtpCodecCapability instead of being an empty string
     4        https://bugs.webkit.org/show_bug.cgi?id=217818
     5
     6        Reviewed by Eric Carlson.
     7
     8        Covered by updated test.
     9
     10        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
     11        (WebCore::toRTCRtpCapabilities):
     12        If line is empty, make sure to return a null string instead.
     13
    1142020-10-16  Philippe Normand  <pnormand@igalia.com>
    215
  • trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp

    r267249 r268592  
    405405    capabilities.codecs.reserveInitialCapacity(rtpCapabilities.codecs.size());
    406406    for (auto& codec : rtpCapabilities.codecs) {
    407         StringBuilder sdpFmtpLine;
     407        StringBuilder sdpFmtpLineBuilder;
    408408        bool hasParameter = false;
    409409        for (auto& parameter : codec.parameters) {
    410             sdpFmtpLine.append(hasParameter ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length()));
     410            sdpFmtpLineBuilder.append(hasParameter ? ";" : "", StringView(parameter.first.data(), parameter.first.length()), '=', StringView(parameter.second.data(), parameter.second.length()));
    411411            hasParameter = true;
    412412        }
    413         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() });
     413        String sdpFmtpLine;
     414        if (sdpFmtpLineBuilder.length())
     415            sdpFmtpLine = sdpFmtpLineBuilder.toString();
     416        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) });
    414417    }
    415418
Note: See TracChangeset for help on using the changeset viewer.