Update contrib.
1 // Copyright (c) 2008-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.
22 #ifndef OMXPROCESSINGUNIT_H
23 #define OMXPROCESSINGUNIT_H
27 #include <mdf/mdfprocessingunit.h>
28 #include <openmax/il/khronos/v1_x/OMX_Component.h>
34 OpenMAX Processing Unit observer class.
39 virtual TInt MopcEventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo) =0;
43 OpenMAX Input Port observer class.
45 class MOmxInputPortCallbacks
49 * Returns the buffer that has been emptied.
51 * The handle to the OpenMAX component sending the callback.
53 * The buffer returned by the OpenMAX component.
55 * KErrNone, if successful; otherwise one of the other system-wide error codes.
58 virtual TInt EmptyBufferDone(OMX_HANDLETYPE aComponent, const CMMFBuffer* aBuffer) =0;
63 OpenMAX Output Port observer class.
65 class MOmxOutputPortCallbacks
69 * Returns the buffer that has been filled.
71 * The handle to the OpenMAX component sending the callback.
73 * The buffer returned by the OpenMAX component.
75 * KErrNone, if successful; otherwise one of the other system-wide error codes.
77 virtual TInt FillBufferDone(OMX_HANDLETYPE aComponent, CMMFBuffer* aBuffer) =0;
81 OpenMAX Processing Unit class.
83 class COmxProcessingUnit : public CMdfProcessingUnit, public MOmxPuCallbacks
88 // from CMdfProcessingUnit
89 IMPORT_C TInt Create(const MMdfProcessingUnitObserver& aProcessingUnitObserver);
90 IMPORT_C TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts);
91 IMPORT_C TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts);
92 IMPORT_C TInt Configure(const TPuConfig& aConfigurationSetup);
93 IMPORT_C TInt GetConfig(TPuConfig& aConfigurationSetup);
94 IMPORT_C void Initialize();
95 IMPORT_C void Execute ();
96 IMPORT_C TInt Pause ();
97 IMPORT_C void Stop ();
98 IMPORT_C TProcessingUnitState State();
99 IMPORT_C TInt CreateCustomInterface(TUid aUid);
100 IMPORT_C TAny* CustomInterface(TUid aUid);
101 IMPORT_C ~COmxProcessingUnit();
103 // from MOmxPuCallbacks
104 IMPORT_C TInt MopcEventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo);
106 // Accessors for Omx Component
107 IMPORT_C TInt OmxGetComponentVersion(const TDesC8& aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID);
108 IMPORT_C TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData);
109 IMPORT_C TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure);
110 IMPORT_C TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure);
111 IMPORT_C TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
112 IMPORT_C TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
113 IMPORT_C TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
114 IMPORT_C TInt OmxGetState(OMX_STATETYPE* aState);
115 IMPORT_C TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup);
116 IMPORT_C TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex);
117 IMPORT_C CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes);
118 IMPORT_C TInt OmxFreeBuffer(CMMFBuffer* aBuffer);
119 IMPORT_C TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aObserver);
120 IMPORT_C TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aObserver);
121 IMPORT_C TInt OmxSetCallbacks(MOmxPuCallbacks& aPuCallbacks);
124 IMPORT_C void ConstructL(const TDesC8& aComponentName, const MMdfProcessingUnitObserver& aProcessingUnitObserver);
125 IMPORT_C COmxProcessingUnit();
126 IMPORT_C TInt AddInputPort(MMdfInputPort* aInputPort);
127 IMPORT_C TInt AddOutputPort(MMdfOutputPort* aOutputPort);
128 IMPORT_C void SetPuState(TProcessingUnitState aState);
129 IMPORT_C const MMdfProcessingUnitObserver* Observer();
134 #endif // OMXPROCESSINGUNIT_H