summaryrefslogtreecommitdiffstats
path: root/domx/omx_core/inc/OMX_TI_Common.h
blob: b39163fce75ab9445c2bb4acf341ccb8b89530f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
/*
 * Copyright (c) 2010, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 *  @file  omx_ti_common.h
 *
 *
 *  @path \OMAPSW_SysDev\multimedia\omx\khronos1_1\omx_core\inc
 *
 *  @rev 1.0
 */

/*==============================================================
 *! Revision History
 *! ============================
 *! 20-Dec-2008 x0052661@ti.com, initial version
 *================================================================*/

#ifndef _OMX_TI_COMMON_H_
#define _OMX_TI_COMMON_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/******************************************************************
 *   INCLUDE FILES
 ******************************************************************/
#include <OMX_Core.h>

/*******************************************************************
 * EXTERNAL REFERENCE NOTE: only use if not found in header file
 *******************************************************************/
/*----------         function prototypes      ------------------- */
/*----------         data declarations        ------------------- */
/*******************************************************************
 * PUBLIC DECLARATIONS: defined here, used elsewhere
 *******************************************************************/
/*----------         function prototypes      ------------------- */
/*----------         data declarations        ------------------- */
#define OMX_BUFFERHEADERFLAG_MODIFIED 0x00000100

#define OMX_TI_BUFFERFLAG_READONLY 0x00000200

/* TI extra data will be passed in the platform private structure rather than
 * appended at the end of the buffer. Adding a new custom flag to indicate
 * this.*/
#define OMX_TI_BUFFERFLAG_DETACHEDEXTRADATA 0x00000400

typedef struct OMX_CONFIG_CHANNELNAME {

	OMX_U32 nSize; /**< Size of the structure in bytes */
	OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
	OMX_U32 nPortIndex; /**< Index of the port */
	OMX_STRING cChannelName; /**< Channel name  */

} OMX_CONFIG_CHANNELNAME;

typedef struct OMX_TI_PLATFORMPRIVATE
{
	OMX_U32 nSize;
	OMX_PTR pExtendedPlatformPrivate;
	OMX_BOOL bReadViaCPU;
	OMX_BOOL bWriteViaCPU;
	OMX_PTR pMetaDataBuffer;
	OMX_U32 nMetaDataSize;
	OMX_PTR pAuxBuf1;
	OMX_U32 pAuxBufSize1;
}OMX_TI_PLATFORMPRIVATE;

/*===============================================================*/
/** OMX_TI_PARAM_BUFFERPREANNOUNCE    : This parameter is used to enable/disable
 *                                      buffer pre announcement. Buffer pre
 *                                      announcement is enabled by default i.e.
 *                                      if buffer is being allocated by client
 *                                      then the buffer ptrs will be made known
 *                                      to the component at the time of
 *                                      UseBuffer and these will not change in
 *                                      lifetime of the component. If pre
 *                                      announcement is disabled then new
 *                                      buffers can be allocated by the client
 *                                      at runtime and passed in ETB/FTB. This
 *                                      parameter is valid only in cases where
 *                                      client allocates the buffer
 *                                      (i.e. UseBuffer cases).
 *
 *  @ param nSize                     : Size of the structure.
 *  @ param nVersion                  : Version.
 *  @ param nPortIndex                : Port index on which the parameter will
 *                                      be applied.
 *  @ param bEnabled                  : Whether buffer pre announcement is
 *                                      enabled or not. Set to TRUE (enabled)
 *                                      by default.
 */
/*===============================================================*/
typedef struct OMX_TI_PARAM_BUFFERPREANNOUNCE
{
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnabled;
}OMX_TI_PARAM_BUFFERPREANNOUNCE;



