Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: services/video_capture/public/cpp/capture_settings.h

Issue 2813343002: [Mojo Video Capture] Switch to using Mojo structs in media/capture/mojo (Closed)
Patch Set: Removed extraneous AtLeast Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_CAPTURE_SETTINGS_H_
6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_CAPTURE_SETTINGS_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::CaptureFormat.
14 struct I420CaptureFormat {
15 gfx::Size frame_size;
16 float frame_rate;
17
18 bool operator==(const I420CaptureFormat& other) const {
19 return frame_size == other.frame_size && frame_rate == other.frame_rate;
20 }
21
22 void ConvertToMediaVideoCaptureFormat(
23 media::VideoCaptureFormat* target) const {
24 target->frame_size = frame_size;
25 target->frame_rate = frame_rate;
26 target->pixel_format = media::PIXEL_FORMAT_I420;
27 target->pixel_storage = media::PIXEL_STORAGE_CPU;
28 }
29 };
30
31 // Cpp equivalent of Mojo struct video_capture::mojom::CaptureSettings.
32 struct CaptureSettings {
33 I420CaptureFormat format;
34 media::ResolutionChangePolicy resolution_change_policy;
35 media::PowerLineFrequency power_line_frequency;
36
37 void ConvertToMediaVideoCaptureParams(
38 media::VideoCaptureParams* target) const {
39 format.ConvertToMediaVideoCaptureFormat(&(target->requested_format));
40 target->resolution_change_policy = resolution_change_policy;
41 target->power_line_frequency = power_line_frequency;
42 }
43 };
44
45 } // namespace video_capture
46
47 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_CAPTURE_SETTINGS_H_
OLDNEW
« no previous file with comments | « services/video_capture/device_media_to_mojo_adapter.cc ('k') | services/video_capture/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698