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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // RTP payload params. | 53 // RTP payload params. |
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. |
| 64 // |rawEvents|: serialized raw bytes containing raw events recorded for |
| 65 // a stream. |
| 66 // The serialization format can be found at |
| 67 // media/cast/logging/log_serializer.cc. |
| 68 callback GetRawEventsCallback = void (DOMString rawEvents); |
| 69 |
| 70 // Callback from the <code>getStats</code> method. |
| 71 // |rawEvents|: serialized raw bytes containing stats recorded for a stream. |
| 72 // The serialization format can be found at |
| 73 // media/cast/logging/log_serializer.cc. |
| 74 callback GetStatsCallback = void (DOMString stats); |
| 75 |
63 interface Functions { | 76 interface Functions { |
64 // Destroys a Cast RTP stream. | 77 // Destroys a Cast RTP stream. |
65 // |streamId| : The RTP stream ID. | 78 // |streamId| : The RTP stream ID. |
66 [nocompile] static void destroy(long streamId); | 79 [nocompile] static void destroy(long streamId); |
67 | 80 |
68 // Returns an array of supported parameters with default values. | 81 // Returns an array of supported parameters with default values. |
69 // This includes a list of supported codecs on this platform and | 82 // This includes a list of supported codecs on this platform and |
70 // corresponding encoding and RTP parameters. | 83 // corresponding encoding and RTP parameters. |
71 // |streamId| : The RTP stream ID. | 84 // |streamId| : The RTP stream ID. |
72 [nocompile] static RtpParams[] getSupportedParams(long streamId); | 85 [nocompile] static RtpParams[] getSupportedParams(long streamId); |
73 | 86 |
74 // Activates the RTP stream by providing the parameters. | 87 // Activates the RTP stream by providing the parameters. |
75 // |streamId| : The RTP stream ID. | 88 // |streamId| : The RTP stream ID. |
76 // |params| : Parameters set for this stream. | 89 // |params| : Parameters set for this stream. |
77 [nocompile] static void start(long streamId, RtpParams params); | 90 [nocompile] static void start(long streamId, RtpParams params); |
78 | 91 |
79 // Stops activity on the specified stream. | 92 // Stops activity on the specified stream. |
80 // |streamId| : The RTP stream ID. | 93 // |streamId| : The RTP stream ID. |
81 [nocompile] static void stop(long streamId); | 94 [nocompile] static void stop(long streamId); |
| 95 |
| 96 // Enables / disables logging for a stream. |
| 97 // |enable|: If true, enables logging. Otherwise disables logging. |
| 98 [nocompile] static void toggleLogging(long streamId, boolean enable); |
| 99 |
| 100 // Get raw events for a stream in the current session. |
| 101 // |streamId|: Stream to get events for. |
| 102 // |callback|: Called with the raw events Blob. |
| 103 [nocompile] static void getRawEvents( |
| 104 long streamId, GetRawEventsCallback callback); |
| 105 |
| 106 // Get stats for a stream in the current session. |
| 107 // |streamId|: Stream to get stats for. |
| 108 // |callback|: Called with the stats Blob. |
| 109 [nocompile] static void getStats( |
| 110 long streamId, GetStatsCallback callback); |
82 }; | 111 }; |
83 | 112 |
84 interface Events { | 113 interface Events { |
85 // Event fired when a Cast RTP stream has started. | 114 // Event fired when a Cast RTP stream has started. |
86 // |streamId| : The ID of the RTP stream. | 115 // |streamId| : The ID of the RTP stream. |
87 static void onStarted(long streamId); | 116 static void onStarted(long streamId); |
88 | 117 |
89 // Event fired when a Cast RTP stream has stopped. | 118 // Event fired when a Cast RTP stream has stopped. |
90 // |streamId| : The ID of the RTP stream. | 119 // |streamId| : The ID of the RTP stream. |
91 static void onStopped(long streamId); | 120 static void onStopped(long streamId); |
92 | 121 |
93 // Event fired when a Cast RTP stream has error. | 122 // Event fired when a Cast RTP stream has error. |
94 // |streamId| : The ID of the RTP stream. | 123 // |streamId| : The ID of the RTP stream. |
95 // |errorString| : The error info. | 124 // |errorString| : The error info. |
96 static void onError(long streamId, DOMString errorString); | 125 static void onError(long streamId, DOMString errorString); |
97 }; | 126 }; |
98 }; | 127 }; |
OLD | NEW |