devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtPcm16ToAlawHwDevice.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_ALAW_HW_DEVICE_H__
       
    17 #define __MMF_BT_PCM16_TO_ALAW_HW_DEVICE_H__
       
    18 #include <mmfbtswcodecwrapper.h>
       
    19 #include "MmfBtAudioCodec.h"
       
    20 #include "MMFAudioSPcm16ToALawCodec.h"
       
    21 
       
    22 const TInt KPCM16ToALawSrcBufferSize  = 0x2000;
       
    23 const TInt KPCM16ToAlawSinkBufferSize = 0x1000;
       
    24 
       
    25 /*
       
    26 *
       
    27 * class CMMFPcm16ToAlawHwDevice 
       
    28 *
       
    29 */
       
    30 class CMMFPcm16ToAlawHwDevice : public CMMFSwCodecWrapper
       
    31 	{
       
    32 public:
       
    33 	static  CMMFPcm16ToAlawHwDevice* NewL();
       
    34 	virtual CMMFSwCodec& Codec();
       
    35     ~CMMFPcm16ToAlawHwDevice(); 
       
    36 private:
       
    37 	void ConstructL();
       
    38 	};
       
    39 
       
    40 /*
       
    41 *
       
    42 * class CMMFPcm16ToALawCodec coverts PCM to ALaw
       
    43 *  
       
    44 */
       
    45 class CMMFPcm16ToALawCodec : public CMMFSwCodec
       
    46 	{
       
    47 public:
       
    48 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
       
    49 	virtual TUint SourceBufferSize() {return KPCM16ToALawSrcBufferSize;};
       
    50 	virtual TUint SinkBufferSize() {return KPCM16ToAlawSinkBufferSize;};
       
    51 private:
       
    52 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
       
    53 private:
       
    54 	TMMFAudioSPcm16ToAlawCodec  iPcm16ToALaw;
       
    55 	};
       
    56 
       
    57 #endif //__MMF_BT_PCM16_TO_ALAW_HW_DEVICE_H__