Chromium Code Reviews| 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/url.mojom"; | |
| 8 | 9 |
| 9 // Represents an output sink to which media can be routed. | 10 // Represents an output sink to which media can be routed. |
| 10 struct MediaSink { | 11 struct MediaSink { |
| 11 enum IconType { | 12 enum IconType { |
| 12 CAST, | 13 CAST, |
| 13 CAST_AUDIO, | 14 CAST_AUDIO, |
| 14 CAST_AUDIO_GROUP, | 15 CAST_AUDIO_GROUP, |
| 15 GENERIC, | 16 GENERIC, |
| 16 HANGOUT | 17 HANGOUT |
| 17 }; | 18 }; |
| 18 | 19 |
| 19 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." | 20 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." |
| 20 string sink_id; | 21 string sink_id; |
| 21 // The human-readable name, e.g. "Janet's Chromecast". | 22 // The human-readable name, e.g. "Janet's Chromecast". |
| 22 string name; | 23 string name; |
| 23 // Optional description of the sink. | 24 // Optional description of the sink. |
| 24 string? description; | 25 string? description; |
| 25 // Optional domain of the sink if this sink is associated with an identity. | 26 // Optional domain of the sink if this sink is associated with an identity. |
| 26 string? domain; | 27 string? domain; |
| 27 // The type of icon to show in the UI for this media sink. | 28 // The type of icon to show in the UI for this media sink. |
| 28 IconType icon_type; | 29 IconType icon_type; |
| 29 }; | 30 }; |
| 30 | 31 |
| 32 // Represents a sink discovered by MediaSinkService. | |
|
imcheng
2017/02/11 01:00:21
Represents a sink discovered by Media Router, whic
zhaobin
2017/02/14 02:08:49
Done.
| |
| 33 struct TypedMediaSink { | |
| 34 MediaSink sink; | |
| 35 | |
| 36 string ip_address; | |
| 37 | |
| 38 // Model name of the sink, if it represents a physical device. | |
| 39 string? model_name; | |
| 40 | |
| 41 MediaSinkExtraData extra_data; | |
| 42 }; | |
| 43 | |
| 44 union MediaSinkExtraData { | |
| 45 DialMediaSink dial_media_sink; | |
| 46 CastMediaSink cast_media_sink; | |
| 47 }; | |
| 48 | |
| 49 struct DialMediaSink { | |
| 50 // Used for DIAL launch | |
| 51 url.mojom.Url app_url; | |
| 52 }; | |
| 53 | |
| 54 struct CastMediaSink { | |
| 55 int32 capabilities; | |
| 56 | |
| 57 // ID of cast channel opened by Media Router. The ID can be | |
| 58 // used to send call chrome.cast.channel.send. | |
| 59 int32 cast_channel_id; | |
| 60 }; | |
| 61 | |
| 31 // Should be kept in sync with media_route.h. | 62 // Should be kept in sync with media_route.h. |
| 32 struct MediaRoute { | 63 struct MediaRoute { |
| 33 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". | 64 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". |
| 34 string media_route_id; | 65 string media_route_id; |
| 35 // The ID of the media source being sent through this media route. | 66 // The ID of the media source being sent through this media route. |
| 36 // May be missing if route is not local. | 67 // May be missing if route is not local. |
| 37 string? media_source; | 68 string? media_source; |
| 38 // The ID of sink that is rendering the media content. | 69 // The ID of sink that is rendering the media content. |
| 39 string media_sink_id; | 70 string media_sink_id; |
| 40 // Human readable description of this route, e.g. | 71 // Human readable description of this route, e.g. |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 | 420 |
| 390 // Called when the a batch of messages arrives from the media sink for the | 421 // Called when the a batch of messages arrives from the media sink for the |
| 391 // route given by |route_id|. | 422 // route given by |route_id|. |
| 392 // |StartListeningForRouteMessages| must be called first in order to receive | 423 // |StartListeningForRouteMessages| must be called first in order to receive |
| 393 // messages. | 424 // messages. |
| 394 // |route_id|: ID of route of the messages. | 425 // |route_id|: ID of route of the messages. |
| 395 // |messages|: A non-empty list of messages received. | 426 // |messages|: A non-empty list of messages received. |
| 396 OnRouteMessagesReceived(string route_id, | 427 OnRouteMessagesReceived(string route_id, |
| 397 array<RouteMessage> messages); | 428 array<RouteMessage> messages); |
| 398 }; | 429 }; |
| OLD | NEW |