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/.
6 * PeerConnection.js' interface to the C++ PeerConnectionImpl.
8 * Do not confuse with RTCPeerConnection. This interface is purely for
9 * communication between the PeerConnection JS DOM binding and the C++
12 * See media/webrtc/signaling/include/PeerConnectionImpl.h
16 interface nsISupports;
18 /* Must be created first. Observer events will be dispatched on the thread provided */
21 interface PeerConnectionImpl {
24 /* Must be called first. Observer events dispatched on the thread provided */
26 void initialize(PeerConnectionObserver observer, Window window,
27 RTCConfiguration iceServers,
32 void createOffer(optional RTCOfferOptions options = {});
36 void setLocalDescription(long action, DOMString sdp);
38 void setRemoteDescription(long action, DOMString sdp);
40 Promise<RTCStatsReport> getStats(MediaStreamTrack? selector);
42 sequence<MediaStream> getRemoteStreams();
44 /* Adds the tracks created by GetUserMedia */
46 TransceiverImpl createTransceiverImpl(DOMString kind,
47 MediaStreamTrack? track);
49 boolean checkNegotiationNeeded();
52 void replaceTrackNoRenegotiation(TransceiverImpl transceiverImpl,
53 MediaStreamTrack? withTrack);
58 void enablePacketDump(unsigned long level,
59 mozPacketDumpType type,
63 void disablePacketDump(unsigned long level,
64 mozPacketDumpType type,
67 /* As the ICE candidates roll in this one should be called each time
68 * in order to keep the candidate list up-to-date for the next SDP-related
69 * call PeerConnectionImpl does not parse ICE candidates, just sticks them
73 void addIceCandidate(DOMString candidate,
76 unsigned short? level);
78 /* Shuts down threads, deletes state */
82 /* Notify DOM window if this plugin crash is ours. */
83 boolean pluginCrash(unsigned long long pluginId, DOMString name);
86 /* This provides the implementation with the certificate it uses to
87 * authenticate itself. The JS side must set this before calling
88 * createOffer/createAnswer or retrieving the value of fingerprint. This has
89 * to be delayed because generating the certificate takes some time. */
90 attribute RTCCertificate certificate;
92 readonly attribute DOMString fingerprint;
93 readonly attribute DOMString currentLocalDescription;
94 readonly attribute DOMString pendingLocalDescription;
95 readonly attribute DOMString currentRemoteDescription;
96 readonly attribute DOMString pendingRemoteDescription;
97 readonly attribute boolean? currentOfferer;
98 readonly attribute boolean? pendingOfferer;
100 readonly attribute RTCIceConnectionState iceConnectionState;
101 readonly attribute RTCIceGatheringState iceGatheringState;
102 readonly attribute RTCSignalingState signalingState;
103 attribute DOMString id;
106 attribute DOMString peerIdentity;
107 readonly attribute boolean privacyRequested;
111 RTCDataChannel createDataChannel(DOMString label, DOMString protocol,
112 unsigned short type, boolean ordered,
113 unsigned short maxTime, unsigned short maxNum,
114 boolean externalNegotiated, unsigned short stream);