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 "teststepciilbcencoderconfig.h" sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::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-0058-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0058L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0059-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0059L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0060-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0060L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0061-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0061L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0096-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0096L(); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0058L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("IlbcEncoderIntfc - Instantiating")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcEncoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); 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: // KUidCustomInterfaceDevSoundIlbcEncoderConfig sl@0: MIlbcEncoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc instantiated successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0059L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcEncoderIntfc - SetEncoderMode")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcEncoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); 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: // KUidIlbcEncoderIntfc sl@0: MIlbcEncoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: MIlbcEncoderIntfc::TEncodeMode encodeMode = MIlbcEncoderIntfc::E30msFrame; sl@0: sl@0: result = ptr->SetEncoderMode(MIlbcEncoderIntfc::E20msFrame); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetEncoderMode finished successfully")); sl@0: sl@0: result = ptr->GetEncoderMode(encodeMode); sl@0: sl@0: if (MIlbcEncoderIntfc::E20msFrame == encodeMode) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetEncoderMode finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetEncoderMode failed with result %d encodeMode %d"), result, encodeMode); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcEncoderIntfc::SetEncoderMode failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0096L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcEncoderIntfc - GetEncoderMode")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcEncoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); 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: // KUidIlbcEncoderIntfc sl@0: MIlbcEncoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: MIlbcEncoderIntfc::TEncodeMode encodeMode = MIlbcEncoderIntfc::E20msFrame; sl@0: sl@0: result = ptr->SetEncoderMode(MIlbcEncoderIntfc::E30msFrame); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetEncoderMode finished successfully")); sl@0: sl@0: result = ptr->GetEncoderMode(encodeMode); // call method sl@0: sl@0: if (MIlbcEncoderIntfc::E30msFrame == encodeMode) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetEncoderMode finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcEncoderIntfc::GetEncoderMode failed with encodeMode %d"), encodeMode); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MIlbcEncoderIntfc::SetEncoderMode failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0060L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcEncoderIntfc - SetVadMode")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcEncoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); 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: // KUidIlbcEncoderIntfc sl@0: MIlbcEncoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TBool vadModeOn = EFalse; sl@0: sl@0: result = ptr->SetVadMode(ETrue); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully")); sl@0: sl@0: result = ptr->GetVadMode(vadModeOn); sl@0: sl@0: if ( (result == KErrNone) && vadModeOn) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIIlbcEncoderConfig::DoTestStep0061L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: TInt result = KErrGeneral; sl@0: sl@0: INFO_PRINTF1(_L("IlbcEncoderIntfc - GetVadMode")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidIlbcEncoderIntfcTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','8'); sl@0: #endif sl@0: sl@0: iTestStepResult = TestInitialize(testUID, EMMFStatePlaying); sl@0: sl@0: if (iTestStepResult != EPass) sl@0: { sl@0: INFO_PRINTF1(_L("DevSound failed to instantiate the test device")); 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: // KUidIlbcEncoderIntfc sl@0: MIlbcEncoderIntfc* ptr = static_cast (iMMFDevSound->CustomInterface(KUidIlbcEncoderIntfc)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TBool vadModeOn = EFalse; sl@0: sl@0: result = ptr->SetVadMode(ETrue); // call method sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully")); sl@0: sl@0: result = ptr->GetVadMode(vadModeOn); sl@0: sl@0: if ( (result == KErrNone) && vadModeOn) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully")); sl@0: sl@0: result = ptr->SetVadMode(EFalse); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::SetVadMode finished successfully")); sl@0: sl@0: result = ptr->GetVadMode(vadModeOn); sl@0: sl@0: if ( (result == KErrNone) && !vadModeOn) sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc::GetVadMode finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::GetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF3(_L("MIlbcEncoderIntfc::SetVadMode failed with result %d vadModeOn %d"), result, vadModeOn); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MIlbcEncoderIntfc failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: }