2013-10-14 16:53:56 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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 18:25:04 +00:00
|
|
|
* Do not confuse with RTCPeerConnection. This interface is purely for
|
2013-10-14 16:53:56 +00:00
|
|
|
* communication between the PeerConnection JS DOM binding and the C++
|
|
|
|
* implementation in SIPCC.
|
|
|
|
*
|
|
|
|
* See media/webrtc/signaling/include/PeerConnectionImpl.h
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
interface nsISupports;
|
|
|
|
|
|
|
|
/* Must be created first. Observer events will be dispatched on the thread provided */
|
|
|
|
[ChromeOnly, Constructor]
|
|
|
|
interface PeerConnectionImpl {
|
|
|
|
/* 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 17:40:04 +00:00
|
|
|
|
2013-10-14 16:53:56 +00:00
|
|
|
/* JSEP calls */
|
|
|
|
[Throws]
|
2014-07-10 18:31:25 +00:00
|
|
|
void createOffer(optional RTCOfferOptions options);
|
2013-10-14 16:53:56 +00:00
|
|
|
[Throws]
|
2014-07-10 18:31:25 +00:00
|
|
|
void createAnswer();
|
2013-10-14 16:53:56 +00:00
|
|
|
[Throws]
|
|
|
|
void setLocalDescription(long action, DOMString sdp);
|
|
|
|
[Throws]
|
|
|
|
void setRemoteDescription(long action, DOMString sdp);
|
|
|
|
|
2013-11-25 19:01:03 +00:00
|
|
|
/* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
|
|
|
|
observer. (see the |PeerConnectionObserver| interface) */
|
2013-10-17 22:00:05 +00:00
|
|
|
[Throws]
|
2014-02-20 17:35:35 +00:00
|
|
|
void getStats(MediaStreamTrack? selector);
|
2013-11-25 19:01:03 +00:00
|
|
|
|
2014-08-14 01:40:54 +00:00
|
|
|
/* Adds the tracks created by GetUserMedia */
|
|
|
|
[Throws]
|
|
|
|
void addTrack(MediaStreamTrack track, MediaStream... streams);
|
|
|
|
[Throws]
|
|
|
|
void removeTrack(MediaStreamTrack track);
|
2013-10-14 16:53:56 +00:00
|
|
|
[Throws]
|
2015-03-11 16:08:21 +00:00
|
|
|
void replaceTrack(MediaStreamTrack thisTrack, MediaStreamTrack withTrack);
|
2014-08-15 05:33:09 +00:00
|
|
|
[Throws]
|
2015-12-31 16:32:24 +00:00
|
|
|
void setParameters(MediaStreamTrack track,
|
|
|
|
optional RTCRtpParameters parameters);
|
|
|
|
[Throws]
|
|
|
|
RTCRtpParameters getParameters(MediaStreamTrack track);
|
|
|
|
[Throws]
|
2013-10-14 16:53:56 +00:00
|
|
|
void closeStreams();
|
|
|
|
|
|
|
|
sequence<MediaStream> getLocalStreams();
|
|
|
|
sequence<MediaStream> getRemoteStreams();
|
|
|
|
|
2015-12-09 20:37:38 +00:00
|
|
|
void selectSsrc(MediaStreamTrack recvTrack, unsigned short ssrcIndex);
|
|
|
|
|
2013-10-14 16:53:56 +00: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]
|
|
|
|
void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
|
|
|
|
|
|
|
|
/* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */
|
|
|
|
void close();
|
|
|
|
|
2014-07-28 15:41:52 +00:00
|
|
|
/* Notify DOM window if this plugin crash is ours. */
|
2015-05-04 19:40:29 +00:00
|
|
|
boolean pluginCrash(unsigned long long pluginId, DOMString name);
|
2014-07-21 07:50:11 +00:00
|
|
|
|
2013-10-14 16:53:56 +00:00
|
|
|
/* Attributes */
|
2015-07-06 17:40:04 +00: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 00:16:29 +00:00
|
|
|
[Constant]
|
2013-12-04 21:36:00 +00:00
|
|
|
readonly attribute DOMString fingerprint;
|
2013-10-14 16:53:56 +00:00
|
|
|
readonly attribute DOMString localDescription;
|
|
|
|
readonly attribute DOMString remoteDescription;
|
|
|
|
|
2013-11-13 22:53:30 +00:00
|
|
|
readonly attribute PCImplIceConnectionState iceConnectionState;
|
|
|
|
readonly attribute PCImplIceGatheringState iceGatheringState;
|
2013-10-14 16:53:56 +00:00
|
|
|
readonly attribute PCImplSignalingState signalingState;
|
2014-11-20 19:43:02 +00:00
|
|
|
attribute DOMString id;
|
2013-10-14 16:53:56 +00:00
|
|
|
|
2014-05-01 10:50:00 +00:00
|
|
|
attribute DOMString peerIdentity;
|
|
|
|
readonly attribute boolean privacyRequested;
|
|
|
|
|
2013-10-14 16:53:56 +00:00
|
|
|
/* Data channels */
|
|
|
|
[Throws]
|
|
|
|
DataChannel createDataChannel(DOMString label, DOMString protocol,
|
|
|
|
unsigned short type, boolean outOfOrderAllowed,
|
|
|
|
unsigned short maxTime, unsigned short maxNum,
|
|
|
|
boolean externalNegotiated, unsigned short stream);
|
|
|
|
};
|