os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevSoundTest/CIPlugins/src/teststepcieaacplusdecoder.cpp
First public contribution.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "teststepcieaacplusdecoder.h"
18 /*****************************************************************************/
19 CTestStepCIEAacPlusDecoder::CTestStepCIEAacPlusDecoder()
21 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0008-HP");
24 /*****************************************************************************/
25 TVerdict CTestStepCIEAacPlusDecoder::DoTestStepL()
27 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
29 //Initialize - with the UID of our test HwDevice and try to get the interface
30 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
31 TUid testUID = {KUidEAacPlusDecoderTestDevice};
33 TFourCC testUID('T','0','0','2');
36 MEAacPlusDecoderIntfc* interface = NULL;
37 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
41 iTestStepResult = EPass;
42 INFO_PRINTF1(_L("Successfully retrieved the interface."));
46 iTestStepResult = EFail;
47 ERR_PRINTF1(_L("Failed to retrieve the interface"));
49 return iTestStepResult;
52 /*****************************************************************************/
53 CTestStepCIEAacPlusDecoderGetSetFrequency::CTestStepCIEAacPlusDecoderGetSetFrequency(TBool aIsGetTest)
54 : iIsGetTest(aIsGetTest)
58 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0015-HP");
62 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0009-HP");
66 TVerdict CTestStepCIEAacPlusDecoderGetSetFrequency::DoTestStepL()
68 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
70 //Initialize - with the UID of our test HwDevice and try to get the interface
71 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
72 TUid testUID = {KUidEAacPlusDecoderTestDevice};
74 TFourCC testUID('T','0','0','2');
77 MEAacPlusDecoderIntfc* interface = NULL;
78 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
82 INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Sampling Frequency"));
83 TUint frequency = 666;
84 interface->SetInputSamplingFrequency(frequency);
87 TInt err = interface->GetInputSamplingFrequency(testFrequency);
88 if (err == KErrNone && testFrequency == frequency)
90 iTestStepResult = EPass;
93 INFO_PRINTF1(_L("Successfully got the frequency."));
97 INFO_PRINTF1(_L("Successfully set the frequency."));
102 iTestStepResult = EFail;
105 ERR_PRINTF1(_L("Failed to get the frequency"));
109 ERR_PRINTF1(_L("Failed to set the frequency"));
115 iTestStepResult = EInconclusive;
116 ERR_PRINTF1(_L("Failed to retrieve the interface."));
119 return iTestStepResult;
122 /*****************************************************************************/
123 CTestStepCIEAacPlusDecoderGetSetObjType::CTestStepCIEAacPlusDecoderGetSetObjType(TBool aIsGetTest)
124 : iIsGetTest(aIsGetTest)
128 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0016-HP");
132 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0010-HP");
136 TVerdict CTestStepCIEAacPlusDecoderGetSetObjType::DoTestStepL()
138 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
140 //Initialize - with the UID of our test HwDevice and try to get the interface
141 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
142 TUid testUID = {KUidEAacPlusDecoderTestDevice};
144 TFourCC testUID('T','0','0','2');
147 MEAacPlusDecoderIntfc* interface = NULL;
148 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
151 INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Object Type"));
153 MEAacPlusDecoderIntfc::TAudioObjectType audioObjectType = MEAacPlusDecoderIntfc::EAacLtp;
154 interface->SetAudioObjectType(audioObjectType);
156 MEAacPlusDecoderIntfc::TAudioObjectType testAudioObjectType;
157 interface->GetAudioObjectType(testAudioObjectType);
158 if (audioObjectType == testAudioObjectType)
160 iTestStepResult = EPass;
163 INFO_PRINTF1(_L("Successfully got the object type."));
167 INFO_PRINTF1(_L("Successfully set the object type."));
172 iTestStepResult = EFail;
175 ERR_PRINTF1(_L("Failed to get the object type"));
179 ERR_PRINTF1(_L("Failed to set the object type"));
185 iTestStepResult = EInconclusive;
186 ERR_PRINTF1(_L("Failed to retrieve the interface."));
189 return iTestStepResult;
192 /*****************************************************************************/
193 CTestStepCIEAacPlusDecoderGetSetNumChannels::CTestStepCIEAacPlusDecoderGetSetNumChannels(TBool aIsGetTest)
194 : iIsGetTest(aIsGetTest)
198 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0017-HP");
202 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0011-HP");
206 TVerdict CTestStepCIEAacPlusDecoderGetSetNumChannels::DoTestStepL()
208 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
210 //Initialize - with the UID of our test HwDevice and try to get the interface
211 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
212 TUid testUID = {KUidEAacPlusDecoderTestDevice};
214 TFourCC testUID('T','0','0','2');
217 MEAacPlusDecoderIntfc* interface = NULL;
218 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
221 INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Number of Channels"));
222 TUint numChannels = 2;
223 interface->SetNumOfChannels(numChannels);
225 TUint testNumChannels;
226 interface->GetNumOfChannels(testNumChannels);
227 if (testNumChannels == numChannels)
229 iTestStepResult = EPass;
232 INFO_PRINTF1(_L("Successfully got the number of channels."));
236 INFO_PRINTF1(_L("Successfully set the number of channels."));
241 iTestStepResult = EFail;
244 ERR_PRINTF1(_L("Failed to get the number of channels"));
248 ERR_PRINTF1(_L("Failed to set the number of channels"));
254 iTestStepResult = EInconclusive;
255 ERR_PRINTF1(_L("Failed to retrieve the interface."));
258 return iTestStepResult;
261 /*****************************************************************************/
262 CTestStepCIEAacPlusDecoderGetSetSbr::CTestStepCIEAacPlusDecoderGetSetSbr(TBool aIsGetTest)
263 : iIsGetTest(aIsGetTest)
267 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0018-HP");
271 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0012-HP");
275 TVerdict CTestStepCIEAacPlusDecoderGetSetSbr::DoTestStepL()
277 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
279 //Initialize - with the UID of our test HwDevice and try to get the interface
280 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
281 TUid testUID = {KUidEAacPlusDecoderTestDevice};
283 TFourCC testUID('T','0','0','2');
286 MEAacPlusDecoderIntfc* interface = NULL;
287 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
290 INFO_PRINTF1(_L("Setting the EAAC+ Decoder's SBR"));
291 interface->SetSbr(ETrue);
293 TBool testSbr = EFalse;
294 interface->GetSbr(testSbr);
297 iTestStepResult = EPass;
300 INFO_PRINTF1(_L("Successfully got SBR."));
304 INFO_PRINTF1(_L("Successfully set SBR."));
309 iTestStepResult = EFail;
312 ERR_PRINTF1(_L("Failed to get SBR."));
316 ERR_PRINTF1(_L("Failed to set SBR."));
322 iTestStepResult = EInconclusive;
323 ERR_PRINTF1(_L("Failed to retrieve the interface."));
326 return iTestStepResult;
329 /*****************************************************************************/
330 CTestStepCIEAacPlusDecoderGetSetDsm::CTestStepCIEAacPlusDecoderGetSetDsm(TBool aIsGetTest)
331 : iIsGetTest(aIsGetTest)
335 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0019-HP");
339 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0013-HP");
343 TVerdict CTestStepCIEAacPlusDecoderGetSetDsm::DoTestStepL()
345 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
347 //Initialize - with the UID of our test HwDevice and try to get the interface
348 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
349 TUid testUID = {KUidEAacPlusDecoderTestDevice};
351 TFourCC testUID('T','0','0','2');
354 MEAacPlusDecoderIntfc* interface = NULL;
355 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
358 INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Down Sampled Mode"));
359 interface->SetDownSampledMode(ETrue);
361 TBool testDSM = EFalse;
362 interface->GetDownSampledMode(testDSM);
365 iTestStepResult = EPass;
368 INFO_PRINTF1(_L("Successfully got the DSM."));
372 INFO_PRINTF1(_L("Successfully set the DSM."));
377 iTestStepResult = EFail;
378 ERR_PRINTF1(_L("Failed to set the DSM."));
383 iTestStepResult = EInconclusive;
384 ERR_PRINTF1(_L("Failed to retrieve the interface."));
387 return iTestStepResult;
390 /*****************************************************************************/
391 CTestStepCIEAacPlusDecoderApplyConfig::CTestStepCIEAacPlusDecoderApplyConfig()
394 iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0014-HP");
397 TVerdict CTestStepCIEAacPlusDecoderApplyConfig::DoTestStepL()
399 INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device"));
401 //Initialize - with the UID of our test HwDevice and try to get the interface
402 #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
403 TUid testUID = {KUidEAacPlusDecoderTestDevice};
405 TFourCC testUID('T','0','0','2');
408 MEAacPlusDecoderIntfc* interface = NULL;
409 interface = static_cast<MEAacPlusDecoderIntfc*>(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc));
412 INFO_PRINTF1(_L("Applying the config to the EAAC+ Decoder"));
413 TInt err = interface->ApplyConfig();
416 iTestStepResult = EPass;
417 INFO_PRINTF1(_L("Successfully applied the config."));
421 iTestStepResult = EFail;
422 ERR_PRINTF2(_L("Failed to apply the config, error: %d"), err);
427 iTestStepResult = EInconclusive;
428 ERR_PRINTF1(_L("Failed to retrieve the interface."));
430 return iTestStepResult;