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 "teststepciaudiodspcontrol.h" sl@0: sl@0: sl@0: TVerdict CTestStepCIAudioDspControl::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-0076-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0076L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0077-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0077L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0078-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0078L(); sl@0: } sl@0: else if (iTestStepName.Compare(_L("MM-MMF-DEVSOUNDCI-U-0079-HP")) == 0) sl@0: { sl@0: iTestStepResult = DoTestStep0079L(); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIAudioDspControl::DoTestStep0076L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("AudioDSPControl - Instantiating")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAudioDspControlTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','3'); 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: // KUidMMFDSPControl sl@0: MMMFDSPControl* ptr = static_cast (iMMFDevSound->CustomInterface(KUidDSPControl)); sl@0: sl@0: if (ptr) sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl instantiated successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF1(_L("MMMFDSPControl failed to retrieve the interface")); sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: } sl@0: sl@0: sl@0: TVerdict CTestStepCIAudioDspControl::DoTestStep0077L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("AudioDSPControl - MmdspcAcceptRecordBuffersInvalidFollowingStop")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAudioDspControlTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','3'); 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: // KUidMMFDSPControl sl@0: MMMFDSPControl* ptr = static_cast (iMMFDevSound->CustomInterface(KUidDSPControl)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TInt result = KErrGeneral; sl@0: sl@0: result = ptr->MmdspcAcceptRecordBuffersInvalidFollowingStop(); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl::MmdspcAcceptRecordBuffersInvalidFollowingStop finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MMMFDSPControl::MmdspcAcceptRecordBuffersInvalidFollowingStop failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl 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 CTestStepCIAudioDspControl::DoTestStep0078L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("AudioDSPControl - MmdspcAcceptPlaybackBuffersInvalidFollowingStop")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAudioDspControlTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','3'); 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: // KUidMMFDSPControl sl@0: MMMFDSPControl* ptr = static_cast (iMMFDevSound->CustomInterface(KUidDSPControl)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TInt result = KErrGeneral; sl@0: sl@0: result = ptr->MmdspcAcceptPlaybackBuffersInvalidFollowingStop(); sl@0: sl@0: if (result == KErrNone) sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl::MmdspcAcceptPlaybackBuffersInvalidFollowingStop finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MMMFDSPControl::MmdspcAcceptPlaybackBuffersInvalidFollowingStop failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl 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 CTestStepCIAudioDspControl::DoTestStep0079L() sl@0: { sl@0: iTestStepResult = EFail; sl@0: sl@0: INFO_PRINTF1(_L("AudioDSPControl - MmdspcGetAudioPlaybackInfo")); sl@0: sl@0: //Initialize - with the UID of our test HwDevice sl@0: #ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND sl@0: TUid testUID = {KUidAudioDspControlTestDevice}; sl@0: #else sl@0: TFourCC testUID('T','0','1','3'); 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: // KUidMMFDSPControl sl@0: MMMFDSPControl* ptr = static_cast (iMMFDevSound->CustomInterface(KUidDSPControl)); sl@0: sl@0: if (ptr) sl@0: { sl@0: TInt result = KErrGeneral; sl@0: TInt64 samplesPlayed = 0; sl@0: TInt64 systemTime = 0; sl@0: TUint bytesDecoderConsumed = 0; sl@0: TUint bytesDecoderDecoded = 0; sl@0: sl@0: result = ptr->MmdspcGetAudioPlaybackInfo (samplesPlayed, systemTime, bytesDecoderConsumed, bytesDecoderDecoded); // call method sl@0: sl@0: if ( (result == KErrNone) && sl@0: (samplesPlayed == 999) && (systemTime == 999) && sl@0: (bytesDecoderConsumed == 999) && (bytesDecoderDecoded == 999) ) sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl::MmdspcGetAudioPlaybackInfo finished successfully")); sl@0: sl@0: iTestStepResult = EPass; sl@0: } sl@0: else sl@0: { sl@0: ERR_PRINTF2(_L("MMMFDSPControl::MmdspcGetAudioPlaybackInfo failed with result %d"), result); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("MMMFDSPControl failed to retrieve the interface")); sl@0: iTestStepResult = EInconclusive; sl@0: } sl@0: sl@0: return iTestStepResult; sl@0: }