First public contribution.
1 // Copyright (c) 2003-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.
16 #ifndef __MMFSWCODECDATAPATH_H__
17 #define __MMFSWCODECDATAPATH_H__
20 #include <mmf/server/mmfdatabuffer.h>
23 #ifdef SYMBIAN_MDF_SHAREDCHUNK_SOUNDDRIVER
24 #include "mdasoundadapter.h"
27 _LIT(KPddFileName,"ESDRV.PDD");
28 _LIT(KLddFileName,"ESOUND.LDD");
31 class MMMFHwDeviceObserver;
35 Interface for setting desired sample rate, channels and for setting Gain/Volume
37 const TUid KUidSwSetParamInterface = {0x1028707E};
38 class MSwSetParamInterface
41 virtual TInt SetSampleRate(TInt aSampleRate)=0;
42 virtual TInt SetNumChannels(TInt aNumChannels)=0;
43 virtual TInt SetGain(TInt aGain)=0;
44 virtual TInt GetBufferSizes(TInt& aMinSize, TInt& aMaxSize)=0;
48 * Interface for discovering various parameters
50 const TUid KUidSwInfoInterface = {0x1028707F};
51 class MSwInfoInterface
54 virtual TInt GetSupportedSampleRates(RArray<TInt>& aSupportedSampleRates)=0;
58 * Base class for the datapath internal to the Sw codec wrapper
61 class CMMFSwCodecDataPath : public CBase
64 enum TSwCodecDataPathState
71 virtual ~CMMFSwCodecDataPath();
72 virtual TInt SetObserver(MMMFHwDeviceObserver& aHwObserver) = 0;
73 virtual TInt AddCodec(CMMFSwCodec& aCodec) = 0;
74 virtual TInt Start() = 0;
75 virtual void Stop() = 0;
76 virtual void Pause() = 0;
77 virtual RMdaDevSound& Device() = 0;
78 virtual void BufferFilledL(CMMFDataBuffer& aBuffer) = 0;
79 virtual void BufferEmptiedL(const CMMFDataBuffer& aBuffer) = 0;
80 virtual void SoundDeviceException(TInt aError) = 0;
81 virtual TSwCodecDataPathState State() const = 0;
82 virtual TAny* CustomInterface(TUid aInterfaceId);
84 CMMFSwCodecDataPath() {};
85 inline void Panic(TInt aPanicCode);
88 #ifdef __CYCLE_MMF_DATABUFFERS__
89 CMMFDataBuffer* CycleAudioBuffer(CMMFDataBuffer* aBuffer);
92 #ifdef __USE_MMF_TRANSFERBUFFERS__
93 CMMFTransferBuffer* CreateTransferBufferL(TUint aBufferSize, CMMFTransferBuffer* aOldBuffer);
96 #ifdef __USE_MMF_PTRBUFFERS__
97 CMMFPtrBuffer* CreatePtrBufferL(TUint aBufferSize);
101 MMMFHwDeviceObserver* iHwDeviceObserver;
103 #ifdef __USE_MMF_TRANSFERBUFFERS__
104 RTransferBuffer* iTransferBuffer;
105 RTransferWindow* iTransferWindow;
108 #ifdef __USE_MMF_PTRBUFFERS__
109 HBufC8* iPtrBufferMemoryBlock;
117 inline void CMMFSwCodecDataPath::Panic(TInt aPanicCode)
119 _LIT(KMMFSwCodecWrapperPanicCategory, "MMFSwCodecWrapper");
120 User::Panic(KMMFSwCodecWrapperPanicCategory, aPanicCode);
124 * Extended datapath class with state info
127 class CMMFSwCodecDataPathX : public CMMFSwCodecDataPath
130 CMMFSwCodecDataPathX(): CMMFSwCodecDataPath() {}
132 // from CMMFSwCodecDataPath
133 TSwCodecDataPathState State() const {return iState;}
135 TSwCodecDataPathState iState;