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