blob: b2297f9de8b0f5eebd9c7696667114f3cd0584b9 [file] [log] [blame]
Roman Stratiienko1cbaaf92022-02-21 10:52:18 +02001/*
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
21constexpr int kBufferMaxPlanes = 4;
22
Roman Stratiienko4b2cc482022-02-21 14:53:58 +020023enum class BufferColorSpace : int32_t {
24 kUndefined,
25 kItuRec601,
26 kItuRec709,
27 kItuRec2020,
28};
29
30enum class BufferSampleRange : int32_t {
31 kUndefined,
32 kFullRange,
33 kLimitedRange,
34};
35
36enum class BufferBlendMode : int32_t {
37 kUndefined,
38 kNone,
39 kPreMult,
40 kCoverage,
41};
42
Roman Stratiienko1cbaaf92022-02-21 10:52:18 +020043struct 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 Stratiienko4b2cc482022-02-21 14:53:58 +020053
54 BufferColorSpace color_space;
55 BufferSampleRange sample_range;
56 BufferBlendMode blend_mode;
Roman Stratiienko1cbaaf92022-02-21 10:52:18 +020057};