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

Side by Side Diff: services/video_capture/public/interfaces/video_capture_format_traits.h

Issue 2419793003: media: Use native video enum types in media mojo interfaces (Closed)
Patch Set: media: Use native video enum types in media mojo 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 | « services/video_capture/public/interfaces/video_capture_format.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_ 5 #ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_
6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_ 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_
7 7
8 #include "media/base/video_capture_types.h" 8 #include "media/base/video_capture_types.h"
9 #include "mojo/common/common_custom_types_struct_traits.h" 9 #include "mojo/common/common_custom_types_struct_traits.h"
10 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h" 10 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 13
14 template <> 14 template <>
15 struct StructTraits<video_capture::mojom::VideoCaptureFormatDataView, 15 struct StructTraits<video_capture::mojom::VideoCaptureFormatDataView,
16 media::VideoCaptureFormat> { 16 media::VideoCaptureFormat> {
17 static const gfx::Size& frame_size(const media::VideoCaptureFormat& format) { 17 static const gfx::Size& frame_size(const media::VideoCaptureFormat& format) {
18 return format.frame_size; 18 return format.frame_size;
19 } 19 }
20 20
21 static float frame_rate(const media::VideoCaptureFormat& format) { 21 static float frame_rate(const media::VideoCaptureFormat& format) {
22 return format.frame_rate; 22 return format.frame_rate;
23 } 23 }
24 24
25 static media::mojom::VideoFormat pixel_format( 25 static media::VideoPixelFormat pixel_format(
26 const media::VideoCaptureFormat& format) { 26 const media::VideoCaptureFormat& format) {
27 return static_cast<media::mojom::VideoFormat>(format.pixel_format); 27 return format.pixel_format;
28 } 28 }
29 29
30 static video_capture::mojom::VideoPixelStorage pixel_storage( 30 static video_capture::mojom::VideoPixelStorage pixel_storage(
31 const media::VideoCaptureFormat& format) { 31 const media::VideoCaptureFormat& format) {
32 return static_cast<video_capture::mojom::VideoPixelStorage>( 32 return static_cast<video_capture::mojom::VideoPixelStorage>(
33 format.pixel_storage); 33 format.pixel_storage);
34 } 34 }
35 35
36 static bool Read(video_capture::mojom::VideoCaptureFormatDataView data, 36 static bool Read(video_capture::mojom::VideoCaptureFormatDataView data,
37 media::VideoCaptureFormat* out); 37 media::VideoCaptureFormat* out);
38 }; 38 };
39 39
40 template <> 40 template <>
41 struct EnumTraits<video_capture::mojom::VideoPixelStorage, 41 struct EnumTraits<video_capture::mojom::VideoPixelStorage,
42 media::VideoPixelStorage> { 42 media::VideoPixelStorage> {
43 static video_capture::mojom::VideoPixelStorage ToMojom( 43 static video_capture::mojom::VideoPixelStorage ToMojom(
44 media::VideoPixelStorage video_pixel_storage); 44 media::VideoPixelStorage video_pixel_storage);
45 45
46 static bool FromMojom(video_capture::mojom::VideoPixelStorage input, 46 static bool FromMojom(video_capture::mojom::VideoPixelStorage input,
47 media::VideoPixelStorage* out); 47 media::VideoPixelStorage* out);
48 }; 48 };
49 } 49 }
50 50
51 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP _H_ 51 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP _H_
OLDNEW
« no previous file with comments | « services/video_capture/public/interfaces/video_capture_format.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698