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 "teststepciadvancedaacencodesettings.h" sl@0: #include "cidefine.h" sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCICreateAdvancedAacEncodeSettings::CTestStepCICreateAdvancedAacEncodeSettings() sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0006-HP"); sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: TVerdict CTestStepCICreateAdvancedAacEncodeSettings::DoTestStepL() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("Initializing test CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','5'); sl@0: #endif sl@0: sl@0: MMMFAdvancedAACEncodeSettings* interface = NULL; sl@0: interface = static_cast( sl@0: InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings)); 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: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: CTestStepCIAdvancedAacEncodeSettings::CTestStepCIAdvancedAacEncodeSettings(TBool aIsGetTest) sl@0: : iIsGetTest(aIsGetTest) sl@0: { sl@0: if (iIsGetTest) sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0099-HP"); sl@0: } sl@0: else sl@0: { sl@0: iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0007-HP"); sl@0: } sl@0: } sl@0: sl@0: /*****************************************************************************/ sl@0: TVerdict CTestStepCIAdvancedAacEncodeSettings::DoTestStepL() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("Initializing test CI device")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','0','5'); sl@0: #endif sl@0: sl@0: MMMFAdvancedAACEncodeSettings* interface = NULL; sl@0: interface = static_cast( sl@0: InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings)); sl@0: sl@0: if (interface) sl@0: { sl@0: MMMFAdvancedAACEncodeSettings::TAACBitrateMode bitrateMode = MMMFAdvancedAACEncodeSettings::EAACBitrateModeFixed; sl@0: INFO_PRINTF1(_L("Calling test CI method")); sl@0: TInt err = interface->SetAACEncodeBitrateMode(bitrateMode); sl@0: sl@0: if (iIsGetTest) sl@0: { sl@0: INFO_PRINTF1(_L("Testing GetAACEncodeBitrateMode")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Testing SetAACEncodeBitrateMode")); sl@0: } sl@0: sl@0: if (err == KErrNone) sl@0: { sl@0: // Successfully set the mode sl@0: INFO_PRINTF1(_L("Set the mode successfully")); sl@0: sl@0: MMMFAdvancedAACEncodeSettings::TAACBitrateMode testMode; sl@0: sl@0: err = interface->GetAACEncodeBitrateMode(testMode); sl@0: sl@0: iTestStepResult = EFail; sl@0: if ((err == KErrNone) && (testMode == bitrateMode)) sl@0: { sl@0: INFO_PRINTF1(_L("Test CI method call was successful")); sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF4(_L("Test CI method failed, error: %d, expected value: %d, actual value: %d"), \ sl@0: err, bitrateMode, testMode); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("Test CI method failed, error"), err); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: WARN_PRINTF1(_L("Failed to retrieve the custom interface.")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: }