1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/devsound/sounddevbt/src/swcodecwrapper/mmfBtSwCodecDataPath.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,92 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __MMFBTSWCODECDATAPATH_H__
1.20 +#define __MMFBTSWCODECDATAPATH_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +#include <mmf/server/mmfdatabuffer.h>
1.24 +
1.25 +class MMMFHwDeviceObserver;
1.26 +class CMMFSwCodec;
1.27 +
1.28 +/**
1.29 + * Base class for the datapath internal to the Sw codec wrapper
1.30 + * @internalComponent
1.31 + */
1.32 +class CMMFSwCodecDataPath : public CBase
1.33 + {
1.34 +public:
1.35 + enum TSwCodecDataPathState
1.36 + {
1.37 + EStopped,
1.38 + EPlaying,
1.39 + EPaused
1.40 + };
1.41 +public:
1.42 + virtual ~CMMFSwCodecDataPath();
1.43 + virtual TInt SetObserver(MMMFHwDeviceObserver& aHwObserver) = 0;
1.44 + virtual TInt AddCodec(CMMFSwCodec& aCodec) = 0;
1.45 + virtual TInt Start() = 0;
1.46 + virtual void Stop() = 0;
1.47 + virtual void Pause() = 0;
1.48 + virtual void BufferFilledL(CMMFDataBuffer& aBuffer) = 0;
1.49 + virtual void BufferEmptiedL(const CMMFDataBuffer& aBuffer) = 0;
1.50 + virtual void SoundDeviceException(TInt aError) = 0;
1.51 + virtual TSwCodecDataPathState State() {return iState;};
1.52 +protected:
1.53 + CMMFSwCodecDataPath() {};
1.54 + inline void Panic(TInt aPanicCode);
1.55 + void ConstructL();
1.56 +
1.57 +#ifdef __CYCLE_MMF_DATABUFFERS__
1.58 + CMMFDataBuffer* CycleAudioBuffer(CMMFDataBuffer* aBuffer);
1.59 +#endif
1.60 +
1.61 +#ifdef __USE_MMF_TRANSFERBUFFERS__
1.62 + CMMFTransferBuffer* CreateTransferBufferL(TUint aBufferSize, CMMFTransferBuffer* aOldBuffer);
1.63 +#endif
1.64 +
1.65 +#ifdef __USE_MMF_PTRBUFFERS__
1.66 + CMMFPtrBuffer* CreatePtrBufferL(TUint aBufferSize);
1.67 +#endif
1.68 +
1.69 +protected:
1.70 + TSwCodecDataPathState iState;
1.71 + MMMFHwDeviceObserver* iHwDeviceObserver;
1.72 + CMMFSwCodec* iCodec;
1.73 +#ifdef __USE_MMF_TRANSFERBUFFERS__
1.74 + RTransferBuffer* iTransferBuffer;
1.75 + RTransferWindow* iTransferWindow;
1.76 +#endif
1.77 +
1.78 +#ifdef __USE_MMF_PTRBUFFERS__
1.79 + HBufC8* iPtrBufferMemoryBlock;
1.80 +#endif
1.81 +
1.82 + };
1.83 +
1.84 +/**
1.85 + * Internal panic
1.86 + * @internalComponent
1.87 + */
1.88 +inline void CMMFSwCodecDataPath::Panic(TInt aPanicCode)
1.89 + {
1.90 + _LIT(KMMFSwCodecWrapperPanicCategory, "MMFSwCodecWrapper");
1.91 + User::Panic(KMMFSwCodecWrapperPanicCategory, aPanicCode);
1.92 + }
1.93 +
1.94 +#endif
1.95 +