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_VIDEO_CAPTURE_SETTINGS_TRAITS_H
_ |
| 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_SETTINGS_TRAITS_H
_ |
| 7 |
| 8 #include "media/capture/video_capture_types.h" |
| 9 #include "mojo/common/common_custom_types_struct_traits.h" |
| 10 #include "services/video_capture/public/interfaces/video_capture_device_proxy.mo
jom.h" |
| 11 |
| 12 namespace mojo { |
| 13 |
| 14 template <> |
| 15 struct StructTraits<video_capture::mojom::VideoCaptureFormatDataView, |
| 16 video_capture::VideoCaptureFormat> { |
| 17 static const gfx::Size& frame_size( |
| 18 const video_capture::VideoCaptureFormat& input) { |
| 19 return input.frame_size; |
| 20 } |
| 21 |
| 22 static float frame_rate(const video_capture::VideoCaptureFormat& input) { |
| 23 return input.frame_rate; |
| 24 } |
| 25 |
| 26 static bool Read(video_capture::mojom::VideoCaptureFormatDataView data, |
| 27 video_capture::VideoCaptureFormat* out); |
| 28 }; |
| 29 |
| 30 template <> |
| 31 struct StructTraits<video_capture::mojom::VideoCaptureSettingsDataView, |
| 32 video_capture::VideoCaptureSettings> { |
| 33 static const video_capture::VideoCaptureFormat& format( |
| 34 const video_capture::VideoCaptureSettings& input) { |
| 35 return input.format; |
| 36 } |
| 37 |
| 38 static media::ResolutionChangePolicy resolution_change_policy( |
| 39 const video_capture::VideoCaptureSettings& input) { |
| 40 return input.resolution_change_policy; |
| 41 } |
| 42 |
| 43 static media::PowerLineFrequency power_line_frequency( |
| 44 const video_capture::VideoCaptureSettings& input) { |
| 45 return input.power_line_frequency; |
| 46 } |
| 47 |
| 48 static bool Read(video_capture::mojom::VideoCaptureSettingsDataView data, |
| 49 video_capture::VideoCaptureSettings* out); |
| 50 }; |
| 51 } |
| 52 |
| 53 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_SETTINGS_TRAIT
S_H_ |
OLD | NEW |