| 1 | /** |
| 2 | * Copyright (c) 2008 The Khronos Group Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining |
| 5 | * a copy of this software and associated documentation files (the |
| 6 | * "Software"), to deal in the Software without restriction, including |
| 7 | * without limitation the rights to use, copy, modify, merge, publish, |
| 8 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 9 | * permit persons to whom the Software is furnished to do so, subject |
| 10 | * to the following conditions: |
| 11 | * The above copyright notice and this permission notice shall be included |
| 12 | * in all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 18 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 19 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 20 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 21 | */ |
| 22 | |
| 23 | /** |
| 24 | * @file OMX_Image.h - OpenMax IL version 1.1.2 |
| 25 | * The structures needed by Image components to exchange parameters and |
| 26 | * configuration data with the components. |
| 27 | */ |
| 28 | #ifndef OMX_Image_h |
| 29 | #define OMX_Image_h |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif /* __cplusplus */ |
| 34 | |
| 35 | |
| 36 | /** |
| 37 | * Each OMX header must include all required header files to allow the |
| 38 | * header to compile without errors. The includes below are required |
| 39 | * for this header file to compile successfully |
| 40 | */ |
| 41 | |
| 42 | #include "OMX_IVCommon.h" |
| 43 | |
| 44 | /** @defgroup imaging OpenMAX IL Imaging Domain |
| 45 | * @ingroup iv |
| 46 | * Structures for OpenMAX IL Imaging domain |
| 47 | * @{ |
| 48 | */ |
| 49 | |
| 50 | /** |
| 51 | * Enumeration used to define the possible image compression coding. |
| 52 | */ |
| 53 | typedef enum OMX_IMAGE_CODINGTYPE { |
| 54 | OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ |
| 55 | OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ |
| 56 | OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ |
| 57 | OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ |
| 58 | OMX_IMAGE_CodingEXIF, /**< EXIF image format */ |
| 59 | OMX_IMAGE_CodingTIFF, /**< TIFF image format */ |
| 60 | OMX_IMAGE_CodingGIF, /**< Graphics image format */ |
| 61 | OMX_IMAGE_CodingPNG, /**< PNG image format */ |
| 62 | OMX_IMAGE_CodingLZW, /**< LZW image format */ |
| 63 | OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ |
| 64 | OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
| 65 | OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
| 66 | |
| 67 | OMX_IMAGE_CodingTGA, |
| 68 | OMX_IMAGE_CodingPPM, |
| 69 | |
| 70 | OMX_IMAGE_CodingMax = 0x7FFFFFFF |
| 71 | } OMX_IMAGE_CODINGTYPE; |
| 72 | |
| 73 | |
| 74 | /** |
| 75 | * Data structure used to define an image path. The number of image paths |
| 76 | * for input and output will vary by type of the image component. |
| 77 | * |
| 78 | * Input (aka Source) : Zero Inputs, one Output, |
| 79 | * Splitter : One Input, 2 or more Outputs, |
| 80 | * Processing Element : One Input, one output, |
| 81 | * Mixer : 2 or more inputs, one output, |
| 82 | * Output (aka Sink) : One Input, zero outputs. |
| 83 | * |
| 84 | * The PortDefinition structure is used to define all of the parameters |
| 85 | * necessary for the compliant component to setup an input or an output |
| 86 | * image path. If additional vendor specific data is required, it should |
| 87 | * be transmitted to the component using the CustomCommand function. |
| 88 | * Compliant components will prepopulate this structure with optimal |
| 89 | * values during the OMX_GetParameter() command. |
| 90 | * |
| 91 | * STRUCT MEMBERS: |
| 92 | * cMIMEType : MIME type of data for the port |
| 93 | * pNativeRender : Platform specific reference for a display if a |
| 94 | * sync, otherwise this field is 0 |
| 95 | * nFrameWidth : Width of frame to be used on port if |
| 96 | * uncompressed format is used. Use 0 for |
| 97 | * unknown, don't care or variable |
| 98 | * nFrameHeight : Height of frame to be used on port if |
| 99 | * uncompressed format is used. Use 0 for |
| 100 | * unknown, don't care or variable |
| 101 | * nStride : Number of bytes per span of an image (i.e. |
| 102 | * indicates the number of bytes to get from |
| 103 | * span N to span N+1, where negative stride |
| 104 | * indicates the image is bottom up |
| 105 | * nSliceHeight : Height used when encoding in slices |
| 106 | * bFlagErrorConcealment : Turns on error concealment if it is supported by |
| 107 | * the OMX component |
| 108 | * eCompressionFormat : Compression format used in this instance of |
| 109 | * the component. When OMX_IMAGE_CodingUnused is |
| 110 | * specified, eColorFormat is valid |
| 111 | * eColorFormat : Decompressed format used by this component |
| 112 | * pNativeWindow : Platform specific reference for a window object if a |
| 113 | * display sink , otherwise this field is 0x0. |
| 114 | */ |
| 115 | typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { |
| 116 | OMX_STRING cMIMEType; |
| 117 | OMX_NATIVE_DEVICETYPE pNativeRender; |
| 118 | OMX_U32 nFrameWidth; |
| 119 | OMX_U32 nFrameHeight; |
| 120 | OMX_S32 nStride; |
| 121 | OMX_U32 nSliceHeight; |
| 122 | OMX_BOOL bFlagErrorConcealment; |
| 123 | OMX_IMAGE_CODINGTYPE eCompressionFormat; |
| 124 | OMX_COLOR_FORMATTYPE eColorFormat; |
| 125 | OMX_NATIVE_WINDOWTYPE pNativeWindow; |
| 126 | } OMX_IMAGE_PORTDEFINITIONTYPE; |
| 127 | |
| 128 | |
| 129 | /** |
| 130 | * Port format parameter. This structure is used to enumerate the various |
| 131 | * data input/output format supported by the port. |
| 132 | * |
| 133 | * STRUCT MEMBERS: |
| 134 | * nSize : Size of the structure in bytes |
| 135 | * nVersion : OMX specification version information |
| 136 | * nPortIndex : Indicates which port to set |
| 137 | * nIndex : Indicates the enumeration index for the format from |
| 138 | * 0x0 to N-1 |
| 139 | * eCompressionFormat : Compression format used in this instance of the |
| 140 | * component. When OMX_IMAGE_CodingUnused is specified, |
| 141 | * eColorFormat is valid |
| 142 | * eColorFormat : Decompressed format used by this component |
| 143 | */ |
| 144 | typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { |
| 145 | OMX_U32 nSize; |
| 146 | OMX_VERSIONTYPE nVersion; |
| 147 | OMX_U32 nPortIndex; |
| 148 | OMX_U32 nIndex; |
| 149 | OMX_IMAGE_CODINGTYPE eCompressionFormat; |
| 150 | OMX_COLOR_FORMATTYPE eColorFormat; |
| 151 | } OMX_IMAGE_PARAM_PORTFORMATTYPE; |
| 152 | |
| 153 | |
| 154 | /** |
| 155 | * Flash control type |
| 156 | * |
| 157 | * ENUMS |
| 158 | * Torch : Flash forced constantly on |
| 159 | */ |
| 160 | typedef enum OMX_IMAGE_FLASHCONTROLTYPE { |
| 161 | OMX_IMAGE_FlashControlOn = 0, |
| 162 | OMX_IMAGE_FlashControlOff, |
| 163 | OMX_IMAGE_FlashControlAuto, |
| 164 | OMX_IMAGE_FlashControlRedEyeReduction, |
| 165 | OMX_IMAGE_FlashControlFillin, |
| 166 | OMX_IMAGE_FlashControlTorch, |
| 167 | OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
| 168 | OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
| 169 | OMX_IMAGE_FlashControlMax = 0x7FFFFFFF |
| 170 | } OMX_IMAGE_FLASHCONTROLTYPE; |
| 171 | |
| 172 | |
| 173 | /** |
| 174 | * Flash control configuration |
| 175 | * |
| 176 | * STRUCT MEMBERS: |
| 177 | * nSize : Size of the structure in bytes |
| 178 | * nVersion : OMX specification version information |
| 179 | * nPortIndex : Port that this structure applies to |
| 180 | * eFlashControl : Flash control type |
| 181 | */ |
| 182 | typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { |
| 183 | OMX_U32 nSize; |
| 184 | OMX_VERSIONTYPE nVersion; |
| 185 | OMX_U32 nPortIndex; |
| 186 | OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; |
| 187 | } OMX_IMAGE_PARAM_FLASHCONTROLTYPE; |
| 188 | |
| 189 | |
| 190 | /** |
| 191 | * Focus control type |
| 192 | */ |
| 193 | typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { |
| 194 | OMX_IMAGE_FocusControlOn = 0, |
| 195 | OMX_IMAGE_FocusControlOff, |
| 196 | OMX_IMAGE_FocusControlAuto, |
| 197 | OMX_IMAGE_FocusControlAutoLock, |
| 198 | OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
| 199 | OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
| 200 | OMX_IMAGE_FocusControlHyperfocal, /* Focus at the hyperfocal point of the lens. */ |
| 201 | OMX_IMAGE_FocusControlAutoMacro, /* CF over a macro range (eg 0-50cm) */ |
| 202 | OMX_IMAGE_FocusControlAutoInfinity, /* CF over distant range (eg 50cm to infinity) */ |
| 203 | OMX_IMAGE_FocusControlAutoLockMacro, /* AF over a macro range (eg 0-50cm) */ |
| 204 | OMX_IMAGE_FocusControlAutoLockInfinity, /* AF over distant range (eg 50cm to infinity) */ |
| 205 | OMX_IMAGE_FocusControlNearFixed, /* Focus at a fixed near focus point - (50cm-1m) */ |
| 206 | OMX_IMAGE_FocusControlAutoNear, /* CF over a near range (eg 0-200cm) */ |
| 207 | OMX_IMAGE_FocusControlAutoLockNear, /* AF over a near range (eg 0-200cm) */ |
| 208 | OMX_IMAGE_FocusControlInfinityFixed, /* Focus at infinity */ |
| 209 | OMX_IMAGE_FocusControlMacroFixed, /* Focus at a macro distance */ |
| 210 | OMX_IMAGE_FocusControlAutoFast, /* CF over a full range with fast response */ |
| 211 | OMX_IMAGE_FocusControlAutoMacroFast, /* CF over a macro range (eg 0-50cm) with fast response */ |
| 212 | OMX_IMAGE_FocusControlAutoNearFast, /* CF over a near range (eg 0-200cm) */ |
| 213 | OMX_IMAGE_FocusControlAutoInfinityFast, /* CF over distant range (eg 50cm to infinity) with fast response */ |
| 214 | OMX_IMAGE_FocusControlCurrentFixed, /* Stop the lens at the current position */ |
| 215 | OMX_IMAGE_FocusControlMax = 0x7FFFFFFF |
| 216 | } OMX_IMAGE_FOCUSCONTROLTYPE; |
| 217 | |
| 218 | |
| 219 | /** |
| 220 | * Focus control configuration |
| 221 | * |
| 222 | * STRUCT MEMBERS: |
| 223 | * nSize : Size of the structure in bytes |
| 224 | * nVersion : OMX specification version information |
| 225 | * nPortIndex : Port that this structure applies to |
| 226 | * eFocusControl : Focus control |
| 227 | * nFocusSteps : Focus can take on values from 0 mm to infinity. |
| 228 | * Interest is only in number of steps over this range. |
| 229 | * nFocusStepIndex : Current focus step index |
| 230 | */ |
| 231 | typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { |
| 232 | OMX_U32 nSize; |
| 233 | OMX_VERSIONTYPE nVersion; |
| 234 | OMX_U32 nPortIndex; |
| 235 | OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; |
| 236 | OMX_U32 nFocusSteps; |
| 237 | OMX_U32 nFocusStepIndex; |
| 238 | } OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; |
| 239 | |
| 240 | |
| 241 | /** |
| 242 | * Q Factor for JPEG compression, which controls the tradeoff between image |
| 243 | * quality and size. Q Factor provides a more simple means of controlling |
| 244 | * JPEG compression quality, without directly programming Quantization |
| 245 | * tables for chroma and luma |
| 246 | * |
| 247 | * STRUCT MEMBERS: |
| 248 | * nSize : Size of the structure in bytes |
| 249 | * nVersion : OMX specification version information |
| 250 | * nPortIndex : Port that this structure applies to |
| 251 | * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 |
| 252 | * produces the smallest, worst quality images, and a factor |
| 253 | * of 100 produces the largest, best quality images. A |
| 254 | * typical default is 75 for small good quality images |
| 255 | */ |
| 256 | typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { |
| 257 | OMX_U32 nSize; |
| 258 | OMX_VERSIONTYPE nVersion; |
| 259 | OMX_U32 nPortIndex; |
| 260 | OMX_U32 nQFactor; |
| 261 | } OMX_IMAGE_PARAM_QFACTORTYPE; |
| 262 | |
| 263 | /** |
| 264 | * Quantization table type |
| 265 | */ |
| 266 | |
| 267 | typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { |
| 268 | OMX_IMAGE_QuantizationTableLuma = 0, |
| 269 | OMX_IMAGE_QuantizationTableChroma, |
| 270 | OMX_IMAGE_QuantizationTableChromaCb, |
| 271 | OMX_IMAGE_QuantizationTableChromaCr, |
| 272 | OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
| 273 | OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
| 274 | OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF |
| 275 | } OMX_IMAGE_QUANTIZATIONTABLETYPE; |
| 276 | |
| 277 | /** |
| 278 | * JPEG quantization tables are used to determine DCT compression for |
| 279 | * YUV data, as an alternative to specifying Q factor, providing exact |
| 280 | * control of compression |
| 281 | * |
| 282 | * STRUCT MEMBERS: |
| 283 | * nSize : Size of the structure in bytes |
| 284 | * nVersion : OMX specification version information |
| 285 | * nPortIndex : Port that this structure applies to |
| 286 | * eQuantizationTable : Quantization table type |
| 287 | * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored |
| 288 | * in increasing columns then by rows of data (i.e. |
| 289 | * row 1, ... row 8). Quantization values are in |
| 290 | * the range 0-255 and stored in linear order |
| 291 | * (i.e. the component will zig-zag the |
| 292 | * quantization table data if required internally) |
| 293 | */ |
| 294 | typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { |
| 295 | OMX_U32 nSize; |
| 296 | OMX_VERSIONTYPE nVersion; |
| 297 | OMX_U32 nPortIndex; |
| 298 | OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; |
| 299 | OMX_U8 nQuantizationMatrix[64]; |
| 300 | } OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; |
| 301 | |
| 302 | |
| 303 | /** |
| 304 | * Huffman table type, the same Huffman table is applied for chroma and |
| 305 | * luma component |
| 306 | */ |
| 307 | typedef enum OMX_IMAGE_HUFFMANTABLETYPE { |
| 308 | OMX_IMAGE_HuffmanTableAC = 0, |
| 309 | OMX_IMAGE_HuffmanTableDC, |
| 310 | OMX_IMAGE_HuffmanTableACLuma, |
| 311 | OMX_IMAGE_HuffmanTableACChroma, |
| 312 | OMX_IMAGE_HuffmanTableDCLuma, |
| 313 | OMX_IMAGE_HuffmanTableDCChroma, |
| 314 | OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
| 315 | OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
| 316 | OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF |
| 317 | } OMX_IMAGE_HUFFMANTABLETYPE; |
| 318 | |
| 319 | /** |
| 320 | * JPEG Huffman table |
| 321 | * |
| 322 | * STRUCT MEMBERS: |
| 323 | * nSize : Size of the structure in bytes |
| 324 | * nVersion : OMX specification version information |
| 325 | * nPortIndex : Port that this structure applies to |
| 326 | * eHuffmanTable : Huffman table type |
| 327 | * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each |
| 328 | * possible length |
| 329 | * nHuffmanTable[256] : 0-255, the size used for AC and DC |
| 330 | * HuffmanTable are 16 and 162 |
| 331 | */ |
| 332 | typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { |
| 333 | OMX_U32 nSize; |
| 334 | OMX_VERSIONTYPE nVersion; |
| 335 | OMX_U32 nPortIndex; |
| 336 | OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; |
| 337 | OMX_U8 nNumberOfHuffmanCodeOfLength[16]; |
| 338 | OMX_U8 nHuffmanTable[256]; |
| 339 | }OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; |
| 340 | |
| 341 | /** @} */ |
| 342 | #ifdef __cplusplus |
| 343 | } |
| 344 | #endif /* __cplusplus */ |
| 345 | |
| 346 | #endif |
| 347 | /* File EOF */ |
| 348 | |