Roman Stratiienko | 1cbaaf9 | 2022-02-21 10:52:18 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <cstdint> |
| 20 | |
| 21 | constexpr int kBufferMaxPlanes = 4; |
| 22 | |
Roman Stratiienko | 4b2cc48 | 2022-02-21 14:53:58 +0200 | [diff] [blame] | 23 | enum class BufferColorSpace : int32_t { |
| 24 | kUndefined, |
| 25 | kItuRec601, |
| 26 | kItuRec709, |
| 27 | kItuRec2020, |
| 28 | }; |
| 29 | |
| 30 | enum class BufferSampleRange : int32_t { |
| 31 | kUndefined, |
| 32 | kFullRange, |
| 33 | kLimitedRange, |
| 34 | }; |
| 35 | |
| 36 | enum class BufferBlendMode : int32_t { |
| 37 | kUndefined, |
| 38 | kNone, |
| 39 | kPreMult, |
| 40 | kCoverage, |
| 41 | }; |
| 42 | |
Roman Stratiienko | 1cbaaf9 | 2022-02-21 10:52:18 +0200 | [diff] [blame] | 43 | struct BufferInfo { |
| 44 | uint32_t width; |
| 45 | uint32_t height; |
| 46 | uint32_t format; /* DRM_FORMAT_* from drm_fourcc.h */ |
| 47 | uint32_t pitches[kBufferMaxPlanes]; |
| 48 | uint32_t offsets[kBufferMaxPlanes]; |
| 49 | /* sizes[] is used only by mapper@4 metadata getter for internal purposes */ |
| 50 | uint32_t sizes[kBufferMaxPlanes]; |
| 51 | int prime_fds[kBufferMaxPlanes]; |
| 52 | uint64_t modifiers[kBufferMaxPlanes]; |
Roman Stratiienko | 4b2cc48 | 2022-02-21 14:53:58 +0200 | [diff] [blame] | 53 | |
| 54 | BufferColorSpace color_space; |
| 55 | BufferSampleRange sample_range; |
| 56 | BufferBlendMode blend_mode; |
Roman Stratiienko | 1cbaaf9 | 2022-02-21 10:52:18 +0200 | [diff] [blame] | 57 | }; |