sl@0: /* sl@0: * Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: #ifndef __MMF_MULAW_TO_PCM16_HW_DEVICE_H__ sl@0: #define __MMF_MULAW_TO_PCM16_HW_DEVICE_H__ sl@0: sl@0: #include sl@0: #include "MMFAudioCodecBase.h" sl@0: sl@0: #include "MMFAudioMuLawToS16PcmCodec.h" sl@0: sl@0: const TInt KMuLawToCM16SrcBufferSize = 0x1000; sl@0: const TInt KMuLawToCM16SinkBufferSize = 0x2000; sl@0: sl@0: /* sl@0: * sl@0: * class CMMFMulawToPcm16CodecHwDevice sl@0: * sl@0: */ sl@0: class CMMFMulawToPcm16CodecHwDevice : public CMMFSwCodecWrapper sl@0: { sl@0: public: sl@0: static CMMFMulawToPcm16CodecHwDevice* NewL(); sl@0: virtual CMMFSwCodec& Codec(); sl@0: ~CMMFMulawToPcm16CodecHwDevice(); sl@0: private: sl@0: void ConstructL(); sl@0: }; sl@0: sl@0: /* sl@0: * sl@0: * class CMMFMulawToPcm16Codec coverts MuLaw to PCM sl@0: * sl@0: */ sl@0: class CMMFMulawToPcm16Codec : public CMMFSwCodec sl@0: { sl@0: public: sl@0: virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest); sl@0: virtual TUint SourceBufferSize() {return KMuLawToCM16SrcBufferSize;}; sl@0: virtual TUint SinkBufferSize() {return KMuLawToCM16SinkBufferSize;}; sl@0: private: sl@0: TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer ); sl@0: TInt MulawSampleToPcm(TUint8 aAlaw); sl@0: private: sl@0: TMMFAudioMuLawToS16PcmCodec iMulawTo16Pcm; sl@0: }; sl@0: sl@0: #endif //__MMF_MULAW_TO_PCM16_HW_DEVICE_H__