/*===============================================================*/
/** OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE : This config is used to
 *                                           enable/disable notification when
 *                                           reference count of a buffer changes
 *                                           This happens usually when buffers
 *                                           are locked/unlocked by codecs. By
 *                                           DEFAULT all notifications are
 *                                           DISABLED.
 *
 *  @ param nSize                          : Size of the structure.
 *  @ param nVersion                       : Version.
 *  @ param nPortIndex                     : Port index on which the config will
 *                                           be applied.
 *  @param bNotifyOnIncrease              : Enable notification when reference
 *                                           count is increased.
 *  @ param bNotifyOnDecrease              : Enable notification when reference
 *                                           count is decreased.
 *  @ param nCountForNotification          : Count at which to trigger
 *                                           notification. Count indicates no.
 *                                           of copies of the buffer in
 *                                           circulation e.g.
 *                                           1 - Only the original buffer is in
 *                                               circulation i.e. no buffers are
 *                                               currently locked.
 *                                           2 - There are two copies of the
 *                                               buffer i.e. one original and
 *                                               one copy which has been locked
 *                                               by the codec.
 *                                           And so on
 *                                           SPECIAL CASE
 *                                           0 - Indicates notify always
 *                                               irrespective of count value.
 */
/*===============================================================*/
typedef struct OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE
{
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bNotifyOnIncrease;
    OMX_BOOL bNotifyOnDecrease;
    OMX_U32 nCountForNotification;
}OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE;





/* OMX_TI_SEVERITYTYPE enumeration is used to indicate severity level of errors returned by TI OpenMax components.
   Critcal      Requires reboot/reset DSP
   Severe       Have to unload components and free memory and try again
   Major        Can be handled without unloading the component
   Minor        Essentially informational
*/
typedef enum OMX_TI_SEVERITYTYPE {
    OMX_TI_ErrorCritical=1,
    OMX_TI_ErrorSevere,
    OMX_TI_ErrorMajor,
    OMX_TI_ErrorMinor
} OMX_TI_SEVERITYTYPE;

/* ============================================================================= */
/*
@brief OMX_TI_PARAM_METADATABUFFERINFO : Structure to access metadata buffer info needed
         by proxy to allocate metadat buffers.

*/
/* ============================================================================= */
typedef struct OMX_TI_PARAM_METADATABUFFERINFO {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bIsMetaDataEnabledOnPort;
    OMX_U32 nMetaDataSize;
} OMX_TI_PARAM_METADATABUFFERINFO;

/*===============================================================*/
/** OMX_TI_BUFFERTYPE                 : This enumberation defines the type of
 *                                      buffer that is exchanged with the OMX
 *                                      component port
 *
 *  OMX_TI_BufferTypeDefault          : Default buffer type accessed via a 
 *                                      single virtual address
 *  OMX_TI_BufferTypeVirtual2D        : Multiple virtual buffers describing a
 *                                      2D buffer
 *  OMX_TI_BufferTypePlatform1D       : Platform specific 1D buffer handle
 *  OMX_TI_BufferTypePlatform2D       : Platform specific buffer handles
 *                                      describing a 2D buffer
 *  OMX_TI_BufferTypePhysicalPageList : List of a given number of physical pages
 *  OMX_TI_BufferTypeHardwareReserved1D:Harware reserve space only that can
 *                                      accomodate a 1D buffer by mapping memory
 *                                      to it
 */
/*===============================================================*/
typedef enum OMX_TI_BUFFERTYPE {
    OMX_TI_BufferTypeDefault = 0,
    OMX_TI_BufferTypeVirtual2D,
    OMX_TI_BufferTypePlatform1D,
    OMX_TI_BufferTypePlatform2D,
    OMX_TI_BufferTypePhysicalPageList,
    OMX_TI_BufferTypeHardwareReserved1D,
    OMX_TI_BufferTypeMax = 0x7FFFFFFF
} OMX_TI_BUFFERTYPE;

