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.
|
|
|
|
*/
|
2015-05-25 10:23:26 +03:00
|
|
|
[scriptable, uuid(96dd548f-7d0f-43c1-b1ad-28e666cf1e82)]
|
2014-08-27 06:28:03 +04:00
|
|
|
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);
|
|
|
|
|
2015-05-25 10:23:26 +03:00
|
|
|
/*
|
|
|
|
* Callback for receiving ICE candidate from remote endpoint.
|
|
|
|
* @param answer The received answer.
|
|
|
|
*/
|
|
|
|
void onIceCandidate(in DOMString candidate);
|
|
|
|
|
2014-08-27 06:28:03 +04:00
|
|
|
/*
|
2016-07-12 05:16:46 +03:00
|
|
|
* The callback for notifying channel connected. This should be async called
|
2016-06-03 06:03:27 +03:00
|
|
|
* after nsIPresentationDevice::establishControlChannel.
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
2016-07-12 05:16:46 +03:00
|
|
|
void notifyConnected();
|
2014-08-27 06:28:03 +04:00
|
|
|
|
|
|
|
/*
|
2016-07-12 05:16:46 +03:00
|
|
|
* The callback for notifying channel disconnected.
|
2014-08-27 06:28:03 +04:00
|
|
|
* @param reason The reason of channel close, NS_OK represents normal close.
|
|
|
|
*/
|
2016-07-12 05:16:46 +03:00
|
|
|
void notifyDisconnected(in nsresult reason);
|
2016-08-02 20:10:00 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The callback for notifying the reconnect command is acknowledged.
|
|
|
|
*/
|
|
|
|
void notifyReconnected();
|
2014-08-27 06:28:03 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The control channel for establishing RTCPeerConnection for a presentation
|
2016-04-11 06:20:55 +03:00
|
|
|
* session. SDP Offer/Answer will be exchanged through this interface. The
|
|
|
|
* control channel should be in-order.
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
2015-05-25 10:23:26 +03:00
|
|
|
[scriptable, uuid(e60e208c-a9f5-4bc6-9a3e-47f3e4ae9c57)]
|
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;
|
|
|
|
|
|
|
|
/*
|
2015-05-25 10:23:26 +03:00
|
|
|
* Send offer to remote endpoint. |onOffer| should be invoked on remote
|
|
|
|
* endpoint.
|
2014-08-27 06:28:03 +04:00
|
|
|
* @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);
|
|
|
|
|
|
|
|
/*
|
2015-05-25 10:23:26 +03:00
|
|
|
* Send answer to remote endpoint. |onAnswer| should be invoked on remote
|
|
|
|
* endpoint.
|
2014-08-27 06:28:03 +04:00
|
|
|
* @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
|
|
|
/*
|
2015-05-25 10:23:26 +03:00
|
|
|
* Send ICE candidate to remote endpoint. |onIceCandidate| should be invoked
|
|
|
|
* on remote endpoint.
|
|
|
|
* @param candidate The candidate to send
|
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
2015-03-30 09:27:27 +03:00
|
|
|
*/
|
2015-05-25 10:23:26 +03:00
|
|
|
void sendIceCandidate(in DOMString candidate);
|
2015-03-30 09:27:27 +03:00
|
|
|
|
2014-08-27 06:28:03 +04:00
|
|
|
/*
|
2016-07-04 13:12:04 +03:00
|
|
|
* Launch a presentation on remote endpoint.
|
|
|
|
* @param presentationId The Id for representing this session.
|
|
|
|
* @param url The URL requested to open by remote device.
|
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
|
|
|
*/
|
|
|
|
void launch(in DOMString presentationId, in DOMString url);
|
|
|
|
|
2016-05-27 02:22:27 +03:00
|
|
|
/*
|
|
|
|
* Terminate a presentation on remote endpoint.
|
|
|
|
* @param presentationId The Id for representing this session.
|
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
|
|
|
*/
|
|
|
|
void terminate(in DOMString presentationId);
|
|
|
|
|
2016-07-04 13:12:04 +03:00
|
|
|
/*
|
|
|
|
* Disconnect the control channel.
|
|
|
|
* @param reason The reason of disconnecting channel; NS_OK represents normal.
|
2014-08-27 06:28:03 +04:00
|
|
|
*/
|
2016-07-04 13:12:04 +03:00
|
|
|
void disconnect(in nsresult reason);
|
2016-08-02 20:10:00 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Reconnect a presentation on remote endpoint.
|
|
|
|
* Note that only controller is allowed to reconnect a session.
|
|
|
|
* @param presentationId The Id for representing this session.
|
|
|
|
* @param url The URL requested to open by remote device.
|
|
|
|
* @throws NS_ERROR_FAILURE on failure
|
|
|
|
*/
|
|
|
|
void reconnect(in DOMString presentationId, in DOMString url);
|
2014-08-27 06:28:03 +04:00
|
|
|
};
|