OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIPTOR
_STRUCT_TRAITS_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_DEVICE_DESCRIPTOR_STRUCT_TRAITS
_H_ |
6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIPTOR
_STRUCT_TRAITS_H_ | 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_DEVICE_DESCRIPTOR_STRUCT_TRAITS
_H_ |
7 | 7 |
8 #include "media/capture/video/video_capture_device_descriptor.h" | 8 #include "media/capture/video/video_capture_device_descriptor.h" |
9 #include "services/video_capture/public/interfaces/video_capture_device_descript
or.mojom.h" | 9 #include "services/video_capture/public/interfaces/device_descriptor.mojom.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 template <> | 13 template <> |
14 struct EnumTraits<video_capture::mojom::VideoCaptureApi, | 14 struct EnumTraits<video_capture::mojom::VideoCaptureApi, |
15 media::VideoCaptureApi> { | 15 media::VideoCaptureApi> { |
16 static video_capture::mojom::VideoCaptureApi ToMojom( | 16 static video_capture::mojom::VideoCaptureApi ToMojom( |
17 media::VideoCaptureApi input); | 17 media::VideoCaptureApi input); |
18 static bool FromMojom(video_capture::mojom::VideoCaptureApi input, | 18 static bool FromMojom(video_capture::mojom::VideoCaptureApi input, |
19 media::VideoCaptureApi* output); | 19 media::VideoCaptureApi* output); |
20 }; | 20 }; |
21 | 21 |
22 template <> | 22 template <> |
23 struct EnumTraits<video_capture::mojom::VideoCaptureTransportType, | 23 struct EnumTraits<video_capture::mojom::VideoCaptureTransportType, |
24 media::VideoCaptureTransportType> { | 24 media::VideoCaptureTransportType> { |
25 static video_capture::mojom::VideoCaptureTransportType ToMojom( | 25 static video_capture::mojom::VideoCaptureTransportType ToMojom( |
26 media::VideoCaptureTransportType input); | 26 media::VideoCaptureTransportType input); |
27 static bool FromMojom(video_capture::mojom::VideoCaptureTransportType input, | 27 static bool FromMojom(video_capture::mojom::VideoCaptureTransportType input, |
28 media::VideoCaptureTransportType* output); | 28 media::VideoCaptureTransportType* output); |
29 }; | 29 }; |
30 | 30 |
31 template <> | 31 template <> |
32 struct StructTraits<video_capture::mojom::VideoCaptureDeviceDescriptorDataView, | 32 struct StructTraits<video_capture::mojom::DeviceDescriptorDataView, |
33 media::VideoCaptureDeviceDescriptor> { | 33 media::VideoCaptureDeviceDescriptor> { |
34 static const std::string& display_name( | 34 static const std::string& display_name( |
35 const media::VideoCaptureDeviceDescriptor& input) { | 35 const media::VideoCaptureDeviceDescriptor& input) { |
36 return input.display_name; | 36 return input.display_name; |
37 } | 37 } |
38 | 38 |
39 static const std::string& device_id( | 39 static const std::string& device_id( |
40 const media::VideoCaptureDeviceDescriptor& input) { | 40 const media::VideoCaptureDeviceDescriptor& input) { |
41 return input.device_id; | 41 return input.device_id; |
42 } | 42 } |
43 | 43 |
44 static const std::string& model_id( | 44 static const std::string& model_id( |
45 const media::VideoCaptureDeviceDescriptor& input) { | 45 const media::VideoCaptureDeviceDescriptor& input) { |
46 return input.model_id; | 46 return input.model_id; |
47 } | 47 } |
48 | 48 |
49 static media::VideoCaptureApi capture_api( | 49 static media::VideoCaptureApi capture_api( |
50 const media::VideoCaptureDeviceDescriptor& input) { | 50 const media::VideoCaptureDeviceDescriptor& input) { |
51 return input.capture_api; | 51 return input.capture_api; |
52 } | 52 } |
53 | 53 |
54 static media::VideoCaptureTransportType transport_type( | 54 static media::VideoCaptureTransportType transport_type( |
55 const media::VideoCaptureDeviceDescriptor& input) { | 55 const media::VideoCaptureDeviceDescriptor& input) { |
56 return input.transport_type; | 56 return input.transport_type; |
57 } | 57 } |
58 | 58 |
59 static bool Read( | 59 static bool Read(video_capture::mojom::DeviceDescriptorDataView data, |
60 video_capture::mojom::VideoCaptureDeviceDescriptorDataView data, | 60 media::VideoCaptureDeviceDescriptor* output); |
61 media::VideoCaptureDeviceDescriptor* output); | |
62 }; | 61 }; |
63 | 62 |
64 } // namespace mojo | 63 } // namespace mojo |
65 | 64 |
66 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_DEVICE_DESCRIP
TOR_STRUCT_TRAITS_H_ | 65 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_DEVICE_DESCRIPTOR_STRUCT_TRA
ITS_H_ |
OLD | NEW |