2014-08-27 06:28:03 +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/. */
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIArray;
|
|
|
|
interface nsIInputStream;
|
|
|
|
|
|
|
|
[scriptable, uuid(ae318e05-2a4e-4f85-95c0-e8b191ad812c)]
|
|
|
|
interface nsIPresentationChannelDescription: nsISupports
|
|
|
|
{
|
|
|
|
const unsigned short TYPE_TCP = 1;
|
|
|
|
const unsigned short TYPE_DATACHANNEL = 2;
|
|
|
|
|
|
|
|
// Type of transport channel.
|
|
|
|
readonly attribute uint8_t type;
|
|
|
|
|
2015-09-01 11:52:51 +03:00
|
|
|
// Addresses for TCP channel (as a list of nsISupportsCString).
|
2014-08-27 06:28:03 +04:00
|
|
|
// Should only be used while type == TYPE_TCP.
|
|
|
|
readonly attribute nsIArray tcpAddress;
|
|
|
|
|
|
|
|
// Port number for TCP channel.
|
|
|
|
// Should only be used while type == TYPE_TCP.
|
|
|
|
readonly attribute uint16_t tcpPort;
|
|
|
|
|
|
|
|
// SDP for Data Channel.
|
|
|
|
// Should only be used while type == TYPE_DATACHANNEL.
|
|
|
|
readonly attribute DOMString dataChannelSDP;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The callbacks for events on control channel.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(d0cdc638-a9d5-4bcd-838c-3aed7c3f2a6b)]
|
|
|
|
interface nsIPresentationControlChannelListener: nsISupports
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Callback for receiving offer from remote endpoint.
|
|
|
|
* @param offer The received offer.
|
|
|
|
*/
|
|
|
|
void onOffer(in nsIPresentationChannelDescription offer);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Callback for receiving answer from remote endpoint.
|
|
|
|
* @param answer The received answer.
|
|
|
|
*/
|
|
|
|
void onAnswer(in nsIPresentationChannelDescription answer);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The callback for notifying channel opened.
|
|
|
|
*/
|
|
|
|
void notifyOpened();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The callback for notifying channel closed.
|
|
|
|
* @param reason The reason of channel close, NS_OK represents normal close.
|
|
|
|
*/
|
|
|
|
void notifyClosed(in nsresult reason);
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The control channel for establishing RTCPeerConnection for a presentation
|
|
|
|
* session. SDP Offer/Answer will be exchanged through this interface.
|
|
|
|
*/
|
2015-03-30 09:27:27 +03:00
|
|
|
[scriptable, uuid(2c8ec493-4e5b-4df7-bedc-7ab25af323f0)]
|
2014-08-27 06:28:03 +04:00
|
|
|
interface nsIPresentationControlChannel: nsISupports
|
|
|
|
{
|
|
|
|
// The listener for handling events of this control channel.
|
|
|
|
// All the events should be pending until listener is assigned.
|
|
|
|
attribute nsIPresentationControlChannelListener listener;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send offer to remote endpiont. |onOffer| should be invoked
|
|
|
|
* on remote endpoint.
|
|
|
|
* @param offer The offer to send.
|
2014-11-18 00:34:10 +03:00
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
|
|
|
void sendOffer(in nsIPresentationChannelDescription offer);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Send answer to remote endpiont. |onAnswer| should
|
|
|
|
* be invoked on remote endpoint.
|
|
|
|
* @param answer The answer to send.
|
2014-11-18 00:34:10 +03:00
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
|
|
|
void sendAnswer(in nsIPresentationChannelDescription answer);
|
|
|
|
|
2015-03-30 09:27:27 +03:00
|
|
|
/*
|
|
|
|
* Notify the app-to-app connection is fully established. (Only used at the
|
|
|
|
* receiver side.)
|
|
|
|
*/
|
|
|
|
void sendReceiverReady();
|
|
|
|
|
2014-08-27 06:28:03 +04:00
|
|
|
/*
|
|
|
|
* Close the transport channel.
|
2015-03-30 09:27:27 +03:00
|
|
|
* @param reason The reason of channel close; NS_OK represents normal.
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
2015-03-30 09:27:27 +03:00
|
|
|
void close(in nsresult reason);
|
2014-08-27 06:28:03 +04:00
|
|
|
};
|