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: void CTestDevVideoPlayResume::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayResume::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayResume::CTestDevVideoPlayResume(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayResume* CTestDevVideoPlayResume::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayResume* self = new(ELeave) CTestDevVideoPlayResume(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayResume::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: Resume")); 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 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 resume on DevVideoPlay then check IsPlaying() sl@0: aDevVideoPlay.Resume(); 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("Resume() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlaySetPosition::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlaySetPosition::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlaySetPosition::CTestDevVideoPlaySetPosition(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetPosition* CTestDevVideoPlaySetPosition::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetPosition* self = new(ELeave) CTestDevVideoPlaySetPosition(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetPosition::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: TInt testPos = KTestPosition; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetPosition")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: expErr = KErrNone; sl@0: break; sl@0: case ETestBothFatal: sl@0: expErr = KErrDied; sl@0: testPos = KTestPositionFatal; sl@0: break; sl@0: case ETestDecoderFatal: sl@0: expErr = KErrDied; sl@0: testPos = KTestPositionFatal; sl@0: // fall through to set post proc to false; sl@0: case ETestDecoderOnly: sl@0: selPost = EFalse; sl@0: break; sl@0: case ETestPostProcFatal: sl@0: expErr = KErrDied; sl@0: testPos = KTestPositionFatal; sl@0: // fall through to set decoder to false; 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: TTimeIntervalMicroSeconds pos(testPos); sl@0: sl@0: // call SetPosition sl@0: aDevVideoPlay.SetPosition(pos); sl@0: sl@0: // if no PANIC and iError is as expected then test has passed sl@0: // if performing a fatal test then expect iError = KErrDied sl@0: if (iError == expErr) sl@0: { sl@0: ERR_PRINTF3(_L("SetPosition() got error %d; Expected %d"), iError, expErr); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("SetPosition() called successfully")); sl@0: } sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayFreezePicture::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayFreezePicture::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayFreezePicture::CTestDevVideoPlayFreezePicture(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayFreezePicture* CTestDevVideoPlayFreezePicture::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayFreezePicture* self = new(ELeave) CTestDevVideoPlayFreezePicture(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayFreezePicture::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: FreezePicture")); 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: TTimeIntervalMicroSeconds pos(KTestPosition); sl@0: sl@0: // call FreezePicture sl@0: aDevVideoPlay.FreezePicture(pos); sl@0: sl@0: // if no PANIC then test has passed sl@0: sl@0: INFO_PRINTF1(_L("FreezePicture() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayReleaseFreeze::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayReleaseFreeze::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayReleaseFreeze::CTestDevVideoPlayReleaseFreeze(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayReleaseFreeze* CTestDevVideoPlayReleaseFreeze::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayReleaseFreeze* self = new(ELeave) CTestDevVideoPlayReleaseFreeze(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayReleaseFreeze::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: ReleaseFreeze")); 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: TTimeIntervalMicroSeconds pos(KTestPosition); sl@0: sl@0: // call ReleaseFreeze sl@0: aDevVideoPlay.ReleaseFreeze(pos); sl@0: sl@0: // if no PANIC then test has passed sl@0: sl@0: INFO_PRINTF1(_L("ReleaseFreeze() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayDecodingPosition::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayDecodingPosition::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayDecodingPosition::CTestDevVideoPlayDecodingPosition(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayDecodingPosition* CTestDevVideoPlayDecodingPosition::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayDecodingPosition* self = new(ELeave) CTestDevVideoPlayDecodingPosition(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayDecodingPosition::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: DecodingPosition")); 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: // get decoding position sl@0: TTimeIntervalMicroSeconds decPos = aDevVideoPlay.DecodingPosition(); sl@0: sl@0: // check against test data sl@0: TTimeIntervalMicroSeconds testTime(KTestDecodePosition); sl@0: if (decPos != testTime) sl@0: { sl@0: ERR_PRINTF3(_L("DecodingPosition() incorrect - gave %d (expected %d)"), sl@0: I64LOW(decPos.Int64()), KTestDecodePosition); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("DecodingPosition() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayPlaybackPosition::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayPlaybackPosition::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayPlaybackPosition::CTestDevVideoPlayPlaybackPosition(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayPlaybackPosition* CTestDevVideoPlayPlaybackPosition::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayPlaybackPosition* self = new(ELeave) CTestDevVideoPlayPlaybackPosition(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayPlaybackPosition::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: PlaybackPosition")); 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: // get playback position sl@0: TTimeIntervalMicroSeconds playPos = aDevVideoPlay.PlaybackPosition(); sl@0: sl@0: // check against test data sl@0: TTimeIntervalMicroSeconds testTime(KTestPlayPosition); sl@0: if (playPos != testTime) sl@0: { sl@0: ERR_PRINTF3(_L("PlaybackPosition() incorrect - gave %d (expected %d)"), sl@0: I64LOW(playPos.Int64()), KTestPlayPosition); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("PlaybackPosition() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayPreDecoderBufferBytes::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayPreDecoderBufferBytes::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayPreDecoderBufferBytes::CTestDevVideoPlayPreDecoderBufferBytes(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayPreDecoderBufferBytes* CTestDevVideoPlayPreDecoderBufferBytes::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayPreDecoderBufferBytes* self = new(ELeave) CTestDevVideoPlayPreDecoderBufferBytes(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayPreDecoderBufferBytes::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: PreDecoderBufferBytes")); 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: // get pre-decoder buffer bytes sl@0: TUint decBytes = aDevVideoPlay.PreDecoderBufferBytes(); sl@0: sl@0: // check against test data sl@0: if (decBytes != KTestPreDecoderBytes) sl@0: { sl@0: ERR_PRINTF3(_L("PreDecoderBufferBytes() incorrect - gave %d (expected %d)"), sl@0: decBytes, KTestPreDecoderBytes); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("PreDecoderBufferBytes() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayPictureBufferBytes::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayPictureBufferBytes::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayPictureBufferBytes::CTestDevVideoPlayPictureBufferBytes(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayPictureBufferBytes* CTestDevVideoPlayPictureBufferBytes::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayPictureBufferBytes* self = new(ELeave) CTestDevVideoPlayPictureBufferBytes(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayPictureBufferBytes::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: PictureBufferBytes")); 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: // get picture buffer bytes sl@0: TUint picBytes = aDevVideoPlay.PictureBufferBytes(); sl@0: sl@0: // check against test data sl@0: if (picBytes != KTestPictureBytes) sl@0: { sl@0: ERR_PRINTF3(_L("PictureBufferBytes() incorrect - gave %d (expected %d)"), sl@0: picBytes, KTestPictureBytes); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("PictureBufferBytes() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayGetPictureCounters::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayGetPictureCounters::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayGetPictureCounters::CTestDevVideoPlayGetPictureCounters(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayGetPictureCounters* CTestDevVideoPlayGetPictureCounters::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayGetPictureCounters* self = new(ELeave) CTestDevVideoPlayGetPictureCounters(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayGetPictureCounters::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: GetPictureCounters")); sl@0: sl@0: // expected results sl@0: switch(iTestType) sl@0: { sl@0: case ETestValid: sl@0: expErr = KErrNone; 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: 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: 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: CMMFDevVideoPlay::TPictureCounters picCounts; sl@0: sl@0: // get picture counters from DevVideoPlay sl@0: aDevVideoPlay.GetPictureCounters(picCounts); sl@0: sl@0: // N.B. PicturesSkipped is sum of decoder and post processor so sl@0: // we have to add these sl@0: CMMFDevVideoPlay::TPictureCounters testCounts = GetTestPictureCounters(); sl@0: if (hwDecoder && hwPostProc) sl@0: { sl@0: // account for both decoder and post processor sl@0: testCounts.iPicturesSkipped *= 2; sl@0: } sl@0: else if (hwPostProc) sl@0: { sl@0: // no decoded samples from a post processor sl@0: testCounts.iPicturesDecoded = 0; sl@0: } sl@0: sl@0: if (!ComparePictureCounters(picCounts, testCounts)) sl@0: { sl@0: ERR_PRINTF1(_L("GetPictureCounters() comparison with test data failed!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("GetPictureCounters() comparison with test data passed.")); sl@0: INFO_PRINTF3(_L("GetPictureCounters(), %d = %d"), err, expErr); sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayGetBitstreamCounters::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayGetBitstreamCounters::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayGetBitstreamCounters::CTestDevVideoPlayGetBitstreamCounters(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayGetBitstreamCounters* CTestDevVideoPlayGetBitstreamCounters::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayGetBitstreamCounters* self = new(ELeave) CTestDevVideoPlayGetBitstreamCounters(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayGetBitstreamCounters::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBitstreamCounters")); 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: CMMFDevVideoPlay::TBitstreamCounters bitCounts; sl@0: sl@0: // get bitstream counters from DevVideoPlay sl@0: aDevVideoPlay.GetBitstreamCounters(bitCounts); sl@0: sl@0: if (!CompareBitstreamCounters(bitCounts, GetTestBitstreamCounters())) sl@0: { sl@0: ERR_PRINTF1(_L("GetBitstreamCounters() comparison with test data failed!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("GetBitstreamCounters() comparison with test data passed.")); sl@0: INFO_PRINTF3(_L("GetBitstreamCounters(), %d = %d"), err, expErr); sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayNumFreeBuffers::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayNumFreeBuffers::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayNumFreeBuffers::CTestDevVideoPlayNumFreeBuffers(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayNumFreeBuffers* CTestDevVideoPlayNumFreeBuffers::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayNumFreeBuffers* self = new(ELeave) CTestDevVideoPlayNumFreeBuffers(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayNumFreeBuffers::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: NumFreeBuffers")); 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: TUint numBuffers = 0; sl@0: sl@0: // get number of free buffers from DevVideoPlay sl@0: numBuffers = aDevVideoPlay.NumFreeBuffers(); sl@0: sl@0: if (numBuffers != KTestNumFreeBuffers) sl@0: { sl@0: ERR_PRINTF1(_L("NumFreeBuffers() comparison with test data failed!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("NumFreeBuffers() comparison with test data passed.")); sl@0: INFO_PRINTF3(_L("NumFreeBuffers(), %d = %d"), numBuffers, KTestNumFreeBuffers); sl@0: } sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlaySetComplexityLevel::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlaySetComplexityLevel::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlaySetComplexityLevel::CTestDevVideoPlaySetComplexityLevel(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlaySetComplexityLevel* CTestDevVideoPlaySetComplexityLevel::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlaySetComplexityLevel* self = new(ELeave) CTestDevVideoPlaySetComplexityLevel(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlaySetComplexityLevel::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: SetComplexityLevel")); 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: 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: // 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 complexity level on decoder sl@0: aDevVideoPlay.SetComplexityLevel(hwDecoder, KTestComplexityLevel1); sl@0: sl@0: // set complexity level on post-processor sl@0: aDevVideoPlay.SetComplexityLevel(hwPostProc, KTestComplexityLevel2); sl@0: sl@0: // if no PANIC then test has passed sl@0: INFO_PRINTF3(_L("SetComplexityLevel(), %d, %d"), KTestComplexityLevel1, KTestComplexityLevel2); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayNumComplexityLevels::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayNumComplexityLevels::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayNumComplexityLevels::CTestDevVideoPlayNumComplexityLevels(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayNumComplexityLevels* CTestDevVideoPlayNumComplexityLevels::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayNumComplexityLevels* self = new(ELeave) CTestDevVideoPlayNumComplexityLevels(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayNumComplexityLevels::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: NumComplexityLevels")); 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: 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: // 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: // get num complexity levels on decoder sl@0: TUint levs1 = aDevVideoPlay.NumComplexityLevels(hwDecoder); sl@0: sl@0: // get num complexity levels on post-processor sl@0: TUint levs2 = aDevVideoPlay.NumComplexityLevels(hwPostProc); sl@0: sl@0: // check return values against test data sl@0: if (levs1 != KTestNumComplexityLevels1 || levs2 != KTestNumComplexityLevels2) sl@0: { sl@0: ERR_PRINTF3(_L("Error - comparison against test data failed! (%d, %d)"), levs1, levs2); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF3(_L("NumComplexityLevels(), %d, %d"), levs1, levs2); sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayGetComplexityLevelInfo::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayGetComplexityLevelInfo::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayGetComplexityLevelInfo::CTestDevVideoPlayGetComplexityLevelInfo(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayGetComplexityLevelInfo* CTestDevVideoPlayGetComplexityLevelInfo::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayGetComplexityLevelInfo* self = new(ELeave) CTestDevVideoPlayGetComplexityLevelInfo(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayGetComplexityLevelInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: GetComplexityLevelInfo")); 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: 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: // 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: CMMFDevVideoPlay::TComplexityLevelInfo levInfo1; sl@0: CMMFDevVideoPlay::TComplexityLevelInfo levInfo2; sl@0: sl@0: // get complexity level info on decoder sl@0: aDevVideoPlay.GetComplexityLevelInfo(hwDecoder, KTestComplexityLevel1, levInfo1); sl@0: sl@0: // get complexity level info on post-processor sl@0: aDevVideoPlay.GetComplexityLevelInfo(hwPostProc, KTestComplexityLevel2, levInfo2); sl@0: sl@0: CMMFDevVideoPlay::TComplexityLevelInfo testInfo1 = GetTestLevelInfo(KTestComplexityLevel1); sl@0: CMMFDevVideoPlay::TComplexityLevelInfo testInfo2 = GetTestLevelInfo(KTestComplexityLevel2); sl@0: sl@0: // check return values against test data sl@0: if (!CompareLevelInfos(levInfo1, testInfo1) || !CompareLevelInfos(levInfo2, testInfo2)) sl@0: { sl@0: ERR_PRINTF1(_L("Error - comparison against test data failed!")); sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Comparison against test data passed ok.")); sl@0: INFO_PRINTF1(_L("GetComplexityLevelInfo() called successfully")); sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayGetBuffer::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayGetBuffer::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: void CTestDevVideoPlayGetBuffer::MdvpoNewBuffers() sl@0: { sl@0: INFO_PRINTF1(_L("CTestDevVideoPlayGetBuffer::MdvpoNewBuffers()")); sl@0: iCalledBack = ETrue; sl@0: } sl@0: sl@0: CTestDevVideoPlayGetBuffer::CTestDevVideoPlayGetBuffer(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayGetBuffer* CTestDevVideoPlayGetBuffer::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayGetBuffer* self = new(ELeave) CTestDevVideoPlayGetBuffer(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayGetBuffer::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBuffer")); 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: TVideoInputBuffer* newBuff = NULL; sl@0: sl@0: // get a buffer of a certain size from DevVideoPlay sl@0: TRAP(err, newBuff = aDevVideoPlay.GetBufferL(KTestBufferSize) ); sl@0: // callback will occur and newBuff will be set to new buffer sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("GetBufferL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: TBool buffSuccess = EFalse; sl@0: sl@0: // check callback has been called and buffer is correct sl@0: if (newBuff && iCalledBack) sl@0: { sl@0: TTimeIntervalMicroSeconds testTime(KTestBufferSize); sl@0: if ( (newBuff->iDecodingTimestamp == testTime) && sl@0: (newBuff->iOptions == KTestBufferOptions) && sl@0: (newBuff->iData == KTestBufferString) ) sl@0: { sl@0: buffSuccess = ETrue; sl@0: } sl@0: } sl@0: sl@0: if (!buffSuccess) sl@0: { sl@0: ERR_PRINTF1(_L("Received buffer is corrupt!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Buffer received correctly")); sl@0: INFO_PRINTF3(_L("GetBuffer(), %d = %d"), err, expErr); sl@0: } sl@0: } sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayWriteCodedData::CTestDevVideoPlayWriteCodedData(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayWriteCodedData* CTestDevVideoPlayWriteCodedData::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayWriteCodedData* self = new(ELeave) CTestDevVideoPlayWriteCodedData(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayWriteCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: WriteCodedData")); 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: // construct a video input buffer structure with a valid timestamp and sl@0: // write this DevVideoPlay. Call will leave on error. sl@0: TVideoInputBuffer* newBuff = NULL; sl@0: TPtrC8 testBufferStringPtr(KTestBufferString); sl@0: TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length())); sl@0: if (err) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize newBuff with test data sl@0: newBuff->iOptions = KTestBufferOptions; sl@0: newBuff->iDecodingTimestamp = KTestBufferSize; sl@0: newBuff->iData.Zero(); sl@0: newBuff->iData.Append(testBufferStringPtr); sl@0: sl@0: // write buffer to DevVideoPlay sl@0: TRAP(err, aDevVideoPlay.WriteCodedDataL(newBuff) ) sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("WriteCodedDataL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Coded data sent successfully")); sl@0: INFO_PRINTF3(_L("WriteCodedDataL(), %d = %d"), err, expErr); sl@0: } sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayScanAndCopyCodedData::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayScanAndCopyCodedData::CTestDevVideoPlayScanAndCopyCodedData(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayScanAndCopyCodedData* CTestDevVideoPlayScanAndCopyCodedData::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayScanAndCopyCodedData* self = new(ELeave) CTestDevVideoPlayScanAndCopyCodedData(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayScanAndCopyCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("MMMFVideoPlayHwDeviceExtensionScanCopy: ScanAndCopyCodedDataL")); 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: 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, 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: // 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: sl@0: // construct a video input buffer structure with a valid timestamp and sl@0: // write this DevVideoPlay. Call will leave on error. sl@0: TVideoInputBuffer* newBuff = NULL; sl@0: TPtrC8 testBufferStringPtr(KTestBufferString); sl@0: TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length())); sl@0: if (err) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: //clean out pre-set stuff from buffer sl@0: newBuff->iData.Zero(); sl@0: //set ptr to test data sl@0: TPtrC8 testBufferString(KTestBufferString); sl@0: HBufC8* bufferDataArea = testBufferString.AllocL(); sl@0: CleanupStack::PushL(bufferDataArea); sl@0: TPtr8 dataAreaPtr = bufferDataArea->Des(); sl@0: TFramePortion framePortion = EFramePortionEndFragment; sl@0: sl@0: MMMFVideoPlayHwDeviceExtensionScanCopy* ciOne = static_cast(aDevVideoPlay.CustomInterface(hwDecoder, KUidDevVideoPlayHwDeviceExtensionScanCopy)); sl@0: sl@0: TInt consumed = 0; sl@0: // write buffer to DevVideoPlay using new interface sl@0: TRAP(err, ciOne->ScanAndCopyCodedDataL(dataAreaPtr, newBuff, consumed, framePortion)); sl@0: sl@0: //compare buffer to test data sl@0: if ((newBuff->iData != KTestBufferString) || consumed != newBuff->iData.Length()) sl@0: { sl@0: err = KErrCorrupt; sl@0: } sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("ScanAndCopyCodedDataL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Coded data sent successfully")); sl@0: INFO_PRINTF3(_L("ScanAndCopyCodedDataL(), %d = %d"), err, expErr); sl@0: } sl@0: CleanupStack::PopAndDestroy(bufferDataArea); sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayExtensionWriteCodedData::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: CTestDevVideoPlayExtensionWriteCodedData::CTestDevVideoPlayExtensionWriteCodedData(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayExtensionWriteCodedData* CTestDevVideoPlayExtensionWriteCodedData::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayExtensionWriteCodedData* self = new(ELeave) CTestDevVideoPlayExtensionWriteCodedData(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayExtensionWriteCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("MMMFVideoPlayHwDeviceExtensionScanCopy: WriteCodedData")); 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: sl@0: // select decoder sl@0: TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); sl@0: 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, 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: // construct a video input buffer structure with a valid timestamp and sl@0: // write this DevVideoPlay. Call will leave on error. sl@0: TVideoInputBuffer* newBuff = NULL; sl@0: TPtrC8 testBufferStringPtr(KTestBufferString); sl@0: TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length())); sl@0: if (err) sl@0: { sl@0: ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay")); sl@0: return EInconclusive; sl@0: } sl@0: sl@0: // initialize newBuff with test data sl@0: newBuff->iOptions = KTestBufferOptions; sl@0: newBuff->iDecodingTimestamp = KTestBufferSize; sl@0: newBuff->iData.Zero(); sl@0: newBuff->iData.Append(testBufferStringPtr); sl@0: sl@0: TFramePortion framePortion = EFramePortionEndFragment; sl@0: sl@0: MMMFVideoPlayHwDeviceExtensionScanCopy* ciOne = static_cast(aDevVideoPlay.CustomInterface(hwDecoder, KUidDevVideoPlayHwDeviceExtensionScanCopy)); sl@0: sl@0: // write buffer to DevVideoPlay using new interface sl@0: TRAP(err, ciOne->WriteCodedDataL(newBuff, framePortion)); sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("WriteCodedDataL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Coded data sent successfully")); sl@0: INFO_PRINTF3(_L("WriteCodedDataL(), %d = %d"), err, expErr); sl@0: } sl@0: return ret; sl@0: } sl@0: sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayWritePicture::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayWritePicture::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: void CTestDevVideoPlayWritePicture::MdvpoReturnPicture(TVideoPicture* aPicture) sl@0: { sl@0: INFO_PRINTF1(_L("CTestDevVideoPlayWritePicture::MdvpoReturnPicture()")); sl@0: sl@0: iPicture = aPicture; sl@0: } sl@0: sl@0: CTestDevVideoPlayWritePicture::CTestDevVideoPlayWritePicture(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayWritePicture* CTestDevVideoPlayWritePicture::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayWritePicture* self = new(ELeave) CTestDevVideoPlayWritePicture(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayWritePicture::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: WritePicture")); 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: // construct a video picture structure with a valid timestamp and sl@0: // write this DevVideoPlay. If the same picture comes back through the sl@0: // MdvpoReturnPicture() callback then test has passed. sl@0: TVideoPicture picture; sl@0: TTimeIntervalMicroSeconds picTime(KTestPictureTimestamp); sl@0: picture.iTimestamp = picTime; sl@0: picture.iOptions = TVideoPicture::ETimestamp; sl@0: sl@0: // write picture to DevVideoPlay sl@0: TRAP(err, aDevVideoPlay.WritePictureL(&picture) ) sl@0: sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("WritePicture() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: TBool picSuccess = EFalse; sl@0: sl@0: // check callback has been called and picture is correct sl@0: if (iPicture) sl@0: { sl@0: if ( (iPicture->iTimestamp == picTime) && sl@0: (iPicture->iOptions == TVideoPicture::ETimestamp) ) sl@0: { sl@0: picSuccess = ETrue; sl@0: } sl@0: } sl@0: sl@0: if (!picSuccess) sl@0: { sl@0: ERR_PRINTF1(_L("Received picture is corrupt!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Original picture received correctly")); sl@0: INFO_PRINTF3(_L("WritePicture(), %d = %d"), err, expErr); sl@0: } sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------ sl@0: sl@0: void CTestDevVideoPlayInputEnd::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestDevVideoPlayInputEnd::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: void CTestDevVideoPlayInputEnd::MdvpoStreamEnd() sl@0: { sl@0: INFO_PRINTF1(_L("CTestDevVideoPlayInputEnd::MdvpoStreamEnd()")); sl@0: sl@0: // keep track on number of times this callback is called sl@0: iEndCount++; sl@0: } sl@0: sl@0: CTestDevVideoPlayInputEnd::CTestDevVideoPlayInputEnd(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoPlayInputEnd* CTestDevVideoPlayInputEnd::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoPlayInputEnd* self = new(ELeave) CTestDevVideoPlayInputEnd(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoPlayInputEnd::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: InputEnd")); 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: // call input end on DevVideoPlay and check callback counter == 1 sl@0: aDevVideoPlay.InputEnd(); sl@0: sl@0: if (iEndCount != 1) sl@0: { sl@0: ERR_PRINTF2(_L("Error - MdvpoStreamEnd only called %d times!"), iEndCount); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: INFO_PRINTF1(_L("InputEnd() called successfully")); sl@0: sl@0: return ret; sl@0: } sl@0: //------------------------------------------------------------------- sl@0: sl@0: void CTestDevVideoGetBufferWithoutInitialize::MdvpoInitComplete(TInt aError) sl@0: { sl@0: INFO_PRINTF2(_L("CTestGetBufferWithoutInitialize::MdvpoInitComplete(): Error = %d"), aError); sl@0: sl@0: iError = aError; sl@0: } sl@0: sl@0: void CTestDevVideoGetBufferWithoutInitialize::MdvpoNewBuffers() sl@0: { sl@0: INFO_PRINTF1(_L("CTestGetBufferWithoutInitialize::MdvpoNewBuffers()")); sl@0: iCalledBack = ETrue; sl@0: } sl@0: sl@0: CTestDevVideoGetBufferWithoutInitialize::CTestDevVideoGetBufferWithoutInitialize(const TDesC& aTestName, TTestType aTestType) sl@0: :CTestDevVideoPlayStep(aTestName, aTestType) sl@0: { sl@0: } sl@0: sl@0: CTestDevVideoGetBufferWithoutInitialize* CTestDevVideoGetBufferWithoutInitialize::NewL(const TDesC& aTestName, TTestType aTestType) sl@0: { sl@0: CTestDevVideoGetBufferWithoutInitialize* self = new(ELeave) CTestDevVideoGetBufferWithoutInitialize(aTestName, aTestType); sl@0: return self; sl@0: } sl@0: sl@0: TVerdict CTestDevVideoGetBufferWithoutInitialize::DoTestL(CMMFDevVideoPlay& aDevVideoPlay) sl@0: { sl@0: TVerdict ret = EPass; sl@0: TInt expErr = KErrNone; sl@0: sl@0: INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBuffer")); sl@0: INFO_PRINTF1(_L("To test the scenario wherein GetBufferL is called without calling initialize")); 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: 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, 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: TVideoInputBuffer* newBuff = NULL; sl@0: // iError is set by the MdvpoInitComplete callback sl@0: TRAP(err, newBuff = aDevVideoPlay.GetBufferL(KTestBufferSize) ); sl@0: // callback will occur and newBuff will be set to new buffer sl@0: if (err != expErr) sl@0: { sl@0: ERR_PRINTF3(_L("GetBufferL() gave error %d (expected %d)"),err, expErr); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: TBool buffSuccess = EFalse; sl@0: sl@0: // check callback has been called and buffer is correct sl@0: if (newBuff && iCalledBack) sl@0: { sl@0: TTimeIntervalMicroSeconds testTime(KTestBufferSize); sl@0: if ( (newBuff->iDecodingTimestamp == testTime) && sl@0: (newBuff->iOptions == KTestBufferOptions) && sl@0: (newBuff->iData == KTestBufferString) ) sl@0: { sl@0: buffSuccess = ETrue; sl@0: } sl@0: } sl@0: sl@0: if (!buffSuccess) sl@0: { sl@0: ERR_PRINTF1(_L("Received buffer is corrupt!")); sl@0: ret = EFail; sl@0: } sl@0: else sl@0: { sl@0: INFO_PRINTF1(_L("Buffer received correctly")); sl@0: INFO_PRINTF3(_L("GetBuffer(), %d = %d"), err, expErr); sl@0: } sl@0: } sl@0: sl@0: return ret; sl@0: } sl@0: //----------------------------------------------------------------------- sl@0: