2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-10-14 20:53:56 +04:00
|
|
|
/* 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/.
|
|
|
|
*
|
|
|
|
* PeerConnection.js' interface to the C++ PeerConnectionImpl.
|
|
|
|
*
|
2015-09-28 21:25:04 +03:00
|
|
|
* Do not confuse with RTCPeerConnection. This interface is purely for
|
2013-10-14 20:53:56 +04:00
|
|
|
* communication between the PeerConnection JS DOM binding and the C++
|
2018-11-14 01:52:24 +03:00
|
|
|
* implementation.
|
2013-10-14 20:53:56 +04:00
|
|
|
*
|
|
|
|
* See media/webrtc/signaling/include/PeerConnectionImpl.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
interface nsISupports;
|
|
|
|
|
|
|
|
/* Must be created first. Observer events will be dispatched on the thread provided */
|
2019-09-12 14:01:17 +03:00
|
|
|
[ChromeOnly]
|
2013-10-14 20:53:56 +04:00
|
|
|
interface PeerConnectionImpl {
|
2019-09-12 14:01:17 +03:00
|
|
|
constructor();
|
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* Must be called first. Observer events dispatched on the thread provided */
|
|
|
|
[Throws]
|
|
|
|
void initialize(PeerConnectionObserver observer, Window window,
|
|
|
|
RTCConfiguration iceServers,
|
|
|
|
nsISupports thread);
|
2015-07-06 20:40:04 +03:00
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* JSEP calls */
|
|
|
|
[Throws]
|
2019-07-03 10:52:35 +03:00
|
|
|
void createOffer(optional RTCOfferOptions options = {});
|
2013-10-14 20:53:56 +04:00
|
|
|
[Throws]
|
2014-07-10 22:31:25 +04:00
|
|
|
void createAnswer();
|
2013-10-14 20:53:56 +04:00
|
|
|
[Throws]
|
|
|
|
void setLocalDescription(long action, DOMString sdp);
|
|
|
|
[Throws]
|
|
|
|
void setRemoteDescription(long action, DOMString sdp);
|
|
|
|
|
2013-11-25 23:01:03 +04:00
|
|
|
/* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
|
|
|
|
observer. (see the |PeerConnectionObserver| interface) */
|
2013-10-18 02:00:05 +04:00
|
|
|
[Throws]
|
2014-02-20 21:35:35 +04:00
|
|
|
void getStats(MediaStreamTrack? selector);
|
2013-11-25 23:01:03 +04:00
|
|
|
|
2014-08-14 05:40:54 +04:00
|
|
|
/* Adds the tracks created by GetUserMedia */
|
|
|
|
[Throws]
|
2017-08-23 23:47:54 +03:00
|
|
|
TransceiverImpl createTransceiverImpl(DOMString kind,
|
|
|
|
MediaStreamTrack? track);
|
|
|
|
[Throws]
|
|
|
|
boolean checkNegotiationNeeded();
|
|
|
|
[Throws]
|
|
|
|
void insertDTMF(TransceiverImpl transceiver, DOMString tones,
|
2016-09-14 15:53:23 +03:00
|
|
|
optional unsigned long duration = 100,
|
|
|
|
optional unsigned long interToneGap = 70);
|
|
|
|
[Throws]
|
|
|
|
DOMString getDTMFToneBuffer(RTCRtpSender sender);
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-11-14 21:29:44 +03:00
|
|
|
sequence<RTCRtpSourceEntry> getRtpSources(MediaStreamTrack track,
|
|
|
|
DOMHighResTimeStamp rtpSourceNow);
|
|
|
|
DOMHighResTimeStamp getNowInRtpSourceReferenceTime();
|
|
|
|
|
2016-09-14 15:53:23 +03:00
|
|
|
[Throws]
|
2017-08-23 23:47:54 +03:00
|
|
|
void replaceTrackNoRenegotiation(TransceiverImpl transceiverImpl,
|
|
|
|
MediaStreamTrack? withTrack);
|
2015-12-31 19:32:24 +03:00
|
|
|
[Throws]
|
2013-10-14 20:53:56 +04:00
|
|
|
void closeStreams();
|
|
|
|
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-04-26 18:01:07 +03:00
|
|
|
void addRIDExtension(MediaStreamTrack recvTrack, unsigned short extensionId);
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-04-26 18:01:07 +03:00
|
|
|
void addRIDFilter(MediaStreamTrack recvTrack, DOMString rid);
|
2015-12-09 23:37:38 +03:00
|
|
|
|
2017-11-14 21:29:44 +03:00
|
|
|
// Inserts CSRC data for the RtpSourceObserver for testing
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-11-14 21:29:44 +03:00
|
|
|
void insertAudioLevelForContributingSource(MediaStreamTrack recvTrack,
|
|
|
|
unsigned long source,
|
|
|
|
DOMHighResTimeStamp timestamp,
|
|
|
|
boolean hasLevel,
|
|
|
|
byte level);
|
|
|
|
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-06-30 03:14:06 +03:00
|
|
|
void enablePacketDump(unsigned long level,
|
|
|
|
mozPacketDumpType type,
|
|
|
|
boolean sending);
|
|
|
|
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2017-06-30 03:14:06 +03:00
|
|
|
void disablePacketDump(unsigned long level,
|
|
|
|
mozPacketDumpType type,
|
|
|
|
boolean sending);
|
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* As the ICE candidates roll in this one should be called each time
|
|
|
|
* in order to keep the candidate list up-to-date for the next SDP-related
|
|
|
|
* call PeerConnectionImpl does not parse ICE candidates, just sticks them
|
|
|
|
* into the SDP.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2019-03-08 18:24:27 +03:00
|
|
|
void addIceCandidate(DOMString candidate,
|
|
|
|
DOMString mid,
|
|
|
|
DOMString ufrag,
|
|
|
|
unsigned short? level);
|
2013-10-14 20:53:56 +04:00
|
|
|
|
2018-11-14 01:52:24 +03:00
|
|
|
/* Shuts down threads, deletes state */
|
2018-02-01 22:22:48 +03:00
|
|
|
[Throws]
|
2013-10-14 20:53:56 +04:00
|
|
|
void close();
|
|
|
|
|
2014-07-28 19:41:52 +04:00
|
|
|
/* Notify DOM window if this plugin crash is ours. */
|
2015-05-04 22:40:29 +03:00
|
|
|
boolean pluginCrash(unsigned long long pluginId, DOMString name);
|
2014-07-21 11:50:11 +04:00
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* Attributes */
|
2015-07-06 20:40:04 +03:00
|
|
|
/* This provides the implementation with the certificate it uses to
|
|
|
|
* authenticate itself. The JS side must set this before calling
|
|
|
|
* createOffer/createAnswer or retrieving the value of fingerprint. This has
|
|
|
|
* to be delayed because generating the certificate takes some time. */
|
|
|
|
attribute RTCCertificate certificate;
|
2014-11-20 03:16:29 +03:00
|
|
|
[Constant]
|
2013-12-05 01:36:00 +04:00
|
|
|
readonly attribute DOMString fingerprint;
|
2017-06-30 11:18:46 +03:00
|
|
|
readonly attribute DOMString currentLocalDescription;
|
|
|
|
readonly attribute DOMString pendingLocalDescription;
|
|
|
|
readonly attribute DOMString currentRemoteDescription;
|
|
|
|
readonly attribute DOMString pendingRemoteDescription;
|
2013-10-14 20:53:56 +04:00
|
|
|
|
2019-06-19 19:54:38 +03:00
|
|
|
readonly attribute RTCIceConnectionState iceConnectionState;
|
|
|
|
readonly attribute RTCIceGatheringState iceGatheringState;
|
|
|
|
readonly attribute RTCSignalingState signalingState;
|
2014-11-20 22:43:02 +03:00
|
|
|
attribute DOMString id;
|
2013-10-14 20:53:56 +04:00
|
|
|
|
2018-02-01 22:22:48 +03:00
|
|
|
[SetterThrows]
|
2014-05-01 14:50:00 +04:00
|
|
|
attribute DOMString peerIdentity;
|
|
|
|
readonly attribute boolean privacyRequested;
|
|
|
|
|
2013-10-14 20:53:56 +04:00
|
|
|
/* Data channels */
|
|
|
|
[Throws]
|
2018-02-10 01:36:48 +03:00
|
|
|
RTCDataChannel createDataChannel(DOMString label, DOMString protocol,
|
2016-11-23 00:13:04 +03:00
|
|
|
unsigned short type, boolean ordered,
|
2013-10-14 20:53:56 +04:00
|
|
|
unsigned short maxTime, unsigned short maxNum,
|
|
|
|
boolean externalNegotiated, unsigned short stream);
|
|
|
|
};
|