Home | History | Annotate | Download | only in include
      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 /**
     19     @file pv_omxcomponent.h
     20     OpenMax decoder_component base header file.
     21 
     22 */
     23 
     24 #ifndef PV_OMXCOMPONENT_H_INCLUDED
     25 #define PV_OMXCOMPONENT_H_INCLUDED
     26 
     27 #ifndef OMX_Component_h
     28 #include "OMX_Component.h"
     29 #endif
     30 
     31 
     32 #ifndef OSCL_SCHEDULER_H_INCLUDED
     33 #include "oscl_scheduler.h"
     34 #endif
     35 
     36 #ifndef PVLOGGER_H_INCLUDED
     37 #include "pvlogger.h"
     38 #endif
     39 
     40 #ifndef PV_OMX_QUEUE_H_INCLUDED
     41 #include "pv_omx_queue.h"
     42 #endif
     43 
     44 #ifndef PV_OMXCORE_H_INCLUDED
     45 #include "pv_omxcore.h"
     46 #endif
     47 
     48 
     49 #define OMX_PORT_INPUTPORT_INDEX OMX_DirInput
     50 #define OMX_PORT_OUTPUTPORT_INDEX OMX_DirOutput
     51 #define OMX_PORT_ALLPORT_INDEX -1
     52 
     53 #define OMX_PORT_NUMBER_FORMATS_SUPPORTED 4
     54 
     55 
     56 /* Application's private data */
     57 typedef struct ComponentPrivateType
     58 {
     59     OMX_HANDLETYPE CompHandle;
     60 
     61 } ComponentPrivateType;
     62 
     63 /**
     64  * This is the Component template from which all
     65  * other Component instances are factored by the core.
     66  */
     67 /**
     68  * The structure for port Type.
     69  */
     70 typedef struct ComponentPortType
     71 {
     72     /** @param pBuffer An array of pointers to buffer headers. */
     73     OMX_BUFFERHEADERTYPE** pBuffer;
     74     /** @param BufferState The State of the Buffer whether assigned or allocated */
     75     OMX_U32* BufferState;
     76     /** @param NumAssignedBuffers Number of buffer assigned on each port */
     77     OMX_U32 NumAssignedBuffers;
     78     /** @param pBufferQueue queue for buffer to be processed by the port */
     79     QueueType* pBufferQueue;
     80     OMX_STATETYPE TransientState;
     81     /** @param BufferUnderProcess  Boolean variables indicate whether the port is processing any buffer */
     82     OMX_BOOL BufferUnderProcess;
     83     OMX_PARAM_PORTDEFINITIONTYPE PortParam;
     84     /** @param NumBufferFlushed Number of buffer Flushed */
     85     OMX_U32 NumBufferFlushed;
     86     /** @param IsPortFlushed Boolean variables indicate port is being flushed at the moment */
     87     OMX_BOOL IsPortFlushed;
     88 
     89     //AUDIO SPECIFIC PARAMETERS
     90     OMX_AUDIO_PARAM_PORTFORMATTYPE  AudioParam;
     91     OMX_AUDIO_PARAM_PCMMODETYPE     AudioPcmMode;
     92     OMX_AUDIO_PARAM_WMATYPE         AudioWmaParam;
     93     OMX_AUDIO_PARAM_MP3TYPE         AudioMp3Param;
     94     OMX_AUDIO_CONFIG_EQUALIZERTYPE  AudioEqualizerType;
     95     OMX_AUDIO_PARAM_AACPROFILETYPE  AudioAacParam;
     96     OMX_AUDIO_PARAM_AMRTYPE         AudioAmrParam;
     97 
     98     //VIDEO SPECIFIC PARAMETERS
     99     OMX_VIDEO_PARAM_PORTFORMATTYPE   VideoParam[OMX_PORT_NUMBER_FORMATS_SUPPORTED];
    100     OMX_VIDEO_PARAM_PROFILELEVELTYPE ProfileLevel;
    101     OMX_VIDEO_PARAM_MPEG4TYPE        VideoMpeg4;
    102     OMX_VIDEO_PARAM_H263TYPE         VideoH263;
    103     OMX_VIDEO_PARAM_AVCTYPE          VideoAvc;
    104     OMX_VIDEO_PARAM_WMVTYPE          VideoWmv;
    105 
    106     //VIDEO ENCODER SPECIFIC PARAMETERS
    107     OMX_CONFIG_ROTATIONTYPE             VideoOrientationType;
    108     OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE VideoErrorCorrection;
    109     OMX_VIDEO_PARAM_BITRATETYPE         VideoRateType;      //Only for rate control type in mpeg4
    110     OMX_VIDEO_PARAM_QUANTIZATIONTYPE    VideoQuantType;
    111     OMX_VIDEO_PARAM_VBSMCTYPE           VideoBlockMotionSize;
    112     OMX_VIDEO_PARAM_MOTIONVECTORTYPE    VideoMotionVector;
    113     OMX_VIDEO_PARAM_INTRAREFRESHTYPE    VideoIntraRefresh;
    114     OMX_VIDEO_PARAM_AVCSLICEFMO         AvcSliceFMO;
    115 
    116     OMX_CONFIG_FRAMERATETYPE            VideoConfigFrameRateType;
    117     OMX_VIDEO_CONFIG_BITRATETYPE        VideoConfigBitRateType;
    118 
    119     //This will be used to dynamically request the Iframe using SetConfig API
    120     OMX_CONFIG_INTRAREFRESHVOPTYPE      VideoIFrame;
    121 
    122     OMX_U32  ActualNumPortFormatsSupported;
    123 
    124 } ComponentPortType;
    125 
    126 
    127 
    128 class OSCL_IMPORT_REF OmxComponentBase : public OsclActiveObject
    129 {
    130     public:
    131 
    132         OmxComponentBase();
    133         virtual ~OmxComponentBase() {}
    134 
    135         /** Component entry points declarations without proxy interface*/
    136         static OMX_ERRORTYPE BaseComponentGetComponentVersion(
    137             OMX_IN  OMX_HANDLETYPE hComponent,
    138             OMX_OUT OMX_STRING pComponentName,
    139             OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
    140             OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
    141             OMX_OUT OMX_UUIDTYPE* pComponentUUID);
    142 
    143         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentGetConfig(
    144             OMX_IN  OMX_HANDLETYPE hComponent,
    145             OMX_IN  OMX_INDEXTYPE nIndex,
    146             OMX_INOUT OMX_PTR pComponentConfigStructure);
    147 
    148         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentSetConfig(
    149             OMX_IN  OMX_HANDLETYPE hComponent,
    150             OMX_IN  OMX_INDEXTYPE nIndex,
    151             OMX_IN  OMX_PTR pComponentConfigStructure);
    152 
    153         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentGetExtensionIndex(
    154             OMX_IN  OMX_HANDLETYPE hComponent,
    155             OMX_IN  OMX_STRING cParameterName,
    156             OMX_OUT OMX_INDEXTYPE* pIndexType);
    157 
    158         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentGetState(
    159             OMX_IN  OMX_HANDLETYPE hComponent,
    160             OMX_OUT OMX_STATETYPE* pState);
    161 
    162         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentGetParameter(
    163             OMX_IN  OMX_HANDLETYPE hComponent,
    164             OMX_IN  OMX_INDEXTYPE nParamIndex,
    165             OMX_INOUT OMX_PTR ComponentParameterStructure);
    166 
    167         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentSetParameter(
    168             OMX_IN  OMX_HANDLETYPE hComponent,
    169             OMX_IN  OMX_INDEXTYPE nParamIndex,
    170             OMX_IN  OMX_PTR ComponentParameterStructure);
    171 
    172         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentUseBuffer(
    173             OMX_IN OMX_HANDLETYPE hComponent,
    174             OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
    175             OMX_IN OMX_U32 nPortIndex,
    176             OMX_IN OMX_PTR pAppPrivate,
    177             OMX_IN OMX_U32 nSizeBytes,
    178             OMX_IN OMX_U8* pBuffer);
    179 
    180         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentAllocateBuffer(
    181             OMX_IN OMX_HANDLETYPE hComponent,
    182             OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer,
    183             OMX_IN OMX_U32 nPortIndex,
    184             OMX_IN OMX_PTR pAppPrivate,
    185             OMX_IN OMX_U32 nSizeBytes);
    186 
    187         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentFreeBuffer(
    188             OMX_IN  OMX_HANDLETYPE hComponent,
    189             OMX_IN  OMX_U32 nPortIndex,
    190             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    191 
    192         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentSendCommand(
    193             OMX_IN  OMX_HANDLETYPE hComponent,
    194             OMX_IN  OMX_COMMANDTYPE Cmd,
    195             OMX_IN  OMX_U32 nParam,
    196             OMX_IN  OMX_PTR pCmdData);
    197 
    198         static OMX_ERRORTYPE BaseComponentComponentDeInit(
    199             OMX_IN  OMX_HANDLETYPE hComponent);
    200 
    201         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentEmptyThisBuffer(
    202             OMX_IN  OMX_HANDLETYPE hComponent,
    203             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    204 
    205         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentFillThisBuffer(
    206             OMX_IN  OMX_HANDLETYPE hComponent,
    207             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    208 
    209         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentSetCallbacks(
    210             OMX_IN  OMX_HANDLETYPE hComponent,
    211             OMX_IN  OMX_CALLBACKTYPE* pCallbacks,
    212             OMX_IN  OMX_PTR pAppData);
    213 
    214         /** Component entry points declarations with proxy interface*/
    215 #if PROXY_INTERFACE
    216         static OMX_ERRORTYPE BaseComponentProxyGetComponentVersion(
    217             OMX_IN  OMX_HANDLETYPE hComponent,
    218             OMX_OUT OMX_STRING pComponentName,
    219             OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
    220             OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
    221             OMX_OUT OMX_UUIDTYPE* pComponentUUID);
    222 
    223         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyGetParameter(
    224             OMX_IN  OMX_HANDLETYPE hComponent,
    225             OMX_IN  OMX_INDEXTYPE nParamIndex,
    226             OMX_INOUT OMX_PTR ComponentParameterStructure);
    227 
    228         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxySetParameter(
    229             OMX_IN  OMX_HANDLETYPE hComponent,
    230             OMX_IN  OMX_INDEXTYPE nParamIndex,
    231             OMX_IN  OMX_PTR ComponentParameterStructure);
    232 
    233         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyGetConfig(
    234             OMX_IN  OMX_HANDLETYPE hComponent,
    235             OMX_IN  OMX_INDEXTYPE nIndex,
    236             OMX_INOUT OMX_PTR pComponentConfigStructure);
    237 
    238         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxySetConfig(
    239             OMX_IN  OMX_HANDLETYPE hComponent,
    240             OMX_IN  OMX_INDEXTYPE nIndex,
    241             OMX_IN  OMX_PTR pComponentConfigStructure);
    242 
    243         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyGetExtensionIndex(
    244             OMX_IN  OMX_HANDLETYPE hComponent,
    245             OMX_IN  OMX_STRING cParameterName,
    246             OMX_OUT OMX_INDEXTYPE* pIndexType);
    247 
    248         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyGetState(
    249             OMX_IN  OMX_HANDLETYPE hComponent,
    250             OMX_OUT OMX_STATETYPE* pState);
    251 
    252         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyUseBuffer(
    253             OMX_IN OMX_HANDLETYPE hComponent,
    254             OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
    255             OMX_IN OMX_U32 nPortIndex,
    256             OMX_IN OMX_PTR pAppPrivate,
    257             OMX_IN OMX_U32 nSizeBytes,
    258             OMX_IN OMX_U8* pBuffer);
    259 
    260         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyAllocateBuffer(
    261             OMX_IN OMX_HANDLETYPE hComponent,
    262             OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer,
    263             OMX_IN OMX_U32 nPortIndex,
    264             OMX_IN OMX_PTR pAppPrivate,
    265             OMX_IN OMX_U32 nSizeBytes);
    266 
    267         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyFreeBuffer(
    268             OMX_IN  OMX_HANDLETYPE hComponent,
    269             OMX_IN  OMX_U32 nPortIndex,
    270             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    271 
    272         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxySendCommand(
    273             OMX_IN  OMX_HANDLETYPE hComponent,
    274             OMX_IN  OMX_COMMANDTYPE Cmd,
    275             OMX_IN  OMX_U32 nParam,
    276             OMX_IN  OMX_PTR pCmdData);
    277 
    278         static OMX_ERRORTYPE BaseComponentProxyComponentDeInit(
    279             OMX_IN  OMX_HANDLETYPE hComponent);
    280 
    281         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyEmptyThisBuffer(
    282             OMX_IN  OMX_HANDLETYPE hComponent,
    283             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    284 
    285         static OSCL_IMPORT_REF OMX_ERRORTYPE BaseComponentProxyFillThisBuffer(
    286             OMX_IN  OMX_HANDLETYPE hComponent,
    287             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    288 
    289         static OMX_ERRORTYPE BaseComponentProxySetCallbacks(
    290             OMX_IN  OMX_HANDLETYPE hComponent,
    291             OMX_IN  OMX_CALLBACKTYPE* pCallbacks,
    292             OMX_IN  OMX_PTR pAppData);
    293 
    294 #endif // PROXY_INTERFACE
    295 
    296         /*NON STATIC COUNTERPARTS OF STATIC MEMBER API'S */
    297 
    298         //Pure virtual functions, definition to be written in derived class
    299         virtual OMX_ERRORTYPE GetParameter(
    300             OMX_IN  OMX_HANDLETYPE hComponent,
    301             OMX_IN  OMX_INDEXTYPE nParamIndex,
    302             OMX_INOUT OMX_PTR ComponentParameterStructure) = 0;
    303 
    304         virtual OMX_ERRORTYPE SetParameter(
    305             OMX_IN  OMX_HANDLETYPE hComponent,
    306             OMX_IN  OMX_INDEXTYPE nParamIndex,
    307             OMX_IN  OMX_PTR ComponentParameterStructure) = 0;
    308 
    309         virtual OSCL_IMPORT_REF OMX_ERRORTYPE GetConfig(
    310             OMX_IN  OMX_HANDLETYPE hComponent,
    311             OMX_IN  OMX_INDEXTYPE nIndex,
    312             OMX_INOUT OMX_PTR pComponentConfigStructure);
    313 
    314         //Making Setconfig as virtual function to be implemented in respective component class
    315         virtual OSCL_IMPORT_REF OMX_ERRORTYPE SetConfig(
    316             OMX_IN  OMX_HANDLETYPE hComponent,
    317             OMX_IN  OMX_INDEXTYPE nIndex,
    318             OMX_IN  OMX_PTR pComponentConfigStructure);
    319 
    320         OMX_ERRORTYPE GetExtensionIndex(
    321             OMX_IN  OMX_HANDLETYPE hComponent,
    322             OMX_IN  OMX_STRING cParameterName,
    323             OMX_OUT OMX_INDEXTYPE* pIndexType);
    324 
    325         void GetState(OMX_OUT OMX_STATETYPE* pState);
    326 
    327         OMX_ERRORTYPE UseBuffer(
    328             OMX_IN OMX_HANDLETYPE hComponent,
    329             OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
    330             OMX_IN OMX_U32 nPortIndex,
    331             OMX_IN OMX_PTR pAppPrivate,
    332             OMX_IN OMX_U32 nSizeBytes,
    333             OMX_IN OMX_U8* pBuffer);
    334 
    335         OMX_ERRORTYPE AllocateBuffer(
    336             OMX_IN OMX_HANDLETYPE hComponent,
    337             OMX_INOUT OMX_BUFFERHEADERTYPE** pBuffer,
    338             OMX_IN OMX_U32 nPortIndex,
    339             OMX_IN OMX_PTR pAppPrivate,
    340             OMX_IN OMX_U32 nSizeBytes);
    341 
    342         OMX_ERRORTYPE FreeBuffer(
    343             OMX_IN  OMX_HANDLETYPE hComponent,
    344             OMX_IN  OMX_U32 nPortIndex,
    345             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    346 
    347         OMX_ERRORTYPE SendCommand(
    348             OMX_IN  OMX_HANDLETYPE hComponent,
    349             OMX_IN  OMX_COMMANDTYPE Cmd,
    350             OMX_IN  OMX_S32 nParam,
    351             OMX_IN  OMX_PTR pCmdData);
    352 
    353         OMX_ERRORTYPE EmptyThisBuffer(
    354             OMX_IN  OMX_HANDLETYPE hComponent,
    355             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    356 
    357         OMX_ERRORTYPE FillThisBuffer(
    358             OMX_IN  OMX_HANDLETYPE hComponent,
    359             OMX_IN  OMX_BUFFERHEADERTYPE* pBuffer);
    360 
    361         OMX_ERRORTYPE SetCallbacks(
    362             OMX_IN  OMX_HANDLETYPE hComponent,
    363             OMX_IN  OMX_CALLBACKTYPE* pCallbacks,
    364             OMX_IN  OMX_PTR pAppData);
    365 
    366 
    367         OMX_PTR GetOmxHandle()
    368         {
    369             return &iOmxComponent;
    370         };
    371 
    372         /*OTHER PROCESSING FUNCTIONS */
    373 
    374         //Pure virtual function called from base, must have a definition in derived components
    375         //virtual void Decode() = 0;
    376         virtual void ProcessData() = 0;
    377 
    378         virtual OSCL_IMPORT_REF void BufferMgmtFunction();
    379         virtual OSCL_IMPORT_REF OMX_BOOL BufferMgmtWithoutMarker();
    380         //Extra routines called from BufferMgmtWithoutMarker that may vary from component to component
    381         virtual OSCL_IMPORT_REF void ComponentBufferMgmtWithoutMarker();
    382         OSCL_IMPORT_REF void TempInputBufferMgmtWithoutMarker();
    383 
    384 
    385         virtual void ProcessInBufferFlag() {};
    386 
    387         /* This function will exist only for audio components, thats why can't be made puire virtual
    388            Also putting it into the audio base class will require a check everytime in the
    389            BufferMgmtFunction() to create either an audio or video pointer to access this function
    390         */
    391         virtual void SyncWithInputTimestamp() {};
    392         virtual void ResetComponent() {};
    393         virtual OMX_ERRORTYPE ReAllocatePartialAssemblyBuffers(OMX_BUFFERHEADERTYPE* aInputBufferHdr)
    394         {
    395             OSCL_UNUSED_ARG(aInputBufferHdr);
    396             return OMX_ErrorNone;
    397         }
    398 
    399         OMX_BOOL AssemblePartialFrames(OMX_BUFFERHEADERTYPE* aInputBuffer);
    400         virtual OSCL_IMPORT_REF OMX_BOOL ParseFullAVCFramesIntoNALs(OMX_BUFFERHEADERTYPE* aInputBuffer);
    401         OMX_ERRORTYPE MessageHandler(CoreMessage* Message);
    402         OMX_ERRORTYPE DoStateSet(OMX_U32);
    403 
    404         OMX_ERRORTYPE DisablePort(OMX_S32 PortIndex);
    405         void DisableSinglePort(OMX_U32 PortIndex);
    406 
    407         OMX_ERRORTYPE EnablePort(OMX_S32 PortIndex);
    408         void EnableSinglePort(OMX_U32 PortIndex);
    409 
    410         OMX_ERRORTYPE FlushPort(OMX_S32 PortIndex);
    411         void SetPortFlushFlag(OMX_S32, OMX_S32 index, OMX_BOOL value);
    412         void SetNumBufferFlush(OMX_S32, OMX_S32 index, OMX_S32 value);
    413 
    414         OSCL_IMPORT_REF void ReturnInputBuffer(OMX_BUFFERHEADERTYPE* pInputBuffer, ComponentPortType* pPort);
    415         OSCL_IMPORT_REF void ReturnOutputBuffer(OMX_BUFFERHEADERTYPE* pOutputBuffer, ComponentPortType* pPort);
    416 
    417         virtual OMX_ERRORTYPE ComponentInit() = 0;
    418         virtual OMX_ERRORTYPE ComponentDeInit() = 0;
    419 
    420         OSCL_IMPORT_REF OMX_ERRORTYPE ConstructBaseComponent(OMX_PTR pAppData);
    421         OSCL_IMPORT_REF OMX_ERRORTYPE DestroyBaseComponent();
    422 
    423         OMX_ERRORTYPE TunnelRequest(
    424             OMX_IN  OMX_HANDLETYPE hComp,
    425             OMX_IN  OMX_U32 nPort,
    426             OMX_IN  OMX_HANDLETYPE hTunneledComp,
    427             OMX_IN  OMX_U32 nTunneledPort,
    428             OMX_INOUT  OMX_TUNNELSETUPTYPE* pTunnelSetup);
    429 
    430         OMX_ERRORTYPE ParameterSanityCheck(
    431             OMX_IN  OMX_HANDLETYPE hComponent,
    432             OMX_IN  OMX_U32 nPortIndex,
    433             OMX_IN  OMX_PTR pStructure,
    434             OMX_IN  size_t size);
    435 
    436         OSCL_IMPORT_REF void SetHeader(OMX_PTR aheader, OMX_U32 asize);
    437         OSCL_IMPORT_REF OMX_ERRORTYPE CheckHeader(OMX_PTR aheader, OMX_U32 asize);
    438 
    439         void ResetAfterFlush(OMX_S32 PortIndex);
    440 
    441         //Flag to call BufferMgmtFunction in the RunL() when the component state is executing
    442         OMX_BOOL                iBufferExecuteFlag;
    443         ComponentPrivateType*   ipAppPriv;
    444 
    445 
    446     protected:
    447 
    448         PVLogger* iLogger;
    449 
    450         OSCL_IMPORT_REF void Run();
    451 
    452         OMX_CALLBACKTYPE*   ipCallbacks;
    453         OMX_PTR             iCallbackData;
    454         OMX_STATETYPE       iState;
    455 
    456         CoreDescriptorType* ipCoreDescriptor;
    457         OMX_U32             iNumInputBuffer;
    458 
    459         OMX_U8*             ipFrameDecodeBuffer;
    460         OMX_BOOL            iPartialFrameAssembly;
    461         OMX_BOOL            iIsInputBufferEnded;
    462         OMX_BOOL            iEndofStream;
    463         OMX_U8*             ipTempInputBuffer;
    464         OMX_U32             iTempInputBufferLength;
    465         OMX_COMPONENTTYPE*  ipTargetComponent;
    466         OMX_PTR             iTargetMarkData;
    467         OMX_COMPONENTTYPE*  ipTempTargetComponent;
    468         OMX_PTR             iTempTargetMarkData;
    469         OMX_BOOL            iMarkPropagate;
    470         OMX_BOOL            iNewInBufferRequired;
    471         OMX_BOOL            iNewOutBufRequired;
    472         OMX_U32             iTempConsumedLength;
    473         OMX_U32             iOutBufferCount;
    474         OMX_BOOL            iCodecReady;
    475         OMX_U8*             ipInputCurrBuffer;
    476         OMX_U32             iInputCurrBufferSize;
    477         OMX_U32             iInputCurrLength;
    478         OMX_S32             iFrameCount;
    479         OMX_BOOL            iStateTransitionFlag;
    480 
    481         OMX_BOOL                iEndOfFrameFlag;
    482         OMX_BUFFERHEADERTYPE*   ipInputBuffer;
    483         OMX_BUFFERHEADERTYPE*   ipOutputBuffer;
    484         OMX_U32                 iOutputFrameLength;
    485         OMX_COMPONENTTYPE       iOmxComponent;  // structure
    486         OMX_U32                 iNumPorts;
    487         OMX_U32                 iCompressedFormatPortNum;
    488         OMX_PTR                 ipComponentProxy;
    489 
    490         PV_OMXComponentCapabilityFlagsType iPVCapabilityFlags;
    491 
    492         //The ports of the component
    493         ComponentPortType** ipPorts;
    494         //Indicate whether component has been already initialized */
    495         OMX_BOOL iIsInit;
    496         //OpenMAX standard parameter that contains a short description of the available ports
    497         OMX_PORT_PARAM_TYPE iPortTypesParam;
    498         OMX_U32 iGroupPriority;
    499         //ID of a group of components that share the same logical chain
    500         OMX_U32 iGroupID;
    501         //Roles of the component
    502         OMX_U8 iComponentRole[OMX_MAX_STRINGNAME_SIZE];
    503         //Flag to indicate whether role has been set by client or not
    504         OMX_BOOL iComponentRoleFlag;
    505         //This field holds the private data associated with a mark request, if any
    506         OMX_MARKTYPE* ipMark;
    507 
    508         OMX_BOOL                iEosProcessing;
    509         OMX_BOOL                iFirstFragment;
    510         OMX_TICKS               iFrameTimestamp;
    511         OMX_BOOL                iRepositionFlag;
    512         OMX_U32                 iSamplesPerFrame;
    513         OMX_BOOL                iSilenceInsertionInProgress;
    514         OMX_U32                 iSilenceFramesNeeded;
    515         OMX_BOOL                iIsFirstOutputFrame;
    516         OMX_S32                 iInputBufferRemainingBytes;
    517         OMX_BOOL                iResizePending;
    518         OMX_U8*                 ipTempOutBufferForPortReconfig;
    519         OMX_U32                 iSizeOutBufferForPortReconfig;
    520         OMX_BOOL                iSendOutBufferAfterPortReconfigFlag;
    521         OMX_TICKS               iTimestampOutBufferForPortReconfig;
    522         OMX_TICKS               iOutputMicroSecPerFrame;
    523 
    524 
    525         OMX_BOOL                iIsAudioComponent;
    526 
    527 
    528 };
    529 
    530 
    531 class OSCL_IMPORT_REF OmxComponentAudio : public OmxComponentBase
    532 {
    533     public:
    534         OSCL_IMPORT_REF OmxComponentAudio();
    535         virtual ~OmxComponentAudio() {}
    536 
    537         OSCL_IMPORT_REF OMX_ERRORTYPE GetParameter(
    538             OMX_IN  OMX_HANDLETYPE hComponent,
    539             OMX_IN  OMX_INDEXTYPE nParamIndex,
    540             OMX_INOUT OMX_PTR ComponentParameterStructure);
    541 
    542         OSCL_IMPORT_REF OMX_ERRORTYPE SetParameter(
    543             OMX_IN  OMX_HANDLETYPE hComponent,
    544             OMX_IN  OMX_INDEXTYPE nParamIndex,
    545             OMX_IN  OMX_PTR ComponentParameterStructure);
    546 
    547         virtual void UpdateAACPlusFlag(OMX_BOOL aAacPlusFlag)
    548         {
    549             OSCL_UNUSED_ARG(aAacPlusFlag);
    550         }
    551 };
    552 
    553 
    554 
    555 class OSCL_IMPORT_REF OmxComponentVideo : public OmxComponentBase
    556 {
    557     public:
    558         OSCL_IMPORT_REF OmxComponentVideo();
    559         virtual ~OmxComponentVideo() {}
    560 
    561         OSCL_IMPORT_REF OMX_ERRORTYPE GetParameter(
    562             OMX_IN  OMX_HANDLETYPE hComponent,
    563             OMX_IN  OMX_INDEXTYPE nParamIndex,
    564             OMX_INOUT OMX_PTR ComponentParameterStructure);
    565 
    566         OSCL_IMPORT_REF OMX_ERRORTYPE SetParameter(
    567             OMX_IN  OMX_HANDLETYPE hComponent,
    568             OMX_IN  OMX_INDEXTYPE nParamIndex,
    569             OMX_IN  OMX_PTR ComponentParameterStructure);
    570 
    571 
    572 };
    573 
    574 
    575 #endif      //#ifndef PV_OMXCOMPONENT_H_INCLUDED
    576