diff -r 000000000000 -r 79dd3e2336a0 devsound/devsoundrefplugin/src/plugin/audio/MMFpcm16ToPcmU8HwDevice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devsound/devsoundrefplugin/src/plugin/audio/MMFpcm16ToPcmU8HwDevice.h Fri Oct 08 19:40:43 2010 +0100 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __MMF_PCM16_TO_PCMU8_HW_DEVICE_H__ +#define __MMF_PCM16_TO_PCMU8_HW_DEVICE_H__ + +#include +#include "MMFAudioCodec.h" + +#include + +const TInt KPCM16ToPCMU8SourceBufferSize = 0x2000; +const TInt KPCM16ToPCMU8SinkBufferSize = 0x1000; //sink buffer length is half source + +/* +* +* class CMMFPcm16ToPcmU8HwDevice +* +*/ +class CMMFPcm16ToPcmU8HwDevice : public CMMFSwCodecWrapper + { +public: + static CMMFPcm16ToPcmU8HwDevice* NewL(); + virtual CMMFSwCodec& Codec(); + ~CMMFPcm16ToPcmU8HwDevice(); +private: + void ConstructL(); + }; + +/* +* +* class CMMFPcm16ToPcmU8Codec converts Pcm16 to Pcm unsigned 8 bit +* +*/ +class CMMFPcm16ToPcmU8Codec : public CMMFSwCodec + { +public: + virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest); + virtual TUint SourceBufferSize() {return KPCM16ToPCMU8SourceBufferSize;}; + virtual TUint SinkBufferSize() {return KPCM16ToPCMU8SinkBufferSize;}; +private: + TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer ); +private: + TMMFAudioS16ToU8PcmCodec iAudioS16ToU8Pcm ; + }; + +#endif //__MMF_PCMS16_TO_PCMS8_HW_DEVICE_H__ +