1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/PeerConnectionImpl.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,84 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + * 1.9 + * PeerConnection.js' interface to the C++ PeerConnectionImpl. 1.10 + * 1.11 + * Do not confuse with mozRTCPeerConnection. This interface is purely for 1.12 + * communication between the PeerConnection JS DOM binding and the C++ 1.13 + * implementation in SIPCC. 1.14 + * 1.15 + * See media/webrtc/signaling/include/PeerConnectionImpl.h 1.16 + * 1.17 + */ 1.18 + 1.19 +interface nsISupports; 1.20 + 1.21 +/* Must be created first. Observer events will be dispatched on the thread provided */ 1.22 +[ChromeOnly, Constructor] 1.23 +interface PeerConnectionImpl { 1.24 + /* Must be called first. Observer events dispatched on the thread provided */ 1.25 + [Throws] 1.26 + void initialize(PeerConnectionObserver observer, Window window, 1.27 + RTCConfiguration iceServers, 1.28 + nsISupports thread); 1.29 + /* JSEP calls */ 1.30 + [Throws] 1.31 + void createOffer(optional MediaConstraintsInternal constraints); 1.32 + [Throws] 1.33 + void createAnswer(optional MediaConstraintsInternal constraints); 1.34 + [Throws] 1.35 + void setLocalDescription(long action, DOMString sdp); 1.36 + [Throws] 1.37 + void setRemoteDescription(long action, DOMString sdp); 1.38 + 1.39 + /* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our 1.40 + observer. (see the |PeerConnectionObserver| interface) */ 1.41 + [Throws] 1.42 + void getStats(MediaStreamTrack? selector); 1.43 + 1.44 + /* Adds the stream created by GetUserMedia */ 1.45 + [Throws] 1.46 + void addStream(MediaStream stream, 1.47 + optional MediaConstraintsInternal constraints); 1.48 + [Throws] 1.49 + void removeStream(MediaStream stream); 1.50 + [Throws] 1.51 + void closeStreams(); 1.52 + 1.53 + sequence<MediaStream> getLocalStreams(); 1.54 + sequence<MediaStream> getRemoteStreams(); 1.55 + 1.56 + /* As the ICE candidates roll in this one should be called each time 1.57 + * in order to keep the candidate list up-to-date for the next SDP-related 1.58 + * call PeerConnectionImpl does not parse ICE candidates, just sticks them 1.59 + * into the SDP. 1.60 + */ 1.61 + [Throws] 1.62 + void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level); 1.63 + 1.64 + /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */ 1.65 + void close(); 1.66 + 1.67 + /* Attributes */ 1.68 + readonly attribute DOMString fingerprint; 1.69 + readonly attribute DOMString localDescription; 1.70 + readonly attribute DOMString remoteDescription; 1.71 + 1.72 + readonly attribute PCImplIceConnectionState iceConnectionState; 1.73 + readonly attribute PCImplIceGatheringState iceGatheringState; 1.74 + readonly attribute PCImplReadyState readyState; 1.75 + readonly attribute PCImplSignalingState signalingState; 1.76 + readonly attribute PCImplSipccState sipccState; 1.77 + 1.78 + /* Data channels */ 1.79 + [Throws] 1.80 + DataChannel createDataChannel(DOMString label, DOMString protocol, 1.81 + unsigned short type, boolean outOfOrderAllowed, 1.82 + unsigned short maxTime, unsigned short maxNum, 1.83 + boolean externalNegotiated, unsigned short stream); 1.84 + [Throws] 1.85 + void connectDataConnection(unsigned short localport, 1.86 + unsigned short remoteport, unsigned short numstreams); 1.87 +};