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

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 Derek 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 struct DialMediaSink {
41 string ip_address;
dcheng 2017/03/03 10:37:10 Can we add a typemap for net::IPAddress? We alread
zhaobin 2017/03/03 23:56:42 Do it in a seperate patch? Created crbug.com/69842
dcheng 2017/03/04 01:49:16 The reason I mention is because mojo struct trait
zhaobin 2017/03/06 18:31:26 Added IPAddress here. host_resolver_service.mojom
dcheng 2017/03/06 23:02:05 How about just creating a new mojom for the struct
zhaobin 2017/03/07 19:28:49 Is it ok to leave struct IPAddress in media_router
dcheng 2017/03/07 19:54:32 (Sorry just saw this comment) Hmm... it's not gre
42
43 // Model name of the sink, if it represents a physical device.
44 string model_name;
45
46 // Used for DIAL launch
47 url.mojom.Url app_url;
48 };
49
50 struct CastMediaSink {
51 string ip_address;
52
53 // Model name of the sink, if it represents a physical device.
54 string model_name;
55
56 // A bit vector representing capabilities of the sink. Meaning of capacity
57 // value for each bit:
58 // NONE: 0,
59 // VIDEO_OUT: 1 << 0,
60 // VIDEO_IN: 1 << 1,
61 // AUDIO_OUT: 1 << 2,
62 // AUDIO_IN: 1 << 3,
63 // DEV_MODE: 1 << 4,
64 // MULTIZONE_GROUP: 1 << 5
65 int32 capabilities;
66
67 // ID of Cast channel opened by Media Router. The ID is defined by the
68 // chrome.cast.channel API.
69 int32 cast_channel_id;
30 }; 70 };
31 71
32 // Should be kept in sync with media_route.h. 72 // Should be kept in sync with media_route.h.
33 struct MediaRoute { 73 struct MediaRoute {
34 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo". 74 // The ID of this media route, e.g. "r_PR1O_blkC9dsKp-tb1ti8qurOo".
35 string media_route_id; 75 string media_route_id;
36 // The ID of the media source being sent through this media route. 76 // The ID of the media source being sent through this media route.
37 // May be missing if route is not local. 77 // May be missing if route is not local.
38 string? media_source; 78 string? media_source;
39 // The ID of sink that is rendering the media content. 79 // The ID of sink that is rendering the media content.
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 430
391 // Called when the a batch of messages arrives from the media sink for the 431 // Called when the a batch of messages arrives from the media sink for the
392 // route given by |route_id|. 432 // route given by |route_id|.
393 // |StartListeningForRouteMessages| must be called first in order to receive 433 // |StartListeningForRouteMessages| must be called first in order to receive
394 // messages. 434 // messages.
395 // |route_id|: ID of route of the messages. 435 // |route_id|: ID of route of the messages.
396 // |messages|: A non-empty list of messages received. 436 // |messages|: A non-empty list of messages received.
397 OnRouteMessagesReceived(string route_id, 437 OnRouteMessagesReceived(string route_id,
398 array<RouteMessage> messages); 438 array<RouteMessage> messages);
399 }; 439 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698