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_CPP_VIDEO_CAPTURE_FORMAT_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_ |
| 7 |
| 8 #include "media/capture/video_capture_types.h" |
| 9 #include "ui/gfx/geometry/size.h" |
| 10 |
| 11 namespace video_capture { |
| 12 |
| 13 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureFormat. |
| 14 struct VideoCaptureFormat { |
| 15 gfx::Size frame_size; |
| 16 float frame_rate; |
| 17 |
| 18 void ConvertToMediaVideoCaptureFormat( |
| 19 media::VideoCaptureFormat* target) const { |
| 20 target->frame_size = frame_size; |
| 21 target->frame_rate = frame_rate; |
| 22 target->pixel_format = media::PIXEL_FORMAT_I420; |
| 23 target->pixel_storage = media::PIXEL_STORAGE_CPU; |
| 24 } |
| 25 }; |
| 26 |
| 27 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureSettings. |
| 28 struct VideoCaptureSettings { |
| 29 VideoCaptureFormat format; |
| 30 media::ResolutionChangePolicy resolution_change_policy; |
| 31 media::PowerLineFrequency power_line_frequency; |
| 32 |
| 33 void ConvertToMediaVideoCaptureParams( |
| 34 media::VideoCaptureParams* target) const { |
| 35 format.ConvertToMediaVideoCaptureFormat(&(target->requested_format)); |
| 36 target->resolution_change_policy = resolution_change_policy; |
| 37 target->power_line_frequency = power_line_frequency; |
| 38 } |
| 39 }; |
| 40 |
| 41 } // namespace video_capture |
| 42 |
| 43 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_ |
OLD | NEW |