W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > October 2018

[webrtc-pc] setParameters: check for number of encodings

From: Bernard Aboba via GitHub <sysbot+gh@w3.org>
Date: Sat, 27 Oct 2018 17:54:09 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issues.opened-374671228-1540662848-sysbot+gh@w3.org>
aboba has just created a new issue for https://github.com/w3c/webrtc-pc:

== setParameters: check for number of encodings ==
The following code (from Simulcast Playground by Fippo) run without issue on Firefox: 

`navigator.mediaDevices.getUserMedia({video: {wіdth: 1280, height: 720}})
.then(stream => {
    show(stream, false);
    const sender = pc1.addTrack(stream.getTracks()[0], stream);
    sender.setParameters({encodings: [
        {rid: "hi", maxBitrate: bitrates[0]},
        {rid: "mid", maxBitrate: bitrates[1], scaleResolutionDownBy: 2},
        {rid: "lo", maxBitrate: bitrates[2], scaleResolutionDownBy: 4},
    ]});
    return pc1.createOffer();
})`

Yet, in Section 5.2, setParameters contains the following checks:

Validate parameters by running the following steps:

    Let encodings be parameters.encodings.
    Let codecs be parameters.codecs.
    Let N be the number of RTCRtpEncodingParameters stored in sender's internal [[SendEncodings]] slot.
    If any of the following conditions are met, return a promise rejected with a newly created InvalidModificationError:
        encodings.length is different from N.
        encodings has been re-ordered. 

These checks would (wrongly) result in an InvalidModificationError in the above code snippet. 
The problem that the check is (incorrectly) trying to find is an attempt to change the number of encodings *after* negotiation.  That would set negotiation-needed, which is not permitted in setParameters.  But prior to calling sLD, setParameters should be able to change the 'simulcast envelope'. 




Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2016 using your GitHub account
Received on Saturday, 27 October 2018 17:54:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:07 UTC