Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: chrome/browser/media/router/mojo/media_router.mojom

Issue 2675033002: [Media Router] Add MediaSink subtypes (Closed)
Patch Set: resolve code review comments from dcheng Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
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;
31 // This is currently only set by MediaRouter in OnSinksDiscovered().
32 MediaSinkExtraData? extra_data;
33 };
34
35 union MediaSinkExtraData {
36 DialMediaSink dial_media_sink;
37 CastMediaSink cast_media_sink;
38 };
39
40 // Mirror of net::IPAddress.
dcheng 2017/03/07 19:54:32 Sorry, I clarify, I meant that this struct should
zhaobin 2017/03/10 01:42:27 Done.
41 struct IPAddress {
42 // IP address as a numeric value from most to least significant byte.
43 // Will be of length 4 for IPv4 addresses and 16 for IPv6.
44 array<uint8> address;
45 };
46
47 struct DialMediaSink {
48 IPAddress ip_address;
49
50 // Model name of the sink, if it represents a physical device.
51 string model_name;
52
53 // Used for DIAL launch
54 url.mojom.Url app_url;
55 };
56
57 struct CastMediaSink {
58 IPAddress ip_address;
59
60 // Model name of the sink, if it represents a physical device.
61 string model_name;
62
63 // A bit vector representing capabilities of the sink. Meaning of capacity
64 // value for each bit:
65 // NONE: 0,
66 // VIDEO_OUT: 1 << 0,
67 // VIDEO_IN: 1 << 1,
68 // AUDIO_OUT: 1 << 2,
69 // AUDIO_IN: 1 << 3,
70 // DEV_MODE: 1 << 4,
71 // MULTIZONE_GROUP: 1 << 5
72 uint8 capabilities;
73
74 // ID of Cast channel opened by Media Router. The ID is defined by the
75 // chrome.cast.channel API.
76 int32 cast_channel_id;
30 }; 77 };
31 78
32 // Should be kept in sync with media_route.h. 79 // Should be kept in sync with media_route.h.
33 struct MediaRoute { 80 struct MediaRoute {
34 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". 81 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo".
35 string media_route_id; 82 string media_route_id;
36 // The ID of the media source being sent through this media route. 83 // The ID of the media source being sent through this media route.
37 // May be missing if route is not local. 84 // May be missing if route is not local.
38 string? media_source; 85 string? media_source;
39 // The ID of sink that is rendering the media content. 86 // The ID of sink that is rendering the media content.
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 437
391 // Called when the a batch of messages arrives from the media sink for the 438 // Called when the a batch of messages arrives from the media sink for the
392 // route given by |route_id|. 439 // route given by |route_id|.
393 // |StartListeningForRouteMessages| must be called first in order to receive 440 // |StartListeningForRouteMessages| must be called first in order to receive
394 // messages. 441 // messages.
395 // |route_id|: ID of route of the messages. 442 // |route_id|: ID of route of the messages.
396 // |messages|: A non-empty list of messages received. 443 // |messages|: A non-empty list of messages received.
397 OnRouteMessagesReceived(string route_id, 444 OnRouteMessagesReceived(string route_id,
398 array<RouteMessage> messages); 445 array<RouteMessage> messages);
399 }; 446 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698