os/mm/mmdevicefw/mdfunittest/codecapi/omxvorbis/hwdeviceadapter/audiocodectestadapter.h
Update contrib.
2 * Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
24 #ifndef AUDIOCODECTESTADAPTER_H
25 #define AUDIOCODECTESTADAPTER_H
27 #include <mmf/server/mmfhwdevice.h>
28 #include <mdf/mdfinputport.h>
29 #include <mdf/mdfoutputport.h>
30 #include <mdf/mdfprocessingunit.h>
31 #include <mdf/mdfpuloader.h>
32 #include <mmf/server/mmfdatabuffer.h>
33 #include <mmf/server/mmfhwdevicesetup.h>
34 #include <mmf/common/mmfutilities.h>
38 class CMdfHwDeviceCodecTestAdapter : public CMMFHwDevice,
39 public MMdfInputPortObserver,
40 public MMdfOutputPortObserver,
41 public MMdfProcessingUnitObserver,
42 public MMdfHwDeviceSetup
46 Hardware Device Adapter panics raised as a result of a programming error.
48 enum THwDeviceAdapterPanics
51 Raised when the Codec Processing Unit has not been initialised.
52 @see CMdfHwDeviceAdapter::CustomInterface
53 @see CMdfHwDeviceAdapter::SetDataTypesL
58 The current state of the Hardware Device Adapter.
60 enum THwDevAdapterState
63 The PULoader has been loaded.
65 EProcessingUnitLoaderLoaded,
67 The Processing Units have been loaded.
69 EProcessingUnitLoaded,
71 The Processing Units are currently being initialised.
73 EProcessingUnitInitializing,
75 The Processing Units are currently in the idle state.
79 The Processing Units are currently in the executing state.
81 EProcessingUnitExecuting,
83 The Processing Units are currently in the paused state.
89 static CMdfHwDeviceCodecTestAdapter* NewL();
92 TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
95 TInt Init(THwDeviceInitParams& aDevInfo);
96 TAny* CustomInterface(TUid aInterfaceId);
97 TInt ThisHwBufferFilled(CMMFBuffer& aFillBufferPtr);
98 TInt ThisHwBufferEmptied(CMMFBuffer& aEmptyBufferPtr);
99 TInt SetConfig(TTaskConfig& aConfig);
100 TInt StopAndDeleteCodec();
102 ~CMdfHwDeviceCodecTestAdapter();
104 // from MMdfInputPortObserver
105 void MipoWriteDataComplete(const MMdfInputPort* aPu,
106 CMMFBuffer* aBuffer, TInt aErrorCode);
107 void MipoDisconnectTunnelComplete(const MMdfInputPort* aPu, TInt aErrorCode);
108 void MipoRestartTunnelComplete(const MMdfInputPort* aPu, TInt aErrorCode);
110 // from MMdfOutputPortObserver
111 void MopoReadDataComplete(const MMdfOutputPort* aPu,
112 CMMFBuffer* aBuffer, TInt aErrorCode);
113 void MopoDisconnectTunnelComplete(const MMdfOutputPort* aPu, TInt aErrorCode);
114 void MopoRestartTunnelComplete(const MMdfOutputPort* aPu, TInt aErrorCode);
116 // from MMdfProcessingUnitObserver
117 void InitializeComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode);
118 void ExecuteComplete(const CMdfProcessingUnit* aPu, TInt aErrorCode);
120 // from MMdfHwDeviceSetup
121 void SetDataTypesL(TFourCC aSrcType, TFourCC aDestType);
123 void GetState(THwDevAdapterState& aState) const;
126 CMdfHwDeviceCodecTestAdapter();
128 TInt CreateBuffers();
131 TInt InitializeEncodeDecode();
132 TInt StartExecuting();
134 void StopHwDevice(TInt error);
137 CMdfPuLoader* iPuLoader;
138 TUid iPuLoaderDtorKey;
139 MMdfInputPort* iInputPort;
140 MMdfOutputPort* iOutputPort;
142 CMdfProcessingUnit* iCodecPU;
144 THwDevAdapterState iState;
147 TBool iPCMPUCallbackComplete;
149 TBool iPCMPuMopoStopCompleted;
150 TBool iPCMPuMipoStopCompleted;
159 CMMFBuffer* iInputBuffer;
160 CMMFBuffer* iOutputBuffer;
162 TUint32 iInputPortBufferSize;
163 TUint32 iOutputPortBufferSize;
164 TInt iInputPortBufferData;
165 TInt iOutputPortBufferData;
167 CActiveSchedulerWait* iActiveWait;
169 TDeviceFunc iFuncCmd;
171 TFourCC iFirstFourCC;
172 TFourCC iSecondFourCC;
175 #endif // AUDIOCODECTESTADAPTER_H