|
1 /* |
|
2 * Copyright (c) 2009 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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef EAACPLUSFRAMEPARSER_H |
|
20 #define EAACPLUSFRAMEPARSER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "EAacPlusUtil.h" |
|
25 |
|
26 class CFrameTable; |
|
27 class CMMFBuffer; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * This class implements utility functions to extract AAC frame |
|
33 * information. |
|
34 * |
|
35 * @lib MmfEAacPlusUtil.lib |
|
36 * @since 3.2 |
|
37 */ |
|
38 class CEAacPlusFrameParser : public CBase |
|
39 { |
|
40 public: |
|
41 |
|
42 class TEAacPlusParserConfig |
|
43 { |
|
44 public: |
|
45 CEAacPlusUtil::TEAacPlusFrameLenConfig iFrameLenConfig; // config info needed by util for frame length. |
|
46 TInt iOutSamplingFrequency; // output sampling freq of decoder |
|
47 TInt iNumOfSamples; // samples per frame |
|
48 CFrameTable* iFrameTable; // the frame table |
|
49 }; |
|
50 |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 IMPORT_C static CEAacPlusFrameParser* NewL(); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 IMPORT_C virtual ~CEAacPlusFrameParser(); |
|
62 |
|
63 public: // New functions |
|
64 |
|
65 /** |
|
66 * Used to parse the aac frames and populate the seek table. |
|
67 * @since 3.2 |
|
68 * @param aBuf buffer of AAC data from start of aac content |
|
69 * @param aBufLen length of aBuf |
|
70 * @return status |
|
71 */ |
|
72 IMPORT_C TInt Parse(const CMMFBuffer& aSrc, TInt& aSrcUsed); |
|
73 |
|
74 /** |
|
75 * Used to configure the utility with information needed to enable the apis. |
|
76 * This api can be used if GetAacFrameInfo is not used to initialize the utility. |
|
77 * @since 3.2 |
|
78 * @param aFormatType format type |
|
79 * @param aSamplingFrequency sampling frequency |
|
80 * @return status |
|
81 */ |
|
82 IMPORT_C TInt Config(TEAacPlusParserConfig& aParserConfig); |
|
83 IMPORT_C TInt ReConfig(); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * C++ default constructor. |
|
89 */ |
|
90 CEAacPlusFrameParser(); |
|
91 |
|
92 /** |
|
93 * By default Symbian 2nd phase constructor is private. |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 private: // Data |
|
98 CEAacPlusUtil* iAacUtil; |
|
99 CFrameTable* iFrameTable; |
|
100 |
|
101 // local input buffer |
|
102 TUint8* iTmpBuf; |
|
103 const TUint8* iTmpBufPtr; |
|
104 TInt iTmpBufBytes; |
|
105 TInt iBytesCopied; |
|
106 |
|
107 TBool iUsingTmpBuf; |
|
108 |
|
109 TInt iPos; |
|
110 // CEAacPlusUtil::TEAacPlusFormatType iFormatType; |
|
111 // TInt iInSamplingFrequency; |
|
112 // TInt iOutSamplingFrequency; |
|
113 // TInt iNumOfSamples; |
|
114 TEAacPlusParserConfig iParserConfig; |
|
115 |
|
116 }; |
|
117 |
|
118 #endif // EAACPLUSFRAMEPARSER_H |
|
119 |
|
120 // End of File |