| 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 #include "services/video_capture/public/interfaces/video_capture_device_descript
or_struct_traits.h" | 5 #include "services/video_capture/public/interfaces/device_descriptor_struct_trai
ts.h" |
| 6 | 6 |
| 7 namespace mojo { | 7 namespace mojo { |
| 8 | 8 |
| 9 // static | 9 // static |
| 10 video_capture::mojom::VideoCaptureApi | 10 video_capture::mojom::VideoCaptureApi |
| 11 EnumTraits<video_capture::mojom::VideoCaptureApi, | 11 EnumTraits<video_capture::mojom::VideoCaptureApi, |
| 12 media::VideoCaptureApi>::ToMojom(media::VideoCaptureApi input) { | 12 media::VideoCaptureApi>::ToMojom(media::VideoCaptureApi input) { |
| 13 switch (input) { | 13 switch (input) { |
| 14 case media::VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE: | 14 case media::VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE: |
| 15 return video_capture::mojom::VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE; | 15 return video_capture::mojom::VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 return true; | 109 return true; |
| 110 case video_capture::mojom::VideoCaptureTransportType::OTHER_TRANSPORT: | 110 case video_capture::mojom::VideoCaptureTransportType::OTHER_TRANSPORT: |
| 111 *output = media::VideoCaptureTransportType::OTHER_TRANSPORT; | 111 *output = media::VideoCaptureTransportType::OTHER_TRANSPORT; |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 NOTREACHED(); | 114 NOTREACHED(); |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // static | 118 // static |
| 119 bool StructTraits<video_capture::mojom::VideoCaptureDeviceDescriptorDataView, | 119 bool StructTraits<video_capture::mojom::DeviceDescriptorDataView, |
| 120 media::VideoCaptureDeviceDescriptor>:: | 120 media::VideoCaptureDeviceDescriptor>:: |
| 121 Read(video_capture::mojom::VideoCaptureDeviceDescriptorDataView data, | 121 Read(video_capture::mojom::DeviceDescriptorDataView data, |
| 122 media::VideoCaptureDeviceDescriptor* output) { | 122 media::VideoCaptureDeviceDescriptor* output) { |
| 123 if (!data.ReadDisplayName(&(output->display_name))) | 123 if (!data.ReadDisplayName(&(output->display_name))) |
| 124 return false; | 124 return false; |
| 125 | 125 |
| 126 if (!data.ReadDeviceId(&(output->device_id))) | 126 if (!data.ReadDeviceId(&(output->device_id))) |
| 127 return false; | 127 return false; |
| 128 | 128 |
| 129 if (!data.ReadModelId(&(output->model_id))) | 129 if (!data.ReadModelId(&(output->model_id))) |
| 130 return false; | 130 return false; |
| 131 | 131 |
| 132 if (!data.ReadCaptureApi(&(output->capture_api))) | 132 if (!data.ReadCaptureApi(&(output->capture_api))) |
| 133 return false; | 133 return false; |
| 134 | 134 |
| 135 if (!data.ReadTransportType(&(output->transport_type))) | 135 if (!data.ReadTransportType(&(output->transport_type))) |
| 136 return false; | 136 return false; |
| 137 | 137 |
| 138 return true; | 138 return true; |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace mojo | 141 } // namespace mojo |
| OLD | NEW |