|
1 /* |
|
2 * Copyright (c) 2006 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: Audio Stubs - Custom Interface stub implementation for eAAC+ decoder. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32debug.h> |
|
21 #include "EAacPlusDecoderIntfcCI.h" |
|
22 |
|
23 // EXTERNAL DATA STRUCTURES |
|
24 |
|
25 // EXTERNAL FUNCTION PROTOTYPES |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // LOCAL CONSTANTS AND MACROS |
|
32 |
|
33 // MODULE DATA STRUCTURES |
|
34 |
|
35 // LOCAL FUNCTION PROTOTYPES |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 |
|
39 // ============================= LOCAL FUNCTIONS =============================== |
|
40 |
|
41 // ============================ MEMBER FUNCTIONS =============================== |
|
42 |
|
43 /** |
|
44 * CEAacPlusDecoderIntfcCI::CEAacPlusDecoderIntfcCI |
|
45 * C++ default constructor can NOT contain any code, that might leave. |
|
46 */ |
|
47 CEAacPlusDecoderIntfcCI::CEAacPlusDecoderIntfcCI() |
|
48 { |
|
49 } |
|
50 |
|
51 /** |
|
52 * CEAacPlusDecoderIntfcCI::ConstructL |
|
53 * Symbian 2nd phase constructor can leave. |
|
54 */ |
|
55 void CEAacPlusDecoderIntfcCI::ConstructL() |
|
56 { |
|
57 } |
|
58 |
|
59 /** |
|
60 * CEAacPlusDecoderIntfcCI::NewL |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 EXPORT_C CEAacPlusDecoderIntfcCI* CEAacPlusDecoderIntfcCI::NewL() |
|
64 { |
|
65 CEAacPlusDecoderIntfcCI* self = new (ELeave)CEAacPlusDecoderIntfcCI; |
|
66 CleanupStack::PushL(self); |
|
67 self->ConstructL(); |
|
68 CleanupStack::Pop(self); |
|
69 return self; |
|
70 } |
|
71 |
|
72 /** |
|
73 * Destructor |
|
74 */ |
|
75 EXPORT_C CEAacPlusDecoderIntfcCI::~CEAacPlusDecoderIntfcCI() |
|
76 { |
|
77 } |
|
78 |
|
79 |
|
80 // From CEAacPlusDecoderIntfc |
|
81 |
|
82 /** |
|
83 * Configures decoder's profile defined by TAudioObjectType. |
|
84 * (other items defined in the header) |
|
85 */ |
|
86 EXPORT_C void CEAacPlusDecoderIntfcCI::SetAudioObjectType( |
|
87 TAudioObjectType aAudioObjectType) |
|
88 { |
|
89 iAudioObjectType = aAudioObjectType; |
|
90 |
|
91 #ifdef _DEBUG |
|
92 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetAudioObjectType - object type[%d]"), |
|
93 iAudioObjectType); |
|
94 #endif //_DEBUG |
|
95 } |
|
96 |
|
97 /** |
|
98 * Configures decoder's input sampling frequency. |
|
99 * (other items defined in the header) |
|
100 */ |
|
101 EXPORT_C void CEAacPlusDecoderIntfcCI::SetInputSamplingFrequency( |
|
102 TUint aInputSamplingFrequency) |
|
103 { |
|
104 iInputSamplingFrequency = aInputSamplingFrequency; |
|
105 |
|
106 #ifdef _DEBUG |
|
107 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetInputSamplingFrequency [%d]"), |
|
108 iInputSamplingFrequency); |
|
109 #endif //_DEBUG |
|
110 } |
|
111 |
|
112 /** |
|
113 * Configures decoder's channel settings. |
|
114 * (other items defined in the header) |
|
115 */ |
|
116 EXPORT_C void CEAacPlusDecoderIntfcCI::SetNumOfChannels(TUint aNumChannels) |
|
117 { |
|
118 iNumOfChannels = aNumChannels; |
|
119 |
|
120 #ifdef _DEBUG |
|
121 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetNumOfChannels [%d]"), |
|
122 iNumOfChannels); |
|
123 #endif //_DEBUG |
|
124 } |
|
125 |
|
126 /** |
|
127 * Configures decoder's SBR settings. |
|
128 * (other items defined in the header) |
|
129 */ |
|
130 EXPORT_C void CEAacPlusDecoderIntfcCI::SetSbr(TBool aSbrEnabled) |
|
131 { |
|
132 iSbrEnabled = aSbrEnabled; |
|
133 |
|
134 #ifdef _DEBUG |
|
135 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetSbr [%d]"), iSbrEnabled); |
|
136 #endif //_DEBUG |
|
137 } |
|
138 |
|
139 /** |
|
140 * Configures decoder's DSM settings. |
|
141 * (other items defined in the header) |
|
142 */ |
|
143 EXPORT_C void CEAacPlusDecoderIntfcCI::SetDownSampledMode(TBool aDsmEnabled) |
|
144 { |
|
145 iDsmEnabled = aDsmEnabled; |
|
146 |
|
147 #ifdef _DEBUG |
|
148 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::SetDownSampledMode [%d]"), |
|
149 iDsmEnabled); |
|
150 #endif //_DEBUG |
|
151 } |
|
152 |
|
153 /** |
|
154 * Returns decoder's AAC profile settings. |
|
155 * (other items defined in the header) |
|
156 */ |
|
157 EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetAudioObjectType( |
|
158 TAudioObjectType& aAudioObjectType) |
|
159 { |
|
160 aAudioObjectType = iCurrentAudioObjectType; |
|
161 |
|
162 #ifdef _DEBUG |
|
163 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetAudioObjectType [%d]"), |
|
164 iAudioObjectType); |
|
165 #endif //_DEBUG |
|
166 |
|
167 return KErrNone; |
|
168 } |
|
169 |
|
170 /** |
|
171 * Returns decoder's input sampling frequency settings. |
|
172 * (other items defined in the header) |
|
173 */ |
|
174 EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetInputSamplingFrequency( |
|
175 TUint& aInputSamplingFrequency) |
|
176 { |
|
177 aInputSamplingFrequency = iCurrentInputSamplingFrequency; |
|
178 |
|
179 #ifdef _DEBUG |
|
180 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetInputSamplingFrequency [%d]"), |
|
181 iInputSamplingFrequency); |
|
182 #endif //_DEBUG |
|
183 |
|
184 return KErrNone; |
|
185 } |
|
186 |
|
187 /** |
|
188 * Returns decoder's channel settings. |
|
189 * (other items defined in the header) |
|
190 */ |
|
191 EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetNumOfChannels(TUint& aNumOfChannels) |
|
192 { |
|
193 aNumOfChannels = iCurrentNumOfChannels; |
|
194 |
|
195 #ifdef _DEBUG |
|
196 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetNumOfChannels [%d]"), |
|
197 iCurrentNumOfChannels); |
|
198 #endif //_DEBUG |
|
199 |
|
200 return KErrNone; |
|
201 } |
|
202 |
|
203 /** |
|
204 * Returns decoder's SBR settings. |
|
205 * (other items defined in the header) |
|
206 */ |
|
207 EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetSbr(TBool& aSbrEnabled) |
|
208 { |
|
209 aSbrEnabled = iCurrentSbrEnabled; |
|
210 |
|
211 #ifdef _DEBUG |
|
212 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetSbr [%d]"), |
|
213 iCurrentSbrEnabled); |
|
214 #endif //_DEBUG |
|
215 |
|
216 return KErrNone; |
|
217 } |
|
218 |
|
219 /** |
|
220 * Returns decoder's DSM settings. |
|
221 * (other items defined in the header) |
|
222 */ |
|
223 EXPORT_C TInt CEAacPlusDecoderIntfcCI::GetDownSampledMode(TBool& aDsmEnabled) |
|
224 { |
|
225 aDsmEnabled = iCurrentDsmEnabled; |
|
226 |
|
227 #ifdef _DEBUG |
|
228 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::GetDownSampledMode [%d]"), |
|
229 iCurrentDsmEnabled); |
|
230 #endif //_DEBUG |
|
231 |
|
232 return KErrNone; |
|
233 } |
|
234 |
|
235 /** |
|
236 * Applies configuration settings to the decoder. |
|
237 * (other items defined in the header) |
|
238 */ |
|
239 EXPORT_C TInt CEAacPlusDecoderIntfcCI::ApplyConfig() |
|
240 { |
|
241 iCurrentAudioObjectType = iAudioObjectType; |
|
242 iCurrentInputSamplingFrequency = iInputSamplingFrequency; |
|
243 iCurrentNumOfChannels = iNumOfChannels; |
|
244 iCurrentSbrEnabled = iSbrEnabled; |
|
245 iCurrentDsmEnabled = iDsmEnabled; |
|
246 |
|
247 #ifdef _DEBUG |
|
248 RDebug::Print(_L("CEAacPlusDecoderIntfcCI::ApplyConfig - eAAC+ Config Applied")); |
|
249 #endif //_DEBUG |
|
250 |
|
251 return KErrNone; |
|
252 } |
|
253 |
|
254 // End of file |