2013-05-08 04:55:21 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCPeerConnection
|
|
|
|
*/
|
|
|
|
|
|
|
|
callback RTCSessionDescriptionCallback = void (mozRTCSessionDescription sdp);
|
|
|
|
callback RTCPeerConnectionErrorCallback = void (DOMString errorInformation);
|
|
|
|
callback VoidFunction = void ();
|
2013-10-18 02:00:05 +04:00
|
|
|
callback RTCStatsCallback = void (RTCStatsReport report);
|
2013-05-08 04:55:21 +04:00
|
|
|
|
|
|
|
enum RTCSignalingState {
|
|
|
|
"stable",
|
|
|
|
"have-local-offer",
|
|
|
|
"have-remote-offer",
|
|
|
|
"have-local-pranswer",
|
|
|
|
"have-remote-pranswer",
|
|
|
|
"closed"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum RTCIceGatheringState {
|
|
|
|
"new",
|
|
|
|
"gathering",
|
|
|
|
"complete"
|
|
|
|
};
|
|
|
|
|
|
|
|
enum RTCIceConnectionState {
|
|
|
|
"new",
|
|
|
|
"checking",
|
|
|
|
"connected",
|
|
|
|
"completed",
|
|
|
|
"failed",
|
|
|
|
"disconnected",
|
|
|
|
"closed"
|
|
|
|
};
|
|
|
|
|
2013-05-17 03:40:23 +04:00
|
|
|
dictionary RTCDataChannelInit {
|
2013-06-04 01:34:42 +04:00
|
|
|
boolean ordered = true;
|
|
|
|
unsigned short? maxRetransmitTime = null;
|
|
|
|
unsigned short? maxRetransmits = null;
|
|
|
|
DOMString protocol = "";
|
|
|
|
boolean negotiated = false; // spec currently says 'true'; we disagree
|
|
|
|
unsigned short? id = null;
|
|
|
|
|
|
|
|
// these are deprecated due to renaming in the spec, but still supported for Fx22
|
|
|
|
boolean outOfOrderAllowed; // now ordered, and the default changes to keep behavior the same
|
|
|
|
unsigned short maxRetransmitNum; // now maxRetransmits
|
|
|
|
boolean preset; // now negotiated
|
|
|
|
unsigned short stream; // now id
|
2013-05-17 03:40:23 +04:00
|
|
|
};
|
|
|
|
|
2013-10-10 06:27:54 +04:00
|
|
|
// Misnomer dictionaries housing PeerConnection-specific constraints.
|
|
|
|
//
|
|
|
|
// Important! Do not ever add members that might need tracing (e.g. object)
|
|
|
|
// to MediaConstraintSet or any dictionary marked XxxInternal here
|
|
|
|
|
|
|
|
dictionary MediaConstraintSet {
|
|
|
|
boolean OfferToReceiveAudio;
|
|
|
|
boolean OfferToReceiveVideo;
|
|
|
|
boolean MozDontOfferDataChannel;
|
2013-12-18 23:54:23 +04:00
|
|
|
boolean MozBundleOnly;
|
2013-10-10 06:27:54 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// MediaConstraint = single-property-subset of MediaConstraintSet
|
|
|
|
// Implemented as full set. Test Object.keys(pair).length == 1
|
|
|
|
|
|
|
|
// typedef MediaConstraintSet MediaConstraint; // TODO: Bug 913053
|
|
|
|
|
|
|
|
dictionary MediaConstraints {
|
|
|
|
object mandatory; // so we can see unknown + unsupported constraints
|
|
|
|
sequence<MediaConstraintSet> _optional; // a.k.a. MediaConstraint
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary MediaConstraintsInternal {
|
|
|
|
MediaConstraintSet mandatory; // holds only supported constraints
|
|
|
|
sequence<MediaConstraintSet> _optional; // a.k.a. MediaConstraint
|
|
|
|
};
|
|
|
|
|
2013-05-17 03:40:23 +04:00
|
|
|
interface RTCDataChannel;
|
|
|
|
|
2013-05-08 04:55:21 +04:00
|
|
|
[Pref="media.peerconnection.enabled",
|
|
|
|
JSImplementation="@mozilla.org/dom/peerconnection;1",
|
|
|
|
Constructor (optional RTCConfiguration configuration,
|
|
|
|
optional object? constraints)]
|
|
|
|
// moz-prefixed until sufficiently standardized.
|
|
|
|
interface mozRTCPeerConnection : EventTarget {
|
|
|
|
void createOffer (RTCSessionDescriptionCallback successCallback,
|
2013-10-27 18:36:34 +04:00
|
|
|
RTCPeerConnectionErrorCallback failureCallback,
|
2013-10-10 06:27:54 +04:00
|
|
|
optional MediaConstraints constraints);
|
2013-05-08 04:55:21 +04:00
|
|
|
void createAnswer (RTCSessionDescriptionCallback successCallback,
|
2013-10-27 18:36:34 +04:00
|
|
|
RTCPeerConnectionErrorCallback failureCallback,
|
2013-10-10 06:27:54 +04:00
|
|
|
optional MediaConstraints constraints);
|
2013-05-08 04:55:21 +04:00
|
|
|
void setLocalDescription (mozRTCSessionDescription description,
|
|
|
|
optional VoidFunction successCallback,
|
|
|
|
optional RTCPeerConnectionErrorCallback failureCallback);
|
|
|
|
void setRemoteDescription (mozRTCSessionDescription description,
|
|
|
|
optional VoidFunction successCallback,
|
|
|
|
optional RTCPeerConnectionErrorCallback failureCallback);
|
2013-05-17 03:40:23 +04:00
|
|
|
readonly attribute mozRTCSessionDescription? localDescription;
|
|
|
|
readonly attribute mozRTCSessionDescription? remoteDescription;
|
2013-05-08 04:55:21 +04:00
|
|
|
readonly attribute RTCSignalingState signalingState;
|
|
|
|
void updateIce (optional RTCConfiguration configuration,
|
2013-10-10 06:27:54 +04:00
|
|
|
optional MediaConstraints constraints);
|
2013-05-08 04:55:21 +04:00
|
|
|
void addIceCandidate (mozRTCIceCandidate candidate,
|
|
|
|
optional VoidFunction successCallback,
|
|
|
|
optional RTCPeerConnectionErrorCallback failureCallback);
|
|
|
|
readonly attribute RTCIceGatheringState iceGatheringState;
|
|
|
|
readonly attribute RTCIceConnectionState iceConnectionState;
|
|
|
|
sequence<MediaStream> getLocalStreams ();
|
|
|
|
sequence<MediaStream> getRemoteStreams ();
|
|
|
|
MediaStream? getStreamById (DOMString streamId);
|
2013-10-10 06:27:54 +04:00
|
|
|
void addStream (MediaStream stream, optional MediaConstraints constraints);
|
2013-05-08 04:55:21 +04:00
|
|
|
void removeStream (MediaStream stream);
|
|
|
|
void close ();
|
|
|
|
attribute EventHandler onnegotiationneeded;
|
|
|
|
attribute EventHandler onicecandidate;
|
|
|
|
attribute EventHandler onsignalingstatechange;
|
|
|
|
attribute EventHandler onaddstream;
|
|
|
|
attribute EventHandler onremovestream;
|
|
|
|
attribute EventHandler oniceconnectionstatechange;
|
2013-10-18 02:00:05 +04:00
|
|
|
|
|
|
|
void getStats (MediaStreamTrack? selector,
|
|
|
|
RTCStatsCallback successCallback,
|
|
|
|
RTCPeerConnectionErrorCallback failureCallback);
|
2013-05-17 03:40:23 +04:00
|
|
|
|
2013-10-29 21:29:43 +04:00
|
|
|
[ChromeOnly]
|
|
|
|
void getStatsInternal (MediaStreamTrack? selector,
|
|
|
|
RTCStatsCallback successCallback,
|
|
|
|
RTCPeerConnectionErrorCallback failureCallback);
|
|
|
|
|
2013-05-17 03:40:23 +04:00
|
|
|
// Data channel.
|
|
|
|
RTCDataChannel createDataChannel (DOMString label,
|
|
|
|
optional RTCDataChannelInit dataChannelDict);
|
|
|
|
attribute EventHandler ondatachannel;
|
|
|
|
attribute EventHandler onconnection;
|
|
|
|
attribute EventHandler onclosedconnection;
|
2013-05-08 04:55:21 +04:00
|
|
|
};
|
2013-11-25 23:01:03 +04:00
|
|
|
|
|
|
|
callback RTCLogCallback = void (sequence<DOMString> logMessages);
|
|
|
|
|
|
|
|
[JSImplementation="@mozilla.org/dom/webrtcglobalinformation;1",
|
|
|
|
ChromeOnly,
|
|
|
|
Constructor ()]
|
|
|
|
interface WebrtcGlobalInformation {
|
|
|
|
void getAllStats(RTCStatsCallback callback,
|
|
|
|
RTCPeerConnectionErrorCallback errorCallback);
|
|
|
|
void getCandPairLogs(DOMString candPairId,
|
|
|
|
RTCLogCallback callback,
|
|
|
|
RTCPeerConnectionErrorCallback errorCallback);
|
2013-11-26 02:38:41 +04:00
|
|
|
void getLogs(DOMString pattern,
|
|
|
|
RTCLogCallback callback,
|
|
|
|
RTCPeerConnectionErrorCallback errorCallback);
|
2013-11-25 23:01:03 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|