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.webrtc.castSendTransport</code> API takes a track as | 5 // The <code>chrome.webrtc.castSendTransport</code> API takes a track as |
6 // a source of media, and sends that media on the inner transport according to | 6 // a source of media, and sends that media on the inner transport according to |
7 // the given RtpParams. | 7 // the given RtpParams. |
8 namespace webrtc.castSendTransport { | 8 namespace webrtc.castSendTransport { |
9 // Params for audio and video codec. | 9 // Params for audio and video codec. |
10 dictionary CodecSpecificParam { | 10 dictionary CodecSpecificParams { |
11 DOMString key; | 11 DOMString key; |
12 DOMString value; | 12 DOMString value; |
13 }; | 13 }; |
14 | 14 |
15 // RTP payload param. | 15 // RTP payload param. |
16 dictionary RtpPayloadParam { | 16 dictionary RtpPayloadParams { |
17 long payloadType; | 17 long payloadType; |
18 | 18 |
19 DOMString codecName; | 19 DOMString codecName; |
20 | 20 |
21 // Synchronization source identifier. | 21 // Synchronization source identifier. |
22 long? ssrc; | 22 long? ssrc; |
23 | 23 |
24 long? clockRate; | 24 long? clockRate; |
25 | 25 |
26 long? minBitrate; | 26 long? minBitrate; |
27 | 27 |
28 long? maxBitrate; | 28 long? maxBitrate; |
29 | 29 |
30 // The number of channels. | 30 // The number of channels. |
31 long? channels; | 31 long? channels; |
32 | 32 |
33 // Video width in pixels. | 33 // Video width in pixels. |
34 long? width; | 34 long? width; |
35 | 35 |
36 // Video height in pixels. | 36 // Video height in pixels. |
37 long? height; | 37 long? height; |
38 | 38 |
39 // A list of codec specific params. | 39 // A list of codec specific params. |
40 CodecSpecificParam[] codecSpecficParams; | 40 CodecSpecificParams[] codecSpecficParams; |
41 }; | 41 }; |
42 | 42 |
43 // Cast transport capabilities | 43 // Cast transport capabilities |
44 dictionary CastTransportCaps { | 44 dictionary RtpCaps { |
45 // RTP payload params. | 45 // RTP payload params. |
46 RtpPayloadParam[] payloads; | 46 RtpPayloadParams[] payloads; |
47 | 47 |
48 DOMString[] rtcpFeatures; | 48 DOMString[] rtcpFeatures; |
49 | 49 |
50 DOMString[] fecMechanisms; | 50 DOMString[] fecMechanisms; |
51 }; | 51 }; |
52 | 52 |
53 // Cast transport params. | 53 // Cast transport params. |
54 dictionary CastTransportParams { | 54 dictionary RtpParams { |
55 // RTP payload params. | 55 // RTP payload params. |
56 RtpPayloadParam[] payloads; | 56 RtpPayloadParams[] payloads; |
57 | 57 |
58 DOMString[] rtcpFeatures; | 58 DOMString[] rtcpFeatures; |
59 | 59 |
60 DOMString[] fecMechanisms; | 60 DOMString[] fecMechanisms; |
61 }; | 61 }; |
62 | 62 |
63 // Result of <code>create</code> call. | |
64 dictionary CreateInfo { | |
65 // The ID of the newly created transport. | |
66 long transportId; | |
67 }; | |
68 | |
69 // Callback from the <code>create</code> method. | 63 // Callback from the <code>create</code> method. |
70 // |id| : The transport id. | 64 // |id| : The transport id. |
71 callback CreateCallback = void (CreateInfo info); | 65 callback CreateCallback = void (long transportId); |
72 | 66 |
73 // Callback from the <code>createParams</code> method. | 67 // Callback from the <code>createParams</code> method. |
74 // |params| : The cast transport params. | 68 // |params| : The cast transport params. |
75 callback CreateParamsCallback = void (CastTransportParams params); | 69 callback CreateParamsCallback = void (RtpParams params); |
76 | 70 |
77 // Callback from the <code>getCaps</code> method. | 71 // Callback from the <code>getCaps</code> method. |
78 // |caps| : Capabilities of the cast transport. | 72 // |caps| : Capabilities of the cast transport. |
79 callback GetCapsCallback = void (CastTransportCaps caps); | 73 callback GetCapsCallback = void (RtpCaps caps); |
80 | 74 |
81 interface Functions { | 75 interface Functions { |
82 // Creates a cast send transport. | 76 // Creates a cast send transport. |
83 // |track| : the media track encoded by this transport. | |
84 // |innerTransportId| : the ID of the inner transport. The transport to be | 77 // |innerTransportId| : the ID of the inner transport. The transport to be |
85 // created will send data on the inner transport. | 78 // created will send data on the inner transport. |
| 79 // |track| : the media track encoded by this transport. |
86 // |callback| : Called when the transport has been created. | 80 // |callback| : Called when the transport has been created. |
87 [nocompile] static void create( | 81 [nocompile] static void create( |
| 82 long innerTransportId, |
88 [instanceOf=MediaStreamTrack] object track, | 83 [instanceOf=MediaStreamTrack] object track, |
89 long innerTransportId, | |
90 CreateCallback callback); | 84 CreateCallback callback); |
91 | 85 |
92 // Destroys a cast send transport. | 86 // Destroys a cast send transport. |
93 // |transportId| : The transport ID. | 87 // |transportId| : The transport ID. |
94 [nocompile] static void destroy(long transportId); | 88 [nocompile] static void destroy(long transportId); |
95 | 89 |
96 // Creates suitable params given the capabilities. | 90 // Creates suitable params given the capabilities. |
97 // |caps| : the capabilities. | 91 // |caps| : the capabilities. |
98 // |callback| : Called when the params have been created. | 92 // |callback| : Called when the params have been created. |
99 [nocompile] static void getCaps(long transportId, | 93 [nocompile] static void getCaps( |
| 94 long transportId, |
100 GetCapsCallback callback); | 95 GetCapsCallback callback); |
101 | 96 |
102 // Creates suitable params given the capabilities. | 97 // Creates suitable params given the capabilities. |
103 // |transportId| : The transport ID. | 98 // |transportId| : The transport ID. |
104 // |remoteCaps| : Capabilities of remote peer. | 99 // |remoteCaps| : Capabilities of remote peer. |
105 // |callback| : Called when the params has been created. | 100 // |callback| : Called when the params has been created. |
106 [nocompile] static void createParams( | 101 [nocompile] static void createParams( |
107 long transportId, | 102 long transportId, |
108 CastTransportCaps remoteCaps, | 103 RtpCaps remoteCaps, |
109 CreateParamsCallback callback); | 104 CreateParamsCallback callback); |
110 | 105 |
111 // Starts to use the transport by providing remote params info. | 106 // Starts to use the transport by providing remote params info. |
112 // |transportId| : The transport ID. | 107 // |transportId| : The transport ID. |
113 // |params| : Parameters set for this transport. | 108 // |params| : Parameters set for this transport. |
114 [nocompile] static void start(long transportId, | 109 [nocompile] static void start(long transportId, RtpParams params); |
115 CastTransportParams params); | |
116 | 110 |
117 // Stops using the transport. | 111 // Stops using the transport. |
118 // |transportId| : The transport ID. | 112 // |transportId| : The transport ID. |
119 [nocompile] static void stop(long transportId); | 113 [nocompile] static void stop(long transportId); |
120 }; | 114 }; |
121 | 115 |
122 interface Events { | 116 interface Events { |
123 // Event fired when a cast send transport has started. | 117 // Event fired when a cast send transport has started. |
124 // |transportId| : The ID of the transport. | 118 // |transportId| : The ID of the transport. |
125 static void onStarted(long transportId); | 119 static void onStarted(long transportId); |
(...skipping 12 matching lines...) Expand all Loading... |
138 // left. | 132 // left. |
139 // |transportId| : The ID of the transport. | 133 // |transportId| : The ID of the transport. |
140 static void onTimeout(long transportId); | 134 static void onTimeout(long transportId); |
141 | 135 |
142 // Event fired when a cast send transport has error. | 136 // Event fired when a cast send transport has error. |
143 // |transportId| : The ID of the transport. | 137 // |transportId| : The ID of the transport. |
144 // |errorString| : The error info. | 138 // |errorString| : The error info. |
145 static void onError(long transportId, DOMString errorString); | 139 static void onError(long transportId, DOMString errorString); |
146 }; | 140 }; |
147 }; | 141 }; |
148 | |
OLD | NEW |