1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // The <code>chrome.cast.streaming.rtpStream</code> API allows configuration
6 // of encoding parameters and RTP parameters used in a Cast streaming
8 namespace cast.streaming.rtpStream
{
9 // Params for audio and video codec.
10 dictionary CodecSpecificParams
{
16 dictionary RtpPayloadParams
{
21 // Synchronization source identifier.
32 // The number of channels.
35 // Video width in pixels.
38 // Video height in pixels.
41 // 16 bytes AES key encoded in Base64.
44 // 16 bytes AES IV (Initialization vector) mask encoded in Base64.
47 // A list of codec specific params.
48 CodecSpecificParams
[] codecSpecificParams
;
51 // Cast RTP parameters.
52 dictionary RtpParams
{
53 // RTP payload params.
54 RtpPayloadParams payload
;
56 DOMString
[] rtcpFeatures
;
59 // Callback from the <code>create</code> method.
60 // |id| : The ID for the RTP stream.
61 callback CreateCallback
= void (long streamId
);
64 // Destroys a Cast RTP stream.
65 // |streamId| : The RTP stream ID.
66 [nocompile
] static
void destroy
(long streamId
);
68 // Returns an array of supported parameters with default values.
69 // This includes a list of supported codecs on this platform and
70 // corresponding encoding and RTP parameters.
71 // |streamId| : The RTP stream ID.
72 [nocompile
] static RtpParams
[] getSupportedParams
(long streamId
);
74 // Activates the RTP stream by providing the parameters.
75 // |streamId| : The RTP stream ID.
76 // |params| : Parameters set for this stream.
77 [nocompile
] static
void start
(long streamId
, RtpParams params
);
79 // Stops activity on the specified stream.
80 // |streamId| : The RTP stream ID.
81 [nocompile
] static
void stop
(long streamId
);
85 // Event fired when a Cast RTP stream has started.
86 // |streamId| : The ID of the RTP stream.
87 static
void onStarted
(long streamId
);
89 // Event fired when a Cast RTP stream has stopped.
90 // |streamId| : The ID of the RTP stream.
91 static
void onStopped
(long streamId
);
93 // Event fired when a Cast RTP stream has error.
94 // |streamId| : The ID of the RTP stream.
95 // |errorString| : The error info.
96 static
void onError
(long streamId
, DOMString errorString
);