os/mm/devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtPcm16ToImaAdpcm.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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_IMAADPCM_HW_DEVICE_H__
    17 #define __MMF_BT_PCM16_TO_IMAADPCM_HW_DEVICE_H__
    18 
    19 #include <mmfbtswcodecwrapper.h>
    20 #include "MMFAudioCodecBase.h"
    21 #include "MmfBtAudioCodec.h"
    22 #include "MMFAudioPcm16ToImaAdpcmCodec.h"
    23 
    24 const TInt KPCM16ToImaSrcBufferSize  = 0x3F20;
    25 const TInt KPCM16ToImaSinkBufferSize = 0x1000;
    26 const TUint KSourceFrameSize = KImaAdpcmSamplesPerBlock * 2;
    27 const TUint KCodedFrameSize  = KImaAdpcmBlockAlign;
    28 
    29 /*
    30 *
    31 * class CMMFPcm16ToMulawHwDevice 
    32 *
    33 */
    34 class CMMFPcm16ToImaAdpcmHwDevice : public CMMFSwCodecWrapper
    35 	{	
    36 public:
    37 	static  CMMFPcm16ToImaAdpcmHwDevice* NewL();
    38 	virtual CMMFSwCodec& Codec();
    39 	~CMMFPcm16ToImaAdpcmHwDevice(); 
    40 private:
    41 	void ConstructL();
    42 	};
    43 
    44 /*
    45 *
    46 * class CMMFPcm16ToALawCodec coverts Pcm16 to Imaad
    47 *  
    48 */
    49 class CMMFPcm16ToImaAdpcmCodec : public CMMFSwCodec
    50 	{
    51 public:
    52 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
    53 	virtual TUint SourceBufferSize() {return KPCM16ToImaSrcBufferSize;};
    54 	virtual TUint SinkBufferSize() {return   KPCM16ToImaSinkBufferSize;};
    55 private:
    56 	virtual void ResetL();
    57 	void ProcessBuffers(const CMMFDataBuffer& aSource, CMMFDataBuffer& aDestination, CMMFSwCodec::TCodecProcessResult& aResult );
    58 	TBool BuffersStatus( const CMMFDataBuffer* source, const CMMFDataBuffer* destination );
    59 private:
    60 	TMMFAudioPcm16ToImaAdpcmCodec iPcm16ToImaAdpcm;
    61 	TMMFAudioPcm16ToImaAdpcmCodec i16PcmToImaAdpcm;
    62 	TUint iLastFrameNumber;
    63 	};
    64 
    65 #endif //__MMF_BT_PCM16_TO_IMAADPCM_HW_DEVICE_H__