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 "teststepciaacdecoderconfig.h" sl@0: sl@0: sl@0: TVerdict CTestStepCIAacDecoderConfig::DoTestStepL() sl@0: { sl@0: iTestStepResult = ETestSuiteError; sl@0: sl@0: INFO_PRINTF1(_L("Initializing test CI device")); sl@0: sl@0: if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0004-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0004L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0005-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0005L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0093-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0093L(); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIAacDecoderConfig::DoTestStep0004L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("AacDecoderConfig - Instantiating")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAacDecoderConfigTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidCustomInterfaceDevSoundAacConfig sl@0: MAacDecoderConfig* ptr = static_cast (iMMFDevSound->CustomInterface(KUidAacDecoderConfig)); sl@0: sl@0: if (ptr) sl@0: { sl@0: INFO_PRINTF1(_L("MAacDecoderConfig initialized successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MAacDecoderConfig failed to initialize")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIAacDecoderConfig::DoTestStep0005L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("AacDecoderConfig - SetAudioConfig")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAacDecoderConfigTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidCustomInterfaceDevSoundAacConfig sl@0: MAacDecoderConfig* ptr = static_cast (iMMFDevSound->CustomInterface(KUidAacDecoderConfig)); sl@0: sl@0: if (ptr) sl@0: { sl@0: MAacDecoderConfig::TAudioConfig audioConfig; sl@0: sl@0: // Set values before call. sl@0: audioConfig.iAudioObjectType = MAacDecoderConfig::TAudioConfig::EAacSsr; sl@0: sl@0: result = ptr->SetAudioConfig(audioConfig); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: TInt retAudioConfig; sl@0: sl@0: // This file is created by the test stub, the plugin device sl@0: _LIT(KFileName, "c:\\temp\\aacDecoderConfig.txt"); sl@0: sl@0: ReadFileL(KFileName, retAudioConfig); sl@0: sl@0: if (retAudioConfig == audioConfig.iAudioObjectType) sl@0: { sl@0: INFO_PRINTF1(_L("MAacDecoderConfig::SetAudioConfig finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MAacDecoderConfig::SetAudioConfig failed - expected and received mismatch")); sl@0: } sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MAacDecoderConfig failed to initialize")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIAacDecoderConfig::DoTestStep0093L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("AacDecoderConfig - GetSupportedAudioConfigs")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAacDecoderConfigTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // reset the value as previous test is pass sl@0: iTestStepResult = EFail; sl@0: sl@0: // KUidCustomInterfaceDevSoundAacConfig sl@0: MAacDecoderConfig* ptr = static_cast (iMMFDevSound->CustomInterface(KUidAacDecoderConfig)); sl@0: sl@0: if (ptr) sl@0: { sl@0: RArray audioConfig; sl@0: sl@0: result = ptr->GetSupportedAudioConfigs(audioConfig); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: if ( (audioConfig[0].iAudioObjectType == MAacDecoderConfig::TAudioConfig::ESbr) && sl@0: (audioConfig[1].iAudioObjectType == MAacDecoderConfig::TAudioConfig::EAacLtp) && sl@0: (audioConfig[2].iAudioObjectType == MAacDecoderConfig::TAudioConfig::EAacSsr) && sl@0: (audioConfig[3].iAudioObjectType == MAacDecoderConfig::TAudioConfig::EAacLc) && sl@0: (audioConfig[4].iAudioObjectType == MAacDecoderConfig::TAudioConfig::EAacMain) ) sl@0: { sl@0: INFO_PRINTF1(_L("MAacDecoderConfig::GetSupportedAudioConfigs finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MAacDecoderConfig::GetSupportedAudioConfigs failed - expected and received mismatch")); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MAacDecoderConfig::GetSupportedAudioConfigs failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MAacDecoderConfig failed to initialize")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: }