| Index: components/arc/video_accelerator/video_encode_accelerator_struct_traits.h
|
| diff --git a/components/arc/video_accelerator/video_encode_accelerator_struct_traits.h b/components/arc/video_accelerator/video_encode_accelerator_struct_traits.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..eb1624cb106a23de35437e3620a003c115b12c35
|
| --- /dev/null
|
| +++ b/components/arc/video_accelerator/video_encode_accelerator_struct_traits.h
|
| @@ -0,0 +1,68 @@
|
| +// 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 COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAITS_H_
|
| +#define COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAITS_H_
|
| +
|
| +#include "components/arc/common/video_encode_accelerator.mojom.h"
|
| +#include "media/video/video_encode_accelerator.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct EnumTraits<arc::mojom::VideoEncodeAccelerator::Error,
|
| + media::VideoEncodeAccelerator::Error> {
|
| + static arc::mojom::VideoEncodeAccelerator::Error ToMojom(
|
| + media::VideoEncodeAccelerator::Error input);
|
| +
|
| + static bool FromMojom(arc::mojom::VideoEncodeAccelerator::Error input,
|
| + media::VideoEncodeAccelerator::Error* output);
|
| +};
|
| +
|
| +template <>
|
| +struct EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat> {
|
| + static arc::mojom::VideoPixelFormat ToMojom(media::VideoPixelFormat input);
|
| +
|
| + static bool FromMojom(arc::mojom::VideoPixelFormat input,
|
| + media::VideoPixelFormat* output);
|
| +};
|
| +
|
| +template <>
|
| +struct EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile> {
|
| + static arc::mojom::VideoCodecProfile ToMojom(media::VideoCodecProfile input);
|
| +
|
| + static bool FromMojom(arc::mojom::VideoCodecProfile input,
|
| + media::VideoCodecProfile* output);
|
| +};
|
| +
|
| +template <>
|
| +struct StructTraits<arc::mojom::VideoEncodeProfileDataView,
|
| + media::VideoEncodeAccelerator::SupportedProfile> {
|
| + static media::VideoCodecProfile profile(
|
| + const media::VideoEncodeAccelerator::SupportedProfile& r) {
|
| + return r.profile;
|
| + }
|
| + static gfx::Size max_resolution(
|
| + const media::VideoEncodeAccelerator::SupportedProfile& r) {
|
| + return r.max_resolution;
|
| + }
|
| + static uint32_t max_framerate_numerator(
|
| + const media::VideoEncodeAccelerator::SupportedProfile& r) {
|
| + return r.max_framerate_numerator;
|
| + }
|
| + static uint32_t max_framerate_denominator(
|
| + const media::VideoEncodeAccelerator::SupportedProfile& r) {
|
| + return r.max_framerate_denominator;
|
| + }
|
| +
|
| + static bool Read(arc::mojom::VideoEncodeProfileDataView data,
|
| + media::VideoEncodeAccelerator::SupportedProfile* out) {
|
| + NOTIMPLEMENTED();
|
| + return false;
|
| + }
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAITS_H_
|
|
|