Initial version of libomxil-e3250-v4l2
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / openmax / component / video / dec / mpeg4 / Exynos_OMX_Mpeg4dec.h
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_Mpeg4dec.h
20  * @brief
21  * @author      Yunji Kim (yunji.kim@samsung.com)
22  * @author      SeungBeom Kim (sbcrux.kim@samsung.com)
23  * @version     2.0.0
24  * @history
25  *   2012.02.20 : Create
26  */
27
28 #ifndef EXYNOS_OMX_MPEG4_DEC_COMPONENT
29 #define EXYNOS_OMX_MPEG4_DEC_COMPONENT
30
31 #include "Exynos_OMX_Def.h"
32 #include "OMX_Component.h"
33 #include "OMX_Video.h"
34 #include "ExynosVideoApi.h"
35
36 /* Macros need for checking PackedPB */
37 #define USR_DATA_START_CODE     (0x000001B2)
38 #define VOP_START_CODE          (0x000001B6)
39 #define MP4_START_CODE          (0x000001)
40
41 typedef enum _CODEC_TYPE
42 {
43     CODEC_TYPE_H263,
44     CODEC_TYPE_MPEG4
45 } CODEC_TYPE;
46
47 /*
48  * This structure is the same as BitmapInfoHhr struct in pv_avifile_typedefs.h file
49  */
50 typedef struct _BitmapInfoHhr
51 {
52     OMX_U32    BiSize;
53     OMX_U32    BiWidth;
54     OMX_U32    BiHeight;
55     OMX_U16    BiPlanes;
56     OMX_U16    BiBitCount;
57     OMX_U32    BiCompression;
58     OMX_U32    BiSizeImage;
59     OMX_U32    BiXPelsPerMeter;
60     OMX_U32    BiYPelsPerMeter;
61     OMX_U32    BiClrUsed;
62     OMX_U32    BiClrImportant;
63 } BitmapInfoHhr;
64
65 typedef struct _EXYNOS_MFC_MPEG4DEC_HANDLE
66 {
67     OMX_HANDLETYPE             hMFCHandle;
68     OMX_BOOL                   bShareableBuf;
69     OMX_U32                    indexTimestamp;
70     OMX_U32                    outputIndexTimestamp;
71     OMX_BOOL                   bConfiguredMFCSrc;
72     OMX_BOOL                   bConfiguredMFCDst;
73     OMX_U32                    maxDPBNum;
74     CODEC_TYPE                 codecType;
75     OMX_BOOL                   bPackedPB;
76
77     ExynosVideoColorFormatType MFCOutputColorType;
78     ExynosVideoDecOps         *pDecOps;
79     ExynosVideoDecBufferOps   *pInbufOps;
80     ExynosVideoDecBufferOps   *pOutbufOps;
81     ExynosVideoGeometry        codecOutbufConf;
82 } EXYNOS_MFC_MPEG4DEC_HANDLE;
83
84 typedef struct _EXYNOS_MPEG4DEC_HANDLE
85 {
86     /* OMX Codec specific */
87     OMX_VIDEO_PARAM_H263TYPE            h263Component[ALL_PORT_NUM];
88     OMX_VIDEO_PARAM_MPEG4TYPE           mpeg4Component[ALL_PORT_NUM];
89     OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE errorCorrectionType[ALL_PORT_NUM];
90
91     /* EXYNOS MFC Codec specific */
92     EXYNOS_MFC_MPEG4DEC_HANDLE          hMFCMpeg4Handle;
93
94     OMX_BOOL bSourceStart;
95     OMX_BOOL bDestinationStart;
96     OMX_HANDLETYPE hSourceStartEvent;
97     OMX_HANDLETYPE hDestinationStartEvent;
98 } EXYNOS_MPEG4DEC_HANDLE;
99
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103
104 OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(
105     OMX_HANDLETYPE hComponent,
106     OMX_STRING componentName);
107 OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(
108     OMX_HANDLETYPE hComponent);
109
110 #ifdef __cplusplus
111 };
112 #endif
113
114 #endif