Source code

Revision control

Copy as Markdown

Other Tools

/* -*- 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
* PeerConnection.js' interface to the C++ PeerConnectionImpl.
* Do not confuse with RTCPeerConnection. This interface is purely for
* communication between the PeerConnection JS DOM binding and the C++
* implementation.
* See media/webrtc/signaling/include/PeerConnectionImpl.h
interface nsISupports;
callback ChainedOperation = Promise<any> ();
/* Must be created first. Observer events will be dispatched on the thread provided */
interface PeerConnectionImpl {
/* Must be called first. Observer events dispatched on the thread provided */
void initialize(PeerConnectionObserver observer, Window window);
/* JSEP calls */
void createOffer(optional RTCOfferOptions options = {});
void createAnswer();
void setLocalDescription(long action, DOMString sdp);
void setRemoteDescription(long action, DOMString sdp);
Promise<RTCStatsReport> getStats(MediaStreamTrack? selector);
sequence<MediaStream> getRemoteStreams();
/* Adds the tracks created by GetUserMedia */
RTCRtpTransceiver addTransceiver(RTCRtpTransceiverInit init,
DOMString kind,
MediaStreamTrack? sendTrack);
sequence<RTCRtpTransceiver> getTransceivers();
void closeStreams();
void enablePacketDump(unsigned long level,
mozPacketDumpType type,
boolean sending);
void disablePacketDump(unsigned long level,
mozPacketDumpType type,
boolean sending);
/* 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.
void addIceCandidate(DOMString candidate,
DOMString mid,
DOMString ufrag,
unsigned short? level);
/* Shuts down threads, deletes state */
void close();
void setConfiguration(optional RTCConfiguration config = {});
void restartIce();
void restartIceNoRenegotiationNeeded();
/* Notify DOM window if this plugin crash is ours. */
boolean pluginCrash(unsigned long long pluginId, DOMString name);
// Only throws if promise creation fails
Promise<void> onSetDescriptionSuccess(RTCSdpType type, boolean remote);
/* Attributes */
/* 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;
readonly attribute DOMString fingerprint;
readonly attribute DOMString currentLocalDescription;
readonly attribute DOMString pendingLocalDescription;
readonly attribute DOMString currentRemoteDescription;
readonly attribute DOMString pendingRemoteDescription;
readonly attribute boolean? currentOfferer;
readonly attribute boolean? pendingOfferer;
readonly attribute RTCIceConnectionState iceConnectionState;
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCSignalingState signalingState;
attribute DOMString id;
attribute DOMString peerIdentity;
readonly attribute boolean privacyRequested;
/* Data channels */
RTCDataChannel createDataChannel(DOMString label, DOMString protocol,
unsigned short type, boolean ordered,
unsigned short maxTime, unsigned short maxNum,
boolean externalNegotiated, unsigned short stream);
Promise<any> chain(ChainedOperation op);
void updateNegotiationNeeded();
boolean createdSender(RTCRtpSender sender);