• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #ifndef MPEG4_DEC_H_INCLUDED
19 #define MPEG4_DEC_H_INCLUDED
20 
21 #ifndef OMX_Component_h
22 #include "OMX_Component.h"
23 #endif
24 
25 #ifndef _MP4DEC_API_H_
26 #include "mp4dec_api.h"
27 #endif
28 
29 #ifndef _MP4DECLIB_H_
30 #include "mp4dec_lib.h"
31 #endif
32 
33 class Mpeg4Decoder_OMX
34 {
35     public:
36 
37         Mpeg4Decoder_OMX();
38 
39         OMX_S32 InitializeVideoDecode(OMX_S32* aWidth, OMX_S32* aHeight,
40                                       OMX_U8** aBuffer, OMX_S32* aSize, OMX_S32 mode);
41 
42         OMX_ERRORTYPE Mp4DecInit();
43 
44         OMX_BOOL Mp4DecodeVideo(OMX_U8* aOutBuffer, OMX_U32* aOutputLength,
45                                 OMX_U8** aInputBuf, OMX_U32* aInBufSize,
46                                 OMX_PARAM_PORTDEFINITIONTYPE* aPortParam,
47                                 OMX_S32* aFrameCount, OMX_BOOL aMarkerFlag, OMX_BOOL *aResizeFlag);
48 
49         OMX_ERRORTYPE Mp4DecDeinit();
50 
51         OMX_S32 GetVideoHeader(int32 aLayer, uint8 *aBuf, int32 aMaxSize);
52 
53         OMX_BOOL Mpeg4InitCompleteFlag;
54 
55     private:
56         MP4DecodingMode CodecMode;
57         VideoDecControls VideoCtrl;
58 
59         OMX_U8* pFrame0, *pFrame1;
60         OMX_S32 iDisplay_Width, iDisplay_Height;
61         OMX_S32 iShortVideoHeader;
62 
63         OMX_U8 VO_START_CODE1[4];
64         OMX_U8 VOSH_START_CODE1[4];
65         OMX_U8 VOP_START_CODE1[4];
66         OMX_U8 H263_START_CODE1[3];
67 };
68 
69 
70 #endif ///#ifndef MPEG4_DEC_H_INCLUDED
71