- From: Bernard Aboba <Bernard.Aboba@microsoft.com>
- Date: Fri, 9 May 2014 05:19:10 +0000
- To: "public-ortc@w3.org" <public-ortc@w3.org>
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: partial interface RTCRtpReceiver { RTCRtpCapabilities getCapabilities (DOMString kind); } partial interface RTCRtpSender { RTCRtpCapabilities getCapabilities (); }; If it were done this way, with respect to the RTCRtpSender object, it would be possible to retrieve audio and video send and receive capabilities separately: var audioSender = new RTCRtpSender(audioTrack, transport); var videoSender = new RTCRtpSender(videoTrack, transport); rtpAudioSendCaps = audioSender.getCapabilities(); rtpVideoSendCaps = videoSender.getCapabilities(); With the RTCRtpReceiver object, it would look like this: var audioReceiver = new RTCRtpReceiver(transport); var videoReceiver = new RTCRtpReceiver(transport); rtpAudioRecvCaps = audioReceiver.getCapabilities("audio"); rtpVideoRecvCaps = videoReceiver.getCapabilities("video"); One advantage of separating audio and video capabilities is that subsequent calls to createParameters could be more specific: var audioRecvParams = RTCRtpReceiver.createParameters( "audio", remote.rtpAudioSendCaps); var videoRecvParams = RTCRtpReceiver.createParameters( "video", remote.rtpVideoSendCaps);
Received on Friday, 9 May 2014 05:19:40 UTC