blob: da5d02f88ed3aa46701f82279dd9846305cda0d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
// 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.cast.streaming.rtpStream</code> API allows configuration
// of encoding parameters and RTP parameters used in a Cast streaming
// session.
//
// Valid stream IDs are positive and non-zero.
[use_movable_types=true]namespace cast.streaming.rtpStream {
// Params for audio and video codec.
dictionary CodecSpecificParams {
DOMString key;
DOMString value;
};
// RTP payload param.
dictionary RtpPayloadParams {
long payloadType;
// Maximum latency in milliseconds. This parameter controls the logic
// of flow control. Implementation can adjust latency adaptively and
// tries to keep it under this threshold. A larger value allows smoother
// playback at the cost of higher latency.
long maxLatency;
// Minimum latency in milliseconds. Defaults to |maxLatency|.
long? minLatency;
// Starting latency for animated content in milliseconds.
// Defaults to |maxLatency|.
long? animatedLatency;
DOMString codecName;
// Synchronization source identifier.
long ssrc;
long feedbackSsrc;
long? clockRate;
// Minimum bitrate in kilobits per second.
long? minBitrate;
// Maximum bitrate in kilobits per second.
long? maxBitrate;
// The number of channels.
long? channels;
// The maximum frame rate.
double? maxFrameRate;
// 32 bytes hex-encoded AES key.
DOMString? aesKey;
// 32 bytes hex-encoded AES IV (Initialization vector) mask.
DOMString? aesIvMask;
// A list of codec specific params.
CodecSpecificParams[] codecSpecificParams;
};
// Cast RTP parameters.
dictionary RtpParams {
// RTP payload params.
RtpPayloadParams payload;
DOMString[] rtcpFeatures;
};
// Callback from the <code>create</code> method.
// |id| : The ID for the RTP stream.
callback CreateCallback = void (long streamId);
// Callback from the <code>getRawEvents</code> method.
// |rawEvents|: compressed serialized raw bytes containing raw events
// recorded for a stream.
// The compression is in gzip format.
// The serialization format can be found at
// media/cast/logging/log_serializer.cc.
callback GetRawEventsCallback = void (ArrayBuffer rawEvents);
// Callback from the <code>getStats</code> method.
// |rawEvents|: dictionary object containing stats recorded for a stream.
// The format can be found at
// media/cast/logging/stats_event_subscriber.cc.
callback GetStatsCallback = void (object stats);
interface Functions {
// Destroys a Cast RTP stream.
// |streamId| : The RTP stream ID.
[nocompile] static void destroy(long streamId);
// Returns an array of supported parameters with default values.
// This includes a list of supported codecs on this platform and
// corresponding encoding and RTP parameters.
// |streamId| : The RTP stream ID.
[nocompile] static RtpParams[] getSupportedParams(long streamId);
// Activates the RTP stream by providing the parameters.
// |streamId| : The RTP stream ID.
// |params| : Parameters set for this stream.
[nocompile] static void start(long streamId, RtpParams params);
// Stops activity on the specified stream.
// |streamId| : The RTP stream ID.
[nocompile] static void stop(long streamId);
// Enables / disables logging for a stream.
// |enable|: If true, enables logging. Otherwise disables logging.
[nocompile] static void toggleLogging(long streamId, boolean enable);
// Get raw events for a stream in the current session.
// |streamId|: Stream to get events for.
// |extraData|: Extra data to attach to the log, e.g. system info or
// experiment tags, in key-value JSON string format.
// |callback|: Called with the raw events.
[nocompile] static void getRawEvents(
long streamId, optional DOMString extraData,
GetRawEventsCallback callback);
// Get stats for a stream in the current session.
// |streamId|: Stream to get stats for.
// |callback|: Called with the stats.
[nocompile] static void getStats(
long streamId, GetStatsCallback callback);
};
interface Events {
// Event fired when a Cast RTP stream has started.
// |streamId| : The ID of the RTP stream.
static void onStarted(long streamId);
// Event fired when a Cast RTP stream has stopped.
// |streamId| : The ID of the RTP stream.
static void onStopped(long streamId);
// Event fired when a Cast RTP stream has error.
// |streamId| : The ID of the RTP stream.
// |errorString| : The error info.
static void onError(long streamId, DOMString errorString);
};
};
|