|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CPROCAMRFRAMEHANDLER_H__ |
|
22 #define __CPROCAMRFRAMEHANDLER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <f32file.h> |
|
26 |
|
27 #include "AudCommon.h" |
|
28 #include "ProcConstants.h" |
|
29 #include "ProcFrameHandler.h" |
|
30 |
|
31 class CProcAMRFrameHandler : public CProcFrameHandler |
|
32 { |
|
33 |
|
34 public: |
|
35 |
|
36 /* |
|
37 * Symbian constructors and a destructor |
|
38 */ |
|
39 |
|
40 static CProcAMRFrameHandler* NewL(); |
|
41 static CProcAMRFrameHandler* NewLC(); |
|
42 |
|
43 virtual ~CProcAMRFrameHandler(); |
|
44 |
|
45 // From base class CProcFrameHandler |
|
46 virtual TBool ManipulateGainL(const HBufC8* aFrameIn, HBufC8*& aFrameOut, TInt8 aGain); |
|
47 virtual TBool GetGainL(const HBufC8* aFrame, RArray<TInt>& aGains, TInt& aMaxGain) const; |
|
48 virtual TBool GetNormalizingMargin(const HBufC8* aFrame, TInt8& aMargin) const; |
|
49 |
|
50 |
|
51 private: |
|
52 |
|
53 // constructL |
|
54 void ConstructL(); |
|
55 |
|
56 // c++ constructor |
|
57 CProcAMRFrameHandler(); |
|
58 |
|
59 // internal function to read AMR gains |
|
60 TBool GetAMRGains(const HBufC8* aFrame, RArray<TInt>& aGains, TInt& aMaxGain) const; |
|
61 |
|
62 // gets the length of the next frame based on mode myte |
|
63 TInt GetNextFrameLength(const HBufC8* aFrame, TInt aPosNow); |
|
64 |
|
65 TBool GetGPGains(const HBufC8* aFrame, RArray<TInt>& aGains) const; |
|
66 |
|
67 // member variables for energy calculation |
|
68 mutable TReal iPreviousEnergy; |
|
69 mutable TReal iPreviousRn[4]; |
|
70 |
|
71 |
|
72 }; |
|
73 |
|
74 #endif |