devsound/devsoundrefplugin/src/plugin/audio/MmfMuLawToPcm16hwDevice.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 /*
       
     2 * Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __MMF_MULAW_TO_PCM16_HW_DEVICE_H__
       
    19 #define __MMF_MULAW_TO_PCM16_HW_DEVICE_H__
       
    20 
       
    21 #include <mmf/server/mmfswcodecwrapper.h>
       
    22 #include "MMFAudioCodecBase.h"
       
    23 
       
    24 #include "MMFAudioMuLawToS16PcmCodec.h"
       
    25 
       
    26 const TInt KMuLawToCM16SrcBufferSize  = 0x1000;
       
    27 const TInt KMuLawToCM16SinkBufferSize = 0x2000;
       
    28 
       
    29 /*
       
    30 *
       
    31 * class CMMFMulawToPcm16CodecHwDevice 
       
    32 *
       
    33 */
       
    34 class CMMFMulawToPcm16CodecHwDevice : public CMMFSwCodecWrapper
       
    35 	{
       
    36 public:
       
    37 	static  CMMFMulawToPcm16CodecHwDevice* NewL();
       
    38 	virtual CMMFSwCodec& Codec();
       
    39 	~CMMFMulawToPcm16CodecHwDevice(); 
       
    40 private:
       
    41 	void ConstructL();
       
    42 	};
       
    43 
       
    44 /*
       
    45 *
       
    46 * class CMMFMulawToPcm16Codec coverts MuLaw to PCM
       
    47 *  
       
    48 */
       
    49 class CMMFMulawToPcm16Codec : public CMMFSwCodec
       
    50 	{
       
    51 public:
       
    52 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
       
    53 	virtual TUint SourceBufferSize() {return KMuLawToCM16SrcBufferSize;};
       
    54 	virtual TUint SinkBufferSize() {return KMuLawToCM16SinkBufferSize;};
       
    55 private:
       
    56 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
       
    57 	TInt MulawSampleToPcm(TUint8 aAlaw);
       
    58 private:
       
    59 	TMMFAudioMuLawToS16PcmCodec iMulawTo16Pcm;
       
    60 	};
       
    61 
       
    62 #endif //__MMF_MULAW_TO_PCM16_HW_DEVICE_H__