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 |
|
25 * OpenMax IL version 1.1.2 |
|
26 * The structures needed by Image components to exchange parameters and |
|
27 * configuration data with the components. |
|
28 */ |
|
29 #ifndef OMX_Image_h |
|
30 #define OMX_Image_h |
|
31 |
|
32 #ifdef __cplusplus |
|
33 extern "C" { |
|
34 #endif /* __cplusplus */ |
|
35 |
|
36 |
|
37 /** |
|
38 * Each OMX header must include all required header files to allow the |
|
39 * header to compile without errors. The includes below are required |
|
40 * for this header file to compile successfully |
|
41 */ |
|
42 |
|
43 #include <openmax/il/khronos/v1_x/OMX_IVCommon.h> |
|
44 |
|
45 /** @defgroup imaging OpenMAX IL Imaging Domain |
|
46 * @ingroup iv |
|
47 * Structures for OpenMAX IL Imaging domain |
|
48 * @{ |
|
49 */ |
|
50 |
|
51 /** |
|
52 * Enumeration used to define the possible image compression coding. |
|
53 */ |
|
54 typedef enum OMX_IMAGE_CODINGTYPE { |
|
55 OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ |
|
56 OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ |
|
57 OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ |
|
58 OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ |
|
59 OMX_IMAGE_CodingEXIF, /**< EXIF image format */ |
|
60 OMX_IMAGE_CodingTIFF, /**< TIFF image format */ |
|
61 OMX_IMAGE_CodingGIF, /**< Graphics image format */ |
|
62 OMX_IMAGE_CodingPNG, /**< PNG image format */ |
|
63 OMX_IMAGE_CodingLZW, /**< LZW image format */ |
|
64 OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ |
|
65 OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
|
66 OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
|
67 OMX_IMAGE_CodingMax = 0x7FFFFFFF |
|
68 } OMX_IMAGE_CODINGTYPE; |
|
69 |
|
70 |
|
71 /** |
|
72 * Data structure used to define an image path. The number of image paths |
|
73 * for input and output will vary by type of the image component. |
|
74 * |
|
75 * Input (aka Source) : Zero Inputs, one Output, |
|
76 * Splitter : One Input, 2 or more Outputs, |
|
77 * Processing Element : One Input, one output, |
|
78 * Mixer : 2 or more inputs, one output, |
|
79 * Output (aka Sink) : One Input, zero outputs. |
|
80 * |
|
81 * The PortDefinition structure is used to define all of the parameters |
|
82 * necessary for the compliant component to setup an input or an output |
|
83 * image path. If additional vendor specific data is required, it should |
|
84 * be transmitted to the component using the CustomCommand function. |
|
85 * Compliant components will prepopulate this structure with optimal |
|
86 * values during the OMX_GetParameter() command. |
|
87 * |
|
88 * STRUCT MEMBERS: |
|
89 * cMIMEType : MIME type of data for the port |
|
90 * pNativeRender : Platform specific reference for a display if a |
|
91 * sync, otherwise this field is 0 |
|
92 * nFrameWidth : Width of frame to be used on port if |
|
93 * uncompressed format is used. Use 0 for |
|
94 * unknown, don't care or variable |
|
95 * nFrameHeight : Height of frame to be used on port if |
|
96 * uncompressed format is used. Use 0 for |
|
97 * unknown, don't care or variable |
|
98 * nStride : Number of bytes per span of an image (i.e. |
|
99 * indicates the number of bytes to get from |
|
100 * span N to span N+1, where negative stride |
|
101 * indicates the image is bottom up |
|
102 * nSliceHeight : Height used when encoding in slices |
|
103 * bFlagErrorConcealment : Turns on error concealment if it is supported by |
|
104 * the OMX component |
|
105 * eCompressionFormat : Compression format used in this instance of |
|
106 * the component. When OMX_IMAGE_CodingUnused is |
|
107 * specified, eColorFormat is valid |
|
108 * eColorFormat : Decompressed format used by this component |
|
109 * pNativeWindow : Platform specific reference for a window object if a |
|
110 * display sink , otherwise this field is 0x0. |
|
111 */ |
|
112 typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { |
|
113 OMX_STRING cMIMEType; |
|
114 OMX_NATIVE_DEVICETYPE pNativeRender; |
|
115 OMX_U32 nFrameWidth; |
|
116 OMX_U32 nFrameHeight; |
|
117 OMX_S32 nStride; |
|
118 OMX_U32 nSliceHeight; |
|
119 OMX_BOOL bFlagErrorConcealment; |
|
120 OMX_IMAGE_CODINGTYPE eCompressionFormat; |
|
121 OMX_COLOR_FORMATTYPE eColorFormat; |
|
122 OMX_NATIVE_WINDOWTYPE pNativeWindow; |
|
123 } OMX_IMAGE_PORTDEFINITIONTYPE; |
|
124 |
|
125 |
|
126 /** |
|
127 * Port format parameter. This structure is used to enumerate the various |
|
128 * data input/output format supported by the port. |
|
129 * |
|
130 * STRUCT MEMBERS: |
|
131 * nSize : Size of the structure in bytes |
|
132 * nVersion : OMX specification version information |
|
133 * nPortIndex : Indicates which port to set |
|
134 * nIndex : Indicates the enumeration index for the format from |
|
135 * 0x0 to N-1 |
|
136 * eCompressionFormat : Compression format used in this instance of the |
|
137 * component. When OMX_IMAGE_CodingUnused is specified, |
|
138 * eColorFormat is valid |
|
139 * eColorFormat : Decompressed format used by this component |
|
140 */ |
|
141 typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { |
|
142 OMX_U32 nSize; |
|
143 OMX_VERSIONTYPE nVersion; |
|
144 OMX_U32 nPortIndex; |
|
145 OMX_U32 nIndex; |
|
146 OMX_IMAGE_CODINGTYPE eCompressionFormat; |
|
147 OMX_COLOR_FORMATTYPE eColorFormat; |
|
148 } OMX_IMAGE_PARAM_PORTFORMATTYPE; |
|
149 |
|
150 |
|
151 /** |
|
152 * Flash control type |
|
153 * |
|
154 * ENUMS |
|
155 * Torch : Flash forced constantly on |
|
156 */ |
|
157 typedef enum OMX_IMAGE_FLASHCONTROLTYPE { |
|
158 OMX_IMAGE_FlashControlOn = 0, |
|
159 OMX_IMAGE_FlashControlOff, |
|
160 OMX_IMAGE_FlashControlAuto, |
|
161 OMX_IMAGE_FlashControlRedEyeReduction, |
|
162 OMX_IMAGE_FlashControlFillin, |
|
163 OMX_IMAGE_FlashControlTorch, |
|
164 OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
|
165 OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
|
166 OMX_IMAGE_FlashControlMax = 0x7FFFFFFF |
|
167 } OMX_IMAGE_FLASHCONTROLTYPE; |
|
168 |
|
169 |
|
170 /** |
|
171 * Flash control configuration |
|
172 * |
|
173 * STRUCT MEMBERS: |
|
174 * nSize : Size of the structure in bytes |
|
175 * nVersion : OMX specification version information |
|
176 * nPortIndex : Port that this structure applies to |
|
177 * eFlashControl : Flash control type |
|
178 */ |
|
179 typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { |
|
180 OMX_U32 nSize; |
|
181 OMX_VERSIONTYPE nVersion; |
|
182 OMX_U32 nPortIndex; |
|
183 OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; |
|
184 } OMX_IMAGE_PARAM_FLASHCONTROLTYPE; |
|
185 |
|
186 |
|
187 /** |
|
188 * Focus control type |
|
189 */ |
|
190 typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { |
|
191 OMX_IMAGE_FocusControlOn = 0, |
|
192 OMX_IMAGE_FocusControlOff, |
|
193 OMX_IMAGE_FocusControlAuto, |
|
194 OMX_IMAGE_FocusControlAutoLock, |
|
195 OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
|
196 OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
|
197 OMX_IMAGE_FocusControlMax = 0x7FFFFFFF |
|
198 } OMX_IMAGE_FOCUSCONTROLTYPE; |
|
199 |
|
200 |
|
201 /** |
|
202 * Focus control configuration |
|
203 * |
|
204 * STRUCT MEMBERS: |
|
205 * nSize : Size of the structure in bytes |
|
206 * nVersion : OMX specification version information |
|
207 * nPortIndex : Port that this structure applies to |
|
208 * eFocusControl : Focus control |
|
209 * nFocusSteps : Focus can take on values from 0 mm to infinity. |
|
210 * Interest is only in number of steps over this range. |
|
211 * nFocusStepIndex : Current focus step index |
|
212 */ |
|
213 typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { |
|
214 OMX_U32 nSize; |
|
215 OMX_VERSIONTYPE nVersion; |
|
216 OMX_U32 nPortIndex; |
|
217 OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; |
|
218 OMX_U32 nFocusSteps; |
|
219 OMX_U32 nFocusStepIndex; |
|
220 } OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; |
|
221 |
|
222 |
|
223 /** |
|
224 * Q Factor for JPEG compression, which controls the tradeoff between image |
|
225 * quality and size. Q Factor provides a more simple means of controlling |
|
226 * JPEG compression quality, without directly programming Quantization |
|
227 * tables for chroma and luma |
|
228 * |
|
229 * STRUCT MEMBERS: |
|
230 * nSize : Size of the structure in bytes |
|
231 * nVersion : OMX specification version information |
|
232 * nPortIndex : Port that this structure applies to |
|
233 * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 |
|
234 * produces the smallest, worst quality images, and a factor |
|
235 * of 100 produces the largest, best quality images. A |
|
236 * typical default is 75 for small good quality images |
|
237 */ |
|
238 typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { |
|
239 OMX_U32 nSize; |
|
240 OMX_VERSIONTYPE nVersion; |
|
241 OMX_U32 nPortIndex; |
|
242 OMX_U32 nQFactor; |
|
243 } OMX_IMAGE_PARAM_QFACTORTYPE; |
|
244 |
|
245 /** |
|
246 * Quantization table type |
|
247 */ |
|
248 |
|
249 typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { |
|
250 OMX_IMAGE_QuantizationTableLuma = 0, |
|
251 OMX_IMAGE_QuantizationTableChroma, |
|
252 OMX_IMAGE_QuantizationTableChromaCb, |
|
253 OMX_IMAGE_QuantizationTableChromaCr, |
|
254 OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
|
255 OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
|
256 OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF |
|
257 } OMX_IMAGE_QUANTIZATIONTABLETYPE; |
|
258 |
|
259 /** |
|
260 * JPEG quantization tables are used to determine DCT compression for |
|
261 * YUV data, as an alternative to specifying Q factor, providing exact |
|
262 * control of compression |
|
263 * |
|
264 * STRUCT MEMBERS: |
|
265 * nSize : Size of the structure in bytes |
|
266 * nVersion : OMX specification version information |
|
267 * nPortIndex : Port that this structure applies to |
|
268 * eQuantizationTable : Quantization table type |
|
269 * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored |
|
270 * in increasing columns then by rows of data (i.e. |
|
271 * row 1, ... row 8). Quantization values are in |
|
272 * the range 0-255 and stored in linear order |
|
273 * (i.e. the component will zig-zag the |
|
274 * quantization table data if required internally) |
|
275 */ |
|
276 typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { |
|
277 OMX_U32 nSize; |
|
278 OMX_VERSIONTYPE nVersion; |
|
279 OMX_U32 nPortIndex; |
|
280 OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; |
|
281 OMX_U8 nQuantizationMatrix[64]; |
|
282 } OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; |
|
283 |
|
284 |
|
285 /** |
|
286 * Huffman table type, the same Huffman table is applied for chroma and |
|
287 * luma component |
|
288 */ |
|
289 typedef enum OMX_IMAGE_HUFFMANTABLETYPE { |
|
290 OMX_IMAGE_HuffmanTableAC = 0, |
|
291 OMX_IMAGE_HuffmanTableDC, |
|
292 OMX_IMAGE_HuffmanTableACLuma, |
|
293 OMX_IMAGE_HuffmanTableACChroma, |
|
294 OMX_IMAGE_HuffmanTableDCLuma, |
|
295 OMX_IMAGE_HuffmanTableDCChroma, |
|
296 OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ |
|
297 OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ |
|
298 OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF |
|
299 } OMX_IMAGE_HUFFMANTABLETYPE; |
|
300 |
|
301 /** |
|
302 * JPEG Huffman table |
|
303 * |
|
304 * STRUCT MEMBERS: |
|
305 * nSize : Size of the structure in bytes |
|
306 * nVersion : OMX specification version information |
|
307 * nPortIndex : Port that this structure applies to |
|
308 * eHuffmanTable : Huffman table type |
|
309 * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each |
|
310 * possible length |
|
311 * nHuffmanTable[256] : 0-255, the size used for AC and DC |
|
312 * HuffmanTable are 16 and 162 |
|
313 */ |
|
314 typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { |
|
315 OMX_U32 nSize; |
|
316 OMX_VERSIONTYPE nVersion; |
|
317 OMX_U32 nPortIndex; |
|
318 OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; |
|
319 OMX_U8 nNumberOfHuffmanCodeOfLength[16]; |
|
320 OMX_U8 nHuffmanTable[256]; |
|
321 }OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; |
|
322 |
|
323 /** @} */ |
|
324 #ifdef __cplusplus |
|
325 } |
|
326 #endif /* __cplusplus */ |
|
327 |
|
328 #endif |
|
329 /* File EOF */ |
|