w3c / webrtc-extensions

A repository for experimental additions to the WebRTC API
https://w3c.github.io/webrtc-extensions/
Other
58 stars 19 forks source link

get/setParameters() while in-parallel SDP is being processed #58

Open henbos opened 3 years ago

henbos commented 3 years ago

getParameters() returns information based on [[SendEncodings]] which is set when SLD/SRD resolves. setParameters() synchronously validates parameters against [[SendEncodings]] and then in-parallel attempts to configure the the parameters, which resolves or rejects the promise depending on "If any error occurred while configuring the media stack".

If I do getParameters(), setLocalDescription() without awaiting, followed by setParameters() in the same task execution cycle it seems like I will validate the parameters against the [[SendEncodings]] prior to the SLD call, but whether or not the parameters will be successfully or unsuccessfully applied seems may be related to whether or not the in-parallel SLD processing has had an affect yet.

So perhaps the promise should get rejected on a browser like Chrome that does SLD processing on a background thread, and succeed on a browser like Firefox which applies SLD at the end of the task execution cycle. In Chrome, the net effect would be "get params, apply SLD, set params" and in Firefox the net effect would be "get params, set params, apply SLD".

henbos commented 3 years ago

This seems like an obscure question, but I was wondering if Chrome could be optimized by caching parameters, so it got me thinking what would happen in edge cases.

henbos commented 3 years ago

Or is none of this applicable because [[SendEncodings]] shouldn't be modified after first O/A?