devsound/devsoundrefplugin/src/plugin/audio/MMFpcm16ToPcmU8HwDevice.h
changeset 0 79dd3e2336a0
equal deleted inserted replaced
-1:000000000000 0:79dd3e2336a0
       
     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_PCM16_TO_PCMU8_HW_DEVICE_H__
       
    19 #define __MMF_PCM16_TO_PCMU8_HW_DEVICE_H__
       
    20 
       
    21 #include <mmf/server/mmfswcodecwrapper.h>
       
    22 #include "MMFAudioCodec.h"
       
    23 
       
    24 #include <mmfcodec/mmfaudios16tou8pcmcodec.h>
       
    25 
       
    26 const TInt KPCM16ToPCMU8SourceBufferSize = 0x2000;
       
    27 const TInt KPCM16ToPCMU8SinkBufferSize = 0x1000; //sink buffer length is half source
       
    28 
       
    29 /*
       
    30 *
       
    31 * class CMMFPcm16ToPcmU8HwDevice
       
    32 *
       
    33 */
       
    34 class CMMFPcm16ToPcmU8HwDevice : public CMMFSwCodecWrapper
       
    35 	{
       
    36 public:
       
    37 	static  CMMFPcm16ToPcmU8HwDevice* NewL();
       
    38 	virtual CMMFSwCodec& Codec();
       
    39 	~CMMFPcm16ToPcmU8HwDevice(); 
       
    40 private:
       
    41 	void ConstructL();
       
    42 	};
       
    43 
       
    44 /*
       
    45 *
       
    46 * class CMMFPcm16ToPcmU8Codec converts Pcm16 to Pcm unsigned 8 bit
       
    47 *
       
    48 */
       
    49 class CMMFPcm16ToPcmU8Codec : public CMMFSwCodec
       
    50 	{
       
    51 public:
       
    52 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
       
    53 	virtual TUint SourceBufferSize() {return KPCM16ToPCMU8SourceBufferSize;};
       
    54 	virtual TUint SinkBufferSize() {return KPCM16ToPCMU8SinkBufferSize;};
       
    55 private:
       
    56 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
       
    57 private:
       
    58 	TMMFAudioS16ToU8PcmCodec iAudioS16ToU8Pcm ;
       
    59 	};
       
    60 
       
    61 #endif //__MMF_PCMS16_TO_PCMS8_HW_DEVICE_H__
       
    62