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

Side by Side Diff: services/video_capture/public/interfaces/capture_settings_traits.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_INTERFACES_CAPTURE_SETTINGS_TRAITS_H_
6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_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/device.mojom.h"
11
12 namespace mojo {
13
14 template <>
15 struct StructTraits<video_capture::mojom::I420CaptureFormatDataView,
16 video_capture::I420CaptureFormat> {
17 static const gfx::Size& frame_size(
18 const video_capture::I420CaptureFormat& input) {
19 return input.frame_size;
20 }
21
22 static float frame_rate(const video_capture::I420CaptureFormat& input) {
23 return input.frame_rate;
24 }
25
26 static bool Read(video_capture::mojom::I420CaptureFormatDataView data,
27 video_capture::I420CaptureFormat* out);
28 };
29
30 template <>
31 struct StructTraits<video_capture::mojom::CaptureSettingsDataView,
32 video_capture::CaptureSettings> {
33 static const video_capture::I420CaptureFormat& format(
34 const video_capture::CaptureSettings& input) {
35 return input.format;
36 }
37
38 static media::ResolutionChangePolicy resolution_change_policy(
39 const video_capture::CaptureSettings& input) {
40 return input.resolution_change_policy;
41 }
42
43 static media::PowerLineFrequency power_line_frequency(
44 const video_capture::CaptureSettings& input) {
45 return input.power_line_frequency;
46 }
47
48 static bool Read(video_capture::mojom::CaptureSettingsDataView data,
49 video_capture::CaptureSettings* out);
50 };
51 }
52
53 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_CAPTURE_SETTINGS_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698