| Index: services/video_capture/public/interfaces/video_capture_format_traits.h
|
| diff --git a/services/video_capture/public/interfaces/video_capture_format_traits.h b/services/video_capture/public/interfaces/video_capture_format_traits.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6bd94d8ae34bff908db772b351c77c7b61ef2675
|
| --- /dev/null
|
| +++ b/services/video_capture/public/interfaces/video_capture_format_traits.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_
|
| +#define SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_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<video_capture::mojom::VideoCaptureFormatDataView,
|
| + media::VideoCaptureFormat> {
|
| +
|
| + static gfx::Size frame_size(const media::VideoCaptureFormat& r);
|
| +
|
| + static float frame_rate(const media::VideoCaptureFormat& r);
|
| +
|
| + static media::mojom::VideoFormat pixel_format(
|
| + const media::VideoCaptureFormat& r);
|
| +
|
| + static video_capture::mojom::VideoPixelStorage pixel_storage(
|
| + const media::VideoCaptureFormat& r) {
|
| + return video_capture::mojom::VideoPixelStorage(r.pixel_storage);
|
| + }
|
| +
|
| + static bool Read(video_capture::mojom::VideoCaptureFormatDataView data,
|
| + media::VideoCaptureFormat* out);
|
| +};
|
| +
|
| +template <>
|
| +struct EnumTraits<video_capture::mojom::VideoPixelStorage,
|
| + media::VideoPixelStorage> {
|
| + static video_capture::mojom::VideoPixelStorage ToMojom(
|
| + media::VideoPixelStorage video_pixel_storage);
|
| +
|
| + static bool FromMojom(video_capture::mojom::VideoPixelStorage input,
|
| + media::VideoPixelStorage* out);
|
| +};
|
| +}
|
| +
|
| +#endif // SERVICES_VIDEO_CAPTURE_PUBLIC_INTERFACES_VIDEO_CAPTURE_FORMAT_TYPEMAP_H_
|
|
|