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 #define MAX_BUFFER_REF       40
49 
50 #define MAX_BUFFER_PLANE     3
51 
52 #define EXYNOS_OMX_INSTALL_PATH "/system/lib/omx/"
53 
54 typedef enum _EXYNOS_CODEC_TYPE
55 {
56     SW_CODEC,
57     HW_VIDEO_DEC_CODEC,
58     HW_VIDEO_ENC_CODEC,
59     HW_AUDIO_DEC_CODEC,
60     HW_AUDIO_ENC_CODEC
61 } EXYNOS_CODEC_TYPE;
62 
63 typedef struct _EXYNOS_OMX_PRIORITYMGMTTYPE
64 {
65     OMX_U32 nGroupPriority; /* the value 0 represents the highest priority */
66                             /* for a group of components                   */
67     OMX_U32 nGroupID;
68 } EXYNOS_OMX_PRIORITYMGMTTYPE;
69 
70 typedef enum _EXYNOS_OMX_INDEXTYPE
71 {
72 #define EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL "OMX.SEC.index.enableThumbnailMode"
73     OMX_IndexParamEnableThumbnailMode       = 0x7F000001,
74 #define EXYNOS_INDEX_CONFIG_VIDEO_INTRAPERIOD "OMX.SEC.index.VideoIntraPeriod"
75     OMX_IndexConfigVideoIntraPeriod         = 0x7F000002,
76 
77     /* for Android Native Window */
78 #define EXYNOS_INDEX_PARAM_ENABLE_ANB "OMX.google.android.index.enableAndroidNativeBuffers"
79     OMX_IndexParamEnableAndroidBuffers      = 0x7F000011,
80 #define EXYNOS_INDEX_PARAM_GET_ANB "OMX.google.android.index.getAndroidNativeBufferUsage"
81     OMX_IndexParamGetAndroidNativeBuffer    = 0x7F000012,
82 #define EXYNOS_INDEX_PARAM_USE_ANB "OMX.google.android.index.useAndroidNativeBuffer"
83     OMX_IndexParamUseAndroidNativeBuffer    = 0x7F000013,
84     /* for Android Store Metadata Inbuffer */
85 #define EXYNOS_INDEX_PARAM_STORE_METADATA_BUFFER "OMX.google.android.index.storeMetaDataInBuffers"
86     OMX_IndexParamStoreMetaDataBuffer       = 0x7F000014,
87     /* prepend SPS/PPS to I/IDR for H.264 Encoder */
88 #define EXYNOS_INDEX_PARAM_PREPEND_SPSPPS_TO_IDR "OMX.google.android.index.prependSPSPPSToIDRFrames"
89     OMX_IndexParamPrependSPSPPSToIDR        = 0x7F000015,
90 
91     /* for Android PV OpenCore*/
92     OMX_COMPONENT_CAPABILITY_TYPE_INDEX     = 0xFF7A347
93 } EXYNOS_OMX_INDEXTYPE;
94 
95 typedef enum _EXYNOS_OMX_ERRORTYPE
96 {
97     OMX_ErrorNoEOF              = (OMX_S32) 0x90000001,
98     OMX_ErrorInputDataDecodeYet = (OMX_S32) 0x90000002,
99     OMX_ErrorInputDataEncodeYet = (OMX_S32) 0x90000003,
100     OMX_ErrorCodecInit          = (OMX_S32) 0x90000004,
101     OMX_ErrorCodecDecode        = (OMX_S32) 0x90000005,
102     OMX_ErrorCodecEncode        = (OMX_S32) 0x90000006,
103     OMX_ErrorCodecFlush         = (OMX_S32) 0x90000007,
104     OMX_ErrorOutputBufferUseYet = (OMX_S32) 0x90000008
105 } EXYNOS_OMX_ERRORTYPE;
106 
107 typedef enum _EXYNOS_OMX_COMMANDTYPE
108 {
109     EXYNOS_OMX_CommandComponentDeInit = 0x7F000001,
110     EXYNOS_OMX_CommandEmptyBuffer,
111     EXYNOS_OMX_CommandFillBuffer,
112     EXYNOS_OMX_CommandFakeBuffer
113 } EXYNOS_OMX_COMMANDTYPE;
114 
115 typedef enum _EXYNOS_OMX_TRANS_STATETYPE {
116     EXYNOS_OMX_TransStateInvalid,
117     EXYNOS_OMX_TransStateLoadedToIdle,
118     EXYNOS_OMX_TransStateIdleToExecuting,
119     EXYNOS_OMX_TransStateExecutingToIdle,
120     EXYNOS_OMX_TransStateIdleToLoaded,
121     EXYNOS_OMX_TransStateMax = 0X7FFFFFFF
122 } EXYNOS_OMX_TRANS_STATETYPE;
123 
124 typedef enum _EXYNOS_OMX_COLOR_FORMATTYPE {
125     OMX_SEC_COLOR_FormatNV12TPhysicalAddress        = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */
126     OMX_SEC_COLOR_FormatNV12LPhysicalAddress        = 0x7F000002,
127     OMX_SEC_COLOR_FormatNV12LVirtualAddress         = 0x7F000003,
128     OMX_SEC_COLOR_FormatNV12Tiled                   = 0x7FC00002,  /* 0x7FC00002 */
129     OMX_SEC_COLOR_FormatNV21LPhysicalAddress        = 0x7F000010,
130     OMX_SEC_COLOR_FormatNV21Linear                  = 0x7F000011,
131 
132     /* to copy a encoded data for drm component using gsc or fimc */
133     OMX_SEC_COLOR_FormatEncodedData                 = OMX_COLOR_FormatYCbYCr,
134     /* for Android SurfaceMediaSource*/
135     OMX_COLOR_FormatAndroidOpaque                   = 0x7F000789
136 }EXYNOS_OMX_COLOR_FORMATTYPE;
137 
138 typedef enum _EXYNOS_OMX_SUPPORTFORMAT_TYPE
139 {
140     supportFormat_0 = 0x00,
141     supportFormat_1,
142     supportFormat_2,
143     supportFormat_3,
144     supportFormat_4,
145     supportFormat_5,
146     supportFormat_6,
147     supportFormat_7
148 } EXYNOS_OMX_SUPPORTFORMAT_TYPE;
149 
150 typedef enum _EXYNOS_OMX_BUFFERPROCESS_TYPE
151 {
152     BUFFER_DEFAULT  = 0x00,
153     BUFFER_COPY     = 0x01,
154     BUFFER_SHARE    = 0x02,
155     BUFFER_METADATA = 0x04,
156     BUFFER_ANBSHARE = 0x08
157 } EXYNOS_OMX_BUFFERPROCESS_TYPE;
158 
159 typedef struct _EXYNOS_OMX_VIDEO_PROFILELEVEL
160 {
161     OMX_S32  profile;
162     OMX_S32  level;
163 } EXYNOS_OMX_VIDEO_PROFILELEVEL;
164 
165 typedef struct _EXYNOS_OMX_VIDEO_THUMBNAILMODE {
166     OMX_U32 nSize;
167     OMX_VERSIONTYPE nVersion;
168     OMX_U32 nPortIndex;
169     OMX_BOOL bEnable;
170 } EXYNOS_OMX_VIDEO_THUMBNAILMODE;
171 
172 #define OMX_VIDEO_CodingVPX     0x09    /**< Google VPX, formerly known as On2 VP8 */
173 
174 #ifndef __OMX_EXPORTS
175 #define __OMX_EXPORTS
176 #define EXYNOS_EXPORT_REF __attribute__((visibility("default")))
177 #define EXYNOS_IMPORT_REF __attribute__((visibility("default")))
178 #endif
179 
180 #endif
181