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