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