|
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 MMFIMAADPCMTOPCM16HWDEVICE_H |
|
17 #define MMFIMAADPCMTOPCM16HWDEVICE_H |
|
18 #include <mmf/server/mmfswcodecwrapper.h> |
|
19 #include "MMFAudioCodecBase.h" |
|
20 #include "MMFAudioImaAdpcmToS16PcmCodec.h" |
|
21 #include <mmf/server/devsoundstandardcustominterfaces.h> |
|
22 |
|
23 const TInt KImaToPCM16SrcBufferSize = 1024; |
|
24 const TInt KImaToPCM16SinkBufferSize = 4096; |
|
25 |
|
26 /* |
|
27 * |
|
28 * class CMMFImaAdpcmToPcm16CodecHwDevice |
|
29 * |
|
30 */ |
|
31 class CMMFImaAdpcmToPcm16CodecHwDevice : public CMMFSwCodecWrapper, public MMMFDevSoundCustomInterfaceFileBlockLength |
|
32 { |
|
33 public: |
|
34 static CMMFImaAdpcmToPcm16CodecHwDevice* NewL(); |
|
35 virtual CMMFSwCodec& Codec(); |
|
36 ~CMMFImaAdpcmToPcm16CodecHwDevice(); |
|
37 virtual TInt Start(TDeviceFunc aFuncCmd, TDeviceFlow aFlowCmd); |
|
38 private: |
|
39 void SetFileBlockLength(TUint aBlockAlign); |
|
40 TAny* CustomInterface(TUid aInterfaceId); |
|
41 private: |
|
42 void ConstructL(); |
|
43 |
|
44 private: |
|
45 TUint iBlockAlign; |
|
46 }; |
|
47 |
|
48 |
|
49 /* |
|
50 * |
|
51 * class CMMFMulawToPcm16Codec coverts Imaad to PCM16 |
|
52 * |
|
53 */ |
|
54 class CMMFImaAdpcmToPcm16Codec : public CMMFSwCodec |
|
55 { |
|
56 public: |
|
57 CMMFImaAdpcmToPcm16Codec(); |
|
58 virtual TCodecProcessResult ProcessL(const CMMFBuffer& aSource, CMMFBuffer& aDest); |
|
59 virtual TUint SourceBufferSize() {return KImaToPCM16SrcBufferSize;} |
|
60 virtual TUint SinkBufferSize() {return KImaToPCM16SinkBufferSize;} |
|
61 TInt Configure(TUint aChannels, TUint aSampleRate, TUint aBlockAlign = 0); |
|
62 private: |
|
63 TBool CheckPreconditions( const CMMFDataBuffer* aSrcBuffer, CMMFDataBuffer* aDestBuffer ); |
|
64 private: |
|
65 TMMFAudioImaAdpcmToS16PcmCodec iImaAdpcmTo16Pcm; |
|
66 |
|
67 private: |
|
68 TUint iChannels; |
|
69 TUint iSampleRate; |
|
70 TUint iBlockAlign; |
|
71 TUint iSamplesPerBlock; |
|
72 }; |
|
73 |
|
74 #endif //MMFIMAADPCMTOPCM16HWDEVICE_H |