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

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

Issue 2513973002: Use mojo typemap to simplify the code using DmabufPlane (Closed)
Patch Set: Created 4 years, 1 month 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 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 COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_
6 #define COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_
7
8 #include "components/arc/common/video_accelerator.mojom.h"
9 #include "components/arc/video_accelerator/video_accelerator.h"
10
11 namespace mojo {
12
13 template <>
14 struct StructTraits<arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView,
15 ::arc::ArcVideoAcceleratorDmabufPlane> {
Yusuke Sato 2016/11/29 21:34:28 (here and elsewhere) The leading :: seems redundan
yoshiki 2016/11/30 17:25:44 Done.
16 static uint32_t offset(const ::arc::ArcVideoAcceleratorDmabufPlane& r) {
17 return r.offset;
18 }
19 static uint32_t stride(const ::arc::ArcVideoAcceleratorDmabufPlane& r) {
20 return r.stride;
21 }
22
23 static bool Read(arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView data,
24 ::arc::ArcVideoAcceleratorDmabufPlane* out) {
25 out->offset = data.offset();
26 out->stride = data.stride();
Luis Héctor Chávez 2016/11/29 18:25:36 here you can check if either the stride or offset
yoshiki 2016/11/30 17:25:44 Done.
27 return true;
28 }
29 };
30 }
Luis Héctor Chávez 2016/11/29 18:25:36 nit: empty line before to preserve symmetry.
Yusuke Sato 2016/11/29 21:34:28 same. // namespace mojo
yoshiki 2016/11/30 17:25:44 Done.
31
32 #endif // COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698