|
1 /* |
|
2 * Copyright (c) 2002-2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MMF_PCM16_TO_IMAADPCM_HW_DEVICE_H__ |
|
19 #define __MMF_PCM16_TO_IMAADPCM_HW_DEVICE_H__ |
|
20 |
|
21 #include <mmf/server/mmfswcodecwrapper.h> |
|
22 #include "MMFAudioCodecBase.h" |
|
23 #include "MMFAudioCodec.h" |
|
24 #include "MMFAudioPcm16ToImaAdpcmCodec.h" |
|
25 |
|
26 const TInt KPCM16ToImaSrcBufferSize = 0x3F20; |
|
27 const TInt KPCM16ToImaSinkBufferSize = 0x1000; |
|
28 const TUint KSourceFrameSize = KImaAdpcmSamplesPerBlock * 2; |
|
29 const TUint KCodedFrameSize = KImaAdpcmBlockAlign; |
|
30 |
|
31 /* |
|
32 * |
|
33 * class CMMFPcm16ToMulawHwDevice |
|
34 * |
|
35 */ |
|
36 class CMMFPcm16ToImaAdpcmHwDevice : public CMMFSwCodecWrapper |
|
37 { |
|
38 public: |
|
39 static CMMFPcm16ToImaAdpcmHwDevice* NewL(); |
|
40 virtual CMMFSwCodec& Codec(); |
|
41 ~CMMFPcm16ToImaAdpcmHwDevice(); |
|
42 private: |
|
43 void ConstructL(); |
|
44 }; |
|
45 |
|
46 /* |
|
47 * |
|
48 * class CMMFPcm16ToALawCodec coverts Pcm16 to Imaad |
|
49 * |
|
50 */ |
|
51 class CMMFPcm16ToImaAdpcmCodec : public CMMFSwCodec |
|
52 { |
|
53 public: |
|
54 virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest); |
|
55 virtual TUint SourceBufferSize() {return KPCM16ToImaSrcBufferSize;}; |
|
56 virtual TUint SinkBufferSize() {return KPCM16ToImaSinkBufferSize;}; |
|
57 private: |
|
58 virtual void ResetL(); |
|
59 void ProcessBuffers(const CMMFDataBuffer& aSource, CMMFDataBuffer& aDestination, CMMFSwCodec::TCodecProcessResult& aResult ); |
|
60 TBool BuffersStatus( const CMMFDataBuffer* source, const CMMFDataBuffer* destination ); |
|
61 private: |
|
62 TMMFAudioPcm16ToImaAdpcmCodec iPcm16ToImaAdpcm; |
|
63 TMMFAudioPcm16ToImaAdpcmCodec i16PcmToImaAdpcm; |
|
64 TUint iLastFrameNumber; |
|
65 }; |
|
66 |
|
67 #endif //__MMF_PCM16_TO_IMAADPCM_HW_DEVICE_H__ |