OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 5 #ifndef CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
6 #define CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 6 #define CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/manual_constructor.h" | 10 #include "base/memory/manual_constructor.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 DialSinkExtraData(const DialSinkExtraData& other); | 28 DialSinkExtraData(const DialSinkExtraData& other); |
29 ~DialSinkExtraData(); | 29 ~DialSinkExtraData(); |
30 | 30 |
31 bool operator==(const DialSinkExtraData& other) const; | 31 bool operator==(const DialSinkExtraData& other) const; |
32 }; | 32 }; |
33 | 33 |
34 // Extra data for Cast media sink. | 34 // Extra data for Cast media sink. |
35 struct CastSinkExtraData { | 35 struct CastSinkExtraData { |
36 net::IPAddress ip_address; | 36 net::IPAddress ip_address; |
37 | 37 |
38 int port = 0; | |
39 | |
38 // Model name of the sink. | 40 // Model name of the sink. |
39 std::string model_name; | 41 std::string model_name; |
40 | 42 |
41 // A bit vector representing the capabilities of the sink. The values are | 43 // A bit vector representing the capabilities of the sink. The values are |
42 // defined in media_router.mojom. | 44 // defined in media_router.mojom. |
43 uint8_t capabilities = 0; | 45 uint8_t capabilities = 0; |
44 | 46 |
45 // ID of Cast channel opened for the sink. The caller must set this value to a | 47 // ID of Cast channel opened for the sink. The caller must set this value to a |
46 // valid cast_channel_id. The cast_channel_id may change over time as the | 48 // valid cast_channel_id. The cast_channel_id may change over time as the |
47 // browser reconnects to a device. | 49 // browser reconnects to a device. |
48 int cast_channel_id = 0; | 50 int cast_channel_id = 0; |
49 | 51 |
52 // True if Cast channel is opened from DIAL sink. | |
53 bool discovered_by_dial = false; | |
54 | |
50 CastSinkExtraData(); | 55 CastSinkExtraData(); |
51 CastSinkExtraData(const CastSinkExtraData& other); | 56 CastSinkExtraData(const CastSinkExtraData& other); |
52 ~CastSinkExtraData(); | 57 ~CastSinkExtraData(); |
53 | 58 |
54 bool operator==(const CastSinkExtraData& other) const; | 59 bool operator==(const CastSinkExtraData& other) const; |
55 }; | 60 }; |
56 | 61 |
57 // Represents a media sink discovered by MediaSinkService. It is used by | 62 // Represents a media sink discovered by MediaSinkService. It is used by |
58 // MediaSinkService to push MediaSinks with extra data to the | 63 // MediaSinkService to push MediaSinks with extra data to the |
59 // MediaRouteProvider, and it is not exposed to users of MediaRouter. | 64 // MediaRouteProvider, and it is not exposed to users of MediaRouter. |
60 class MediaSinkInternal { | 65 class MediaSinkInternal { |
61 public: | 66 public: |
62 // Used by mojo. | 67 // Used by mojo. |
63 MediaSinkInternal(); | 68 MediaSinkInternal(); |
imcheng
2017/07/12 00:51:36
You'll need to implement move constructor and the
| |
64 | 69 |
65 // Used by MediaSinkService to create media sinks. | 70 // Used by MediaSinkService to create media sinks. |
66 MediaSinkInternal(const MediaSink& sink, const DialSinkExtraData& dial_data); | 71 MediaSinkInternal(const MediaSink& sink, const DialSinkExtraData& dial_data); |
67 MediaSinkInternal(const MediaSink& sink, const CastSinkExtraData& cast_data); | 72 MediaSinkInternal(const MediaSink& sink, const CastSinkExtraData& cast_data); |
68 | 73 |
69 // Used to push instance of this class into vector. | 74 // Used to push instance of this class into vector. |
70 MediaSinkInternal(const MediaSinkInternal& other); | 75 MediaSinkInternal(const MediaSinkInternal& other); |
71 | 76 |
72 ~MediaSinkInternal(); | 77 ~MediaSinkInternal(); |
73 | 78 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 base::ManualConstructor<DialSinkExtraData> dial_data_; | 127 base::ManualConstructor<DialSinkExtraData> dial_data_; |
123 | 128 |
124 // Set if sink is Cast sink. | 129 // Set if sink is Cast sink. |
125 base::ManualConstructor<CastSinkExtraData> cast_data_; | 130 base::ManualConstructor<CastSinkExtraData> cast_data_; |
126 }; | 131 }; |
127 }; | 132 }; |
128 | 133 |
129 } // namespace media_router | 134 } // namespace media_router |
130 | 135 |
131 #endif // CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ | 136 #endif // CHROME_COMMON_MEDIA_ROUTER_DISCOVERY_MEDIA_SINK_INTERNAL_H_ |
OLD | NEW |