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 "mojo/common/time.mojom"; | 7 import "mojo/common/time.mojom"; |
8 import "url/mojo/origin.mojom"; | 8 import "url/mojo/origin.mojom"; |
9 import "url/mojo/url.mojom"; | |
9 | 10 |
10 // Represents an output sink to which media can be routed. | 11 // Represents an output sink to which media can be routed. |
11 struct MediaSink { | 12 struct MediaSink { |
12 enum IconType { | 13 enum IconType { |
mark a. foltz
2017/02/21 17:32:37
Does this generated a nested class enum in the moj
zhaobin
2017/02/22 00:42:08
Created crbug.com/694841.
| |
13 CAST, | 14 CAST, |
14 CAST_AUDIO, | 15 CAST_AUDIO, |
15 CAST_AUDIO_GROUP, | 16 CAST_AUDIO_GROUP, |
16 GENERIC, | 17 GENERIC, |
17 HANGOUT | 18 HANGOUT |
18 }; | 19 }; |
19 | 20 |
20 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." | 21 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." |
21 string sink_id; | 22 string sink_id; |
22 // The human-readable name, e.g. "Janet's Chromecast". | 23 // The human-readable name, e.g. "Janet's Chromecast". |
23 string name; | 24 string name; |
24 // Optional description of the sink. | 25 // Optional description of the sink. |
25 string? description; | 26 string? description; |
26 // Optional domain of the sink if this sink is associated with an identity. | 27 // Optional domain of the sink if this sink is associated with an identity. |
27 string? domain; | 28 string? domain; |
28 // The type of icon to show in the UI for this media sink. | 29 // The type of icon to show in the UI for this media sink. |
29 IconType icon_type; | 30 IconType icon_type; |
30 }; | 31 }; |
31 | 32 |
33 // Represents a sink discovered by Media Router, which is pushed to the | |
34 // MediaRouteProvider. It wraps a MediaSink with additional data required by the | |
35 // MediaRouteProvider to perform additional operations, such as route creation. | |
36 struct TypedMediaSink { | |
mark a. foltz
2017/02/17 02:22:31
Does this need to be distinct from MediaSink?
If
imcheng
2017/02/17 19:56:16
It seems doing this will weaken the validation pro
mark a. foltz
2017/02/21 17:32:37
I see. However we could move all the additional f
zhaobin
2017/02/22 00:42:08
Done.
| |
37 MediaSink sink; | |
38 | |
39 string ip_address; | |
40 | |
41 // Model name of the sink, if it represents a physical device. | |
42 string? model_name; | |
43 | |
44 MediaSinkExtraData extra_data; | |
45 }; | |
46 | |
47 union MediaSinkExtraData { | |
48 DialMediaSink dial_media_sink; | |
49 CastMediaSink cast_media_sink; | |
50 }; | |
51 | |
52 struct DialMediaSink { | |
53 // Used for DIAL launch | |
54 url.mojom.Url app_url; | |
55 }; | |
56 | |
57 struct CastMediaSink { | |
58 int32 capabilities; | |
mark a. foltz
2017/02/17 02:22:31
Can this be defined further? What do the bit posi
zhaobin
2017/02/22 00:42:08
Done.
| |
59 | |
60 // ID of cast channel opened by Media Router. The ID can be | |
61 // used to send call chrome.cast.channel.send. | |
62 int32 cast_channel_id; | |
63 }; | |
64 | |
32 // Should be kept in sync with media_route.h. | 65 // Should be kept in sync with media_route.h. |
33 struct MediaRoute { | 66 struct MediaRoute { |
34 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". | 67 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". |
35 string media_route_id; | 68 string media_route_id; |
36 // The ID of the media source being sent through this media route. | 69 // The ID of the media source being sent through this media route. |
37 // May be missing if route is not local. | 70 // May be missing if route is not local. |
38 string? media_source; | 71 string? media_source; |
39 // The ID of sink that is rendering the media content. | 72 // The ID of sink that is rendering the media content. |
40 string media_sink_id; | 73 string media_sink_id; |
41 // Human readable description of this route, e.g. | 74 // Human readable description of this route, e.g. |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 | 423 |
391 // Called when the a batch of messages arrives from the media sink for the | 424 // Called when the a batch of messages arrives from the media sink for the |
392 // route given by |route_id|. | 425 // route given by |route_id|. |
393 // |StartListeningForRouteMessages| must be called first in order to receive | 426 // |StartListeningForRouteMessages| must be called first in order to receive |
394 // messages. | 427 // messages. |
395 // |route_id|: ID of route of the messages. | 428 // |route_id|: ID of route of the messages. |
396 // |messages|: A non-empty list of messages received. | 429 // |messages|: A non-empty list of messages received. |
397 OnRouteMessagesReceived(string route_id, | 430 OnRouteMessagesReceived(string route_id, |
398 array<RouteMessage> messages); | 431 array<RouteMessage> messages); |
399 }; | 432 }; |
OLD | NEW |