Chromium Code Reviews| Index: components/arc/video_accelerator/video_accelerator_struct_traits.h |
| diff --git a/components/arc/video_accelerator/video_accelerator_struct_traits.h b/components/arc/video_accelerator/video_accelerator_struct_traits.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cf9f55bc30defcd830de7e3079714415ff812d5a |
| --- /dev/null |
| +++ b/components/arc/video_accelerator/video_accelerator_struct_traits.h |
| @@ -0,0 +1,32 @@ |
| +// 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 COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ |
|
Pawel Osciak
2016/12/14 08:53:14
s/COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TR
yoshiki
2016/12/14 14:18:04
Done.
|
| +#define COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ |
| + |
| +#include "components/arc/common/video_accelerator.mojom.h" |
| +#include "components/arc/video_accelerator/video_accelerator.h" |
| + |
| +namespace mojo { |
| + |
| +template <> |
| +struct StructTraits<arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView, |
| + arc::ArcVideoAcceleratorDmabufPlane> { |
| + static uint32_t offset(const arc::ArcVideoAcceleratorDmabufPlane& r) { |
| + DCHECK(r.offset >= 0); |
| + return r.offset; |
| + } |
| + |
| + static uint32_t stride(const arc::ArcVideoAcceleratorDmabufPlane& r) { |
| + DCHECK(r.stride >= 0); |
| + return r.stride; |
| + } |
| + |
| + static bool Read(arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView data, |
| + arc::ArcVideoAcceleratorDmabufPlane* out); |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // COMPONENT_ARC_COMMON_VIDEO_ACCELERATOR_STRUCT_TRAITS_H_ |