OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAITS_
H_ |
| 6 #define COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAITS_
H_ |
| 7 |
| 8 #include "components/arc/common/video_encode_accelerator.mojom.h" |
| 9 #include "media/video/video_encode_accelerator.h" |
| 10 |
| 11 namespace mojo { |
| 12 |
| 13 template <> |
| 14 struct EnumTraits<arc::mojom::VideoEncodeAccelerator::Error, |
| 15 media::VideoEncodeAccelerator::Error> { |
| 16 static arc::mojom::VideoEncodeAccelerator::Error ToMojom( |
| 17 media::VideoEncodeAccelerator::Error input); |
| 18 |
| 19 static bool FromMojom(arc::mojom::VideoEncodeAccelerator::Error input, |
| 20 media::VideoEncodeAccelerator::Error* output); |
| 21 }; |
| 22 |
| 23 template <> |
| 24 struct EnumTraits<arc::mojom::VideoPixelFormat, media::VideoPixelFormat> { |
| 25 static arc::mojom::VideoPixelFormat ToMojom(media::VideoPixelFormat input); |
| 26 |
| 27 static bool FromMojom(arc::mojom::VideoPixelFormat input, |
| 28 media::VideoPixelFormat* output); |
| 29 }; |
| 30 |
| 31 template <> |
| 32 struct EnumTraits<arc::mojom::VideoCodecProfile, media::VideoCodecProfile> { |
| 33 static arc::mojom::VideoCodecProfile ToMojom(media::VideoCodecProfile input); |
| 34 |
| 35 static bool FromMojom(arc::mojom::VideoCodecProfile input, |
| 36 media::VideoCodecProfile* output); |
| 37 }; |
| 38 |
| 39 template <> |
| 40 struct StructTraits<arc::mojom::VideoEncodeProfileDataView, |
| 41 media::VideoEncodeAccelerator::SupportedProfile> { |
| 42 static media::VideoCodecProfile profile( |
| 43 const media::VideoEncodeAccelerator::SupportedProfile& r) { |
| 44 return r.profile; |
| 45 } |
| 46 static gfx::Size max_resolution( |
| 47 const media::VideoEncodeAccelerator::SupportedProfile& r) { |
| 48 return r.max_resolution; |
| 49 } |
| 50 static uint32_t max_framerate_numerator( |
| 51 const media::VideoEncodeAccelerator::SupportedProfile& r) { |
| 52 return r.max_framerate_numerator; |
| 53 } |
| 54 static uint32_t max_framerate_denominator( |
| 55 const media::VideoEncodeAccelerator::SupportedProfile& r) { |
| 56 return r.max_framerate_denominator; |
| 57 } |
| 58 |
| 59 static bool Read(arc::mojom::VideoEncodeProfileDataView data, |
| 60 media::VideoEncodeAccelerator::SupportedProfile* out) { |
| 61 NOTIMPLEMENTED(); |
| 62 return false; |
| 63 } |
| 64 }; |
| 65 |
| 66 } // namespace mojo |
| 67 |
| 68 #endif // COMPONENTS_ARC_VIDEO_ACCELERATOR_VIDEO_ENCODE_ACCELERATOR_STRUCT_TRAI
TS_H_ |
OLD | NEW |