1 /* 2 * Copyright (C) 2021 HiHope Open Source Organization . 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef VideoExt_h 17 #define VideoExt_h 18 19 #include <OMX_IVCommon.h> 20 #include <codec_omx_ext.h> 21 typedef enum OMX_RANGE { 22 RangeUnspecified, 23 RangeFull, 24 RangeLimited, 25 RangeOther = 0xff, 26 } OMX_RANGE; 27 28 typedef enum OMX_PRIMARIES { 29 PrimariesUnspecified, 30 PrimariesBT709_5, // Rec.ITU-R BT.709-5 or equivalent 31 PrimariesBT470_6M, // Rec.ITU-R BT.470-6 System M or equivalent 32 PrimariesBT601_6_625, // Rec.ITU-R BT.601-6 625 or equivalent 33 PrimariesBT601_6_525, // Rec.ITU-R BT.601-6 525 or equivalent 34 PrimariesGenericFilm, // Generic Film 35 PrimariesBT2020, // Rec.ITU-R BT.2020 or equivalent 36 PrimariesOther = 0xff, 37 } OMX_PRIMARIES; 38 39 typedef enum OMX_TRANSFER { 40 TransferUnspecified, 41 TransferLinear, // Linear transfer characteristics 42 TransferSRGB, // sRGB or equivalent 43 TransferSMPTE170M, // SMPTE 170M or equivalent (e.g. BT.601/709/2020) 44 TransferGamma22, // Assumed display gamma 2.2 45 TransferGamma28, // Assumed display gamma 2.8 46 TransferST2084, // SMPTE ST 2084 for 10/12/14/16 bit systems 47 TransferHLG, // ARIB STD-B67 hybrid-log-gamma 48 TransferSMPTE240M = 0x40, // SMPTE 240M 49 TransferXvYCC, // IEC 61966-2-4 50 TransferBT1361, // Rec.ITU-R BT.1361 extended gamut 51 TransferST428, // SMPTE ST 428-1 52 TransferOther = 0xff, 53 } OMX_TRANSFER; 54 55 typedef enum OMX_MATRIXCOEFFS { 56 MatrixUnspecified, 57 MatrixBT709_5, // Rec.ITU-R BT.709-5 or equivalent 58 MatrixBT470_6M, // KR=0.30, KB=0.11 or equivalent 59 MatrixBT601_6, // Rec.ITU-R BT.601-6 625 or equivalent 60 MatrixSMPTE240M, // SMPTE 240M or equivalent 61 MatrixBT2020, // Rec.ITU-R BT.2020 non-constant luminance 62 MatrixBT2020Constant, // Rec.ITU-R BT.2020 constant luminance 63 MatrixOther = 0xff, 64 } OMX_MATRIXCOEFFS; 65 66 typedef struct OMX_COLORASPECTS { 67 OMX_RANGE mRange; // IN/OUT 68 OMX_PRIMARIES mPrimaries; // IN/OUT 69 OMX_TRANSFER mTransfer; // IN/OUT 70 OMX_MATRIXCOEFFS mMatrixCoeffs; // IN/OUT 71 } OMX_COLORASPECTS; 72 73 typedef struct ISO_COLORASPECTS { 74 OMX_U32 mRange; // IN/OUT 75 OMX_U32 mPrimaries; // IN/OUT 76 OMX_U32 mTransfer; // IN/OUT 77 OMX_U32 mMatrixCoeffs; // IN/OUT 78 } ISO_COLORASPECTS; 79 80 typedef struct OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS { 81 OMX_U32 nSize; // IN 82 OMX_VERSIONTYPE nVersion; // IN 83 OMX_U32 nPortIndex; // IN 84 OMX_BOOL bRequestingDataSpace; // IN 85 OMX_BOOL bDataSpaceChanged; // IN 86 OMX_U32 nPixelFormat; // IN 87 OMX_U32 nDataSpace; // OUT 88 OMX_COLORASPECTS sAspects; // IN/OUT 89 } OMX_CONFIG_DESCRIBECOLORASPECTSPARAMS; 90 91 typedef enum OMX_VIDEO_CODINGTYPEEXT { 92 OMX_VIDEO_CodingVP8EXT = 9, 93 OMX_VIDEO_CodingVP9, 94 OMX_VIDEO_AVCLevel52 = 0x10000, 95 }OMX_VIDEO_CODINGTYPEEXT; 96 97 typedef enum OMX_VIDEO_VP9PROFILETYPE { 98 OMX_VIDEO_VP9Profile0 = 0x1, 99 OMX_VIDEO_VP9Profile1 = 0x2, 100 OMX_VIDEO_VP9Profile2 = 0x4, 101 OMX_VIDEO_VP9Profile3 = 0x8, 102 // HDR profiles also support passing HDR metadata 103 OMX_VIDEO_VP9Profile2HDR = 0x1000, 104 OMX_VIDEO_VP9Profile3HDR = 0x2000, 105 OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF, 106 OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF 107 } OMX_VIDEO_VP9PROFILETYPE; 108 109 /** VP9 levels */ 110 typedef enum OMX_VIDEO_VP9LEVELTYPE { 111 OMX_VIDEO_VP9Level1 = 0x1, 112 OMX_VIDEO_VP9Level11 = 0x2, 113 OMX_VIDEO_VP9Level2 = 0x4, 114 OMX_VIDEO_VP9Level21 = 0x8, 115 OMX_VIDEO_VP9Level3 = 0x10, 116 OMX_VIDEO_VP9Level31 = 0x20, 117 OMX_VIDEO_VP9Level4 = 0x40, 118 OMX_VIDEO_VP9Level41 = 0x80, 119 OMX_VIDEO_VP9Level5 = 0x100, 120 OMX_VIDEO_VP9Level51 = 0x200, 121 OMX_VIDEO_VP9Level52 = 0x400, 122 OMX_VIDEO_VP9Level6 = 0x800, 123 OMX_VIDEO_VP9Level61 = 0x1000, 124 OMX_VIDEO_VP9Level62 = 0x2000, 125 OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF, 126 OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF 127 } OMX_VIDEO_VP9LEVELTYPE; 128 129 /** Structure to define if dependent slice segments should be used */ 130 typedef struct OMX_VIDEO_SLICESEGMENTSTYPE { 131 OMX_U32 nSize; 132 OMX_VERSIONTYPE nVersion; 133 OMX_U32 nPortIndex; 134 OMX_BOOL bDepedentSegments; 135 OMX_BOOL bEnableLoopFilterAcrossSlices; 136 } OMX_VIDEO_SLICESEGMENTSTYPE; 137 138 /** Structure to return timestamps of rendered output frames as well as EOS 139 * for tunneled components. 140 */ 141 typedef struct OMX_VIDEO_RENDEREVENTTYPE { 142 OMX_S64 nMediaTimeUs; // timestamp of rendered video frame 143 OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered 144 // Use INT64_MAX for nMediaTimeUs to signal that the EOS 145 // has been reached. In this case, nSystemTimeNs MUST be 146 // the system time when the last frame was rendered. 147 // This MUST be done in addition to returning (and 148 // following) the render information for the last frame. 149 } OMX_VIDEO_RENDEREVENTTYPE; 150 151 /** Dolby Vision Profile enum type */ 152 typedef enum OMX_VIDEO_DOLBYVISIONPROFILETYPE { 153 OMX_VIDEO_DolbyVisionProfileUnknown = 0x0, 154 OMX_VIDEO_DolbyVisionProfileDvavPer = 0x1, 155 OMX_VIDEO_DolbyVisionProfileDvavPen = 0x2, 156 OMX_VIDEO_DolbyVisionProfileDvheDer = 0x4, 157 OMX_VIDEO_DolbyVisionProfileDvheDen = 0x8, 158 OMX_VIDEO_DolbyVisionProfileDvheDtr = 0x10, 159 OMX_VIDEO_DolbyVisionProfileDvheStn = 0x20, 160 OMX_VIDEO_DolbyVisionProfileDvheDth = 0x40, 161 OMX_VIDEO_DolbyVisionProfileDvheDtb = 0x80, 162 OMX_VIDEO_DolbyVisionProfileMax = 0x7FFFFFFF 163 } OMX_VIDEO_DOLBYVISIONPROFILETYPE; 164 165 /** Dolby Vision Level enum type */ 166 typedef enum OMX_VIDEO_DOLBYVISIONLEVELTYPE { 167 OMX_VIDEO_DolbyVisionLevelUnknown = 0x0, 168 OMX_VIDEO_DolbyVisionLevelHd24 = 0x1, 169 OMX_VIDEO_DolbyVisionLevelHd30 = 0x2, 170 OMX_VIDEO_DolbyVisionLevelFhd24 = 0x4, 171 OMX_VIDEO_DolbyVisionLevelFhd30 = 0x8, 172 OMX_VIDEO_DolbyVisionLevelFhd60 = 0x10, 173 OMX_VIDEO_DolbyVisionLevelUhd24 = 0x20, 174 OMX_VIDEO_DolbyVisionLevelUhd30 = 0x40, 175 OMX_VIDEO_DolbyVisionLevelUhd48 = 0x80, 176 OMX_VIDEO_DolbyVisionLevelUhd60 = 0x100, 177 OMX_VIDEO_DolbyVisionLevelmax = 0x7FFFFFFF 178 } OMX_VIDEO_DOLBYVISIONLEVELTYPE; 179 180 #endif