sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "teststepcieaacplusdecoder.h" sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoder::CTestStepCIEAacPlusDecoder() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0008-HP"); sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: TVerdict CTestStepCIEAacPlusDecoder::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: sl@0: if (interface) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully retrieved the interface.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface")); sl@0: } sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderGetSetFrequency::CTestStepCIEAacPlusDecoderGetSetFrequency(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0015-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0009-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderGetSetFrequency::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Sampling Frequency")); sl@0: TUint frequency = 666; sl@0: interface->SetInputSamplingFrequency(frequency); sl@0: sl@0: TUint testFrequency; sl@0: TInt err = interface->GetInputSamplingFrequency(testFrequency); sl@0: if (err == KErrNone && testFrequency == frequency) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the frequency.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the frequency.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the frequency")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the frequency")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderGetSetObjType::CTestStepCIEAacPlusDecoderGetSetObjType(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0016-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0010-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderGetSetObjType::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Object Type")); sl@0: sl@0: MEAacPlusDecoderIntfc::TAudioObjectType audioObjectType = MEAacPlusDecoderIntfc::EAacLtp; sl@0: interface->SetAudioObjectType(audioObjectType); sl@0: sl@0: MEAacPlusDecoderIntfc::TAudioObjectType testAudioObjectType; sl@0: interface->GetAudioObjectType(testAudioObjectType); sl@0: if (audioObjectType == testAudioObjectType) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the object type.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the object type.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the object type")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the object type")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderGetSetNumChannels::CTestStepCIEAacPlusDecoderGetSetNumChannels(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0017-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0011-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderGetSetNumChannels::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Number of Channels")); sl@0: TUint numChannels = 2; sl@0: interface->SetNumOfChannels(numChannels); sl@0: sl@0: TUint testNumChannels; sl@0: interface->GetNumOfChannels(testNumChannels); sl@0: if (testNumChannels == numChannels) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the number of channels.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the number of channels.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get the number of channels")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set the number of channels")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderGetSetSbr::CTestStepCIEAacPlusDecoderGetSetSbr(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0018-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0012-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderGetSetSbr::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the EAAC+ Decoder's SBR")); sl@0: interface->SetSbr(ETrue); sl@0: sl@0: TBool testSbr = EFalse; sl@0: interface->GetSbr(testSbr); sl@0: if (testSbr) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got SBR.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set SBR.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: if (iIsGetTest) sl@0: { sl@0: ERR_PRINTF1(_L("Failed to get SBR.")); sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("Failed to set SBR.")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderGetSetDsm::CTestStepCIEAacPlusDecoderGetSetDsm(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0019-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0013-HP"); sl@0: } sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderGetSetDsm::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Setting the EAAC+ Decoder's Down Sampled Mode")); sl@0: interface->SetDownSampledMode(ETrue); sl@0: sl@0: TBool testDSM = EFalse; sl@0: interface->GetDownSampledMode(testDSM); sl@0: if (testDSM) sl@0: { sl@0: iTestStepResult = EPass; sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Successfully got the DSM.")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Successfully set the DSM.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF1(_L("Failed to set the DSM.")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIEAacPlusDecoderApplyConfig::CTestStepCIEAacPlusDecoderApplyConfig() sl@0: { sl@0: sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0014-HP"); sl@0: } sl@0: sl@0: TVerdict CTestStepCIEAacPlusDecoderApplyConfig::DoTestStepL() sl@0: { sl@0: INFO_PRINTF1(_L("Initializing test EAAC+ Decoder CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice and try to get the interface sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidEAacPlusDecoderTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','2'); sl@0: #endif sl@0: sl@0: MEAacPlusDecoderIntfc* interface = NULL; sl@0: interface = static_cast(InitializeAndInstantiateInterfaceL(testUID, KUidEAacPlusDecoderIntfc)); sl@0: if (interface) sl@0: { sl@0: INFO_PRINTF1(_L("Applying the config to the EAAC+ Decoder")); sl@0: TInt err = interface->ApplyConfig(); sl@0: if (err == KErrNone) sl@0: { sl@0: iTestStepResult = EPass; sl@0: INFO_PRINTF1(_L("Successfully applied the config.")); sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EFail; sl@0: ERR_PRINTF2(_L("Failed to apply the config, error: %d"), err); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: iTestStepResult = EInconclusive; sl@0: ERR_PRINTF1(_L("Failed to retrieve the interface.")); sl@0: } sl@0: return iTestStepResult; sl@0: }