|
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 // MmfBtpcm16ToPcmU8HwDevice.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __MMF_BT_ALAW_TO_PCM16_HW_DEVICE_H__ |
|
19 #define __MMF_BT_ALAW_TO_PCM16_HW_DEVICE_H__ |
|
20 #include <mmfbtswcodecwrapper.h> |
|
21 #include "MMFAudioCodecBase.h" |
|
22 #include "MMFAudioALawToS16PcmCodec.h" |
|
23 |
|
24 const TInt KALawToCM16SrcBufferSize = 0x1000; |
|
25 const TInt KALawToCM16SinkBufferSize = 0x2000; |
|
26 |
|
27 /* |
|
28 * |
|
29 * CMMFAlawToPcm16CodecHwDevice |
|
30 * |
|
31 */ |
|
32 class CMMFAlawToPcm16CodecHwDevice : public CMMFSwCodecWrapper |
|
33 { |
|
34 public: |
|
35 static CMMFAlawToPcm16CodecHwDevice* NewL(); |
|
36 virtual CMMFSwCodec& Codec(); |
|
37 ~CMMFAlawToPcm16CodecHwDevice(); |
|
38 private: |
|
39 void ConstructL(); |
|
40 }; |
|
41 |
|
42 /* |
|
43 * |
|
44 * class CMMFAlawToPcm16Codec coverts ALaw to PCM |
|
45 * |
|
46 */ |
|
47 class CMMFAlawToPcm16Codec : public CMMFSwCodec |
|
48 { |
|
49 public: |
|
50 virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest); |
|
51 virtual TUint SourceBufferSize() {return KALawToCM16SrcBufferSize;}; |
|
52 virtual TUint SinkBufferSize() {return KALawToCM16SinkBufferSize;}; |
|
53 private: |
|
54 TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer ); |
|
55 TInt AlawSampleToPcm(TUint8 aAlaw); |
|
56 private: |
|
57 TMMFAudioALawToS16PcmCodec iAlawTo16Pcm; |
|
58 }; |
|
59 |
|
60 #endif //__MMF_BT_ALAW_TO_PCM16_HW_DEVICE_H__ |
|
61 |