1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmdevicefw/mdf/src/openmax/omxcomponentbody.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,128 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Implementation of the Class COmxComponent
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef OMXPROCESSINGUNITBODY_H
1.22 +#define OMXPROCESSINGUNITBODY_H
1.23 +
1.24 +#include <e32base.h>
1.25 +#include <openmax/il/khronos/v1_x/OMX_Component.h>
1.26 +#include <omxprocessingunit.h>
1.27 +#include "omxcomponentimpl.h"
1.28 +
1.29 +enum TOmxPortPanics
1.30 + {
1.31 + EObserverNotSet,
1.32 + EBodyNotCreated
1.33 + };
1.34 +
1.35 +class CMMFBuffer;
1.36 +class MMdfInputPortObserver;
1.37 +class MMdfOutputPortObserver;
1.38 +
1.39 +class COmxProcessingUnit::CBody : public CBase
1.40 + {
1.41 +public:
1.42 + virtual ~CBody();
1.43 + static CBody* NewL(const TDesC8& aComponentName,
1.44 + MOmxPuCallbacks& aPuCallbacks,
1.45 + COmxProcessingUnit* aParent,
1.46 + const MMdfProcessingUnitObserver& aObserver);
1.47 +
1.48 + // Processing unit calls
1.49 + TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts);
1.50 + TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts);
1.51 + TInt Configure(const TPuConfig& aConfigurationSetup);
1.52 + TInt GetConfig(TPuConfig& aConfigurationSetup);
1.53 + void Initialize();
1.54 + TInt Pause();
1.55 + void Stop();
1.56 + void Execute();
1.57 + TProcessingUnitState State();
1.58 + TInt CreateCustomInterface(TUid aUid);
1.59 + TAny* CustomInterface(TUid aUid);
1.60 +
1.61 + // OMX Processing Unit calls
1.62 + TInt AddInputPort(MMdfInputPort* aInputPort);
1.63 + TInt AddOutputPort(MMdfOutputPort* aOutputPort);
1.64 + void SetPuState(TProcessingUnitState aState);
1.65 + MMdfProcessingUnitObserver* Observer();
1.66 +
1.67 + // OMX calls
1.68 + TInt GetComponentVersion(const TDesC8& aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID);
1.69 + TInt SendCommand(OMX_COMMANDTYPE aCmd, TUint aParam1, TAny* aCmdData);
1.70 + TInt GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure);
1.71 + TInt SetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure);
1.72 + TInt GetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
1.73 + TInt SetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
1.74 + TInt GetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
1.75 + TInt GetState(OMX_STATETYPE* aState);
1.76 + TInt ComponentTunnelRequest(TUint aPortInput, OMX_HANDLETYPE aOutput, TUint aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup);
1.77 + TInt UseBuffer(CMMFBuffer* aBuffer, TUint aPortIndex);
1.78 + CMMFBuffer* AllocateBufferL(TUint aPortIndex, TUint aSizeBytes);
1.79 + TInt FreeBuffer(CMMFBuffer* aBuffer);
1.80 + TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aCallback);
1.81 + TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aCallback);
1.82 + TInt SetCallbacks(MOmxPuCallbacks& aPuCallbacks);
1.83 +
1.84 + TInt EventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1,
1.85 + TUint32 aData2, TAny* aExtraInfo);
1.86 +private:
1.87 + CBody();
1.88 + void ConstructL(const TDesC8& aComponentName,
1.89 + MOmxPuCallbacks& aPuCallbacks,
1.90 + COmxProcessingUnit* aBody,
1.91 + const MMdfProcessingUnitObserver& aObserver);
1.92 +
1.93 +
1.94 +
1.95 +private:
1.96 +
1.97 + void GetExtensionIndexL(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
1.98 + // Processing Unit Data
1.99 + CMdfProcessingUnit* iParent;
1.100 + MMdfProcessingUnitObserver* iObserver;
1.101 + TProcessingUnitState iPuState;
1.102 + RPointerArray<MMdfInputPort> iInputPorts;
1.103 + RPointerArray<MMdfOutputPort> iOutputPorts;
1.104 +
1.105 +
1.106 + COmxBufferManager* iBufferManager;
1.107 + OMX_COMPONENTTYPE* iHandle;
1.108 + COmxCallbacks* iCallbacks;
1.109 +
1.110 + };
1.111 +
1.112 +// Prototypes for OMX callback handler functions
1.113 +OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent,
1.114 + OMX_OUT TAny* aAppData,
1.115 + OMX_OUT OMX_EVENTTYPE aEvent,
1.116 + OMX_OUT TUint32 aData1,
1.117 + OMX_OUT TUint32 aData2,
1.118 + OMX_OUT TAny* aExtra);
1.119 +
1.120 +OMX_ERRORTYPE EmptyBufferDone(
1.121 + OMX_HANDLETYPE aComponent,
1.122 + TAny* aAppData,
1.123 + OMX_BUFFERHEADERTYPE* aBuffer);
1.124 +
1.125 +OMX_ERRORTYPE FillBufferDone(
1.126 + OMX_HANDLETYPE aComponent,
1.127 + TAny* aAppData,
1.128 + OMX_BUFFERHEADERTYPE* aBuffer);
1.129 +
1.130 +
1.131 +#endif // OMXPROCESSINGUNITBODY_H