devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtPcm16ToPcmU8HwDevice.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2002-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 __MMF_BT_PCM16_TO_PCMU8_HW_DEVICE_H__
       
    17 #define __MMF_BT_PCM16_TO_PCMU8_HW_DEVICE_H__
       
    18 
       
    19 #include <mmfbtswcodecwrapper.h>
       
    20 #include "MmfBtAudioCodec.h"
       
    21 
       
    22 #include "MMFAudioS16ToU8PcmCodec.h"
       
    23 
       
    24 const TInt KPCM16ToPCMU8SourceBufferSize = 0x2000;
       
    25 const TInt KPCM16ToPCMU8SinkBufferSize = 0x1000; //sink buffer length is half source
       
    26 
       
    27 /*
       
    28 *
       
    29 * class CMMFPcm16ToPcmU8HwDevice
       
    30 *
       
    31 */
       
    32 class CMMFPcm16ToPcmU8HwDevice : public CMMFSwCodecWrapper
       
    33 	{
       
    34 public:
       
    35 	static  CMMFPcm16ToPcmU8HwDevice* NewL();
       
    36 	virtual CMMFSwCodec& Codec();
       
    37 	~CMMFPcm16ToPcmU8HwDevice(); 
       
    38 private:
       
    39 	void ConstructL();
       
    40 	};
       
    41 
       
    42 /*
       
    43 *
       
    44 * class CMMFPcm16ToPcmU8Codec converts Pcm16 to Pcm unsigned 8 bit
       
    45 *
       
    46 */
       
    47 class CMMFPcm16ToPcmU8Codec : public CMMFSwCodec
       
    48 	{
       
    49 public:
       
    50 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
       
    51 	virtual TUint SourceBufferSize() {return KPCM16ToPCMU8SourceBufferSize;};
       
    52 	virtual TUint SinkBufferSize() {return KPCM16ToPCMU8SinkBufferSize;};
       
    53 private:
       
    54 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
       
    55 private:
       
    56 	TMMFAudioS16ToU8PcmCodec iAudioS16ToU8Pcm ;
       
    57 	};
       
    58 
       
    59 #endif //__MMF_BT_PCMS16_TO_PCMS8_HW_DEVICE_H__
       
    60