Bumping manifests a=b2g-bump
[gecko.git] / dom / webidl / PeerConnectionImpl.webidl
blob712dcf3332411ae9c911d7c3b8453fa15ceffeec
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * PeerConnection.js' interface to the C++ PeerConnectionImpl.
7  *
8  * Do not confuse with mozRTCPeerConnection. This interface is purely for
9  * communication between the PeerConnection JS DOM binding and the C++
10  * implementation in SIPCC.
11  *
12  * See media/webrtc/signaling/include/PeerConnectionImpl.h
13  *
14  */
16 interface nsISupports;
18 /* Must be created first. Observer events will be dispatched on the thread provided */
19 [ChromeOnly, Constructor]
20 interface PeerConnectionImpl  {
21   /* Must be called first. Observer events dispatched on the thread provided */
22   [Throws]
23   void initialize(PeerConnectionObserver observer, Window window,
24                   RTCConfiguration iceServers,
25                   nsISupports thread);
26   /* JSEP calls */
27   [Throws]
28   void createOffer(optional RTCOfferOptions options);
29   [Throws]
30   void createAnswer();
31   [Throws]
32   void setLocalDescription(long action, DOMString sdp);
33   [Throws]
34   void setRemoteDescription(long action, DOMString sdp);
36   /* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
37      observer. (see the |PeerConnectionObserver| interface) */
38   [Throws]
39   void getStats(MediaStreamTrack? selector);
41   /* Adds the tracks created by GetUserMedia */
42   [Throws]
43   void addTrack(MediaStreamTrack track, MediaStream... streams);
44   [Throws]
45   void removeTrack(MediaStreamTrack track);
46   [Throws]
47   void replaceTrack(MediaStreamTrack thisTrack, MediaStreamTrack withTrack,
48                     MediaStream stream);
49   [Throws]
50   void closeStreams();
52   sequence<MediaStream> getLocalStreams();
53   sequence<MediaStream> getRemoteStreams();
55   /* As the ICE candidates roll in this one should be called each time
56    * in order to keep the candidate list up-to-date for the next SDP-related
57    * call PeerConnectionImpl does not parse ICE candidates, just sticks them
58    * into the SDP.
59    */
60   [Throws]
61   void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
63   /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */
64   void close();
66   /* Notify DOM window if this plugin crash is ours. */
67   boolean pluginCrash(unsigned long long pluginId, DOMString name, DOMString pluginDumpID);
69   /* Attributes */
70   readonly attribute DOMString fingerprint;
71   readonly attribute DOMString localDescription;
72   readonly attribute DOMString remoteDescription;
74   readonly attribute PCImplIceConnectionState iceConnectionState;
75   readonly attribute PCImplIceGatheringState iceGatheringState;
76   readonly attribute PCImplSignalingState signalingState;
77   readonly attribute PCImplSipccState sipccState;
78   readonly attribute DOMString id;
80   attribute DOMString peerIdentity;
81   readonly attribute boolean privacyRequested;
83   /* Data channels */
84   [Throws]
85   DataChannel createDataChannel(DOMString label, DOMString protocol,
86     unsigned short type, boolean outOfOrderAllowed,
87     unsigned short maxTime, unsigned short maxNum,
88     boolean externalNegotiated, unsigned short stream);
89   [Throws]
90   void connectDataConnection(unsigned short localport,
91     unsigned short remoteport, unsigned short numstreams);