Update contrib.
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Implementation of the Class COmxComponent
18 #ifndef OMXPROCESSINGUNITBODY_H
19 #define OMXPROCESSINGUNITBODY_H
22 #include <openmax/il/khronos/v1_x/OMX_Component.h>
23 #include <omxprocessingunit.h>
24 #include "omxcomponentimpl.h"
33 class MMdfInputPortObserver;
34 class MMdfOutputPortObserver;
36 class COmxProcessingUnit::CBody : public CBase
40 static CBody* NewL(const TDesC8& aComponentName,
41 MOmxPuCallbacks& aPuCallbacks,
42 COmxProcessingUnit* aParent,
43 const MMdfProcessingUnitObserver& aObserver);
45 // Processing unit calls
46 TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts);
47 TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts);
48 TInt Configure(const TPuConfig& aConfigurationSetup);
49 TInt GetConfig(TPuConfig& aConfigurationSetup);
54 TProcessingUnitState State();
55 TInt CreateCustomInterface(TUid aUid);
56 TAny* CustomInterface(TUid aUid);
58 // OMX Processing Unit calls
59 TInt AddInputPort(MMdfInputPort* aInputPort);
60 TInt AddOutputPort(MMdfOutputPort* aOutputPort);
61 void SetPuState(TProcessingUnitState aState);
62 MMdfProcessingUnitObserver* Observer();
65 TInt GetComponentVersion(const TDesC8& aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID);
66 TInt SendCommand(OMX_COMMANDTYPE aCmd, TUint aParam1, TAny* aCmdData);
67 TInt GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure);
68 TInt SetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure);
69 TInt GetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
70 TInt SetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
71 TInt GetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
72 TInt GetState(OMX_STATETYPE* aState);
73 TInt ComponentTunnelRequest(TUint aPortInput, OMX_HANDLETYPE aOutput, TUint aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup);
74 TInt UseBuffer(CMMFBuffer* aBuffer, TUint aPortIndex);
75 CMMFBuffer* AllocateBufferL(TUint aPortIndex, TUint aSizeBytes);
76 TInt FreeBuffer(CMMFBuffer* aBuffer);
77 TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aCallback);
78 TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aCallback);
79 TInt SetCallbacks(MOmxPuCallbacks& aPuCallbacks);
81 TInt EventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1,
82 TUint32 aData2, TAny* aExtraInfo);
85 void ConstructL(const TDesC8& aComponentName,
86 MOmxPuCallbacks& aPuCallbacks,
87 COmxProcessingUnit* aBody,
88 const MMdfProcessingUnitObserver& aObserver);
94 void GetExtensionIndexL(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
95 // Processing Unit Data
96 CMdfProcessingUnit* iParent;
97 MMdfProcessingUnitObserver* iObserver;
98 TProcessingUnitState iPuState;
99 RPointerArray<MMdfInputPort> iInputPorts;
100 RPointerArray<MMdfOutputPort> iOutputPorts;
103 COmxBufferManager* iBufferManager;
104 OMX_COMPONENTTYPE* iHandle;
105 COmxCallbacks* iCallbacks;
109 // Prototypes for OMX callback handler functions
110 OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent,
111 OMX_OUT TAny* aAppData,
112 OMX_OUT OMX_EVENTTYPE aEvent,
113 OMX_OUT TUint32 aData1,
114 OMX_OUT TUint32 aData2,
115 OMX_OUT TAny* aExtra);
117 OMX_ERRORTYPE EmptyBufferDone(
118 OMX_HANDLETYPE aComponent,
120 OMX_BUFFERHEADERTYPE* aBuffer);
122 OMX_ERRORTYPE FillBufferDone(
123 OMX_HANDLETYPE aComponent,
125 OMX_BUFFERHEADERTYPE* aBuffer);
128 #endif // OMXPROCESSINGUNITBODY_H