Skip to content

Separating audio and video capabilities #81

@aboba

Description

@aboba

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 ();
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions