os/mm/devsound/sounddevbt/src/Plugin/HwDevice/Audio/MmfBtImaAdpcmToPcm16HwDevice.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_IMAADPCM_TO_PCM16_HW_DEVICE_H__
    17 #define __MMF_BT_IMAADPCM_TO_PCM16_HW_DEVICE_H__
    18 #include <mmfbtswcodecwrapper.h>
    19 #include "MMFAudioCodecBase.h"
    20 #include "MMFAudioImaAdpcmToS16PcmCodec.h"
    21 
    22 const TInt KImaToPCM16SrcBufferSize  = 1024;
    23 const TInt KImaToPCM16SinkBufferSize = 4096;
    24 
    25 /*
    26 *
    27 * class CMMFImaAdpcmToPcm16CodecHwDevice 
    28 *
    29 */
    30 class CMMFImaAdpcmToPcm16CodecHwDevice : public CMMFSwCodecWrapper
    31 	{
    32 public:
    33 	static  CMMFImaAdpcmToPcm16CodecHwDevice* NewL();
    34 	virtual CMMFSwCodec& Codec();
    35 	~CMMFImaAdpcmToPcm16CodecHwDevice(); 
    36 	virtual TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd);
    37 private:
    38 	void ConstructL();
    39 	};
    40 
    41 /*
    42 *
    43 * class CMMFMulawToPcm16Codec coverts Imaad to PCM16
    44 *  
    45 */
    46 class CMMFImaAdpcmToPcm16Codec : public CMMFSwCodec
    47 	{
    48 public:
    49 	CMMFImaAdpcmToPcm16Codec();
    50 	virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
    51 	virtual TUint SourceBufferSize() {return KImaToPCM16SrcBufferSize;}
    52 	virtual TUint SinkBufferSize() {return KImaToPCM16SinkBufferSize;}
    53 	TInt Configure(TUint aChannels, TUint aSampleRate);
    54 private:
    55 	TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer );
    56 private:
    57 	TMMFAudioImaAdpcmToS16PcmCodec iImaAdpcmTo16Pcm;
    58 	
    59 private:
    60 	TUint iChannels;
    61 	TUint iSampleRate;
    62 	TUint iBlockAlign;
    63 	TUint iSamplesPerBlock;
    64 	};
    65 
    66 #endif //__MMF_BT_IMAADPCM_TO_PCM16_HW_DEVICE_H__