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

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

Issue 2486543002: [Mojo Video Capture] Add test ReceiveFramesFromFakeCaptureDevice (Closed)
Patch Set: mcasas comments mk2 Created 4 years, 1 month 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
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 SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_ 5 #ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_
6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_ 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_
7 7
8 #include "media/capture/video_capture_types.h" 8 #include "media/capture/video_capture_types.h"
9 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
10 10
11 namespace video_capture { 11 namespace video_capture {
12 12
13 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureFormat. 13 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureFormat.
14 struct VideoCaptureFormat { 14 struct VideoCaptureFormat {
15 gfx::Size frame_size; 15 gfx::Size frame_size;
16 float frame_rate; 16 float frame_rate;
17 17
18 bool operator==(const VideoCaptureFormat& other) const {
19 return frame_size == other.frame_size && frame_rate == other.frame_rate;
20 }
21
18 void ConvertToMediaVideoCaptureFormat( 22 void ConvertToMediaVideoCaptureFormat(
19 media::VideoCaptureFormat* target) const { 23 media::VideoCaptureFormat* target) const {
20 target->frame_size = frame_size; 24 target->frame_size = frame_size;
21 target->frame_rate = frame_rate; 25 target->frame_rate = frame_rate;
22 target->pixel_format = media::PIXEL_FORMAT_I420; 26 target->pixel_format = media::PIXEL_FORMAT_I420;
23 target->pixel_storage = media::PIXEL_STORAGE_CPU; 27 target->pixel_storage = media::PIXEL_STORAGE_CPU;
24 } 28 }
25 }; 29 };
26 30
27 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureSettings. 31 // Cpp equivalent of Mojo struct video_capture::mojom::VideoCaptureSettings.
28 struct VideoCaptureSettings { 32 struct VideoCaptureSettings {
29 VideoCaptureFormat format; 33 VideoCaptureFormat format;
30 media::ResolutionChangePolicy resolution_change_policy; 34 media::ResolutionChangePolicy resolution_change_policy;
31 media::PowerLineFrequency power_line_frequency; 35 media::PowerLineFrequency power_line_frequency;
32 36
33 void ConvertToMediaVideoCaptureParams( 37 void ConvertToMediaVideoCaptureParams(
34 media::VideoCaptureParams* target) const { 38 media::VideoCaptureParams* target) const {
35 format.ConvertToMediaVideoCaptureFormat(&(target->requested_format)); 39 format.ConvertToMediaVideoCaptureFormat(&(target->requested_format));
36 target->resolution_change_policy = resolution_change_policy; 40 target->resolution_change_policy = resolution_change_policy;
37 target->power_line_frequency = power_line_frequency; 41 target->power_line_frequency = power_line_frequency;
38 } 42 }
39 }; 43 };
40 44
41 } // namespace video_capture 45 } // namespace video_capture
42 46
43 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_ 47 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_VIDEO_CAPTURE_FORMAT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698