1/*--------------------------------------------------------------------------
2Copyright (c) 2011 The Linux Foundation. All rights reserved.
3
4Redistribution and use in source and binary forms, with or without
5modification, are permitted provided that the following conditions are 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 copyright
9      notice, this list of conditions and the following disclaimer in the
10      documentation and/or other materials provided with the distribution.
11    * Neither the name of The Linux Foundation nor
12      the names of its contributors may be used to endorse or promote
13      products derived from this software without specific prior written
14      permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27--------------------------------------------------------------------------*/
28
29#ifndef __H_QOMX_COREEXTENSIONS_H__
30#define __H_QOMX_COREEXTENSIONS_H__
31
32
33
34/*========================================================================
35
36                     INCLUDE FILES FOR MODULE
37
38========================================================================== */
39#include <OMX_Core.h>
40
41/*========================================================================
42
43                      DEFINITIONS AND DECLARATIONS
44
45========================================================================== */
46
47#if defined( __cplusplus )
48extern "C"
49{
50#endif /* end of macro __cplusplus */
51
52/**
53 * Qualcom vendor extensions.
54 */
55#define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData" /**< reference: QOMX_INDEXEXTRADATATYPE */
56#define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */
57
58/**
59 * Buffer header nFlags field extension.
60 *
61 * The source of a stream sets the TIMESTAMPINVALID flag to
62 * indicate that the buffer header nTimeStamp field does not
63 * hold valid timestamp information. The component that updates
64 * the nTimeStamp field to reflect a valid timestamp shall clear
65 * this flag.
66 */
67#define QOMX_BUFFERFLAG_TIMESTAMPINVALID 0x80000000
68
69/**
70 * Buffer header nFlags field extension.
71 *
72 * The READONLY flag is set when the component emitting the
73 * buffer on an output port identifies the buffer's contents to
74 * be read-only. The IL client or input port that receives a
75 * filled read-only buffer cannot alter the contents of the
76 * buffer. This flag can be cleared by the component when the
77 * emptied buffer is returned to it.
78 */
79#define QOMX_BUFFERFLAG_READONLY         0x40000000
80
81/**
82 * Buffer header nFlags field extension.
83 *
84 * The ENDOFSUBFRAME flag is an optional flag that is set by an
85 * output port when the last byte that a buffer payload contains
86 * is an end-of-subframe. Any component that implements setting
87 * the ENDOFSUBFRAME flag on an output port shall set this flag
88 * for every buffer sent from the output port containing an
89 * end-of-subframe.
90 *
91 * A subframe is defined by the next level of natural
92 * partitioning in a logical unit for a given format. For
93 * example, a subframe in an H.264 access unit is defined as the
94 * "network abstraction layer" unit, or NAL unit.
95 */
96#define QOMX_BUFFERFLAG_ENDOFSUBFRAME    0x20000000
97
98/**
99 * A component sends this error to the IL client (via the EventHandler callback)
100 * in the event that application of a config or parameter has failed some time
101 * after the return of OMX_SetConfig or OMX_SetParameter. This may happen when a
102 * component transitions between states and discovers some incompatibility
103 * between multiple settings. Configuration indicies sent via extra data may also
104 * fail when set to a down stream component. The index that failed will be
105 * included as the nData2 parameter of the EventHandler callback.
106 */
107#define QOMX_ErrorAsyncIndexFailed (OMX_ErrorVendorStartUnused+1)
108
109/* In some scenarios there may be a possibilty to run out of the storage space
110 * and components may want to notify this error to IL client to take appropriate
111 * action by the IL client.
112 *
113 * For example, In recording scenario, MUX component can know the available
114 * space in the recording media and can compute peridically to accommodate the
115 * meta data before we reach to a stage where we end up no space to write even
116 * the meta data. When the space limit reached in recording media, MUX component
117 * would like to notify the IL client with  QOMX_ErrorSpaceLimitReached.
118 * After this error all the buffers that are returned will have nFilledLen
119 * unchanges i.e not consumed.
120 */
121#define QOMX_ErrorStorageLimitReached (OMX_ErrorVendorStartUnused + 2)
122
123/**
124 * This structure is used to enable/disable the generation or
125 * consumption of the QOMX_ExtraDataOMXIndex extra data type for
126 * the specified OpenMax index.
127 *
128 * STRUCT MEMBERS:
129 *  nSize      : Size of the structure in bytes
130 *  nVersion   : OMX specification version info
131 *  nPortIndex : Port that this structure applies to
132 *  bEnabled   : Enable/Disable the extra data processing
133 *  nIndex     : The index associated with the extra data
134 */
135typedef struct QOMX_INDEXEXTRADATATYPE {
136    OMX_U32 nSize;
137    OMX_VERSIONTYPE nVersion;
138    OMX_U32 nPortIndex;
139    OMX_BOOL bEnabled;
140    OMX_INDEXTYPE nIndex;
141} QOMX_INDEXEXTRADATATYPE;
142
143/**
144 * This structure is used to indicate the maximum number of buffers
145 * that a port will hold during data flow.
146 *
147 * STRUCT MEMBERS:
148 *  nSize              : Size of the structure in bytes
149 *  nVersion           : OMX specification version info
150 *  nPortIndex         : Port that this structure applies to
151 *  nHeldBufferCount   : Read-only, maximum number of buffers that will be held
152 */
153typedef struct QOMX_HELDBUFFERCOUNTTYPE {
154    OMX_U32 nSize;
155    OMX_VERSIONTYPE nVersion;
156    OMX_U32 nPortIndex;
157    OMX_U32 nHeldBufferCount;
158} QOMX_HELDBUFFERCOUNTTYPE;
159
160#if defined( __cplusplus )
161}
162#endif /* end of macro __cplusplus */
163
164#endif /* end of macro __H_QOMX_COREEXTENSIONS_H__ */
165