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 CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ | 5 #ifndef CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ |
6 #define CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ | 6 #define CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "content/common/video_capture.mojom.h" | 8 #include "content/common/video_capture.mojom.h" |
9 #include "media/base/video_capture_types.h" | 9 #include "media/capture/video_capture_types.h" |
10 #include "mojo/common/common_custom_types_struct_traits.h" | 10 #include "mojo/common/common_custom_types_struct_traits.h" |
11 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h" | 11 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 template <> | 15 template <> |
16 struct StructTraits<content::mojom::VideoCaptureParamsDataView, | 16 struct StructTraits<content::mojom::VideoCaptureParamsDataView, |
17 media::VideoCaptureParams> { | 17 media::VideoCaptureParams> { |
18 static media::VideoCaptureFormat requested_format( | 18 static media::VideoCaptureFormat requested_format( |
19 const media::VideoCaptureParams& params) { | 19 const media::VideoCaptureParams& params) { |
20 return params.requested_format; | 20 return params.requested_format; |
21 } | 21 } |
22 | 22 |
23 static media::ResolutionChangePolicy resolution_change_policy( | 23 static media::ResolutionChangePolicy resolution_change_policy( |
24 const media::VideoCaptureParams& params) { | 24 const media::VideoCaptureParams& params) { |
25 return params.resolution_change_policy; | 25 return params.resolution_change_policy; |
26 } | 26 } |
27 | 27 |
28 static media::PowerLineFrequency power_line_frequency( | 28 static media::PowerLineFrequency power_line_frequency( |
29 const media::VideoCaptureParams& params) { | 29 const media::VideoCaptureParams& params) { |
30 return params.power_line_frequency; | 30 return params.power_line_frequency; |
31 } | 31 } |
32 | 32 |
33 static bool Read(content::mojom::VideoCaptureParamsDataView data, | 33 static bool Read(content::mojom::VideoCaptureParamsDataView data, |
34 media::VideoCaptureParams* out); | 34 media::VideoCaptureParams* out); |
35 }; | 35 }; |
36 } | 36 } |
37 | 37 |
38 #endif // CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ | 38 #endif // CONTENT_COMMON_VIDEO_CAPTURE_STRUCT_TRAITS_H_ |
OLD | NEW |