Re: Issue 141: Mandatory "kind" in RTCRtpReceiver constructor

Peter Thatcher said: 

"Wouldn't the RtpReceiver know if it's audio or video as soon as the RtpParameters are passed into receive()?"

[BA] Currently, "kind" is not passed to receive, only RTCRtpParameters which looks like this: 

dictionary RTCRtpParameters {
    DOMString                                 muxId = "";
    sequence<RTCRtpCodecParameters>           codecs;
    sequence<RTCRtpHeaderExtensionParameters> headerExtensions;
    sequence<RTCRtpEncodingParameters>        encodings;
    RTCRtcpParameters                         rtcp;
};

RTCRtpCodecParameters does not include "kind", although RTCRtpCodecCapabilities does include it: 

partial dictionary RTCRtpCodecParameters {
    DOMString                 name = "";
    payloadtype               payloadType;
};

partial dictionary RTCRtpCodecCapability {
    DOMString                 name = "";
    DOMString                 kind;
    payloadtype               preferredPayloadType;
};

So it seems that an implementation would need to match RTCRtpParameters.codecs[i].name against RTCRtpCodecCapability.name in order to determine the "kind" of each of the codecs. 

Since the intended "kind" is typically known when the RTCRtpReceiver object is created (it is always known for WebRTC 1.0), this seems like something that need not wait until packets are received to be determined. 

Received on Tuesday, 5 August 2014 18:04:07 UTC