/*===============================================================*/
/** OMX_TI_BUFFERDESCRIPTOR_TYPE      : This buffer descriptor structure is used
 *                                      to convey additional buffer information
 *                                      when OMX_TI_IndexUseBufferDescriptor is
 *                                      enabled and it is passed via pBuffer
 *                                      in OMX_BUFFERHEADERTYPE
 *
 *  @ param nSize                     : Size of the structure.
 *  @ param eBufType                  : Specifies type of buffer
 *  @ param nNumOfBuf                 : Number of component buffers of eBufType
 *  @ param pBuf                      : Array of buffers of type eBufType
 */
/*===============================================================*/
typedef struct OMX_TI_BUFFERDESCRIPTOR_TYPE {
    OMX_U32 nSize;
    OMX_TI_BUFFERTYPE eBufType;
    OMX_U32 nNumOfBuf;
    OMX_PTR pBuf[3];
} OMX_TI_BUFFERDESCRIPTOR_TYPE;

/*===============================================================*/
/** OMX_TI_PARAM_USEBUFFERDESCRIPTOR  : This parameter is used to enable/disable
 *                                      buffer descriptor mode. When enabled,
 *                                      the pBuffer in OMX buffer header points
 *                                      to a buffer descriptor structure
 *                                      OMX_TI_BUFFERDESCRIPTOR_TYPE instead of
 *                                      the buffer directly.
 *
 *  @ param nSize                     : Size of the structure.
 *  @ param nVersion                  : Version.
 *  @ param nPortIndex                : Port index on which the parameter will
 *                                      be applied.
 *  @ param bEnabled                  : Whether buffer descriptor mode is
 *                                      enabled or not. Set to FALSE (disabled)
 *                                      by default.
 */
/*===============================================================*/
typedef struct OMX_TI_PARAM_USEBUFFERDESCRIPTOR {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_BOOL bEnabled;
    OMX_TI_BUFFERTYPE eBufferType;
} OMX_TI_PARAM_USEBUFFERDESCRIPTOR;


/*===============================================================*/
/** OMX_TI_PARAM_COMPONENTBUFALLOCTYPE :This parameter is used to query/set
 *                                      internal buffers used by OMX component
 *                                      after allocation by the user of OMX
 *                                      component during regular OMX buffer
 *                                      allocation/free life cycle
 *
 *  @ param nSize                     : Size of the structure.
 *  @ param nVersion                  : Version.
 *  @ param nPortIndex                : Port index on which the parameter will
 *                                      be applied.
 *  @ param nIndex                    : Present buffer number whose requirement
 *                                      is queried and then set
 *  @ param eBufType                  : Present nIndex'ed buffer type
 *  @ param pBuf                      : Buffer communication
 *  @ param nAllocWidth               : Size of buffer (Width in case of 2D)
 *  @ param nAllocLines               : Size of buffer (1 in case of 1D)
 *  @ param nOffset                   : Offset from which buffer communicated is
 *                                      valid
 */
/*===============================================================*/
typedef struct OMX_TI_PARAM_COMPONENTBUFALLOCTYPE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_U32 nPortIndex;
    OMX_U32 nIndex;
    OMX_TI_BUFFERTYPE eBufType;
    OMX_PTR pBuf[3];
    OMX_U32 nAllocWidth;
    OMX_U32 nAllocLines;
    OMX_U32 nOffset;
} OMX_TI_PARAM_COMPONENTBUFALLOCTYPE;

/*===============================================================*/
/** OMX_TI_COMPONENT_HANDLE           : This parameter is used to retrieve
 *                                      the component handle by the client.
 *
 *  @ param nSize                     : Size of the structure.
 *  @ param nVersion                  : Version.
 *  @ param pHandle                   : Component Handle
 */
/*===============================================================*/
typedef struct OMX_TI_COMPONENT_HANDLE {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
    OMX_HANDLETYPE pHandle;
} OMX_TI_COMPONENT_HANDLE;

/*******************************************************************
 * PRIVATE DECLARATIONS: defined here, used only here
 *******************************************************************/
/*----------          data declarations        ------------------- */
/*----------          function prototypes      ------------------- */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _OMX_TI_COMMON_H_ */