OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module media_router.interfaces; | 5 module media_router.interfaces; |
6 | 6 |
7 // Represents an output sink to which media can be routed. | 7 // Represents an output sink to which media can be routed. |
8 struct MediaSink { | 8 struct MediaSink { |
9 enum IconType { | 9 enum IconType { |
10 CAST, | 10 CAST, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 // (See CreateRoute for additional documentation) | 136 // (See CreateRoute for additional documentation) |
137 // If the operation was successful, |route| will be defined and | 137 // If the operation was successful, |route| will be defined and |
138 // |error_text| will be null. | 138 // |error_text| will be null. |
139 // If the operation failed, |route| will be null and |error_text| | 139 // If the operation failed, |route| will be null and |error_text| |
140 // will be set. | 140 // will be set. |
141 JoinRoute(string media_source, | 141 JoinRoute(string media_source, |
142 string presentation_id, | 142 string presentation_id, |
143 string origin, | 143 string origin, |
144 int32 tab_id) => (MediaRoute? route, string? error_text); | 144 int32 tab_id) => (MediaRoute? route, string? error_text); |
145 | 145 |
146 // Closes the route specified by |route_id|. | 146 // Termintes the route specified by |route_id|. |
mlamouri (slow - plz ping)
2015/12/10 15:39:51
nit: "Terminates"
mark a. foltz
2015/12/10 23:46:48
Done
| |
147 CloseRoute(string route_id); | 147 TerminateRoute(string route_id); |
148 | 148 |
149 // Sends |message| via the media route |media_route_id|. | 149 // Sends |message| via the media route |media_route_id|. |
150 // If the operation was successful, |sent| is true; otherwise it is false. | 150 // If the operation was successful, |sent| is true; otherwise it is false. |
151 SendRouteMessage(string media_route_id, string message) => (bool sent); | 151 SendRouteMessage(string media_route_id, string message) => (bool sent); |
152 | 152 |
153 // Sends |data| via the media route |media_route_id|. | 153 // Sends |data| via the media route |media_route_id|. |
154 // If the operation was successful, |sent| is true; otherwise it is false. | 154 // If the operation was successful, |sent| is true; otherwise it is false. |
155 SendRouteBinaryMessage(string media_route_id, array<uint8> data) | 155 SendRouteBinaryMessage(string media_route_id, array<uint8> data) |
156 => (bool sent); | 156 => (bool sent); |
157 | 157 |
(...skipping 18 matching lines...) Expand all Loading... | |
176 // |error| indicates if a permanent error occurred. If true, then subsequent | 176 // |error| indicates if a permanent error occurred. If true, then subsequent |
177 // calls will also return with |error| being true. | 177 // calls will also return with |error| being true. |
178 ListenForRouteMessages(string route_id) => | 178 ListenForRouteMessages(string route_id) => |
179 (array<RouteMessage> messages, bool error); | 179 (array<RouteMessage> messages, bool error); |
180 | 180 |
181 // Called when there are no more listeners for messages for |route_id|. | 181 // Called when there are no more listeners for messages for |route_id|. |
182 // Calling this will resolve the pending |ListenForRouteMessages| callback | 182 // Calling this will resolve the pending |ListenForRouteMessages| callback |
183 // with an empty list. | 183 // with an empty list. |
184 StopListeningForRouteMessages(string route_id); | 184 StopListeningForRouteMessages(string route_id); |
185 | 185 |
186 // Indicates that the presentation session that was connected to route | 186 // Indicates that a PresentationConnection that was connected to route |
187 // |route_id| is no longer connected to it. | 187 // |route_id| has been closed (via .close(), garbage collection or |
188 OnPresentationSessionDetached(string route_id); | 188 // navigation). |
189 DetachRoute(string route_id); | |
189 }; | 190 }; |
190 | 191 |
191 // Interface for a service which observes state changes across media | 192 // Interface for a service which observes state changes across media |
192 // sources, sinks, and issues. | 193 // sources, sinks, and issues. |
193 interface MediaRouter { | 194 interface MediaRouter { |
194 | 195 |
195 // Represents overall media sink availability states. | 196 // Represents overall media sink availability states. |
196 // UNAVAILABLE - No sinks are available. | 197 // UNAVAILABLE - No sinks are available. |
197 // PER_SOURCE - Sinks are available, but are only compatible with specific | 198 // PER_SOURCE - Sinks are available, but are only compatible with specific |
198 // media sources. | 199 // media sources. |
(...skipping 28 matching lines...) Expand all Loading... | |
227 | 228 |
228 // Called when the overall availability of media sinks has been updated. | 229 // Called when the overall availability of media sinks has been updated. |
229 OnSinkAvailabilityUpdated(SinkAvailability availability); | 230 OnSinkAvailabilityUpdated(SinkAvailability availability); |
230 | 231 |
231 // Called when the state of presentation connected to route |route_id| has | 232 // Called when the state of presentation connected to route |route_id| has |
232 // changed to |state|. | 233 // changed to |state|. |
233 OnPresentationConnectionStateChanged( | 234 OnPresentationConnectionStateChanged( |
234 string route_id, PresentationConnectionState state); | 235 string route_id, PresentationConnectionState state); |
235 }; | 236 }; |
236 | 237 |
OLD | NEW |