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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/video_capture_traits.h
diff --git a/content/common/video_capture_traits.h b/content/common/video_capture_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..8580dd47a13df01d462acc695a79f5732df23a4e
--- /dev/null
+++ b/content/common/video_capture_traits.h
@@ -0,0 +1,40 @@
+// 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.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
+#define CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
+
+#include "content/common/video_capture.mojom.h"
+#include "media/base/video_capture_types.h"
+#include "mojo/common/common_custom_types_struct_traits.h"
+#include "services/video_capture/public/interfaces/video_capture_format.mojom.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<content::mojom::VideoCaptureParamsDataView,
+ media::VideoCaptureParams> {
+ static media::VideoCaptureFormat requested_format(
+ const media::VideoCaptureParams& params) {
+ return params.requested_format;
+ }
+
+ static video_capture::mojom::ResolutionChangePolicy resolution_change_policy(
+ const media::VideoCaptureParams& params) {
+ 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.
+ params.resolution_change_policy);
+ }
+
+ static video_capture::mojom::PowerLineFrequency power_line_frequency(
+ const media::VideoCaptureParams& params) {
+ return static_cast<video_capture::mojom::PowerLineFrequency>(
+ params.power_line_frequency);
+ }
+
+ static bool Read(content::mojom::VideoCaptureParamsDataView data,
+ media::VideoCaptureParams* out);
+};
+}
+
+#endif // CONTENT_COMMON_VIDEO_CAPTURE_TRAITS_H_
« 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