RTCRtpParameter defaults?

It just occurred to me that we have no way to know the defaults chosen by the browser engine when calling RTCRtpSender.send(…) or RTCRtpReceiver.receive(…) method. You may need that if you intend the browser engine to pick things like SSRC values for you but still signal those on the wire.


I suggest we can solve this by returning a Promise<RTCRtpParameters> from the send(..) and the receive(…) methods.

Example:

interface RTCRtpSender {
    //...
    Promise<RTCRtpParameters> send (RTCRtpParameters parameters);
    //...
};

The “send(…)” method returns a Promise whose “resolve” function will execute when the send parameters have taken effect and be pass back a copy of the RTCRtpParameters previously passed in with any browser chosen defaults appropriately filled as needed.


interface RTCRtpReceiver {
    //...
    Promise<RTCRtpParameters> receive (RTCRtpParameters parameters);
    //...
};

The “receive(…)” method returns a Promise whose “resolve” function will execute when the receive parameters have taken effect and be pass back a copy of the RTCRtpParameters previously passed in with any browser chosen defaults appropriately filled as needed.


In programmer can then do:

var promise = sender.send(params);
promise.then(function(params) { … success with params filled in…. }, function() {… failure…});


This also gives knowledge of when send/receive are activated should any asynchronous operations be required to fulfill the send/receive requests.

-Robin

Received on Friday, 13 June 2014 22:10:37 UTC