mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
dom: Add WebRTC transceiver stubs.
This commit is contained in:
parent
1ae117f67b
commit
84efd56e57
9 changed files with 220 additions and 4 deletions
|
@ -115,6 +115,22 @@ enum RTCSignalingState {
|
|||
"closed"
|
||||
};
|
||||
|
||||
dictionary RTCRtpCodingParameters {
|
||||
DOMString rid;
|
||||
};
|
||||
|
||||
dictionary RTCRtpEncodingParameters : RTCRtpCodingParameters {
|
||||
boolean active = true;
|
||||
unsigned long maxBitrate;
|
||||
double scaleResolutionDownBy;
|
||||
};
|
||||
|
||||
dictionary RTCRtpTransceiverInit {
|
||||
RTCRtpTransceiverDirection direction = "sendrecv";
|
||||
sequence<MediaStream> streams = [];
|
||||
sequence<RTCRtpEncodingParameters> sendEncodings = [];
|
||||
};
|
||||
|
||||
partial interface RTCPeerConnection {
|
||||
// sequence<RTCRtpSender> getSenders();
|
||||
// sequence<RTCRtpReceiver> getReceivers();
|
||||
|
@ -122,8 +138,9 @@ partial interface RTCPeerConnection {
|
|||
// RTCRtpSender addTrack(MediaStreamTrack track,
|
||||
// MediaStream... streams);
|
||||
// void removeTrack(RTCRtpSender sender);
|
||||
// RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind,
|
||||
// optional RTCRtpTransceiverInit init);
|
||||
[Pref="dom.webrtc.transceiver.enabled"]
|
||||
RTCRtpTransceiver addTransceiver((MediaStreamTrack or DOMString) trackOrKind,
|
||||
optional RTCRtpTransceiverInit init = {});
|
||||
attribute EventHandler ontrack;
|
||||
};
|
||||
|
||||
|
|
47
components/script/dom/webidls/RTCRtpSender.webidl
Normal file
47
components/script/dom/webidls/RTCRtpSender.webidl
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender
|
||||
|
||||
dictionary RTCRtpHeaderExtensionParameters {
|
||||
required DOMString uri;
|
||||
required unsigned short id;
|
||||
boolean encrypted = false;
|
||||
};
|
||||
|
||||
dictionary RTCRtcpParameters {
|
||||
DOMString cname;
|
||||
boolean reducedSize;
|
||||
};
|
||||
|
||||
dictionary RTCRtpCodecParameters {
|
||||
required octet payloadType;
|
||||
required DOMString mimeType;
|
||||
required unsigned long clockRate;
|
||||
unsigned short channels;
|
||||
DOMString sdpFmtpLine;
|
||||
};
|
||||
|
||||
dictionary RTCRtpParameters {
|
||||
required sequence<RTCRtpHeaderExtensionParameters> headerExtensions;
|
||||
required RTCRtcpParameters rtcp;
|
||||
required sequence<RTCRtpCodecParameters> codecs;
|
||||
};
|
||||
|
||||
dictionary RTCRtpSendParameters : RTCRtpParameters {
|
||||
required DOMString transactionId;
|
||||
required sequence<RTCRtpEncodingParameters> encodings;
|
||||
};
|
||||
|
||||
[Exposed=Window, Pref="dom.webrtc.transceiver.enabled"]
|
||||
interface RTCRtpSender {
|
||||
//readonly attribute MediaStreamTrack? track;
|
||||
//readonly attribute RTCDtlsTransport? transport;
|
||||
//static RTCRtpCapabilities? getCapabilities(DOMString kind);
|
||||
Promise<void> setParameters(RTCRtpSendParameters parameters);
|
||||
RTCRtpSendParameters getParameters();
|
||||
//Promise<void> replaceTrack(MediaStreamTrack? withTrack);
|
||||
//void setStreams(MediaStream... streams);
|
||||
//Promise<RTCStatsReport> getStats();
|
||||
};
|
24
components/script/dom/webidls/RTCRtpTransceiver.webidl
Normal file
24
components/script/dom/webidls/RTCRtpTransceiver.webidl
Normal file
|
@ -0,0 +1,24 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://w3c.github.io/webrtc-pc/#rtcrtptransceiver-interface
|
||||
|
||||
[Exposed=Window, Pref="dom.webrtc.transceiver.enabled"]
|
||||
interface RTCRtpTransceiver {
|
||||
//readonly attribute DOMString? mid;
|
||||
[SameObject] readonly attribute RTCRtpSender sender;
|
||||
//[SameObject] readonly attribute RTCRtpReceiver receiver;
|
||||
attribute RTCRtpTransceiverDirection direction;
|
||||
//readonly attribute RTCRtpTransceiverDirection? currentDirection;
|
||||
//void stop();
|
||||
//void setCodecPreferences(sequence<RTCRtpCodecCapability> codecs);
|
||||
};
|
||||
|
||||
enum RTCRtpTransceiverDirection {
|
||||
"sendrecv",
|
||||
"sendonly",
|
||||
"recvonly",
|
||||
"inactive",
|
||||
"stopped"
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue