sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Implementation of the Class COmxComponent sl@0: // sl@0: // sl@0: sl@0: #ifndef OMXPROCESSINGUNITBODY_H sl@0: #define OMXPROCESSINGUNITBODY_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "omxcomponentimpl.h" sl@0: sl@0: enum TOmxPortPanics sl@0: { sl@0: EObserverNotSet, sl@0: EBodyNotCreated sl@0: }; sl@0: sl@0: class CMMFBuffer; sl@0: class MMdfInputPortObserver; sl@0: class MMdfOutputPortObserver; sl@0: sl@0: class COmxProcessingUnit::CBody : public CBase sl@0: { sl@0: public: sl@0: virtual ~CBody(); sl@0: static CBody* NewL(const TDesC8& aComponentName, sl@0: MOmxPuCallbacks& aPuCallbacks, sl@0: COmxProcessingUnit* aParent, sl@0: const MMdfProcessingUnitObserver& aObserver); sl@0: sl@0: // Processing unit calls sl@0: TInt GetInputPorts(RPointerArray& aComponentInputPorts); sl@0: TInt GetOutputPorts(RPointerArray& aComponentOutputPorts); sl@0: TInt Configure(const TPuConfig& aConfigurationSetup); sl@0: TInt GetConfig(TPuConfig& aConfigurationSetup); sl@0: void Initialize(); sl@0: TInt Pause(); sl@0: void Stop(); sl@0: void Execute(); sl@0: TProcessingUnitState State(); sl@0: TInt CreateCustomInterface(TUid aUid); sl@0: TAny* CustomInterface(TUid aUid); sl@0: sl@0: // OMX Processing Unit calls sl@0: TInt AddInputPort(MMdfInputPort* aInputPort); sl@0: TInt AddOutputPort(MMdfOutputPort* aOutputPort); sl@0: void SetPuState(TProcessingUnitState aState); sl@0: MMdfProcessingUnitObserver* Observer(); sl@0: sl@0: // OMX calls sl@0: TInt GetComponentVersion(const TDesC8& aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID); sl@0: TInt SendCommand(OMX_COMMANDTYPE aCmd, TUint aParam1, TAny* aCmdData); sl@0: TInt GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure); sl@0: TInt SetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure); sl@0: TInt GetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); sl@0: TInt SetConfig(OMX_INDEXTYPE aIndex, TAny* aValue); sl@0: TInt GetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); sl@0: TInt GetState(OMX_STATETYPE* aState); sl@0: TInt ComponentTunnelRequest(TUint aPortInput, OMX_HANDLETYPE aOutput, TUint aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup); sl@0: TInt UseBuffer(CMMFBuffer* aBuffer, TUint aPortIndex); sl@0: CMMFBuffer* AllocateBufferL(TUint aPortIndex, TUint aSizeBytes); sl@0: TInt FreeBuffer(CMMFBuffer* aBuffer); sl@0: TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aCallback); sl@0: TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aCallback); sl@0: TInt SetCallbacks(MOmxPuCallbacks& aPuCallbacks); sl@0: sl@0: TInt EventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, sl@0: TUint32 aData2, TAny* aExtraInfo); sl@0: private: sl@0: CBody(); sl@0: void ConstructL(const TDesC8& aComponentName, sl@0: MOmxPuCallbacks& aPuCallbacks, sl@0: COmxProcessingUnit* aBody, sl@0: const MMdfProcessingUnitObserver& aObserver); sl@0: sl@0: sl@0: sl@0: private: sl@0: sl@0: void GetExtensionIndexL(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType); sl@0: // Processing Unit Data sl@0: CMdfProcessingUnit* iParent; sl@0: MMdfProcessingUnitObserver* iObserver; sl@0: TProcessingUnitState iPuState; sl@0: RPointerArray iInputPorts; sl@0: RPointerArray iOutputPorts; sl@0: sl@0: sl@0: COmxBufferManager* iBufferManager; sl@0: OMX_COMPONENTTYPE* iHandle; sl@0: COmxCallbacks* iCallbacks; sl@0: sl@0: }; sl@0: sl@0: // Prototypes for OMX callback handler functions sl@0: OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, sl@0: OMX_OUT TAny* aAppData, sl@0: OMX_OUT OMX_EVENTTYPE aEvent, sl@0: OMX_OUT TUint32 aData1, sl@0: OMX_OUT TUint32 aData2, sl@0: OMX_OUT TAny* aExtra); sl@0: sl@0: OMX_ERRORTYPE EmptyBufferDone( sl@0: OMX_HANDLETYPE aComponent, sl@0: TAny* aAppData, sl@0: OMX_BUFFERHEADERTYPE* aBuffer); sl@0: sl@0: OMX_ERRORTYPE FillBufferDone( sl@0: OMX_HANDLETYPE aComponent, sl@0: TAny* aAppData, sl@0: OMX_BUFFERHEADERTYPE* aBuffer); sl@0: sl@0: sl@0: #endif // OMXPROCESSINGUNITBODY_H