OLD | NEW |
(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_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_ |
| 6 #define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_ |
| 7 |
| 8 #include "media/base/video_capture_types.h" |
| 9 #include "mojo/common/common_custom_types_struct_traits.h" |
| 10 #include "services/video_capture/public/interfaces/video_capture_format.mojom.h" |
| 11 |
| 12 namespace mojo { |
| 13 |
| 14 template <> |
| 15 struct StructTraits<video_capture::mojom::VideoCaptureFormatDataView, |
| 16 media::VideoCaptureFormat> { |
| 17 |
| 18 static const gfx::Size& frame_size(const media::VideoCaptureFormat& format); |
| 19 |
| 20 static float frame_rate(const media::VideoCaptureFormat& format) { |
| 21 return format.frame_rate; |
| 22 } |
| 23 |
| 24 static media::mojom::VideoFormat pixel_format( |
| 25 const media::VideoCaptureFormat& format); |
| 26 |
| 27 static video_capture::mojom::VideoPixelStorage pixel_storage( |
| 28 const media::VideoCaptureFormat& format); |
| 29 |
| 30 static bool Read(video_capture::mojom::VideoCaptureFormatDataView data, |
| 31 media::VideoCaptureFormat* out); |
| 32 }; |
| 33 |
| 34 template <> |
| 35 struct EnumTraits<video_capture::mojom::VideoPixelStorage, |
| 36 media::VideoPixelStorage> { |
| 37 static video_capture::mojom::VideoPixelStorage ToMojom( |
| 38 media::VideoPixelStorage video_pixel_storage); |
| 39 |
| 40 static bool FromMojom(video_capture::mojom::VideoPixelStorage input, |
| 41 media::VideoPixelStorage* out); |
| 42 }; |
| 43 } |
| 44 |
| 45 #endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP
_H_ |
OLD | NEW |