-
Notifications
You must be signed in to change notification settings - Fork 42
Description
Currently, getCapabilities is defined as follows:
partial interface RTCRtpSender {
static RTCRtpCapabilities getCapabilities ();
};
partial interface RTCRtpReceiver {
static RTCRtpCapabilities getCapabilities ();
};
The implication is that getCapabilities() returns both audio and video capabilities in a single RTCRtpCapabilities object.
However, if getCapabilities wasn't defined as static, then it could return only capabilities of the appropriate kind:
For example, with respect to the RTCRtpSender object, it could work this way:
var audioSender = new RTCRtpSender(audioTrack, transport);
var videoSender = new RTCRtpSender(videoTrack, transport);
rtpAudioSendCaps = audioSender.getCapabilities();
rtpVideoSendCaps = videoSender.getCapabilities();
With the RTCRtpReceiver object, it could work this way:
var audioReceiver = new RTCRtpReceiver(transport);
var videoReceiver = new RTCRtpReceiver(transport);
rtpAudioRecvCaps = audioReceiver.getCapabilities("audio");
rtpVideoRecvCaps = videoReceiver.getCapabilities("video");
The advantage of doing it this way is that a subsequent call to createParameters could be more specific:
var audioRecvParams = RTCRtpReceiver.createParameters(
"audio", remote.rtpAudioSendCaps);
var videoRecvParams = RTCRtpReceiver.createParameters(
"video", remote.rtpVideoSendCaps);
So an alternative would be as follows:
partial interface RTCRtpReceiver {
RTCRtpCapabilities getCapabilities (DOMString kind);
}
partial interface RTCRtpSender {
RTCRtpCapabilities getCapabilities ();
};