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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMF_BT_PCM16_TO_IMAADPCM_HW_DEVICE_H__
17 #define __MMF_BT_PCM16_TO_IMAADPCM_HW_DEVICE_H__
19 #include <mmfbtswcodecwrapper.h>
20 #include "MMFAudioCodecBase.h"
21 #include "MmfBtAudioCodec.h"
22 #include "MMFAudioPcm16ToImaAdpcmCodec.h"
24 const TInt KPCM16ToImaSrcBufferSize = 0x3F20;
25 const TInt KPCM16ToImaSinkBufferSize = 0x1000;
26 const TUint KSourceFrameSize = KImaAdpcmSamplesPerBlock * 2;
27 const TUint KCodedFrameSize = KImaAdpcmBlockAlign;
31 * class CMMFPcm16ToMulawHwDevice
34 class CMMFPcm16ToImaAdpcmHwDevice : public CMMFSwCodecWrapper
37 static CMMFPcm16ToImaAdpcmHwDevice* NewL();
38 virtual CMMFSwCodec& Codec();
39 ~CMMFPcm16ToImaAdpcmHwDevice();
46 * class CMMFPcm16ToALawCodec coverts Pcm16 to Imaad
49 class CMMFPcm16ToImaAdpcmCodec : public CMMFSwCodec
52 virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest);
53 virtual TUint SourceBufferSize() {return KPCM16ToImaSrcBufferSize;};
54 virtual TUint SinkBufferSize() {return KPCM16ToImaSinkBufferSize;};
56 virtual void ResetL();
57 void ProcessBuffers(const CMMFDataBuffer& aSource, CMMFDataBuffer& aDestination, CMMFSwCodec::TCodecProcessResult& aResult );
58 TBool BuffersStatus( const CMMFDataBuffer* source, const CMMFDataBuffer* destination );
60 TMMFAudioPcm16ToImaAdpcmCodec iPcm16ToImaAdpcm;
61 TMMFAudioPcm16ToImaAdpcmCodec i16PcmToImaAdpcm;
62 TUint iLastFrameNumber;
65 #endif //__MMF_BT_PCM16_TO_IMAADPCM_HW_DEVICE_H__