sl@0: sl@0: // Copyright (c) 2003-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: // TestDevVideoPlay.cpp sl@0: // sl@0: // sl@0: sl@0: #include "TestDevVideoPlay.h" sl@0: #include "TestDevVideoPlayTestData.h" sl@0: #include "TestDevVideoPlugins/decoder.h" sl@0: #include "TestDevVideoPlugins/postproc.h" sl@0: #include sl@0: sl@0: CTestDevVideoPlaySetInputCrop::CTestDevVideoPlaySetInputCrop(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetInputCrop* CTestDevVideoPlaySetInputCrop::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetInputCrop* self = new(ELeave) CTestDevVideoPlaySetInputCrop(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetInputCrop::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetInputCrop")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set input crop on decoder sl@0: TRect testRect1(KTestInputCropRectA, KTestInputCropRectB, KTestInputCropRectC, KTestInputCropRectD); sl@0: TRAP(err, aDevVideoPlay.SetInputCropOptionsL(hwDecoder, testRect1) ) sl@0: sl@0: // set input crop on post-processor sl@0: TRect testRect2(KTestInputCropRectD, KTestInputCropRectC, KTestInputCropRectB, KTestInputCropRectA); sl@0: TRAP(err2, aDevVideoPlay.SetInputCropOptionsL(hwPostProc, testRect2) ) sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetInputCropOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetInputCropOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetInputCropOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetYuvToRgbOptionsFormat::CTestDevVideoPlaySetYuvToRgbOptionsFormat(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetYuvToRgbOptionsFormat* CTestDevVideoPlaySetYuvToRgbOptionsFormat::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetYuvToRgbOptionsFormat* self = new(ELeave) CTestDevVideoPlaySetYuvToRgbOptionsFormat(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetYuvToRgbOptionsFormat::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetYuvToRgbOptionsFormat")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set YUV to RGB options with formats on decoder sl@0: TRAP(err, aDevVideoPlay.SetYuvToRgbOptionsL(hwDecoder, KTestYuvToRgb1, KTestYuvFormat1, KTestRgbFormat1) ); sl@0: sl@0: // set YUV to RGB options with formats on post-processor sl@0: TRAP(err2, aDevVideoPlay.SetYuvToRgbOptionsL(hwPostProc, KTestYuvToRgb2, KTestYuvFormat2, KTestRgbFormat2) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetYuvToRgbOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetYuvToRgbOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetYuvToRgbOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetYuvToRgbOptions::CTestDevVideoPlaySetYuvToRgbOptions(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetYuvToRgbOptions* CTestDevVideoPlaySetYuvToRgbOptions::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetYuvToRgbOptions* self = new(ELeave) CTestDevVideoPlaySetYuvToRgbOptions(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetYuvToRgbOptions::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetYuvToRgbOptions")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set YUV to RGB options with formats on decoder sl@0: TRAP(err, aDevVideoPlay.SetYuvToRgbOptionsL(hwDecoder, KTestYuvToRgb1) ); sl@0: sl@0: // set YUV to RGB options with formats on post-processor sl@0: TRAP(err2, aDevVideoPlay.SetYuvToRgbOptionsL(hwPostProc, KTestYuvToRgb2) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetYuvToRgbOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetYuvToRgbOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetYuvToRgbOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetRotate::CTestDevVideoPlaySetRotate(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetRotate* CTestDevVideoPlaySetRotate::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetRotate* self = new(ELeave) CTestDevVideoPlaySetRotate(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetRotate::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetRotate")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set rotate options on decoder sl@0: TRAP(err, aDevVideoPlay.SetRotateOptionsL(hwDecoder, KTestRotate1) ); sl@0: sl@0: // set rotate options on post-processor sl@0: TRAP(err2, aDevVideoPlay.SetRotateOptionsL(hwPostProc, KTestRotate2) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetRotateOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetRotateOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetRotateOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetScale::CTestDevVideoPlaySetScale(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetScale* CTestDevVideoPlaySetScale::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetScale* self = new(ELeave) CTestDevVideoPlaySetScale(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetScale::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetScale")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set scale options on decoder sl@0: TSize testScale1(KTestScaleX, KTestScaleY); sl@0: TRAP(err, aDevVideoPlay.SetScaleOptionsL(hwDecoder, testScale1, ETrue) ); sl@0: sl@0: TSize testScale2(KTestScaleY, KTestScaleX); sl@0: // set scale options on post-processor sl@0: TRAP(err2, aDevVideoPlay.SetScaleOptionsL(hwPostProc, testScale2, ETrue) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetScaleOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetScaleOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetScaleOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetCrop::CTestDevVideoPlaySetCrop(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetCrop* CTestDevVideoPlaySetCrop::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetCrop* self = new(ELeave) CTestDevVideoPlaySetCrop(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetCrop::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetCrop")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set output crop options on decoder sl@0: TRect testRect1(KTestOutputCropRectA, KTestOutputCropRectB, KTestOutputCropRectC, KTestOutputCropRectD); sl@0: TRAP(err, aDevVideoPlay.SetOutputCropOptionsL(hwDecoder, testRect1) ); sl@0: sl@0: // set output crop options on post-processor sl@0: TRect testRect2(KTestOutputCropRectD, KTestOutputCropRectC, KTestOutputCropRectB, KTestOutputCropRectA); sl@0: TRAP(err2, aDevVideoPlay.SetOutputCropOptionsL(hwPostProc, testRect2) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetOutputCropOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetOutputCropOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetOutputCropOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetPostProcOptions::CTestDevVideoPlaySetPostProcOptions(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetPostProcOptions* CTestDevVideoPlaySetPostProcOptions::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetPostProcOptions* self = new(ELeave) CTestDevVideoPlaySetPostProcOptions(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetPostProcOptions::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetPostProcOptions")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: TInt err2 = KErrNone; sl@0: sl@0: THwDeviceId hwDecoder = 0; sl@0: THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set post-processor options on decoder sl@0: TRAP(err, aDevVideoPlay.SetPostProcSpecificOptionsL(hwDecoder, KTestPostProcOptions1) ); sl@0: sl@0: // set post-processor options on post-processor sl@0: TRAP(err2, aDevVideoPlay.SetPostProcSpecificOptionsL(hwPostProc, KTestPostProcOptions2) ); sl@0: sl@0: sl@0: if ((err != expErr) || (err2 != expErr)) sl@0: { sl@0: ERR_PRINTF3(_L("SetPostProcSpecificOptionsL() on Decoder gave error %d (expected %d)"),err, expErr); sl@0: ERR_PRINTF3(_L("SetPostProcSpecificOptionsL() on Post-Processor gave error %d (expected %d)"),err2, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF4(_L("SetPostProcSpecificOptionsL(), %d, %d= %d"), err, err2, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetClockSource::CTestDevVideoPlaySetClockSource(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetClockSource* CTestDevVideoPlaySetClockSource::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetClockSource* self = new(ELeave) CTestDevVideoPlaySetClockSource(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetClockSource::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: // TInt expErr = KErrNone; sl@0: TBool selDec = ETrue; sl@0: TBool selPost = ETrue; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetClockSource")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: // expErr = KErrNone; // EABI warning removal sl@0: break; sl@0: case ETestDecoderOnly: sl@0: selPost = EFalse; sl@0: break; sl@0: case ETestPostProcOnly: sl@0: selDec = EFalse; sl@0: break; sl@0: default: sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: if (selDec) sl@0: { sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // select post-processor sl@0: if (selPost) sl@0: { sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: CSystemClockSource *time1 = NULL; sl@0: sl@0: // no parameters so no need to have a separate 'test clock source' sl@0: TRAP(err, time1 = CSystemClockSource::NewL()); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't construct system clock class")); sl@0: sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set clock source sl@0: aDevVideoPlay.SetClockSource(time1); sl@0: sl@0: // if there is no panic then test has passed sl@0: sl@0: INFO_PRINTF1(_L("SetClockSourceL() called correctly on HW Devices.")); sl@0: sl@0: // delete clock source sl@0: delete time1; time1 = NULL; sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetVideoOutput::CTestDevVideoPlaySetVideoOutput(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetVideoOutput* CTestDevVideoPlaySetVideoOutput::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetVideoOutput* self = new(ELeave) CTestDevVideoPlaySetVideoOutput(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetVideoOutput::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetVideoOutput")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: expErr = KErrHardwareNotAvailable;//Post processor plugin will leave with this if it gets sl@0: //the method call correctly sl@0: sl@0: TRAP(err, aDevVideoPlay.SetVideoDestScreenL(ETrue) ) sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("SetVideoDestScreenL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF3(_L("SetVideoDestScreenL(), %d = %d"), err, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySynchronizeDecoding::CTestDevVideoPlaySynchronizeDecoding(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySynchronizeDecoding* CTestDevVideoPlaySynchronizeDecoding::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySynchronizeDecoding* self = new(ELeave) CTestDevVideoPlaySynchronizeDecoding(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySynchronizeDecoding::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SynchronizeDecoding")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // eABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // eABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // call synchronize decoding on Decoder sl@0: aDevVideoPlay.SynchronizeDecoding(ETrue); sl@0: // if this doesn't panic then test passes sl@0: sl@0: INFO_PRINTF1(_L("SynchronizeDecoding() called successfully.")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetBufferOptions::CTestDevVideoPlaySetBufferOptions(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetBufferOptions* CTestDevVideoPlaySetBufferOptions::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetBufferOptions* self = new(ELeave) CTestDevVideoPlaySetBufferOptions(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetBufferOptions::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetBufferOptions")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize buffer options to the test data sl@0: CMMFDevVideoPlay::TBufferOptions buffOptions = GetTestBufferOptions(); sl@0: sl@0: // set buffer options on decoder [will leave on error] sl@0: TRAP(err, aDevVideoPlay.SetBufferOptionsL(buffOptions) ); sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("SetBufferOptionsL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF3(_L("SetBufferOptions(), %d = %d"), err, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlayGetBufferOptions::CTestDevVideoPlayGetBufferOptions(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayGetBufferOptions* CTestDevVideoPlayGetBufferOptions::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayGetBufferOptions* self = new(ELeave) CTestDevVideoPlayGetBufferOptions(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayGetBufferOptions::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBufferOptions")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // get buffer options from the decoder sl@0: CMMFDevVideoPlay::TBufferOptions buffOptions; sl@0: aDevVideoPlay.GetBufferOptions(buffOptions); sl@0: sl@0: // compare this to the test data sl@0: if ( !CompareBufferOptions(buffOptions, GetTestBufferOptions()) ) sl@0: { sl@0: ERR_PRINTF1(_L("GetBufferOptions() comparison with test data failed!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("GetBufferOptions() comparison with test data passed.")); sl@0: INFO_PRINTF3(_L("GetBufferOptions(), %d = %d"), err, expErr); sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: CTestDevVideoPlaySetHrdVbv::CTestDevVideoPlaySetHrdVbv(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetHrdVbv* CTestDevVideoPlaySetHrdVbv::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetHrdVbv* self = new(ELeave) CTestDevVideoPlaySetHrdVbv(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetHrdVbv::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetHrdVbv")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: HBufC8* hrdVbvParams = NULL; sl@0: TRAP(err, hrdVbvParams = KTestHrdVbvParams().AllocL()); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize hrd/vbv params")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set hrd/vbv spec on decoder sl@0: aDevVideoPlay.SetHrdVbvSpec(KTestHrdVbvSpec, *hrdVbvParams); sl@0: // if this doesn't panic then test has passed sl@0: sl@0: // delete copy sl@0: delete hrdVbvParams; hrdVbvParams = NULL; sl@0: sl@0: INFO_PRINTF1(_L("SetHrdVbvSpec() called successfully.")); sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayInit::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayInit::CTestDevVideoPlayInit(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayInit* CTestDevVideoPlayInit::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayInit* self = new(ELeave) CTestDevVideoPlayInit(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayInit::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: Init")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response in iError sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("Initialize() gave error %d (expected %d)"),iError, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF3(_L("Initialize(), %d = %d"), iError, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayStartDSA::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayStartDSA::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayStartDSA::CTestDevVideoPlayStartDSA(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayStartDSA* CTestDevVideoPlayStartDSA::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayStartDSA* self = new(ELeave) CTestDevVideoPlayStartDSA(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayStartDSA::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: StartDSA")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // screen device is independant of DevVideo so we can construct one here sl@0: // and just check that it is non NULL at the plugin sl@0: CFbsScreenDevice *screenDev = NULL; sl@0: TRAP(err, screenDev = CFbsScreenDevice::NewL(_L("scdv"), EColor16)); sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize screen device")); sl@0: //return EInconclusive; sl@0: } sl@0: sl@0: TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD); sl@0: TRegionFix<1> reg1(dsaRect); sl@0: sl@0: // start direct screen access sl@0: TRAP(err, aDevVideoPlay.StartDirectScreenAccessL(dsaRect, *screenDev, reg1) ); sl@0: sl@0: // delete screen device and rect sl@0: delete screenDev; sl@0: screenDev = NULL; sl@0: sl@0: reg1.Clear(); sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("StartDirectScreenAccessL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF3(_L("StartDirectScreenAccessL(), %d = %d"), err, expErr); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlaySetClipRegion::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlaySetClipRegion::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlaySetClipRegion::CTestDevVideoPlaySetClipRegion(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetClipRegion* CTestDevVideoPlaySetClipRegion::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetClipRegion* self = new(ELeave) CTestDevVideoPlaySetClipRegion(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetClipRegion::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetClipRegion")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // eABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD); sl@0: TRegionFix<1> reg1(dsaRect); sl@0: sl@0: // set clip region sl@0: aDevVideoPlay.SetScreenClipRegion(reg1); sl@0: sl@0: // clear region sl@0: reg1.Clear(); sl@0: sl@0: // if no PANIC then test has passed sl@0: INFO_PRINTF1(_L("SetScreenClipRegion() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlaySetPauseClipFail::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlaySetPauseClipFail::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlaySetPauseClipFail::CTestDevVideoPlaySetPauseClipFail(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetPauseClipFail* CTestDevVideoPlaySetPauseClipFail::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetPauseClipFail* self = new(ELeave) CTestDevVideoPlaySetPauseClipFail(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetPauseClipFail::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetPauseClipFail")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // set pause on clip fail to ETrue sl@0: aDevVideoPlay.SetPauseOnClipFail(ETrue); sl@0: sl@0: // if no PANIC then test has passed sl@0: INFO_PRINTF1(_L("SetPauseClipFail() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayAbortDSA::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayAbortDSA::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayAbortDSA::CTestDevVideoPlayAbortDSA(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayAbortDSA* CTestDevVideoPlayAbortDSA::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayAbortDSA* self = new(ELeave) CTestDevVideoPlayAbortDSA(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayAbortDSA::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: AbortDSA")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // eABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // abort direct screen access [is there a way to check this?] sl@0: aDevVideoPlay.AbortDirectScreenAccess(); sl@0: sl@0: INFO_PRINTF1(_L("AbortDirectScreenAccess() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayIsPlaying::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayIsPlaying::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayIsPlaying::CTestDevVideoPlayIsPlaying(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayIsPlaying* CTestDevVideoPlayIsPlaying::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayIsPlaying* self = new(ELeave) CTestDevVideoPlayIsPlaying(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayIsPlaying::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: IsPlaying")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TBool playing = ETrue; sl@0: sl@0: // check DevVideoPlay is not playing sl@0: playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (playing) sl@0: { sl@0: ERR_PRINTF1(_L("IsPlaying() reported ETrue - expected EFalse!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("IsPlaying() returned EFalse as expected")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayRedraw::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayRedraw::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayRedraw::CTestDevVideoPlayRedraw(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayRedraw* CTestDevVideoPlayRedraw::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayRedraw* self = new(ELeave) CTestDevVideoPlayRedraw(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayRedraw::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: Redraw")); sl@0: sl@0: // expected results sl@0: if (iTestType != ETestValid) sl@0: { sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // select post-processor sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // call redraw [is there a way to check this?] sl@0: aDevVideoPlay.Redraw(); sl@0: sl@0: INFO_PRINTF1(_L("Redraw() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayStart::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayStart::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayStart::CTestDevVideoPlayStart(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayStart* CTestDevVideoPlayStart::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayStart* self = new(ELeave) CTestDevVideoPlayStart(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayStart::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: // TInt expErr = KErrNone; sl@0: TBool selDec = ETrue; sl@0: TBool selPost = ETrue; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: Start")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: // expErr = KErrNone; // EABI warning removal sl@0: break; sl@0: case ETestDecoderOnly: sl@0: selPost = EFalse; sl@0: break; sl@0: case ETestPostProcOnly: sl@0: selDec = EFalse; sl@0: break; sl@0: default: sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: if (selDec) sl@0: { sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // select post-processor sl@0: if (selPost) sl@0: { sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABIO warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // check not already playing sl@0: TBool playing = aDevVideoPlay.IsPlaying(); sl@0: if (playing) sl@0: { sl@0: ERR_PRINTF1(_L("Error - DevVideoPlay already playing!")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // call start on DevVideoPlay then check IsPlaying() sl@0: aDevVideoPlay.Start(); sl@0: playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (!playing) sl@0: { sl@0: ERR_PRINTF1(_L("IsPlaying() returned EFalse - expected ETrue")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("Start() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayStop::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayStop::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayStop::CTestDevVideoPlayStop(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayStop* CTestDevVideoPlayStop::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayStop* self = new(ELeave) CTestDevVideoPlayStop(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayStop::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: // TInt expErr = KErrNone; sl@0: TBool selDec = ETrue; sl@0: TBool selPost = ETrue; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: Stop")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: // expErr = KErrNone; // EABI warning removal sl@0: break; sl@0: case ETestDecoderOnly: sl@0: selPost = EFalse; sl@0: break; sl@0: case ETestPostProcOnly: sl@0: selDec = EFalse; sl@0: break; sl@0: default: sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: if (selDec) sl@0: { sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // select post-processor sl@0: if (selPost) sl@0: { sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // check DevVideoPlay has started playing then call stop sl@0: aDevVideoPlay.Start(); sl@0: TBool playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (!playing) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't start playback!")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // call stop sl@0: aDevVideoPlay.Stop(); sl@0: playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (playing) sl@0: { sl@0: ERR_PRINTF1(_L("IsPlaying() returned ETrue - expected EFalse")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("Stop() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayPause::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayPause::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayPause::CTestDevVideoPlayPause(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayPause* CTestDevVideoPlayPause::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayPause* self = new(ELeave) CTestDevVideoPlayPause(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayPause::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: // TInt expErr = KErrNone; sl@0: TBool selDec = ETrue; sl@0: TBool selPost = ETrue; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: Pause")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: // expErr = KErrNone; // EABI warning removal sl@0: break; sl@0: case ETestDecoderOnly: sl@0: selPost = EFalse; sl@0: break; sl@0: case ETestPostProcOnly: sl@0: selDec = EFalse; sl@0: break; sl@0: default: sl@0: ERR_PRINTF1(_L("Error - invalid test step type")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: TInt err = KErrNone; sl@0: sl@0: // THwDeviceId hwDecoder = 0; sl@0: // THwDeviceId hwPostProc = 0; sl@0: sl@0: // select decoder sl@0: if (selDec) sl@0: { sl@0: // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize decoder")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // select post-processor sl@0: if (selPost) sl@0: { sl@0: // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); sl@0: TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal sl@0: if (err != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize post processor")); sl@0: return EInconclusive; sl@0: } sl@0: } sl@0: sl@0: // initialize CDevVideoPlay and wait for response sl@0: // iError is set by the MdvpoInitComplete callback sl@0: aDevVideoPlay.Initialize(); sl@0: sl@0: if (iError != KErrNone) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // check DevVideoPlay has started playing then call pause sl@0: aDevVideoPlay.Start(); sl@0: TBool playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (!playing) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't start playback!")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // call pause sl@0: aDevVideoPlay.Pause(); sl@0: playing = aDevVideoPlay.IsPlaying(); sl@0: sl@0: if (playing) sl@0: { sl@0: ERR_PRINTF1(_L("IsPlaying() returned ETrue - expected EFalse")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("Pause() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: