| // Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // The <code>chrome.webrtc.castSendTransport</code> API takes a track as |
| // a source of media, and sends that media on the inner transport according to |
| // the given RtpParams. |
| namespace webrtc.castSendTransport { |
| // Params for audio and video codec. |
| dictionary CodecSpecificParams { |
| DOMString key; |
| DOMString value; |
| }; |
| |
| // RTP payload param. |
| dictionary RtpPayloadParams { |
| long payloadType; |
| |
| DOMString codecName; |
| |
| // Synchronization source identifier. |
| long? ssrc; |
| |
| long? clockRate; |
| |
| long? minBitrate; |
| |
| long? maxBitrate; |
| |
| // The number of channels. |
| long? channels; |
| |
| // Video width in pixels. |
| long? width; |
| |
| // Video height in pixels. |
| long? height; |
| |
| // A list of codec specific params. |
| CodecSpecificParams[] codecSpecificParams; |
| }; |
| |
| // Cast transport capabilities |
| dictionary RtpCaps { |
| // RTP payload params. |
| RtpPayloadParams[] payloads; |
| |
| DOMString[] rtcpFeatures; |
| }; |
| |
| // Cast transport params. |
| dictionary RtpParams { |
| // RTP payload params. |
| RtpPayloadParams[] payloads; |
| |
| DOMString[] rtcpFeatures; |
| }; |
| |
| // Callback from the <code>create</code> method. |
| // |id| : The transport id. |
| callback CreateCallback = void (long transportId); |
| |
| interface Functions { |
| // Creates a cast send transport. |
| // |innerTransportId| : the ID of the inner transport. The transport to be |
| // created will send data on the inner transport. |
| // |track| : the media track encoded by this transport. |
| // |callback| : Called when the transport has been created. |
| [nocompile] static void create( |
| long innerTransportId, |
| [instanceOf=MediaStreamTrack] object track, |
| CreateCallback callback); |
| |
| // Destroys a cast send transport. |
| // |transportId| : The transport ID. |
| [nocompile] static void destroy(long transportId); |
| |
| // Returns capabilities of the transport. |
| // |transportId| : The transport ID. |
| [nocompile] static RtpCaps getCaps(long transportId); |
| |
| // Starts to use the transport by providing remote params info. |
| // |transportId| : The transport ID. |
| // |params| : Parameters set for this transport. |
| [nocompile] static void start(long transportId, RtpParams params); |
| |
| // Stops using the transport. |
| // |transportId| : The transport ID. |
| [nocompile] static void stop(long transportId); |
| }; |
| |
| interface Events { |
| // Event fired when a cast send transport has started. |
| // |transportId| : The ID of the transport. |
| static void onStarted(long transportId); |
| |
| // Event fired when a cast send transport has connected. |
| // After this event, the transport is ready to send the track. |
| // |transportId| : The ID of the transport. |
| static void onConnected(long transportId); |
| |
| // Event fired when a cast send transport has stopped. |
| // |transportId| : The ID of the transport. |
| static void onStopped(long transportId); |
| |
| // Event fired when a cast send transport has timeout. |
| // This happens when network has been congested for a while, or one side |
| // left. |
| // |transportId| : The ID of the transport. |
| static void onTimeout(long transportId); |
| |
| // Event fired when a cast send transport has error. |
| // |transportId| : The ID of the transport. |
| // |errorString| : The error info. |
| static void onError(long transportId, DOMString errorString); |
| }; |
| }; |