os/mm/mmdevicefw/mdf/src/openmax/omxcomponentbody.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Implementation of the Class COmxComponent
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#ifndef OMXPROCESSINGUNITBODY_H
sl@0
    19
#define OMXPROCESSINGUNITBODY_H
sl@0
    20
sl@0
    21
#include <e32base.h>
sl@0
    22
#include <openmax/il/khronos/v1_x/OMX_Component.h>
sl@0
    23
#include <omxprocessingunit.h>
sl@0
    24
#include "omxcomponentimpl.h"
sl@0
    25
sl@0
    26
enum TOmxPortPanics
sl@0
    27
	{
sl@0
    28
	EObserverNotSet,
sl@0
    29
	EBodyNotCreated
sl@0
    30
	};
sl@0
    31
sl@0
    32
class CMMFBuffer;
sl@0
    33
class MMdfInputPortObserver;
sl@0
    34
class MMdfOutputPortObserver;
sl@0
    35
sl@0
    36
class COmxProcessingUnit::CBody : public CBase
sl@0
    37
	{
sl@0
    38
public:
sl@0
    39
	virtual ~CBody();
sl@0
    40
	static CBody* NewL(const TDesC8& aComponentName, 
sl@0
    41
						MOmxPuCallbacks& aPuCallbacks, 
sl@0
    42
						COmxProcessingUnit* aParent, 
sl@0
    43
						const MMdfProcessingUnitObserver& aObserver);
sl@0
    44
sl@0
    45
	// Processing unit calls
sl@0
    46
	TInt GetInputPorts(RPointerArray<MMdfInputPort>& aComponentInputPorts);
sl@0
    47
	TInt GetOutputPorts(RPointerArray<MMdfOutputPort>& aComponentOutputPorts);
sl@0
    48
	TInt Configure(const TPuConfig& aConfigurationSetup);
sl@0
    49
	TInt GetConfig(TPuConfig& aConfigurationSetup);
sl@0
    50
	void Initialize();
sl@0
    51
	TInt Pause();
sl@0
    52
	void Stop();
sl@0
    53
	void Execute();
sl@0
    54
	TProcessingUnitState State();
sl@0
    55
	TInt CreateCustomInterface(TUid aUid);
sl@0
    56
	TAny* CustomInterface(TUid aUid);
sl@0
    57
	
sl@0
    58
	// OMX Processing Unit calls	
sl@0
    59
	TInt AddInputPort(MMdfInputPort* aInputPort);
sl@0
    60
	TInt AddOutputPort(MMdfOutputPort* aOutputPort);
sl@0
    61
	void SetPuState(TProcessingUnitState aState);	
sl@0
    62
	MMdfProcessingUnitObserver* Observer();
sl@0
    63
sl@0
    64
	// OMX calls 
sl@0
    65
	TInt GetComponentVersion(const TDesC8& aComponentName, OMX_VERSIONTYPE* aComponentVersion, OMX_VERSIONTYPE* aSpecVersion, OMX_UUIDTYPE* aComponentUUID);
sl@0
    66
	TInt SendCommand(OMX_COMMANDTYPE aCmd, TUint aParam1, TAny* aCmdData);
sl@0
    67
	TInt GetParameter(OMX_INDEXTYPE aParamIndex, TAny* aComponentParameterStructure);
sl@0
    68
	TInt SetParameter(OMX_INDEXTYPE aIndex, TAny* aComponentParameterStructure);
sl@0
    69
	TInt GetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
sl@0
    70
	TInt SetConfig(OMX_INDEXTYPE aIndex, TAny* aValue);
sl@0
    71
	TInt GetExtensionIndex(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
sl@0
    72
	TInt GetState(OMX_STATETYPE* aState);
sl@0
    73
	TInt ComponentTunnelRequest(TUint aPortInput, OMX_HANDLETYPE aOutput, TUint aPortOutput, OMX_TUNNELSETUPTYPE* aTunnelSetup);
sl@0
    74
	TInt UseBuffer(CMMFBuffer* aBuffer, TUint aPortIndex);
sl@0
    75
	CMMFBuffer* AllocateBufferL(TUint aPortIndex, TUint aSizeBytes);
sl@0
    76
	TInt FreeBuffer(CMMFBuffer* aBuffer);
sl@0
    77
	TInt EmptyThisBuffer(const CMMFBuffer* aBuffer, MOmxInputPortCallbacks* aCallback);
sl@0
    78
	TInt FillThisBuffer(CMMFBuffer* aBuffer, MOmxOutputPortCallbacks* aCallback);
sl@0
    79
	TInt SetCallbacks(MOmxPuCallbacks& aPuCallbacks);
sl@0
    80
	
sl@0
    81
	TInt EventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent, TUint32 aData1,
sl@0
    82
		 TUint32 aData2, TAny* aExtraInfo);
sl@0
    83
private:
sl@0
    84
	CBody();
sl@0
    85
	void ConstructL(const TDesC8& aComponentName, 
sl@0
    86
						MOmxPuCallbacks& aPuCallbacks, 
sl@0
    87
						COmxProcessingUnit* aBody,
sl@0
    88
						const MMdfProcessingUnitObserver& aObserver);
sl@0
    89
						
sl@0
    90
	
sl@0
    91
	
sl@0
    92
private:
sl@0
    93
sl@0
    94
	void GetExtensionIndexL(const TDesC8& aParameterName, OMX_INDEXTYPE* aIndexType);
sl@0
    95
	// Processing Unit Data
sl@0
    96
	CMdfProcessingUnit* iParent;
sl@0
    97
	MMdfProcessingUnitObserver* iObserver;
sl@0
    98
	TProcessingUnitState 		iPuState;
sl@0
    99
	RPointerArray<MMdfInputPort> iInputPorts;
sl@0
   100
	RPointerArray<MMdfOutputPort> iOutputPorts;	
sl@0
   101
sl@0
   102
sl@0
   103
	COmxBufferManager* iBufferManager;
sl@0
   104
	OMX_COMPONENTTYPE* iHandle;
sl@0
   105
	COmxCallbacks* iCallbacks;
sl@0
   106
sl@0
   107
	};
sl@0
   108
	
sl@0
   109
// Prototypes for OMX callback handler functions
sl@0
   110
OMX_ERRORTYPE EventHandler(OMX_OUT OMX_HANDLETYPE aComponent, 
sl@0
   111
					OMX_OUT TAny* aAppData,
sl@0
   112
        			OMX_OUT OMX_EVENTTYPE aEvent, 
sl@0
   113
        			OMX_OUT TUint32 aData1,
sl@0
   114
        			OMX_OUT TUint32 aData2,
sl@0
   115
        			OMX_OUT TAny* aExtra);
sl@0
   116
        			
sl@0
   117
OMX_ERRORTYPE EmptyBufferDone(
sl@0
   118
       OMX_HANDLETYPE aComponent,
sl@0
   119
       TAny* aAppData,
sl@0
   120
       OMX_BUFFERHEADERTYPE* aBuffer);
sl@0
   121
        
sl@0
   122
OMX_ERRORTYPE FillBufferDone(
sl@0
   123
       OMX_HANDLETYPE aComponent,
sl@0
   124
       TAny* aAppData,
sl@0
   125
       OMX_BUFFERHEADERTYPE* aBuffer);
sl@0
   126
sl@0
   127
sl@0
   128
#endif // OMXPROCESSINGUNITBODY_H