OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The <code>chrome.cast.streaming.rtpStream</code> API allows configuration | 5 // The <code>chrome.cast.streaming.rtpStream</code> API allows configuration |
6 // of encoding parameters and RTP parameters used in a Cast streaming | 6 // of encoding parameters and RTP parameters used in a Cast streaming |
7 // session. | 7 // session. |
8 namespace cast.streaming.rtpStream { | 8 namespace cast.streaming.rtpStream { |
9 // Params for audio and video codec. | 9 // Params for audio and video codec. |
10 dictionary CodecSpecificParams { | 10 dictionary CodecSpecificParams { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 RtpPayloadParams payload; | 54 RtpPayloadParams payload; |
55 | 55 |
56 DOMString[] rtcpFeatures; | 56 DOMString[] rtcpFeatures; |
57 }; | 57 }; |
58 | 58 |
59 // Callback from the <code>create</code> method. | 59 // Callback from the <code>create</code> method. |
60 // |id| : The ID for the RTP stream. | 60 // |id| : The ID for the RTP stream. |
61 callback CreateCallback = void (long streamId); | 61 callback CreateCallback = void (long streamId); |
62 | 62 |
63 // Callback from the <code>getRawEvents</code> method. | 63 // Callback from the <code>getRawEvents</code> method. |
64 // |rawEvents|: serialized raw bytes containing raw events recorded for | 64 // |rawEvents|: compressed serialized raw bytes containing raw events |
65 // a stream. | 65 // recorded for a stream. |
| 66 // The compression is in gzip format. |
66 // The serialization format can be found at | 67 // The serialization format can be found at |
67 // media/cast/logging/log_serializer.cc. | 68 // media/cast/logging/log_serializer.cc. |
68 callback GetRawEventsCallback = void (DOMString rawEvents); | 69 callback GetRawEventsCallback = void (DOMString rawEvents); |
69 | 70 |
70 // Callback from the <code>getStats</code> method. | 71 // Callback from the <code>getStats</code> method. |
71 // |rawEvents|: serialized raw bytes containing stats recorded for a stream. | 72 // |rawEvents|: dictionary object containing stats recorded for a stream. |
72 // The serialization format can be found at | 73 // The format can be found at |
73 // media/cast/logging/log_serializer.cc. | 74 // media/cast/logging/stats_converter.cc. |
74 callback GetStatsCallback = void (DOMString stats); | 75 callback GetStatsCallback = void (object stats); |
75 | 76 |
76 interface Functions { | 77 interface Functions { |
77 // Destroys a Cast RTP stream. | 78 // Destroys a Cast RTP stream. |
78 // |streamId| : The RTP stream ID. | 79 // |streamId| : The RTP stream ID. |
79 [nocompile] static void destroy(long streamId); | 80 [nocompile] static void destroy(long streamId); |
80 | 81 |
81 // Returns an array of supported parameters with default values. | 82 // Returns an array of supported parameters with default values. |
82 // This includes a list of supported codecs on this platform and | 83 // This includes a list of supported codecs on this platform and |
83 // corresponding encoding and RTP parameters. | 84 // corresponding encoding and RTP parameters. |
84 // |streamId| : The RTP stream ID. | 85 // |streamId| : The RTP stream ID. |
85 [nocompile] static RtpParams[] getSupportedParams(long streamId); | 86 [nocompile] static RtpParams[] getSupportedParams(long streamId); |
86 | 87 |
87 // Activates the RTP stream by providing the parameters. | 88 // Activates the RTP stream by providing the parameters. |
88 // |streamId| : The RTP stream ID. | 89 // |streamId| : The RTP stream ID. |
89 // |params| : Parameters set for this stream. | 90 // |params| : Parameters set for this stream. |
90 [nocompile] static void start(long streamId, RtpParams params); | 91 [nocompile] static void start(long streamId, RtpParams params); |
91 | 92 |
92 // Stops activity on the specified stream. | 93 // Stops activity on the specified stream. |
93 // |streamId| : The RTP stream ID. | 94 // |streamId| : The RTP stream ID. |
94 [nocompile] static void stop(long streamId); | 95 [nocompile] static void stop(long streamId); |
95 | 96 |
96 // Enables / disables logging for a stream. | 97 // Enables / disables logging for a stream. |
97 // |enable|: If true, enables logging. Otherwise disables logging. | 98 // |enable|: If true, enables logging. Otherwise disables logging. |
98 [nocompile] static void toggleLogging(long streamId, boolean enable); | 99 [nocompile] static void toggleLogging(long streamId, boolean enable); |
99 | 100 |
100 // Get raw events for a stream in the current session. | 101 // Get raw events for a stream in the current session. |
101 // |streamId|: Stream to get events for. | 102 // |streamId|: Stream to get events for. |
102 // |callback|: Called with the raw events Blob. | 103 // |callback|: Called with the raw events. |
103 [nocompile] static void getRawEvents( | 104 [nocompile] static void getRawEvents( |
104 long streamId, GetRawEventsCallback callback); | 105 long streamId, GetRawEventsCallback callback); |
105 | 106 |
106 // Get stats for a stream in the current session. | 107 // Get stats for a stream in the current session. |
107 // |streamId|: Stream to get stats for. | 108 // |streamId|: Stream to get stats for. |
108 // |callback|: Called with the stats Blob. | 109 // |callback|: Called with the stats. |
109 [nocompile] static void getStats( | 110 [nocompile] static void getStats( |
110 long streamId, GetStatsCallback callback); | 111 long streamId, GetStatsCallback callback); |
111 }; | 112 }; |
112 | 113 |
113 interface Events { | 114 interface Events { |
114 // Event fired when a Cast RTP stream has started. | 115 // Event fired when a Cast RTP stream has started. |
115 // |streamId| : The ID of the RTP stream. | 116 // |streamId| : The ID of the RTP stream. |
116 static void onStarted(long streamId); | 117 static void onStarted(long streamId); |
117 | 118 |
118 // Event fired when a Cast RTP stream has stopped. | 119 // Event fired when a Cast RTP stream has stopped. |
119 // |streamId| : The ID of the RTP stream. | 120 // |streamId| : The ID of the RTP stream. |
120 static void onStopped(long streamId); | 121 static void onStopped(long streamId); |
121 | 122 |
122 // Event fired when a Cast RTP stream has error. | 123 // Event fired when a Cast RTP stream has error. |
123 // |streamId| : The ID of the RTP stream. | 124 // |streamId| : The ID of the RTP stream. |
124 // |errorString| : The error info. | 125 // |errorString| : The error info. |
125 static void onError(long streamId, DOMString errorString); | 126 static void onError(long streamId, DOMString errorString); |
126 }; | 127 }; |
127 }; | 128 }; |
OLD | NEW |