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

Side by Side Diff: services/video_capture/public/interfaces/capture_settings_traits.cc

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 #include "services/video_capture/public/interfaces/capture_settings_traits.h"
6
7 #include "media/capture/mojo/video_capture_types_typemap_traits.h"
8 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h"
9
10 namespace mojo {
11
12 // static
13 bool StructTraits<video_capture::mojom::I420CaptureFormatDataView,
14 video_capture::I420CaptureFormat>::
15 Read(video_capture::mojom::I420CaptureFormatDataView data,
16 video_capture::I420CaptureFormat* out) {
17 if (!data.ReadFrameSize(&out->frame_size))
18 return false;
19 out->frame_rate = data.frame_rate();
20 return true;
21 }
22
23 // static
24 bool StructTraits<video_capture::mojom::CaptureSettingsDataView,
25 video_capture::CaptureSettings>::
26 Read(video_capture::mojom::CaptureSettingsDataView data,
27 video_capture::CaptureSettings* out) {
28 if (!data.ReadFormat(&out->format))
29 return false;
30 if (!data.ReadResolutionChangePolicy(&out->resolution_change_policy))
31 return false;
32 if (!data.ReadPowerLineFrequency(&out->power_line_frequency))
33 return false;
34 return true;
35 }
36
37 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698