OMX_TI_Common.h revision c322989ae6ff6769490828de1b5eda12b749cce9
1/*
2 * Copyright (c) 2010, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * *  Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions and the following disclaimer.
11 *
12 * *  Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * *  Neither the name of Texas Instruments Incorporated nor the names of
17 *    its contributors may be used to endorse or promote products derived
18 *    from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33/**
34 *  @file  omx_ti_common.h
35 *
36 *
37 *  @path \OMAPSW_SysDev\multimedia\omx\khronos1_1\omx_core\inc
38 *
39 *  @rev 1.0
40 */
41
42/*==============================================================
43 *! Revision History
44 *! ============================
45 *! 20-Dec-2008 x0052661@ti.com, initial version
46 *================================================================*/
47
48#ifndef _OMX_TI_COMMON_H_
49#define _OMX_TI_COMMON_H_
50
51#ifdef __cplusplus
52extern "C" {
53#endif /* __cplusplus */
54
55/******************************************************************
56 *   INCLUDE FILES
57 ******************************************************************/
58#include <OMX_Core.h>
59
60/*******************************************************************
61 * EXTERNAL REFERENCE NOTE: only use if not found in header file
62 *******************************************************************/
63/*----------         function prototypes      ------------------- */
64/*----------         data declarations        ------------------- */
65/*******************************************************************
66 * PUBLIC DECLARATIONS: defined here, used elsewhere
67 *******************************************************************/
68/*----------         function prototypes      ------------------- */
69/*----------         data declarations        ------------------- */
70#define OMX_BUFFERHEADERFLAG_MODIFIED 0x00000100
71
72#define OMX_TI_BUFFERFLAG_READONLY 0x00000200
73
74/* TI extra data will be passed in the platform private structure rather than
75 * appended at the end of the buffer. Adding a new custom flag to indicate
76 * this.*/
77#define OMX_TI_BUFFERFLAG_DETACHEDEXTRADATA 0x00000400
78
79typedef struct OMX_CONFIG_CHANNELNAME {
80
81	OMX_U32 nSize; /**< Size of the structure in bytes */
82	OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
83	OMX_U32 nPortIndex; /**< Index of the port */
84	OMX_STRING cChannelName; /**< Channel name  */
85
86} OMX_CONFIG_CHANNELNAME;
87
88typedef struct OMX_TI_PLATFORMPRIVATE
89{
90	OMX_U32 nSize;
91	OMX_PTR pExtendedPlatformPrivate;
92	OMX_BOOL bReadViaCPU;
93	OMX_BOOL bWriteViaCPU;
94	OMX_PTR pMetaDataBuffer;
95	OMX_U32 nMetaDataSize;
96	OMX_PTR pAuxBuf1;
97	OMX_U32 pAuxBufSize1;
98}OMX_TI_PLATFORMPRIVATE;
99
100/*===============================================================*/
101/** OMX_TI_PARAM_BUFFERPREANNOUNCE    : This parameter is used to enable/disable
102 *                                      buffer pre announcement. Buffer pre
103 *                                      announcement is enabled by default i.e.
104 *                                      if buffer is being allocated by client
105 *                                      then the buffer ptrs will be made known
106 *                                      to the component at the time of
107 *                                      UseBuffer and these will not change in
108 *                                      lifetime of the component. If pre
109 *                                      announcement is disabled then new
110 *                                      buffers can be allocated by the client
111 *                                      at runtime and passed in ETB/FTB. This
112 *                                      parameter is valid only in cases where
113 *                                      client allocates the buffer
114 *                                      (i.e. UseBuffer cases).
115 *
116 *  @ param nSize                     : Size of the structure.
117 *  @ param nVersion                  : Version.
118 *  @ param nPortIndex                : Port index on which the parameter will
119 *                                      be applied.
120 *  @ param bEnabled                  : Whether buffer pre announcement is
121 *                                      enabled or not. Set to TRUE (enabled)
122 *                                      by default.
123 */
124/*===============================================================*/
125typedef struct OMX_TI_PARAM_BUFFERPREANNOUNCE
126{
127    OMX_U32 nSize;
128    OMX_VERSIONTYPE nVersion;
129    OMX_U32 nPortIndex;
130    OMX_BOOL bEnabled;
131}OMX_TI_PARAM_BUFFERPREANNOUNCE;
132
133
134
135/*===============================================================*/
136/** OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE : This config is used to
137 *                                           enable/disable notification when
138 *                                           reference count of a buffer changes
139 *                                           This happens usually when buffers
140 *                                           are locked/unlocked by codecs. By
141 *                                           DEFAULT all notifications are
142 *                                           DISABLED.
143 *
144 *  @ param nSize                          : Size of the structure.
145 *  @ param nVersion                       : Version.
146 *  @ param nPortIndex                     : Port index on which the config will
147 *                                           be applied.
148 *  @param bNotifyOnIncrease              : Enable notification when reference
149 *                                           count is increased.
150 *  @ param bNotifyOnDecrease              : Enable notification when reference
151 *                                           count is decreased.
152 *  @ param nCountForNotification          : Count at which to trigger
153 *                                           notification. Count indicates no.
154 *                                           of copies of the buffer in
155 *                                           circulation e.g.
156 *                                           1 - Only the original buffer is in
157 *                                               circulation i.e. no buffers are
158 *                                               currently locked.
159 *                                           2 - There are two copies of the
160 *                                               buffer i.e. one original and
161 *                                               one copy which has been locked
162 *                                               by the codec.
163 *                                           And so on
164 *                                           SPECIAL CASE
165 *                                           0 - Indicates notify always
166 *                                               irrespective of count value.
167 */
168/*===============================================================*/
169typedef struct OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE
170{
171    OMX_U32 nSize;
172    OMX_VERSIONTYPE nVersion;
173    OMX_U32 nPortIndex;
174    OMX_BOOL bNotifyOnIncrease;
175    OMX_BOOL bNotifyOnDecrease;
176    OMX_U32 nCountForNotification;
177}OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE;
178
179
180
181
182
183/* OMX_TI_SEVERITYTYPE enumeration is used to indicate severity level of errors returned by TI OpenMax components.
184   Critcal      Requires reboot/reset DSP
185   Severe       Have to unload components and free memory and try again
186   Major        Can be handled without unloading the component
187   Minor        Essentially informational
188*/
189typedef enum OMX_TI_SEVERITYTYPE {
190    OMX_TI_ErrorCritical=1,
191    OMX_TI_ErrorSevere,
192    OMX_TI_ErrorMajor,
193    OMX_TI_ErrorMinor
194} OMX_TI_SEVERITYTYPE;
195
196/* ============================================================================= */
197/*
198@brief OMX_TI_PARAM_METADATABUFFERINFO : Structure to access metadata buffer info needed
199         by proxy to allocate metadat buffers.
200
201*/
202/* ============================================================================= */
203typedef struct OMX_TI_PARAM_METADATABUFFERINFO {
204    OMX_U32 nSize;
205    OMX_VERSIONTYPE nVersion;
206    OMX_U32 nPortIndex;
207    OMX_BOOL bIsMetaDataEnabledOnPort;
208    OMX_U32 nMetaDataSize;
209} OMX_TI_PARAM_METADATABUFFERINFO;
210
211/*******************************************************************
212 * PRIVATE DECLARATIONS: defined here, used only here
213 *******************************************************************/
214/*----------          data declarations        ------------------- */
215/*----------          function prototypes      ------------------- */
216
217#ifdef __cplusplus
218}
219#endif /* __cplusplus */
220
221#endif /* _OMX_TI_COMMON_H_ */
222