OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
Ken Rockot(use gerrit already)
2016/10/06 23:09:05
nit: I would prefer we name this file more clearly
mcasas
2016/10/06 23:46:36
Done.
| |
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 CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_ | |
6 #define CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_ | |
7 | |
8 #include "content/common/video_capture.mojom.h" | |
9 #include "media/base/video_capture_types.h" | |
10 #include "mojo/common/common_custom_types_struct_traits.h" | |
11 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h" | |
12 | |
13 namespace mojo { | |
14 | |
15 template <> | |
16 struct StructTraits<content::mojom::VideoCaptureParamsDataView, | |
17 media::VideoCaptureParams> { | |
18 static media::VideoCaptureFormat requested_format( | |
19 const media::VideoCaptureParams& params) { | |
20 return params.requested_format; | |
21 } | |
22 | |
23 static video_capture::mojom::ResolutionChangePolicy resolution_change_policy( | |
24 const media::VideoCaptureParams& params) { | |
25 return static_cast<video_capture::mojom::ResolutionChangePolicy>( | |
Ken Rockot(use gerrit already)
2016/10/06 23:12:30
Oops, just noticed this - you shouldn't need to do
mcasas
2016/10/06 23:46:36
Done.
| |
26 params.resolution_change_policy); | |
27 } | |
28 | |
29 static video_capture::mojom::PowerLineFrequency power_line_frequency( | |
30 const media::VideoCaptureParams& params) { | |
31 return static_cast<video_capture::mojom::PowerLineFrequency>( | |
32 params.power_line_frequency); | |
33 } | |
34 | |
35 static bool Read(content::mojom::VideoCaptureParamsDataView data, | |
36 media::VideoCaptureParams* out); | |
37 }; | |
38 } | |
39 | |
40 #endif // CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_ | |
OLD | NEW |