video: added OMX_IndexVendorGetBufferFD support
[GitHub/LineageOS/android_hardware_samsung_slsi_openmax.git] / include / exynos / Exynos_OMX_Def.h
CommitLineData
c6f4bc34
YK
1/*
2 *
3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * @file Exynos_OMX_Def.h
20 * @brief Exynos_OMX specific define
21 * @author SeungBeom Kim (sbcrux.kim@samsung.com)
22 * @version 2.0.0
23 * @history
24 * 2012.02.20 : Create
25 */
26
27#ifndef EXYNOS_OMX_DEF
28#define EXYNOS_OMX_DEF
29
30#include "OMX_Types.h"
31#include "OMX_IVCommon.h"
32
33#define VERSIONMAJOR_NUMBER 1
34#define VERSIONMINOR_NUMBER 0
35#define REVISION_NUMBER 0
36#define STEP_NUMBER 0
37
38
39#define MAX_OMX_COMPONENT_NUM 20
40#define MAX_OMX_COMPONENT_ROLE_NUM 10
41#define MAX_OMX_COMPONENT_NAME_SIZE OMX_MAX_STRINGNAME_SIZE
42#define MAX_OMX_COMPONENT_ROLE_SIZE OMX_MAX_STRINGNAME_SIZE
43#define MAX_OMX_COMPONENT_LIBNAME_SIZE OMX_MAX_STRINGNAME_SIZE * 2
44#define MAX_OMX_MIMETYPE_SIZE OMX_MAX_STRINGNAME_SIZE
45
46#define MAX_TIMESTAMP 40
47#define MAX_FLAGS 40
48
49#define MAX_BUFFER_PLANE 3
50
51#define EXYNOS_OMX_INSTALL_PATH "/system/lib/omx/"
52
53typedef enum _EXYNOS_CODEC_TYPE
54{
55 SW_CODEC,
56 HW_VIDEO_DEC_CODEC,
57 HW_VIDEO_ENC_CODEC,
58 HW_AUDIO_DEC_CODEC,
59 HW_AUDIO_ENC_CODEC
60} EXYNOS_CODEC_TYPE;
61
62typedef struct _EXYNOS_OMX_PRIORITYMGMTTYPE
63{
64 OMX_U32 nGroupPriority; /* the value 0 represents the highest priority */
65 /* for a group of components */
66 OMX_U32 nGroupID;
67} EXYNOS_OMX_PRIORITYMGMTTYPE;
68
c31a957e
TK
69typedef struct _EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE {
70 OMX_U32 nSize;
71 OMX_VERSIONTYPE nVersion;
72 OMX_U32 nPortIndex;
73 OMX_BOOL bNeedContigMem;
74} EXYNOS_OMX_VIDEO_PARAM_PORTMEMTYPE;
75
ea1234c8
TK
76typedef struct _EXYNOS_OMX_VIDEO_CONFIG_BUFFERINFO {
77 OMX_U32 nSize;
78 OMX_VERSIONTYPE nVersion;
79 OMX_PTR OMX_IN pVirAddr;
80 OMX_S32 OMX_OUT fd;
81} EXYNOS_OMX_VIDEO_CONFIG_BUFFERINFO;
82
c6f4bc34
YK
83typedef enum _EXYNOS_OMX_INDEXTYPE
84{
85#define EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL "OMX.SEC.index.ThumbnailMode"
86 OMX_IndexVendorThumbnailMode = 0x7F000001,
87#define EXYNOS_INDEX_CONFIG_VIDEO_INTRAPERIOD "OMX.SEC.index.VideoIntraPeriod"
88 OMX_IndexConfigVideoIntraPeriod = 0x7F000002,
064c4768
SKR
89#ifdef USE_S3D_SUPPORT
90#define EXYNOS_INDEX_PARAM_GET_S3D "OMX.SEC.index.S3DMode"
91 OMX_IndexVendorS3DMode = 0x7F000003,
92#endif
c31a957e
TK
93#define EXYNOS_INDEX_PARAM_NEED_CONTIG_MEMORY "OMX.SEC.index.NeedContigMemory"
94 OMX_IndexVendorNeedContigMemory = 0x7F000004,
ea1234c8
TK
95#define EXYNOS_INDEX_CONFIG_GET_BUFFER_FD "OMX.SEC.index.GetBufferFD"
96 OMX_IndexVendorGetBufferFD = 0x7F000005,
c6f4bc34
YK
97
98 /* for Android Native Window */
99#define EXYNOS_INDEX_PARAM_ENABLE_ANB "OMX.google.android.index.enableAndroidNativeBuffers"
100 OMX_IndexParamEnableAndroidBuffers = 0x7F000011,
101#define EXYNOS_INDEX_PARAM_GET_ANB "OMX.google.android.index.getAndroidNativeBufferUsage"
102 OMX_IndexParamGetAndroidNativeBuffer = 0x7F000012,
103#define EXYNOS_INDEX_PARAM_USE_ANB "OMX.google.android.index.useAndroidNativeBuffer"
104 OMX_IndexParamUseAndroidNativeBuffer = 0x7F000013,
105 /* for Android Store Metadata Inbuffer */
106#define EXYNOS_INDEX_PARAM_STORE_METADATA_BUFFER "OMX.google.android.index.storeMetaDataInBuffers"
107 OMX_IndexParamStoreMetaDataBuffer = 0x7F000014,
d2ab55ed
JY
108 /* prepend SPS/PPS to I/IDR for H.264 Encoder */
109#define EXYNOS_INDEX_PARAM_PREPEND_SPSPPS_TO_IDR "OMX.google.android.index.prependSPSPPSToIDRFrames"
110 OMX_IndexParamPrependSPSPPSToIDR = 0x7F000015,
c6f4bc34
YK
111
112 /* for Android PV OpenCore*/
113 OMX_COMPONENT_CAPABILITY_TYPE_INDEX = 0xFF7A347
114} EXYNOS_OMX_INDEXTYPE;
115
116typedef enum _EXYNOS_OMX_ERRORTYPE
117{
118 OMX_ErrorNoEOF = (OMX_S32) 0x90000001,
119 OMX_ErrorInputDataDecodeYet = (OMX_S32) 0x90000002,
120 OMX_ErrorInputDataEncodeYet = (OMX_S32) 0x90000003,
121 OMX_ErrorCodecInit = (OMX_S32) 0x90000004,
122 OMX_ErrorCodecDecode = (OMX_S32) 0x90000005,
123 OMX_ErrorCodecEncode = (OMX_S32) 0x90000006,
124 OMX_ErrorCodecFlush = (OMX_S32) 0x90000007,
b907369f
TK
125 OMX_ErrorOutputBufferUseYet = (OMX_S32) 0x90000008,
126 OMX_ErrorCorruptedFrame = (OMX_S32) 0x90000009
c6f4bc34
YK
127} EXYNOS_OMX_ERRORTYPE;
128
129typedef enum _EXYNOS_OMX_COMMANDTYPE
130{
131 EXYNOS_OMX_CommandComponentDeInit = 0x7F000001,
132 EXYNOS_OMX_CommandEmptyBuffer,
133 EXYNOS_OMX_CommandFillBuffer,
134 EXYNOS_OMX_CommandFakeBuffer
135} EXYNOS_OMX_COMMANDTYPE;
136
137typedef enum _EXYNOS_OMX_TRANS_STATETYPE {
138 EXYNOS_OMX_TransStateInvalid,
139 EXYNOS_OMX_TransStateLoadedToIdle,
140 EXYNOS_OMX_TransStateIdleToExecuting,
141 EXYNOS_OMX_TransStateExecutingToIdle,
142 EXYNOS_OMX_TransStateIdleToLoaded,
143 EXYNOS_OMX_TransStateMax = 0X7FFFFFFF
144} EXYNOS_OMX_TRANS_STATETYPE;
145
146typedef enum _EXYNOS_OMX_COLOR_FORMATTYPE {
147 OMX_SEC_COLOR_FormatNV12TPhysicalAddress = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */
148 OMX_SEC_COLOR_FormatNV12LPhysicalAddress = 0x7F000002,
149 OMX_SEC_COLOR_FormatNV12LVirtualAddress = 0x7F000003,
150 OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002, /* 0x7FC00002 */
151 OMX_SEC_COLOR_FormatNV21LPhysicalAddress = 0x7F000010,
152 OMX_SEC_COLOR_FormatNV21Linear = 0x7F000011,
153
154 /* to copy a encoded data for drm component using gsc or fimc */
155 OMX_SEC_COLOR_FormatEncodedData = OMX_COLOR_FormatYCbYCr,
1fb99dbf 156#ifdef USE_KHRONOS_OMX_HEADER
c6f4bc34
YK
157 /* for Android SurfaceMediaSource*/
158 OMX_COLOR_FormatAndroidOpaque = 0x7F000789
1fb99dbf 159#endif
c6f4bc34
YK
160}EXYNOS_OMX_COLOR_FORMATTYPE;
161
162typedef enum _EXYNOS_OMX_SUPPORTFORMAT_TYPE
163{
164 supportFormat_0 = 0x00,
165 supportFormat_1,
166 supportFormat_2,
167 supportFormat_3,
168 supportFormat_4,
169 supportFormat_5,
170 supportFormat_6,
171 supportFormat_7
172} EXYNOS_OMX_SUPPORTFORMAT_TYPE;
173
174typedef enum _EXYNOS_OMX_BUFFERPROCESS_TYPE
175{
176 BUFFER_DEFAULT = 0x00,
177 BUFFER_COPY = 0x01,
178 BUFFER_SHARE = 0x02,
179 BUFFER_METADATA = 0x04,
180 BUFFER_ANBSHARE = 0x08
181} EXYNOS_OMX_BUFFERPROCESS_TYPE;
182
183typedef struct _EXYNOS_OMX_VIDEO_PROFILELEVEL
184{
185 OMX_S32 profile;
186 OMX_S32 level;
187} EXYNOS_OMX_VIDEO_PROFILELEVEL;
188
064c4768
SKR
189#ifdef USE_S3D_SUPPORT
190typedef enum _EXYNOS_OMX_FPARGMT_TYPE
191{
192 OMX_SEC_FPARGMT_CHECKERBRD_INTERL = 0x00,
193 OMX_SEC_FPARGMT_COLUMN_INTERL = 0x01,
194 OMX_SEC_FPARGMT_ROW_INTERL = 0x02,
195 OMX_SEC_FPARGMT_SIDE_BY_SIDE = 0x03,
196 OMX_SEC_FPARGMT_TOP_BOTTOM = 0x04,
197 OMX_SEC_FPARGMT_TEMPORAL_INTERL = 0x05,
198 OMX_SEC_FPARGMT_NONE = 0x0A
199} EXYNOS_OMX_FPARGMT_TYPE;
200#endif
201
31e78666
TK
202typedef enum _EXYNOS_OMX_EVENTTYPE
203{
204 OMX_EventVendorStart = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
205#ifdef USE_S3D_SUPPORT
206 OMX_EventS3DInformation,
207#endif
208} EXYNOS_OMX_EVENTTYPE;
209
1fb99dbf 210#ifdef USE_KHRONOS_OMX_HEADER
c6f4bc34 211#define OMX_VIDEO_CodingVPX 0x09 /**< Google VPX, formerly known as On2 VP8 */
1fb99dbf 212#endif
c6f4bc34
YK
213
214#ifndef __OMX_EXPORTS
215#define __OMX_EXPORTS
216#define EXYNOS_EXPORT_REF __attribute__((visibility("default")))
217#define EXYNOS_IMPORT_REF __attribute__((visibility("default")))
218#endif
219
220#endif