devsound/sounddevbt/src/swcodecwrapper/mmfBtSwCodecDataPath.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2005-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __MMFBTSWCODECDATAPATH_H__
       
    17 #define __MMFBTSWCODECDATAPATH_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <mmf/server/mmfdatabuffer.h>
       
    21 
       
    22 class MMMFHwDeviceObserver;
       
    23 class CMMFSwCodec;
       
    24 
       
    25 /**
       
    26  *  Base class for the datapath internal to the Sw codec wrapper
       
    27  *  @internalComponent
       
    28  */
       
    29 class CMMFSwCodecDataPath : public CBase
       
    30 	{ 
       
    31 public: 
       
    32 	enum TSwCodecDataPathState
       
    33 	{
       
    34 	EStopped,
       
    35 	EPlaying,
       
    36 	EPaused
       
    37 	};
       
    38 public:	
       
    39 	virtual	~CMMFSwCodecDataPath(); 
       
    40 	virtual TInt SetObserver(MMMFHwDeviceObserver& aHwObserver) = 0;
       
    41 	virtual TInt AddCodec(CMMFSwCodec& aCodec) = 0;
       
    42 	virtual TInt Start() = 0;
       
    43 	virtual void Stop() = 0;
       
    44 	virtual void Pause() = 0;
       
    45 	virtual void BufferFilledL(CMMFDataBuffer& aBuffer) = 0;
       
    46 	virtual void BufferEmptiedL(const CMMFDataBuffer& aBuffer) = 0;
       
    47 	virtual void SoundDeviceException(TInt aError) = 0;
       
    48 	virtual TSwCodecDataPathState State() {return iState;};
       
    49 protected:	
       
    50 	CMMFSwCodecDataPath() {};
       
    51 	inline void Panic(TInt aPanicCode);
       
    52 	void ConstructL();
       
    53 
       
    54 #ifdef __CYCLE_MMF_DATABUFFERS__
       
    55 	CMMFDataBuffer* CycleAudioBuffer(CMMFDataBuffer* aBuffer);
       
    56 #endif
       
    57 
       
    58 #ifdef __USE_MMF_TRANSFERBUFFERS__
       
    59 	CMMFTransferBuffer* CreateTransferBufferL(TUint aBufferSize, CMMFTransferBuffer* aOldBuffer);
       
    60 #endif
       
    61 
       
    62 #ifdef __USE_MMF_PTRBUFFERS__
       
    63 	CMMFPtrBuffer* CreatePtrBufferL(TUint aBufferSize);
       
    64 #endif
       
    65 
       
    66 protected: 
       
    67 	TSwCodecDataPathState iState;
       
    68 	MMMFHwDeviceObserver* iHwDeviceObserver;
       
    69 	CMMFSwCodec* iCodec;
       
    70 #ifdef __USE_MMF_TRANSFERBUFFERS__
       
    71 	RTransferBuffer* iTransferBuffer;
       
    72 	RTransferWindow* iTransferWindow;
       
    73 #endif
       
    74 
       
    75 #ifdef __USE_MMF_PTRBUFFERS__
       
    76 	HBufC8* iPtrBufferMemoryBlock;
       
    77 #endif
       
    78 
       
    79 	};
       
    80 
       
    81 /**
       
    82  * Internal panic
       
    83  * @internalComponent
       
    84  */
       
    85 inline void CMMFSwCodecDataPath::Panic(TInt aPanicCode)
       
    86 	{
       
    87 	_LIT(KMMFSwCodecWrapperPanicCategory, "MMFSwCodecWrapper");
       
    88 	User::Panic(KMMFSwCodecWrapperPanicCategory, aPanicCode);
       
    89 	}
       
    90 
       
    91 #endif
       
    92