omxil/mmilapi/unittest/test_plugins/omxildummybaseilif/omxildummybaseilifbody.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:56:55 +0200
changeset 0 40261b775718
child 16 eedf2dcd43c6
permissions -rw-r--r--
Revision: 201003 Kit: 201005

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// omxildummybaseifilbody.h
// 
//

#ifndef OMXILDUMMYBASEIFILBODY_H
#define OMXILDUMMYBASEIFILBODY_H


#include "omxildummybaseilif.h"
#include "omxildummybaseportilif.h"
#include "omxilgenericilifbodyimpl.h" 
#include <e32base.h>
#include <openmax/il/khronos/v1_x/OMX_Component.h>


/**
Body implementation of the COmxILDummyBaseILIF specific to OpenMAX specification.
*/
class COmxILDummyBaseILIF::CBody : public CBase
	{
public:
	static CBody* NewL(COmxILDummyBaseILIF& aParent,
					   MILIfObserver& aComponentIfObserver,
					   const TDesC8& aComponentName);
	~CBody();

	OMX_COMPONENTTYPE* Handle() const;
	
	TInt OmxGetComponentVersion(TPtr8 aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID);
	TInt OmxSendCommand(OMX_COMMANDTYPE aCmd, TUint32 aParam1, TAny* aCmdData);
	TInt OmxGetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure);
	TInt OmxSetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure);
	TInt OmxGetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
	TInt OmxSetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
	TInt OmxGetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
	TInt OmxGetState(OMX_STATETYPE*  aState);
	TInt OmxComponentTunnelRequest(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput);
	TInt OmxComponentDisconnectTunnel(TUint32 aPortInput, OMX_HANDLETYPE aOutput, TUint32 aPortOutput);
	TInt OmxUseBuffer(CMMFBuffer* aBuffer, TUint32 aPortIndex);
	CMMFBuffer* OmxAllocateBufferL(TUint32 aPortIndex, TUint32 aSizeBytes);
	TInt OmxFreeBuffer(CMMFBuffer* aBuffer);
	TInt OmxEmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver);
	TInt OmxFillThisBuffer(CMMFBuffer* aBuffer, MOmxILComponentIfObserver* aObserver);
	TInt OmxComponentRoleEnum(TPtr8& aComponentRole, TUint32 aIndex);

	TInt SetIfToRole(const TUid& aComponentRole);
	TInt GetIfRole(TUid& aComponentRole) const;

	TInt GetComponentPorts(RPointerArray<MILComponentPortIf>& aComponentPorts, OMX_DIRTYPE);
	TInt SetPortsL();

	TInt FillBufferDone(CMMFBuffer* aBuffer, TInt aPortIndex);
	TInt EmptyBufferDone(const CMMFBuffer* aBuffer, TInt aPortIndex);
	TInt EventHandler(OMX_EVENTTYPE aEvent, TUint32 aData1, TUint32 aData2, TAny* aExtraInfo);
	
private:
	CBody(COmxILDummyBaseILIF& aParent, MILIfObserver& aComponentIfObserver);
	void ConstructL(const TDesC8& aComponentName);

private:

	OMX_COMPONENTTYPE* iHandle;
	
	RPointerArray<COmxILDummyBasePortILIF> iInputPorts;
	RPointerArray<COmxILDummyBasePortILIF> iOutputPorts;

	COmxBufferManager* iBufferManager;
	COmxCallbacks* iCallbacks;

	COmxILDummyBaseILIF& iParent;
	MILIfObserver& iIfObserver;

	TUid iFormat;	
	};

#endif // OMXILDUMMYBASEIFILBODY_H