Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 MediaConstraintsInternal constraints);
29 [Throws]
30 void createAnswer(optional MediaConstraintsInternal constraints);
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 stream created by GetUserMedia */
42 [Throws]
43 void addStream(MediaStream stream,
44 optional MediaConstraintsInternal constraints);
45 [Throws]
46 void removeStream(MediaStream stream);
47 [Throws]
48 void closeStreams();
50 sequence<MediaStream> getLocalStreams();
51 sequence<MediaStream> getRemoteStreams();
53 /* As the ICE candidates roll in this one should be called each time
54 * in order to keep the candidate list up-to-date for the next SDP-related
55 * call PeerConnectionImpl does not parse ICE candidates, just sticks them
56 * into the SDP.
57 */
58 [Throws]
59 void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
61 /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */
62 void close();
64 /* Attributes */
65 readonly attribute DOMString fingerprint;
66 readonly attribute DOMString localDescription;
67 readonly attribute DOMString remoteDescription;
69 readonly attribute PCImplIceConnectionState iceConnectionState;
70 readonly attribute PCImplIceGatheringState iceGatheringState;
71 readonly attribute PCImplReadyState readyState;
72 readonly attribute PCImplSignalingState signalingState;
73 readonly attribute PCImplSipccState sipccState;
75 /* Data channels */
76 [Throws]
77 DataChannel createDataChannel(DOMString label, DOMString protocol,
78 unsigned short type, boolean outOfOrderAllowed,
79 unsigned short maxTime, unsigned short maxNum,
80 boolean externalNegotiated, unsigned short stream);
81 [Throws]
82 void connectDataConnection(unsigned short localport,
83 unsigned short remoteport, unsigned short numstreams);
84 };