Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 <aidl/android/hardware/graphics/common/BlendMode.h> |
| 20 | #include <aidl/android/hardware/graphics/common/Dataspace.h> |
| 21 | #include <aidl/android/hardware/graphics/common/ExtendableType.h> |
| 22 | #include <aidl/android/hardware/graphics/common/Interlaced.h> |
| 23 | #include <aidl/android/hardware/graphics/common/PlaneLayout.h> |
Joseph Murphy | 048552f | 2019-12-17 19:58:45 +0000 | [diff] [blame^] | 24 | #include <aidl/android/hardware/graphics/common/ChromaSiting.h> |
| 25 | #include <aidl/android/hardware/graphics/common/Compression.h> |
| 26 | #include <aidl/android/hardware/graphics/common/Interlaced.h> |
Marissa Wall | 317482c | 2019-12-12 14:26:59 -0800 | [diff] [blame] | 27 | #include <aidl/android/hardware/graphics/common/StandardMetadataType.h> |
Joseph Murphy | 048552f | 2019-12-17 19:58:45 +0000 | [diff] [blame^] | 28 | #include <aidl/android/hardware/graphics/common/PlaneLayoutComponentType.h> |
| 29 | |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 30 | #include <android/hardware/graphics/mapper/4.0/IMapper.h> |
| 31 | |
| 32 | namespace android { |
| 33 | |
| 34 | namespace gralloc4 { |
| 35 | |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 36 | #define GRALLOC4_STANDARD_METADATA_TYPE "android.hardware.graphics.common.StandardMetadataType" |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 37 | #define GRALLOC4_STANDARD_CHROMA_SITING "android.hardware.graphics.common.ChromaSiting" |
| 38 | #define GRALLOC4_STANDARD_COMPRESSION "android.hardware.graphics.common.Compression" |
| 39 | #define GRALLOC4_STANDARD_INTERLACED "android.hardware.graphics.common.Interlaced" |
| 40 | #define GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE \ |
| 41 | "android.hardware.graphics.common.PlaneLayoutComponentType" |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 42 | |
| 43 | /*---------------------------------------------------------------------------------------------*/ |
| 44 | /** |
| 45 | * Definitions of the standard buffer metadata types. It is recommended that everyone uses |
| 46 | * these definitions directly for standard buffer metadata types. |
| 47 | */ |
| 48 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_BufferId = { |
| 49 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::BUFFER_ID) |
| 50 | }; |
| 51 | |
| 52 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Name = { |
| 53 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::NAME) |
| 54 | }; |
| 55 | |
| 56 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Width = { |
| 57 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::WIDTH) |
| 58 | }; |
| 59 | |
| 60 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Height = { |
| 61 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::HEIGHT) |
| 62 | }; |
| 63 | |
| 64 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_LayerCount = { |
| 65 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::LAYER_COUNT) |
| 66 | }; |
| 67 | |
| 68 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_PixelFormatRequested = { |
| 69 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::PIXEL_FORMAT_REQUESTED) |
| 70 | }; |
| 71 | |
| 72 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_PixelFormatFourCC = { |
| 73 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::PIXEL_FORMAT_FOURCC) |
| 74 | }; |
| 75 | |
| 76 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_PixelFormatModifier = { |
| 77 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::PIXEL_FORMAT_MODIFIER) |
| 78 | }; |
| 79 | |
| 80 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Usage = { |
| 81 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::USAGE) |
| 82 | }; |
| 83 | |
| 84 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_AllocationSize = { |
| 85 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::ALLOCATION_SIZE) |
| 86 | }; |
| 87 | |
| 88 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_ProtectedContent = { |
| 89 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::PROTECTED_CONTENT) |
| 90 | }; |
| 91 | |
| 92 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Compression = { |
| 93 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::COMPRESSION) |
| 94 | }; |
| 95 | |
| 96 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Interlaced = { |
| 97 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::INTERLACED) |
| 98 | }; |
| 99 | |
| 100 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_ChromaSiting = { |
| 101 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::CHROMA_SITING) |
| 102 | }; |
| 103 | |
| 104 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_PlaneLayouts = { |
| 105 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::PLANE_LAYOUTS) |
| 106 | }; |
| 107 | |
| 108 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_Dataspace = { |
| 109 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::DATASPACE) |
| 110 | }; |
| 111 | |
| 112 | static const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType MetadataType_BlendMode = { |
| 113 | GRALLOC4_STANDARD_METADATA_TYPE, static_cast<int64_t>(aidl::android::hardware::graphics::common::StandardMetadataType::BLEND_MODE) |
| 114 | }; |
| 115 | |
| 116 | /*---------------------------------------------------------------------------------------------*/ |
| 117 | |
| 118 | /** |
| 119 | * Definitions of the standard compression strategies. It is recommended that everyone uses |
| 120 | * these definitions directly for standard compression strategies. |
| 121 | */ |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 122 | static const aidl::android::hardware::graphics::common::ExtendableType Compression_None = |
| 123 | {GRALLOC4_STANDARD_COMPRESSION, |
| 124 | static_cast<int64_t>(aidl::android::hardware::graphics::common::Compression::NONE)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 125 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 126 | static const aidl::android::hardware::graphics::common::ExtendableType |
| 127 | Compression_DisplayStreamCompression = |
| 128 | {GRALLOC4_STANDARD_COMPRESSION, |
| 129 | static_cast<int64_t>(aidl::android::hardware::graphics::common::Compression:: |
| 130 | DISPLAY_STREAM_COMPRESSION)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 131 | |
| 132 | /*---------------------------------------------------------------------------------------------*/ |
| 133 | |
| 134 | /** |
| 135 | * Definitions of the standard interlaced strategies. It is recommended that everyone uses |
| 136 | * these definitions directly for standard interlaced strategies. |
| 137 | */ |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 138 | static const aidl::android::hardware::graphics::common::ExtendableType Interlaced_None = |
| 139 | {GRALLOC4_STANDARD_INTERLACED, |
| 140 | static_cast<int64_t>(aidl::android::hardware::graphics::common::Interlaced::NONE)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 141 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 142 | static const aidl::android::hardware::graphics::common::ExtendableType Interlaced_TopBottom = |
| 143 | {GRALLOC4_STANDARD_INTERLACED, |
| 144 | static_cast<int64_t>(aidl::android::hardware::graphics::common::Interlaced::TOP_BOTTOM)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 145 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 146 | static const aidl::android::hardware::graphics::common::ExtendableType Interlaced_RightLeft = |
| 147 | {GRALLOC4_STANDARD_INTERLACED, |
| 148 | static_cast<int64_t>(aidl::android::hardware::graphics::common::Interlaced::RIGHT_LEFT)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 149 | |
| 150 | /*---------------------------------------------------------------------------------------------*/ |
| 151 | |
| 152 | /** |
| 153 | * Definitions of the standard chroma siting. It is recommended that everyone uses |
| 154 | * these definitions directly for standard chroma siting. |
| 155 | */ |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 156 | static const aidl::android::hardware::graphics::common::ExtendableType ChromaSiting_None = |
| 157 | {GRALLOC4_STANDARD_CHROMA_SITING, |
| 158 | static_cast<int64_t>(aidl::android::hardware::graphics::common::ChromaSiting::NONE)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 159 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 160 | static const aidl::android::hardware::graphics::common::ExtendableType ChromaSiting_Unknown = |
| 161 | {GRALLOC4_STANDARD_CHROMA_SITING, |
| 162 | static_cast<int64_t>(aidl::android::hardware::graphics::common::ChromaSiting::UNKNOWN)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 163 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 164 | static const aidl::android::hardware::graphics::common::ExtendableType |
| 165 | ChromaSiting_SitedInterstitial = {GRALLOC4_STANDARD_CHROMA_SITING, |
| 166 | static_cast<int64_t>( |
| 167 | aidl::android::hardware::graphics::common:: |
| 168 | ChromaSiting::SITED_INTERSTITIAL)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 169 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 170 | static const aidl::android::hardware::graphics::common::ExtendableType |
| 171 | ChromaSiting_CositedHorizontal = {GRALLOC4_STANDARD_CHROMA_SITING, |
| 172 | static_cast<int64_t>( |
| 173 | aidl::android::hardware::graphics::common:: |
| 174 | ChromaSiting::COSITED_HORIZONTAL)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 175 | |
| 176 | /*---------------------------------------------------------------------------------------------*/ |
| 177 | |
| 178 | /** |
| 179 | * Definitions of the standard plane layout component types. It is recommended that everyone uses |
| 180 | * these definitions directly for standard plane layout component types |
| 181 | */ |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 182 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_Y = |
| 183 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 184 | static_cast<int64_t>( |
| 185 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::Y)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 186 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 187 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_CB = |
| 188 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 189 | static_cast<int64_t>( |
| 190 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::CB)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 191 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 192 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_CR = |
| 193 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 194 | static_cast<int64_t>( |
| 195 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::CR)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 196 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 197 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_R = |
| 198 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 199 | static_cast<int64_t>( |
| 200 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::R)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 201 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 202 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_G = |
| 203 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 204 | static_cast<int64_t>( |
| 205 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::G)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 206 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 207 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_B = |
| 208 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 209 | static_cast<int64_t>( |
| 210 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::B)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 211 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 212 | static const aidl::android::hardware::graphics::common::ExtendableType PlaneLayoutComponentType_A = |
| 213 | {GRALLOC4_STANDARD_PLANE_LAYOUT_COMPONENT_TYPE, |
| 214 | static_cast<int64_t>( |
| 215 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType::A)}; |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 216 | |
| 217 | /*---------------------------------------------------------------------------------------------*/ |
| 218 | |
| 219 | /** |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 220 | * The functions below encode and decode standard metadata into a byte stream. It is STRONGLY |
| 221 | * recommended that both the vendor and system partitions use these functions when getting |
| 222 | * and setting metadata through gralloc 4 (IMapper 4.0). |
| 223 | */ |
| 224 | status_t encodeBufferId(uint64_t bufferId, android::hardware::hidl_vec<uint8_t>* outBufferId); |
| 225 | status_t decodeBufferId(const android::hardware::hidl_vec<uint8_t>& bufferId, uint64_t* outBufferId); |
| 226 | |
| 227 | status_t encodeName(const std::string& name, android::hardware::hidl_vec<uint8_t>* outName); |
| 228 | status_t decodeName(const android::hardware::hidl_vec<uint8_t>& name, std::string* outName); |
| 229 | |
| 230 | status_t encodeWidth(uint64_t width, android::hardware::hidl_vec<uint8_t>* outWidth); |
| 231 | status_t decodeWidth(const android::hardware::hidl_vec<uint8_t>& width, uint64_t* outWidth); |
| 232 | |
| 233 | status_t encodeHeight(uint64_t height, android::hardware::hidl_vec<uint8_t>* outHeight); |
| 234 | status_t decodeHeight(const android::hardware::hidl_vec<uint8_t>& height, uint64_t* outHeight); |
| 235 | |
| 236 | status_t encodeLayerCount(uint64_t layerCount, android::hardware::hidl_vec<uint8_t>* outLayerCount); |
| 237 | status_t decodeLayerCount(const android::hardware::hidl_vec<uint8_t>& layerCount, uint64_t* outLayerCount); |
| 238 | |
| 239 | status_t encodePixelFormatRequested(const hardware::graphics::common::V1_2::PixelFormat& pixelFormatRequested, android::hardware::hidl_vec<uint8_t>* outPixelFormatRequested); |
| 240 | status_t decodePixelFormatRequested(const android::hardware::hidl_vec<uint8_t>& pixelFormatRequested, hardware::graphics::common::V1_2::PixelFormat* outPixelFormatRequested); |
| 241 | |
| 242 | status_t encodePixelFormatFourCC(uint32_t pixelFormatFourCC, android::hardware::hidl_vec<uint8_t>* outPixelFormatFourCC); |
| 243 | status_t decodePixelFormatFourCC(const android::hardware::hidl_vec<uint8_t>& pixelFormatFourCC, uint32_t* outPixelFormatFourCC); |
| 244 | |
| 245 | status_t encodePixelFormatModifier(uint64_t pixelFormatModifier, android::hardware::hidl_vec<uint8_t>* outPixelFormatModifier); |
| 246 | status_t decodePixelFormatModifier(const android::hardware::hidl_vec<uint8_t>& pixelFormatModifier, uint64_t* outPixelFormatModifier); |
| 247 | |
| 248 | status_t encodeUsage(uint64_t usage, android::hardware::hidl_vec<uint8_t>* outUsage); |
| 249 | status_t decodeUsage(const android::hardware::hidl_vec<uint8_t>& usage, uint64_t* outUsage); |
| 250 | |
| 251 | status_t encodeAllocationSize(uint64_t allocationSize, android::hardware::hidl_vec<uint8_t>* outAllocationSize); |
| 252 | status_t decodeAllocationSize(const android::hardware::hidl_vec<uint8_t>& allocationSize, uint64_t* outAllocationSize); |
| 253 | |
| 254 | status_t encodeProtectedContent(uint64_t protectedContent, android::hardware::hidl_vec<uint8_t>* outProtectedContent); |
| 255 | status_t decodeProtectedContent(const android::hardware::hidl_vec<uint8_t>& protectedContent, uint64_t* outProtectedContent); |
| 256 | |
| 257 | status_t encodeCompression(const aidl::android::hardware::graphics::common::ExtendableType& compression, android::hardware::hidl_vec<uint8_t>* outCompression); |
| 258 | status_t decodeCompression(const android::hardware::hidl_vec<uint8_t>& compression, aidl::android::hardware::graphics::common::ExtendableType* outCompression); |
| 259 | |
| 260 | status_t encodeInterlaced(const aidl::android::hardware::graphics::common::ExtendableType& interlaced, android::hardware::hidl_vec<uint8_t>* outInterlaced); |
| 261 | status_t decodeInterlaced(const android::hardware::hidl_vec<uint8_t>& interlaced, aidl::android::hardware::graphics::common::ExtendableType* outInterlaced); |
| 262 | |
| 263 | status_t encodeChromaSiting(const aidl::android::hardware::graphics::common::ExtendableType& chromaSiting, android::hardware::hidl_vec<uint8_t>* outChromaSiting); |
| 264 | status_t decodeChromaSiting(const android::hardware::hidl_vec<uint8_t>& chromaSiting, aidl::android::hardware::graphics::common::ExtendableType* outChromaSiting); |
| 265 | |
| 266 | status_t encodePlaneLayouts(const std::vector<aidl::android::hardware::graphics::common::PlaneLayout>& planeLayouts, android::hardware::hidl_vec<uint8_t>* outPlaneLayouts); |
| 267 | status_t decodePlaneLayouts(const android::hardware::hidl_vec<uint8_t>& planeLayouts, std::vector<aidl::android::hardware::graphics::common::PlaneLayout>* outPlaneLayouts); |
| 268 | |
| 269 | status_t encodeDataspace(const aidl::android::hardware::graphics::common::Dataspace& dataspace, android::hardware::hidl_vec<uint8_t>* outDataspace); |
| 270 | status_t decodeDataspace(const android::hardware::hidl_vec<uint8_t>& dataspace, aidl::android::hardware::graphics::common::Dataspace* outDataspace); |
| 271 | |
| 272 | status_t encodeBlendMode(const aidl::android::hardware::graphics::common::BlendMode& blendMode, android::hardware::hidl_vec<uint8_t>* outBlendMode); |
| 273 | status_t decodeBlendMode(const android::hardware::hidl_vec<uint8_t>& blendMode, aidl::android::hardware::graphics::common::BlendMode* outBlendMode); |
| 274 | |
Marissa Wall | 22b2de1 | 2019-12-02 18:11:43 -0800 | [diff] [blame] | 275 | /** |
| 276 | * The functions below can be used to parse extendable types. |
| 277 | */ |
| 278 | bool isStandardMetadataType( |
| 279 | const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType& metadataType); |
| 280 | bool isStandardCompression( |
| 281 | const aidl::android::hardware::graphics::common::ExtendableType& compression); |
| 282 | bool isStandardInterlaced( |
| 283 | const aidl::android::hardware::graphics::common::ExtendableType& interlaced); |
| 284 | bool isStandardChromaSiting( |
| 285 | const aidl::android::hardware::graphics::common::ExtendableType& chromaSiting); |
| 286 | bool isStandardPlaneLayoutComponentType( |
| 287 | const aidl::android::hardware::graphics::common::ExtendableType& planeLayoutComponentType); |
| 288 | |
| 289 | aidl::android::hardware::graphics::common::StandardMetadataType getStandardMetadataTypeValue( |
| 290 | const android::hardware::graphics::mapper::V4_0::IMapper::MetadataType& metadataType); |
| 291 | aidl::android::hardware::graphics::common::Compression getStandardCompressionValue( |
| 292 | const aidl::android::hardware::graphics::common::ExtendableType& compression); |
| 293 | aidl::android::hardware::graphics::common::Interlaced getStandardInterlacedValue( |
| 294 | const aidl::android::hardware::graphics::common::ExtendableType& interlaced); |
| 295 | aidl::android::hardware::graphics::common::ChromaSiting getStandardChromaSitingValue( |
| 296 | const aidl::android::hardware::graphics::common::ExtendableType& chromaSiting); |
| 297 | aidl::android::hardware::graphics::common::PlaneLayoutComponentType |
| 298 | getStandardPlaneLayoutComponentTypeValue( |
| 299 | const aidl::android::hardware::graphics::common::ExtendableType& planeLayoutComponentType); |
| 300 | |
| 301 | /** |
| 302 | * The functions below return string representations of ExtendableTypes |
| 303 | */ |
| 304 | std::string getCompressionName( |
| 305 | const aidl::android::hardware::graphics::common::ExtendableType& compression); |
| 306 | std::string getInterlacedName( |
| 307 | const aidl::android::hardware::graphics::common::ExtendableType& interlaced); |
| 308 | std::string getChromaSitingName( |
| 309 | const aidl::android::hardware::graphics::common::ExtendableType& chromaSiting); |
| 310 | std::string getPlaneLayoutComponentTypeName( |
| 311 | const aidl::android::hardware::graphics::common::ExtendableType& planeLayoutComponentType); |
| 312 | |
Marissa Wall | 4858652 | 2019-11-19 14:01:36 -0800 | [diff] [blame] | 313 | } // namespace gralloc4 |
| 314 | |
| 315 | } // namespace android |