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

Side by Side Diff: components/arc/video_accelerator/video_encode_accelerator_struct_traits.h

Issue 2892863002: ArcBridge: Add VideoEncodeAccelerator implementation. (Closed)
Patch Set: Rebase Created 3 years, 6 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
OLDNEW
(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(
dcheng 2017/06/21 09:42:29 Nit: return non-trivial types by const ref
dcheng 2017/06/22 20:05:13 I think this might have been missed in the latest
Owen Lin 2017/06/23 01:37:54 Sorry, I missed that. Done.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698