Exynos_OMX_Basecomponent.h revision 8ca4698d20d66c72d552eea35dd5dff150001894
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_Basecomponent.h
20 * @brief
21 * @author     SeungBeom Kim (sbcrux.kim@samsung.com)
22 *             Yunji Kim (yunji.kim@samsung.com)
23 * @version    2.0.0
24 * @history
25 *    2012.02.20 : Create
26 */
27
28#ifndef EXYNOS_OMX_BASECOMP
29#define EXYNOS_OMX_BASECOMP
30
31#include "Exynos_OMX_Def.h"
32#include "OMX_Component.h"
33#include "Exynos_OSAL_Queue.h"
34#include "Exynos_OMX_Baseport.h"
35
36
37typedef struct _EXYNOS_OMX_MESSAGE
38{
39    OMX_U32 messageType;
40    OMX_U32 messageParam;
41    OMX_PTR pCmdData;
42} EXYNOS_OMX_MESSAGE;
43
44/* for Check TimeStamp after Seek */
45typedef struct _EXYNOS_OMX_TIMESTAMP
46{
47    OMX_BOOL  needSetStartTimeStamp;
48    OMX_BOOL  needCheckStartTimeStamp;
49    OMX_TICKS startTimeStamp;
50    OMX_U32   nStartFlags;
51} EXYNOS_OMX_TIMESTAMP;
52
53typedef struct _EXYNOS_OMX_BASECOMPONENT
54{
55    OMX_STRING                  componentName;
56    OMX_VERSIONTYPE             componentVersion;
57    OMX_VERSIONTYPE             specVersion;
58
59    OMX_STATETYPE               currentState;
60    EXYNOS_OMX_TRANS_STATETYPE  transientState;
61
62    EXYNOS_CODEC_TYPE           codecType;
63    EXYNOS_OMX_PRIORITYMGMTTYPE compPriority;
64    OMX_MARKTYPE                propagateMarkType;
65    OMX_HANDLETYPE              compMutex;
66
67    OMX_HANDLETYPE              hComponentHandle;
68
69    /* Message Handler */
70    OMX_BOOL                    bExitMessageHandlerThread;
71    OMX_HANDLETYPE              hMessageHandler;
72    OMX_HANDLETYPE              msgSemaphoreHandle;
73    EXYNOS_QUEUE                messageQ;
74
75    /* Port */
76    OMX_PORT_PARAM_TYPE         portParam;
77    EXYNOS_OMX_BASEPORT        *pExynosPort;
78
79    OMX_HANDLETYPE              pauseEvent;
80
81    /* Callback function */
82    OMX_CALLBACKTYPE           *pCallbacks;
83    OMX_PTR                     callbackData;
84
85    /* Save Timestamp */
86    OMX_TICKS                   timeStamp[MAX_TIMESTAMP];
87    EXYNOS_OMX_TIMESTAMP        checkTimeStamp;
88
89    /* Save Flags */
90    OMX_U32                     nFlags[MAX_FLAGS];
91
92    OMX_BOOL                    getAllDelayBuffer;
93    OMX_BOOL                    reInputData;
94
95    OMX_BOOL bUseFlagEOF;
96    OMX_BOOL bSaveFlagEOS;
97
98    /* Check for Old & New OMX Process type switch */
99    OMX_BOOL bMultiThreadProcess;
100
101    OMX_ERRORTYPE (*exynos_codec_componentInit)(OMX_COMPONENTTYPE *pOMXComponent);
102    OMX_ERRORTYPE (*exynos_codec_componentTerminate)(OMX_COMPONENTTYPE *pOMXComponent);
103
104    OMX_ERRORTYPE (*exynos_AllocateTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex);
105    OMX_ERRORTYPE (*exynos_FreeTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex);
106    OMX_ERRORTYPE (*exynos_BufferProcessCreate)(OMX_COMPONENTTYPE *pOMXComponent);
107    OMX_ERRORTYPE (*exynos_BufferProcessTerminate)(OMX_COMPONENTTYPE *pOMXComponent);
108    OMX_ERRORTYPE (*exynos_BufferFlush)(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
109} EXYNOS_OMX_BASECOMPONENT;
110
111OMX_ERRORTYPE Exynos_OMX_GetParameter(
112    OMX_IN OMX_HANDLETYPE hComponent,
113    OMX_IN OMX_INDEXTYPE  nParamIndex,
114    OMX_INOUT OMX_PTR     ComponentParameterStructure);
115
116OMX_ERRORTYPE Exynos_OMX_SetParameter(
117    OMX_IN OMX_HANDLETYPE hComponent,
118    OMX_IN OMX_INDEXTYPE  nIndex,
119    OMX_IN OMX_PTR        ComponentParameterStructure);
120
121OMX_ERRORTYPE Exynos_OMX_GetConfig(
122    OMX_IN OMX_HANDLETYPE hComponent,
123    OMX_IN OMX_INDEXTYPE  nIndex,
124    OMX_INOUT OMX_PTR     pComponentConfigStructure);
125
126OMX_ERRORTYPE Exynos_OMX_SetConfig(
127    OMX_IN OMX_HANDLETYPE hComponent,
128    OMX_IN OMX_INDEXTYPE  nIndex,
129    OMX_IN OMX_PTR        pComponentConfigStructure);
130
131OMX_ERRORTYPE Exynos_OMX_GetExtensionIndex(
132    OMX_IN OMX_HANDLETYPE  hComponent,
133    OMX_IN OMX_STRING      cParameterName,
134    OMX_OUT OMX_INDEXTYPE *pIndexType);
135
136OMX_ERRORTYPE Exynos_OMX_BaseComponent_Constructor(OMX_IN OMX_HANDLETYPE hComponent);
137OMX_ERRORTYPE Exynos_OMX_BaseComponent_Destructor(OMX_IN OMX_HANDLETYPE hComponent);
138
139#ifdef __cplusplus
140extern "C" {
141#endif
142
143    OMX_ERRORTYPE Exynos_OMX_Check_SizeVersion(OMX_PTR header, OMX_U32 size);
144
145
146#ifdef __cplusplus
147};
148#endif
149
150#endif
151