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.mojom; | 5 module media_router.mojom; |
6 | 6 |
7 import "chrome/browser/media/router/mojo/media_controller.mojom"; | |
8 import "chrome/browser/media/router/mojo/media_status.mojom"; | |
7 import "mojo/common/time.mojom"; | 9 import "mojo/common/time.mojom"; |
8 import "url/mojo/origin.mojom"; | 10 import "url/mojo/origin.mojom"; |
9 | 11 |
10 // Represents an output sink to which media can be routed. | 12 // Represents an output sink to which media can be routed. |
11 struct MediaSink { | 13 struct MediaSink { |
12 enum IconType { | 14 enum IconType { |
13 CAST, | 15 CAST, |
14 CAST_AUDIO, | 16 CAST_AUDIO, |
15 CAST_AUDIO_GROUP, | 17 CAST_AUDIO_GROUP, |
16 GENERIC, | 18 GENERIC, |
(...skipping 14 matching lines...) Expand all Loading... | |
31 | 33 |
32 // Should be kept in sync with media_route.h. | 34 // Should be kept in sync with media_route.h. |
33 struct MediaRoute { | 35 struct MediaRoute { |
34 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". | 36 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". |
35 string media_route_id; | 37 string media_route_id; |
36 // The ID of the media source being sent through this media route. | 38 // The ID of the media source being sent through this media route. |
37 // May be missing if route is not local. | 39 // May be missing if route is not local. |
38 string? media_source; | 40 string? media_source; |
39 // The ID of sink that is rendering the media content. | 41 // The ID of sink that is rendering the media content. |
40 string media_sink_id; | 42 string media_sink_id; |
41 // Human readable description of this route, e.g. | 43 // Human readable description of this route, e.g. "Tab casting". |
42 // "Tab casting". | |
43 string description; | 44 string description; |
44 // Specifies that the route is requested locally. | 45 // Specifies that the route is requested locally. |
45 bool is_local; | 46 bool is_local; |
46 // An optional path to an HTML page bundled bundled with the media router | 47 // An optional path to an HTML page bundled bundled with the media router |
47 // component extension. When set, the route can have custom route detail as | 48 // component extension. When set, the route can have custom route detail as |
48 // well as its own route controls in the media router dialog. | 49 // well as its own route controls in the media router dialog. |
49 string? custom_controller_path; | 50 string? custom_controller_path; |
50 // Set to true if this route should be displayed for |media_sink_id| in UI. | 51 // Set to true if this route should be displayed for |media_sink_id| in UI. |
51 bool for_display; | 52 bool for_display; |
52 // Set to true if this route was created by an incognito profile. | 53 // Set to true if this route was created by an incognito profile. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 // Indicates that the Media Router is interested in finding a sink that | 316 // Indicates that the Media Router is interested in finding a sink that |
316 // matches |search_criteria| and is compatible with the source urn | 317 // matches |search_criteria| and is compatible with the source urn |
317 // |media_source|. |search_criteria| should contain an exact copy of the user | 318 // |media_source|. |search_criteria| should contain an exact copy of the user |
318 // input. The user's current domain is also used to search. The domain is the | 319 // input. The user's current domain is also used to search. The domain is the |
319 // hosted domain of the user's signed-in identity, or empty if the user has no | 320 // hosted domain of the user's signed-in identity, or empty if the user has no |
320 // domain or is not signed in. | 321 // domain or is not signed in. |
321 SearchSinks(string sink_id, | 322 SearchSinks(string sink_id, |
322 string media_source, | 323 string media_source, |
323 SinkSearchCriteria search_criteria) => | 324 SinkSearchCriteria search_criteria) => |
324 (string sink_id); | 325 (string sink_id); |
326 | |
327 // Creates a controller for the media route with given |route_id| and binds it | |
328 // to |media_controller| for receiving media commands. This method returns | |
329 // false if such a media route doesn't exist, a controller already exists | |
330 // for it, or there was an error while creating a controller. | |
331 // |media_controller| becomes invalid when the media route is terminated. The | |
332 // created controller is destroyed when |media_controller| becomes invalid. | |
333 // TODO(takumif): Consider returning an enum instead of a bool to distinguish | |
334 // between error conditions for metrics/debugging. | |
335 CreateMediaRouteController(string route_id, | |
336 MediaController& media_controller) => | |
337 (bool success); | |
338 | |
339 // Sets the observer to be notified whenever there is a change in the status | |
340 // of a media route. A media route can have at most one observer at a time, | |
341 // and it will be overwritten each time this method is called with the same | |
342 // |route_id|. | |
343 // TODO(takumif): Consider allowing multiple observers per media route. | |
344 SetMediaRouteStatusObserver(string route_id, MediaStatusObserver observer); | |
dcheng
2017/03/17 06:15:14
I suggest moving these to the followup where they'
takumif
2017/03/17 21:48:02
They are implemented in the Media Router component
| |
325 }; | 345 }; |
326 | 346 |
327 // Interface for a service which observes state changes across media | 347 // Interface for a service which observes state changes across media |
328 // sources, sinks, and issues. | 348 // sources, sinks, and issues. |
329 interface MediaRouter { | 349 interface MediaRouter { |
330 | 350 |
331 // Represents overall media sink availability states. | 351 // Represents overall media sink availability states. |
332 // UNAVAILABLE - No sinks are available. | 352 // UNAVAILABLE - No sinks are available. |
333 // PER_SOURCE - Sinks are available, but are only compatible with specific | 353 // PER_SOURCE - Sinks are available, but are only compatible with specific |
334 // media sources. | 354 // media sources. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 | 410 |
391 // Called when the a batch of messages arrives from the media sink for the | 411 // Called when the a batch of messages arrives from the media sink for the |
392 // route given by |route_id|. | 412 // route given by |route_id|. |
393 // |StartListeningForRouteMessages| must be called first in order to receive | 413 // |StartListeningForRouteMessages| must be called first in order to receive |
394 // messages. | 414 // messages. |
395 // |route_id|: ID of route of the messages. | 415 // |route_id|: ID of route of the messages. |
396 // |messages|: A non-empty list of messages received. | 416 // |messages|: A non-empty list of messages received. |
397 OnRouteMessagesReceived(string route_id, | 417 OnRouteMessagesReceived(string route_id, |
398 array<RouteMessage> messages); | 418 array<RouteMessage> messages); |
399 }; | 419 }; |
OLD | NEW |