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

Side by Side Diff: content/common/video_capture_traits.h

Issue 2395163002: VideoCapture: migrate VideoCapture renderer-->host messages to mojo, part 2 (Closed)
Patch Set: Added //content/common:mojo_bindings dep on //services/video_capture/public/interfaces Created 4 years, 2 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
« no previous file with comments | « content/common/video_capture.typemap ('k') | content/common/video_capture_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
Ken Rockot(use gerrit already) 2016/10/06 23:09:05 nit: I would prefer we name this file more clearly
mcasas 2016/10/06 23:46:36 Done.
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 CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
6 #define CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
7
8 #include "content/common/video_capture.mojom.h"
9 #include "media/base/video_capture_types.h"
10 #include "mojo/common/common_custom_types_struct_traits.h"
11 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h"
12
13 namespace mojo {
14
15 template <>
16 struct StructTraits<content::mojom::VideoCaptureParamsDataView,
17 media::VideoCaptureParams> {
18 static media::VideoCaptureFormat requested_format(
19 const media::VideoCaptureParams& params) {
20 return params.requested_format;
21 }
22
23 static video_capture::mojom::ResolutionChangePolicy resolution_change_policy(
24 const media::VideoCaptureParams& params) {
25 return static_cast<video_capture::mojom::ResolutionChangePolicy>(
Ken Rockot(use gerrit already) 2016/10/06 23:12:30 Oops, just noticed this - you shouldn't need to do
mcasas 2016/10/06 23:46:36 Done.
26 params.resolution_change_policy);
27 }
28
29 static video_capture::mojom::PowerLineFrequency power_line_frequency(
30 const media::VideoCaptureParams& params) {
31 return static_cast<video_capture::mojom::PowerLineFrequency>(
32 params.power_line_frequency);
33 }
34
35 static bool Read(content::mojom::VideoCaptureParamsDataView data,
36 media::VideoCaptureParams* out);
37 };
38 }
39
40 #endif // CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/video_capture.typemap ('k') | content/common/video_capture_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698