• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 
3 Redistribution and use in source and binary forms, with or without
4 modification, are permitted provided that the following conditions are
5 met:
6     * Redistributions of source code must retain the above copyright
7       notice, this list of conditions and the following disclaimer.
8     * Redistributions in binary form must reproduce the above
9       copyright notice, this list of conditions and the following
10       disclaimer in the documentation and/or other materials provided
11       with the distribution.
12     * Neither the name of The Linux Foundation nor the names of its
13       contributors may be used to endorse or promote products derived
14       from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
27 
28 #ifndef __QOMX_EXTENSIONS_H__
29 #define __QOMX_EXTENSIONS_H__
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <OMX_Image.h>
36 #include <qexif.h>
37 
38 /** qomx_image_eventd
39 *  Qcom specific events extended from OMX_EVENT
40 *  @ OMX_EVENT_THUMBNAIL_DROPPED - Indicates that the thumbnail
41 *                                 size id too big to be included
42 *                                 in the exif and will be
43 *                                 dropped
44 **/
45 typedef enum {
46  OMX_EVENT_THUMBNAIL_DROPPED = OMX_EventVendorStartUnused+1
47 } QOMX_IMAGE_EXT_EVENTS;
48 
49 /**
50 *  The following macros defines the string to be used for
51 *  getting the extension indices.
52 **/
53 #define QOMX_IMAGE_EXT_EXIF_NAME                  "OMX.QCOM.image.exttype.exif"
54 #define QOMX_IMAGE_EXT_THUMBNAIL_NAME        "OMX.QCOM.image.exttype.thumbnail"
55 #define QOMX_IMAGE_EXT_BUFFER_OFFSET_NAME "OMX.QCOM.image.exttype.bufferOffset"
56 #define QOMX_IMAGE_EXT_MOBICAT_NAME            "OMX.QCOM.image.exttype.mobicat"
57 #define QOMX_IMAGE_EXT_ENCODING_MODE_NAME        "OMX.QCOM.image.encoding.mode"
58 #define QOMX_IMAGE_EXT_WORK_BUFFER_NAME      "OMX.QCOM.image.exttype.workbuffer"
59 
60 /** QOMX_IMAGE_EXT_INDEXTYPE
61 *  This enum is an extension of the OMX_INDEXTYPE enum and
62 *  specifies Qcom supported extention indexes. These indexes are
63 *  associated with the extension names and can be used as
64 *  Indexes in the SetParameter and Getparameter functins to set
65 *  or get values from qcom specific data structures
66 **/
67 typedef enum {
68   //Name: OMX.QCOM.image.exttype.exif
69   QOMX_IMAGE_EXT_EXIF = 0x07F00000,
70 
71   //Name: OMX.QCOM.image.exttype.thumbnail
72   QOMX_IMAGE_EXT_THUMBNAIL = 0x07F00001,
73 
74   //Name: OMX.QCOM.image.exttype.bufferOffset
75   QOMX_IMAGE_EXT_BUFFER_OFFSET = 0x07F00002,
76 
77   //Name: OMX.QCOM.image.exttype.mobicat
78   QOMX_IMAGE_EXT_MOBICAT = 0x07F00003,
79 
80   //Name: OMX.QCOM.image.encoding.approach
81   QOMX_IMAGE_EXT_ENCODING_MODE = 0x07F00004,
82 
83   //Name: OMX.QCOM.image.exttype.workbuffer
84   QOMX_IMAGE_EXT_WORK_BUFFER = 0x07F00004,
85 
86 } QOMX_IMAGE_EXT_INDEXTYPE;
87 
88 /** QOMX_BUFFER_INFO
89 *  The structure specifies informaton
90 *   associated with the buffers and should be passed as appData
91 *   in UseBuffer calls to the OMX component with buffer specific
92 *   data. @ fd - FD of the buffer allocated. If the buffer is
93 *          allocated on the heap, it can be zero.
94 *   @offset - Buffer offset
95 **/
96 
97 typedef struct {
98   OMX_U32 fd;
99   OMX_U32 offset;
100 } QOMX_BUFFER_INFO;
101 
102 /** QEXIF_INFO_DATA
103 *   The basic exif structure used to construct
104 *   information for a single exif tag.
105 *   @tag_entry
106 *   @tag_id
107 **/
108 typedef struct{
109   exif_tag_entry_t tag_entry;
110   exif_tag_id_t tag_id;
111 } QEXIF_INFO_DATA;
112 
113 /**QOMX_EXIF_INFO
114 *  The structure contains an array of exif tag
115 *  structures(qexif_info_data) and should be passed to the OMX
116 *  layer by the OMX client using the extension index.
117 *  @exif_data - Array of exif tags
118 *  @numOfEntries - Number of exif tags entries being passed in
119 *                 the array
120 **/
121 typedef struct {
122   QEXIF_INFO_DATA *exif_data;
123   OMX_U32 numOfEntries;
124 } QOMX_EXIF_INFO;
125 
126 /**QOMX_YUV_FRAME_INFO
127 *  The structre contains all the offsets
128 *  associated with the Y and cbcr buffers.
129 *  @yOffset - Offset within the Y buffer
130 *  @cbcrOffset - Offset within the cb/cr buffer. The array
131 *                should be populated in order depending on cb
132 *                first or cr first in case of planar data. For
133 *                pseusoplanar, only the first array element
134 *                needs to be filled and the secnd element should
135 *                be set to zero.
136 *  @cbcrStartOffset - Start offset of the cb/cr buffer starting
137 *                     starting from the Y buffer. The array
138 *                     should be populated in order depending on
139 *                     cb first or cr first in case of planar
140 *                     data. For pseusoplanar, only the first
141 *                     array element needs to be filled and the
142 *                     secnd element should be set to zero.
143 **/
144 typedef struct {
145   OMX_U32 yOffset;
146   OMX_U32 cbcrOffset[2];
147   OMX_U32 cbcrStartOffset[2];
148 } QOMX_YUV_FRAME_INFO;
149 
150 /** qomx_thumbnail_info
151 *  Includes all information associated with the thumbnail
152 *  @input_width - Width of the input thumbnail buffer
153 *  @input_height - Heighr of the input thumbnail buffer
154 *  @scaling_enabled - Flag indicating if thumbnail scaling is
155 *  enabled.
156 *  @crop_info - Includes the crop width, crop height,
157 *               horizontal and vertical offsets.
158 *  @output_width - Output Width of the the thumbnail. This is
159 *                the width after scaling if scaling is enabled
160 *                or width after cropping if only cropping is
161 *                enabled or same same input width otherwise
162 *  @output_height - Output height of the thumbnail. This is
163 *                the height after scaling if scaling is enabled
164 *                or height after cropping if only cropping is
165 *                enabled or same same input height otherwise
166 **/
167 typedef struct {
168   OMX_U32 input_width;
169   OMX_U32 input_height;
170   OMX_U8 scaling_enabled;
171   OMX_CONFIG_RECTTYPE crop_info;
172   OMX_U32 output_width;
173   OMX_U32 output_height;
174   QOMX_YUV_FRAME_INFO tmbOffset;
175 } QOMX_THUMBNAIL_INFO;
176 
177 /**qomx_mobicat
178 *  Mobicat data to padded tot he OMX layer
179 *  @mobicatData - Mobicate data
180 *  @mobicatDataLength - length of the mobicat data
181 **/
182 typedef struct {
183   OMX_U8 *mobicatData;
184   OMX_U32 mobicatDataLength;
185 } QOMX_MOBICAT;
186 
187 /**qomx_workbuffer
188 *  Ion buffer to be used for the H/W encoder
189 *  @fd - FD of the buffer allocated
190 *  @vaddr - Buffer address
191 **/
192 typedef struct {
193   int fd;
194   uint8_t *vaddr;
195 } QOMX_WORK_BUFFER;
196 
197 /** QOMX_IMG_COLOR_FORMATTYPE
198 *  This enum is an extension of the OMX_COLOR_FORMATTYPE enum.
199 *  It specifies Qcom supported color formats.
200 **/
201 typedef enum QOMX_IMG_COLOR_FORMATTYPE {
202   OMX_QCOM_IMG_COLOR_FormatYVU420SemiPlanar = OMX_COLOR_FormatVendorStartUnused + 0x300,
203   OMX_QCOM_IMG_COLOR_FormatYVU422SemiPlanar,
204   OMX_QCOM_IMG_COLOR_FormatYVU422SemiPlanar_h1v2,
205   OMX_QCOM_IMG_COLOR_FormatYUV422SemiPlanar_h1v2,
206   OMX_QCOM_IMG_COLOR_FormatYVU444SemiPlanar,
207   OMX_QCOM_IMG_COLOR_FormatYUV444SemiPlanar,
208   OMX_QCOM_IMG_COLOR_FormatYVU420Planar,
209   OMX_QCOM_IMG_COLOR_FormatYVU422Planar,
210   OMX_QCOM_IMG_COLOR_FormatYVU422Planar_h1v2,
211   OMX_QCOM_IMG_COLOR_FormatYUV422Planar_h1v2,
212   OMX_QCOM_IMG_COLOR_FormatYVU444Planar,
213   OMX_QCOM_IMG_COLOR_FormatYUV444Planar
214 } QOMX_IMG_COLOR_FORMATTYPE;
215 
216 /** QOMX_ENCODING_MODE
217 *  This enum is used to select parallel encoding
218 *  or sequential encoding for the thumbnail and
219 *  main image
220 **/
221 typedef enum {
222   OMX_Serial_Encoding,
223   OMX_Parallel_Encoding
224 } QOMX_ENCODING_MODE;
225 
226 #ifdef __cplusplus
227  }
228 #endif
229 
230 #endif
231