First public contribution.
2 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
3 // All rights reserved.
4 // This component and the accompanying materials are made available
5 // under the terms of "Eclipse Public License v1.0"
6 // which accompanies this distribution, and is available
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
15 // TestDevVideoPlay.cpp
19 #include "TestDevVideoPlay.h"
20 #include "TestDevVideoPlayTestData.h"
21 #include "TestDevVideoPlugins/decoder.h"
22 #include "TestDevVideoPlugins/postproc.h"
25 void CTestDevVideoPlayResume::MdvpoInitComplete(TInt aError)
27 INFO_PRINTF2(_L("CTestDevVideoPlayResume::MdvpoInitComplete(): Error = %d"), aError);
32 CTestDevVideoPlayResume::CTestDevVideoPlayResume(const TDesC& aTestName, TTestType aTestType)
33 :CTestDevVideoPlayStep(aTestName, aTestType)
37 CTestDevVideoPlayResume* CTestDevVideoPlayResume::NewL(const TDesC& aTestName, TTestType aTestType)
39 CTestDevVideoPlayResume* self = new(ELeave) CTestDevVideoPlayResume(aTestName, aTestType);
43 TVerdict CTestDevVideoPlayResume::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
46 // TInt expErr = KErrNone;
48 TBool selPost = ETrue;
50 INFO_PRINTF1(_L("CMMFDevVideoPlay: Resume"));
56 // expErr = KErrNone; // EABI warning removal
58 case ETestDecoderOnly:
61 case ETestPostProcOnly:
65 ERR_PRINTF1(_L("Error - invalid test step type"));
71 // THwDeviceId hwDecoder = 0;
72 // THwDeviceId hwPostProc = 0;
77 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
78 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
81 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
86 // select post-processor
89 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
90 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
93 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
98 // initialize CDevVideoPlay and wait for response
99 // iError is set by the MdvpoInitComplete callback
100 aDevVideoPlay.Initialize();
102 if (iError != KErrNone)
104 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
105 return EInconclusive;
108 // check not already playing
109 TBool playing = aDevVideoPlay.IsPlaying();
112 ERR_PRINTF1(_L("Error - DevVideoPlay already playing!"));
113 return EInconclusive;
116 // call resume on DevVideoPlay then check IsPlaying()
117 aDevVideoPlay.Resume();
118 playing = aDevVideoPlay.IsPlaying();
122 ERR_PRINTF1(_L("IsPlaying() returned EFalse - expected ETrue"));
126 INFO_PRINTF1(_L("Resume() called successfully"));
130 //------------------------------------------------------------------
132 void CTestDevVideoPlaySetPosition::MdvpoInitComplete(TInt aError)
134 INFO_PRINTF2(_L("CTestDevVideoPlaySetPosition::MdvpoInitComplete(): Error = %d"), aError);
139 CTestDevVideoPlaySetPosition::CTestDevVideoPlaySetPosition(const TDesC& aTestName, TTestType aTestType)
140 :CTestDevVideoPlayStep(aTestName, aTestType)
144 CTestDevVideoPlaySetPosition* CTestDevVideoPlaySetPosition::NewL(const TDesC& aTestName, TTestType aTestType)
146 CTestDevVideoPlaySetPosition* self = new(ELeave) CTestDevVideoPlaySetPosition(aTestName, aTestType);
150 TVerdict CTestDevVideoPlaySetPosition::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
152 TVerdict ret = EPass;
153 TInt expErr = KErrNone;
154 TBool selDec = ETrue;
155 TBool selPost = ETrue;
156 TInt testPos = KTestPosition;
158 INFO_PRINTF1(_L("CMMFDevVideoPlay: SetPosition"));
168 testPos = KTestPositionFatal;
170 case ETestDecoderFatal:
172 testPos = KTestPositionFatal;
173 // fall through to set post proc to false;
174 case ETestDecoderOnly:
177 case ETestPostProcFatal:
179 testPos = KTestPositionFatal;
180 // fall through to set decoder to false;
181 case ETestPostProcOnly:
185 ERR_PRINTF1(_L("Error - invalid test step type"));
186 return EInconclusive;
191 // THwDeviceId hwDecoder = 0;
192 // THwDeviceId hwPostProc = 0;
197 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
198 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
201 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
202 return EInconclusive;
206 // select post-processor
209 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
210 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
213 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
214 return EInconclusive;
218 // initialize CDevVideoPlay and wait for response
219 // iError is set by the MdvpoInitComplete callback
220 aDevVideoPlay.Initialize();
222 if (iError != KErrNone)
224 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
225 return EInconclusive;
228 TTimeIntervalMicroSeconds pos(testPos);
231 aDevVideoPlay.SetPosition(pos);
233 // if no PANIC and iError is as expected then test has passed
234 // if performing a fatal test then expect iError = KErrDied
235 if (iError == expErr)
237 ERR_PRINTF3(_L("SetPosition() got error %d; Expected %d"), iError, expErr);
241 INFO_PRINTF1(_L("SetPosition() called successfully"));
245 //------------------------------------------------------------------
247 void CTestDevVideoPlayFreezePicture::MdvpoInitComplete(TInt aError)
249 INFO_PRINTF2(_L("CTestDevVideoPlayFreezePicture::MdvpoInitComplete(): Error = %d"), aError);
254 CTestDevVideoPlayFreezePicture::CTestDevVideoPlayFreezePicture(const TDesC& aTestName, TTestType aTestType)
255 :CTestDevVideoPlayStep(aTestName, aTestType)
259 CTestDevVideoPlayFreezePicture* CTestDevVideoPlayFreezePicture::NewL(const TDesC& aTestName, TTestType aTestType)
261 CTestDevVideoPlayFreezePicture* self = new(ELeave) CTestDevVideoPlayFreezePicture(aTestName, aTestType);
265 TVerdict CTestDevVideoPlayFreezePicture::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
267 TVerdict ret = EPass;
269 INFO_PRINTF1(_L("CMMFDevVideoPlay: FreezePicture"));
272 if (iTestType != ETestValid)
274 ERR_PRINTF1(_L("Error - invalid test step type"));
275 return EInconclusive;
280 // THwDeviceId hwDecoder = 0;
281 // THwDeviceId hwPostProc = 0;
284 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
285 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
288 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
289 return EInconclusive;
292 // select post-processor
293 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
294 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
297 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
298 return EInconclusive;
301 // initialize CDevVideoPlay and wait for response
302 // iError is set by the MdvpoInitComplete callback
303 aDevVideoPlay.Initialize();
305 if (iError != KErrNone)
307 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
308 return EInconclusive;
311 TTimeIntervalMicroSeconds pos(KTestPosition);
313 // call FreezePicture
314 aDevVideoPlay.FreezePicture(pos);
316 // if no PANIC then test has passed
318 INFO_PRINTF1(_L("FreezePicture() called successfully"));
322 //------------------------------------------------------------------
324 void CTestDevVideoPlayReleaseFreeze::MdvpoInitComplete(TInt aError)
326 INFO_PRINTF2(_L("CTestDevVideoPlayReleaseFreeze::MdvpoInitComplete(): Error = %d"), aError);
331 CTestDevVideoPlayReleaseFreeze::CTestDevVideoPlayReleaseFreeze(const TDesC& aTestName, TTestType aTestType)
332 :CTestDevVideoPlayStep(aTestName, aTestType)
336 CTestDevVideoPlayReleaseFreeze* CTestDevVideoPlayReleaseFreeze::NewL(const TDesC& aTestName, TTestType aTestType)
338 CTestDevVideoPlayReleaseFreeze* self = new(ELeave) CTestDevVideoPlayReleaseFreeze(aTestName, aTestType);
342 TVerdict CTestDevVideoPlayReleaseFreeze::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
344 TVerdict ret = EPass;
346 INFO_PRINTF1(_L("CMMFDevVideoPlay: ReleaseFreeze"));
349 if (iTestType != ETestValid)
351 ERR_PRINTF1(_L("Error - invalid test step type"));
352 return EInconclusive;
357 // THwDeviceId hwDecoder = 0;
358 // THwDeviceId hwPostProc = 0;
361 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
362 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
365 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
366 return EInconclusive;
369 // select post-processor
370 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
371 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
374 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
375 return EInconclusive;
378 // initialize CDevVideoPlay and wait for response
379 // iError is set by the MdvpoInitComplete callback
380 aDevVideoPlay.Initialize();
382 if (iError != KErrNone)
384 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
385 return EInconclusive;
388 TTimeIntervalMicroSeconds pos(KTestPosition);
390 // call ReleaseFreeze
391 aDevVideoPlay.ReleaseFreeze(pos);
393 // if no PANIC then test has passed
395 INFO_PRINTF1(_L("ReleaseFreeze() called successfully"));
399 //------------------------------------------------------------------
401 void CTestDevVideoPlayDecodingPosition::MdvpoInitComplete(TInt aError)
403 INFO_PRINTF2(_L("CTestDevVideoPlayDecodingPosition::MdvpoInitComplete(): Error = %d"), aError);
408 CTestDevVideoPlayDecodingPosition::CTestDevVideoPlayDecodingPosition(const TDesC& aTestName, TTestType aTestType)
409 :CTestDevVideoPlayStep(aTestName, aTestType)
413 CTestDevVideoPlayDecodingPosition* CTestDevVideoPlayDecodingPosition::NewL(const TDesC& aTestName, TTestType aTestType)
415 CTestDevVideoPlayDecodingPosition* self = new(ELeave) CTestDevVideoPlayDecodingPosition(aTestName, aTestType);
419 TVerdict CTestDevVideoPlayDecodingPosition::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
421 TVerdict ret = EPass;
423 INFO_PRINTF1(_L("CMMFDevVideoPlay: DecodingPosition"));
426 if (iTestType != ETestValid)
428 ERR_PRINTF1(_L("Error - invalid test step type"));
429 return EInconclusive;
434 // THwDeviceId hwDecoder = 0;
435 // THwDeviceId hwPostProc = 0;
438 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
439 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
442 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
443 return EInconclusive;
446 // select post-processor
447 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
448 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
451 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
452 return EInconclusive;
455 // initialize CDevVideoPlay and wait for response
456 // iError is set by the MdvpoInitComplete callback
457 aDevVideoPlay.Initialize();
459 if (iError != KErrNone)
461 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
462 return EInconclusive;
465 // get decoding position
466 TTimeIntervalMicroSeconds decPos = aDevVideoPlay.DecodingPosition();
468 // check against test data
469 TTimeIntervalMicroSeconds testTime(KTestDecodePosition);
470 if (decPos != testTime)
472 ERR_PRINTF3(_L("DecodingPosition() incorrect - gave %d (expected %d)"),
473 I64LOW(decPos.Int64()), KTestDecodePosition);
477 INFO_PRINTF1(_L("DecodingPosition() called successfully"));
481 //------------------------------------------------------------------
483 void CTestDevVideoPlayPlaybackPosition::MdvpoInitComplete(TInt aError)
485 INFO_PRINTF2(_L("CTestDevVideoPlayPlaybackPosition::MdvpoInitComplete(): Error = %d"), aError);
490 CTestDevVideoPlayPlaybackPosition::CTestDevVideoPlayPlaybackPosition(const TDesC& aTestName, TTestType aTestType)
491 :CTestDevVideoPlayStep(aTestName, aTestType)
495 CTestDevVideoPlayPlaybackPosition* CTestDevVideoPlayPlaybackPosition::NewL(const TDesC& aTestName, TTestType aTestType)
497 CTestDevVideoPlayPlaybackPosition* self = new(ELeave) CTestDevVideoPlayPlaybackPosition(aTestName, aTestType);
501 TVerdict CTestDevVideoPlayPlaybackPosition::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
503 TVerdict ret = EPass;
505 INFO_PRINTF1(_L("CMMFDevVideoPlay: PlaybackPosition"));
508 if (iTestType != ETestValid)
510 ERR_PRINTF1(_L("Error - invalid test step type"));
511 return EInconclusive;
516 // THwDeviceId hwDecoder = 0;
517 // THwDeviceId hwPostProc = 0;
520 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
521 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
524 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
525 return EInconclusive;
528 // select post-processor
529 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
530 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
533 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
534 return EInconclusive;
537 // initialize CDevVideoPlay and wait for response
538 // iError is set by the MdvpoInitComplete callback
539 aDevVideoPlay.Initialize();
541 if (iError != KErrNone)
543 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
544 return EInconclusive;
547 // get playback position
548 TTimeIntervalMicroSeconds playPos = aDevVideoPlay.PlaybackPosition();
550 // check against test data
551 TTimeIntervalMicroSeconds testTime(KTestPlayPosition);
552 if (playPos != testTime)
554 ERR_PRINTF3(_L("PlaybackPosition() incorrect - gave %d (expected %d)"),
555 I64LOW(playPos.Int64()), KTestPlayPosition);
559 INFO_PRINTF1(_L("PlaybackPosition() called successfully"));
563 //------------------------------------------------------------------
565 void CTestDevVideoPlayPreDecoderBufferBytes::MdvpoInitComplete(TInt aError)
567 INFO_PRINTF2(_L("CTestDevVideoPlayPreDecoderBufferBytes::MdvpoInitComplete(): Error = %d"), aError);
572 CTestDevVideoPlayPreDecoderBufferBytes::CTestDevVideoPlayPreDecoderBufferBytes(const TDesC& aTestName, TTestType aTestType)
573 :CTestDevVideoPlayStep(aTestName, aTestType)
577 CTestDevVideoPlayPreDecoderBufferBytes* CTestDevVideoPlayPreDecoderBufferBytes::NewL(const TDesC& aTestName, TTestType aTestType)
579 CTestDevVideoPlayPreDecoderBufferBytes* self = new(ELeave) CTestDevVideoPlayPreDecoderBufferBytes(aTestName, aTestType);
583 TVerdict CTestDevVideoPlayPreDecoderBufferBytes::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
585 TVerdict ret = EPass;
587 INFO_PRINTF1(_L("CMMFDevVideoPlay: PreDecoderBufferBytes"));
590 if (iTestType != ETestValid)
592 ERR_PRINTF1(_L("Error - invalid test step type"));
593 return EInconclusive;
598 // THwDeviceId hwDecoder = 0;
599 // THwDeviceId hwPostProc = 0;
602 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
603 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
606 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
607 return EInconclusive;
610 // select post-processor
611 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
612 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
615 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
616 return EInconclusive;
619 // initialize CDevVideoPlay and wait for response
620 // iError is set by the MdvpoInitComplete callback
621 aDevVideoPlay.Initialize();
623 if (iError != KErrNone)
625 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
626 return EInconclusive;
629 // get pre-decoder buffer bytes
630 TUint decBytes = aDevVideoPlay.PreDecoderBufferBytes();
632 // check against test data
633 if (decBytes != KTestPreDecoderBytes)
635 ERR_PRINTF3(_L("PreDecoderBufferBytes() incorrect - gave %d (expected %d)"),
636 decBytes, KTestPreDecoderBytes);
640 INFO_PRINTF1(_L("PreDecoderBufferBytes() called successfully"));
644 //------------------------------------------------------------------
646 void CTestDevVideoPlayPictureBufferBytes::MdvpoInitComplete(TInt aError)
648 INFO_PRINTF2(_L("CTestDevVideoPlayPictureBufferBytes::MdvpoInitComplete(): Error = %d"), aError);
653 CTestDevVideoPlayPictureBufferBytes::CTestDevVideoPlayPictureBufferBytes(const TDesC& aTestName, TTestType aTestType)
654 :CTestDevVideoPlayStep(aTestName, aTestType)
658 CTestDevVideoPlayPictureBufferBytes* CTestDevVideoPlayPictureBufferBytes::NewL(const TDesC& aTestName, TTestType aTestType)
660 CTestDevVideoPlayPictureBufferBytes* self = new(ELeave) CTestDevVideoPlayPictureBufferBytes(aTestName, aTestType);
664 TVerdict CTestDevVideoPlayPictureBufferBytes::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
666 TVerdict ret = EPass;
668 INFO_PRINTF1(_L("CMMFDevVideoPlay: PictureBufferBytes"));
671 if (iTestType != ETestValid)
673 ERR_PRINTF1(_L("Error - invalid test step type"));
674 return EInconclusive;
679 // THwDeviceId hwDecoder = 0;
680 // THwDeviceId hwPostProc = 0;
683 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
684 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
687 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
688 return EInconclusive;
691 // select post-processor
692 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
693 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
696 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
697 return EInconclusive;
700 // initialize CDevVideoPlay and wait for response
701 // iError is set by the MdvpoInitComplete callback
702 aDevVideoPlay.Initialize();
704 if (iError != KErrNone)
706 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
707 return EInconclusive;
710 // get picture buffer bytes
711 TUint picBytes = aDevVideoPlay.PictureBufferBytes();
713 // check against test data
714 if (picBytes != KTestPictureBytes)
716 ERR_PRINTF3(_L("PictureBufferBytes() incorrect - gave %d (expected %d)"),
717 picBytes, KTestPictureBytes);
721 INFO_PRINTF1(_L("PictureBufferBytes() called successfully"));
725 //------------------------------------------------------------------
727 void CTestDevVideoPlayGetPictureCounters::MdvpoInitComplete(TInt aError)
729 INFO_PRINTF2(_L("CTestDevVideoPlayGetPictureCounters::MdvpoInitComplete(): Error = %d"), aError);
734 CTestDevVideoPlayGetPictureCounters::CTestDevVideoPlayGetPictureCounters(const TDesC& aTestName, TTestType aTestType)
735 :CTestDevVideoPlayStep(aTestName, aTestType)
739 CTestDevVideoPlayGetPictureCounters* CTestDevVideoPlayGetPictureCounters::NewL(const TDesC& aTestName, TTestType aTestType)
741 CTestDevVideoPlayGetPictureCounters* self = new(ELeave) CTestDevVideoPlayGetPictureCounters(aTestName, aTestType);
745 TVerdict CTestDevVideoPlayGetPictureCounters::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
747 TVerdict ret = EPass;
748 TInt expErr = KErrNone;
749 TBool selDec = ETrue;
750 TBool selPost = ETrue;
752 INFO_PRINTF1(_L("CMMFDevVideoPlay: GetPictureCounters"));
760 case ETestDecoderOnly:
763 case ETestPostProcOnly:
767 ERR_PRINTF1(_L("Error - invalid test step type"));
768 return EInconclusive;
773 THwDeviceId hwDecoder = 0;
774 THwDeviceId hwPostProc = 0;
779 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
782 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
783 return EInconclusive;
787 // select post-processor
790 TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
793 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
794 return EInconclusive;
798 // initialize CDevVideoPlay and wait for response
799 // iError is set by the MdvpoInitComplete callback
800 aDevVideoPlay.Initialize();
802 if (iError != KErrNone)
804 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
805 return EInconclusive;
808 CMMFDevVideoPlay::TPictureCounters picCounts;
810 // get picture counters from DevVideoPlay
811 aDevVideoPlay.GetPictureCounters(picCounts);
813 // N.B. PicturesSkipped is sum of decoder and post processor so
814 // we have to add these
815 CMMFDevVideoPlay::TPictureCounters testCounts = GetTestPictureCounters();
816 if (hwDecoder && hwPostProc)
818 // account for both decoder and post processor
819 testCounts.iPicturesSkipped *= 2;
823 // no decoded samples from a post processor
824 testCounts.iPicturesDecoded = 0;
827 if (!ComparePictureCounters(picCounts, testCounts))
829 ERR_PRINTF1(_L("GetPictureCounters() comparison with test data failed!"));
834 INFO_PRINTF1(_L("GetPictureCounters() comparison with test data passed."));
835 INFO_PRINTF3(_L("GetPictureCounters(), %d = %d"), err, expErr);
840 //------------------------------------------------------------------
842 void CTestDevVideoPlayGetBitstreamCounters::MdvpoInitComplete(TInt aError)
844 INFO_PRINTF2(_L("CTestDevVideoPlayGetBitstreamCounters::MdvpoInitComplete(): Error = %d"), aError);
849 CTestDevVideoPlayGetBitstreamCounters::CTestDevVideoPlayGetBitstreamCounters(const TDesC& aTestName, TTestType aTestType)
850 :CTestDevVideoPlayStep(aTestName, aTestType)
854 CTestDevVideoPlayGetBitstreamCounters* CTestDevVideoPlayGetBitstreamCounters::NewL(const TDesC& aTestName, TTestType aTestType)
856 CTestDevVideoPlayGetBitstreamCounters* self = new(ELeave) CTestDevVideoPlayGetBitstreamCounters(aTestName, aTestType);
860 TVerdict CTestDevVideoPlayGetBitstreamCounters::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
862 TVerdict ret = EPass;
863 TInt expErr = KErrNone;
865 INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBitstreamCounters"));
868 if (iTestType != ETestValid)
870 ERR_PRINTF1(_L("Error - invalid test step type"));
871 return EInconclusive;
876 // THwDeviceId hwDecoder = 0;
877 // THwDeviceId hwPostProc = 0;
880 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
881 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));// EABI warning removal
884 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
885 return EInconclusive;
888 // select post-processor
889 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
890 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
893 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
894 return EInconclusive;
897 // initialize CDevVideoPlay and wait for response
898 // iError is set by the MdvpoInitComplete callback
899 aDevVideoPlay.Initialize();
901 if (iError != KErrNone)
903 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
904 return EInconclusive;
907 CMMFDevVideoPlay::TBitstreamCounters bitCounts;
909 // get bitstream counters from DevVideoPlay
910 aDevVideoPlay.GetBitstreamCounters(bitCounts);
912 if (!CompareBitstreamCounters(bitCounts, GetTestBitstreamCounters()))
914 ERR_PRINTF1(_L("GetBitstreamCounters() comparison with test data failed!"));
919 INFO_PRINTF1(_L("GetBitstreamCounters() comparison with test data passed."));
920 INFO_PRINTF3(_L("GetBitstreamCounters(), %d = %d"), err, expErr);
925 //------------------------------------------------------------------
927 void CTestDevVideoPlayNumFreeBuffers::MdvpoInitComplete(TInt aError)
929 INFO_PRINTF2(_L("CTestDevVideoPlayNumFreeBuffers::MdvpoInitComplete(): Error = %d"), aError);
934 CTestDevVideoPlayNumFreeBuffers::CTestDevVideoPlayNumFreeBuffers(const TDesC& aTestName, TTestType aTestType)
935 :CTestDevVideoPlayStep(aTestName, aTestType)
939 CTestDevVideoPlayNumFreeBuffers* CTestDevVideoPlayNumFreeBuffers::NewL(const TDesC& aTestName, TTestType aTestType)
941 CTestDevVideoPlayNumFreeBuffers* self = new(ELeave) CTestDevVideoPlayNumFreeBuffers(aTestName, aTestType);
945 TVerdict CTestDevVideoPlayNumFreeBuffers::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
947 TVerdict ret = EPass;
949 INFO_PRINTF1(_L("CMMFDevVideoPlay: NumFreeBuffers"));
952 if (iTestType != ETestValid)
954 ERR_PRINTF1(_L("Error - invalid test step type"));
955 return EInconclusive;
960 // THwDeviceId hwDecoder = 0;
961 // THwDeviceId hwPostProc = 0;
964 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
965 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
968 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
969 return EInconclusive;
972 // select post-processor
973 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
974 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
977 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
978 return EInconclusive;
981 // initialize CDevVideoPlay and wait for response
982 // iError is set by the MdvpoInitComplete callback
983 aDevVideoPlay.Initialize();
985 if (iError != KErrNone)
987 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
988 return EInconclusive;
991 TUint numBuffers = 0;
993 // get number of free buffers from DevVideoPlay
994 numBuffers = aDevVideoPlay.NumFreeBuffers();
996 if (numBuffers != KTestNumFreeBuffers)
998 ERR_PRINTF1(_L("NumFreeBuffers() comparison with test data failed!"));
1003 INFO_PRINTF1(_L("NumFreeBuffers() comparison with test data passed."));
1004 INFO_PRINTF3(_L("NumFreeBuffers(), %d = %d"), numBuffers, KTestNumFreeBuffers);
1008 //------------------------------------------------------------------
1010 void CTestDevVideoPlaySetComplexityLevel::MdvpoInitComplete(TInt aError)
1012 INFO_PRINTF2(_L("CTestDevVideoPlaySetComplexityLevel::MdvpoInitComplete(): Error = %d"), aError);
1017 CTestDevVideoPlaySetComplexityLevel::CTestDevVideoPlaySetComplexityLevel(const TDesC& aTestName, TTestType aTestType)
1018 :CTestDevVideoPlayStep(aTestName, aTestType)
1022 CTestDevVideoPlaySetComplexityLevel* CTestDevVideoPlaySetComplexityLevel::NewL(const TDesC& aTestName, TTestType aTestType)
1024 CTestDevVideoPlaySetComplexityLevel* self = new(ELeave) CTestDevVideoPlaySetComplexityLevel(aTestName, aTestType);
1028 TVerdict CTestDevVideoPlaySetComplexityLevel::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1030 TVerdict ret = EPass;
1032 INFO_PRINTF1(_L("CMMFDevVideoPlay: SetComplexityLevel"));
1035 if (iTestType != ETestValid)
1037 ERR_PRINTF1(_L("Error - invalid test step type"));
1038 return EInconclusive;
1041 TInt err = KErrNone;
1043 THwDeviceId hwDecoder = 0;
1044 THwDeviceId hwPostProc = 0;
1047 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1048 if (err != KErrNone)
1050 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1051 return EInconclusive;
1054 // select post-processor
1055 TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1056 if (err != KErrNone)
1058 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1059 return EInconclusive;
1062 // initialize CDevVideoPlay and wait for response
1063 // iError is set by the MdvpoInitComplete callback
1064 aDevVideoPlay.Initialize();
1066 if (iError != KErrNone)
1068 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1069 return EInconclusive;
1072 // set complexity level on decoder
1073 aDevVideoPlay.SetComplexityLevel(hwDecoder, KTestComplexityLevel1);
1075 // set complexity level on post-processor
1076 aDevVideoPlay.SetComplexityLevel(hwPostProc, KTestComplexityLevel2);
1078 // if no PANIC then test has passed
1079 INFO_PRINTF3(_L("SetComplexityLevel(), %d, %d"), KTestComplexityLevel1, KTestComplexityLevel2);
1083 //------------------------------------------------------------------
1085 void CTestDevVideoPlayNumComplexityLevels::MdvpoInitComplete(TInt aError)
1087 INFO_PRINTF2(_L("CTestDevVideoPlayNumComplexityLevels::MdvpoInitComplete(): Error = %d"), aError);
1092 CTestDevVideoPlayNumComplexityLevels::CTestDevVideoPlayNumComplexityLevels(const TDesC& aTestName, TTestType aTestType)
1093 :CTestDevVideoPlayStep(aTestName, aTestType)
1097 CTestDevVideoPlayNumComplexityLevels* CTestDevVideoPlayNumComplexityLevels::NewL(const TDesC& aTestName, TTestType aTestType)
1099 CTestDevVideoPlayNumComplexityLevels* self = new(ELeave) CTestDevVideoPlayNumComplexityLevels(aTestName, aTestType);
1103 TVerdict CTestDevVideoPlayNumComplexityLevels::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1105 TVerdict ret = EPass;
1107 INFO_PRINTF1(_L("CMMFDevVideoPlay: NumComplexityLevels"));
1110 if (iTestType != ETestValid)
1112 ERR_PRINTF1(_L("Error - invalid test step type"));
1113 return EInconclusive;
1116 TInt err = KErrNone;
1118 THwDeviceId hwDecoder = 0;
1119 THwDeviceId hwPostProc = 0;
1122 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1123 if (err != KErrNone)
1125 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1126 return EInconclusive;
1129 // select post-processor
1130 TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1131 if (err != KErrNone)
1133 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1134 return EInconclusive;
1137 // initialize CDevVideoPlay and wait for response
1138 // iError is set by the MdvpoInitComplete callback
1139 aDevVideoPlay.Initialize();
1141 if (iError != KErrNone)
1143 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1144 return EInconclusive;
1147 // get num complexity levels on decoder
1148 TUint levs1 = aDevVideoPlay.NumComplexityLevels(hwDecoder);
1150 // get num complexity levels on post-processor
1151 TUint levs2 = aDevVideoPlay.NumComplexityLevels(hwPostProc);
1153 // check return values against test data
1154 if (levs1 != KTestNumComplexityLevels1 || levs2 != KTestNumComplexityLevels2)
1156 ERR_PRINTF3(_L("Error - comparison against test data failed! (%d, %d)"), levs1, levs2);
1160 INFO_PRINTF3(_L("NumComplexityLevels(), %d, %d"), levs1, levs2);
1165 //------------------------------------------------------------------
1167 void CTestDevVideoPlayGetComplexityLevelInfo::MdvpoInitComplete(TInt aError)
1169 INFO_PRINTF2(_L("CTestDevVideoPlayGetComplexityLevelInfo::MdvpoInitComplete(): Error = %d"), aError);
1174 CTestDevVideoPlayGetComplexityLevelInfo::CTestDevVideoPlayGetComplexityLevelInfo(const TDesC& aTestName, TTestType aTestType)
1175 :CTestDevVideoPlayStep(aTestName, aTestType)
1179 CTestDevVideoPlayGetComplexityLevelInfo* CTestDevVideoPlayGetComplexityLevelInfo::NewL(const TDesC& aTestName, TTestType aTestType)
1181 CTestDevVideoPlayGetComplexityLevelInfo* self = new(ELeave) CTestDevVideoPlayGetComplexityLevelInfo(aTestName, aTestType);
1185 TVerdict CTestDevVideoPlayGetComplexityLevelInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1187 TVerdict ret = EPass;
1189 INFO_PRINTF1(_L("CMMFDevVideoPlay: GetComplexityLevelInfo"));
1192 if (iTestType != ETestValid)
1194 ERR_PRINTF1(_L("Error - invalid test step type"));
1195 return EInconclusive;
1198 TInt err = KErrNone;
1200 THwDeviceId hwDecoder = 0;
1201 THwDeviceId hwPostProc = 0;
1204 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1205 if (err != KErrNone)
1207 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1208 return EInconclusive;
1211 // select post-processor
1212 TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1213 if (err != KErrNone)
1215 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1216 return EInconclusive;
1219 // initialize CDevVideoPlay and wait for response
1220 // iError is set by the MdvpoInitComplete callback
1221 aDevVideoPlay.Initialize();
1223 if (iError != KErrNone)
1225 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1226 return EInconclusive;
1229 CMMFDevVideoPlay::TComplexityLevelInfo levInfo1;
1230 CMMFDevVideoPlay::TComplexityLevelInfo levInfo2;
1232 // get complexity level info on decoder
1233 aDevVideoPlay.GetComplexityLevelInfo(hwDecoder, KTestComplexityLevel1, levInfo1);
1235 // get complexity level info on post-processor
1236 aDevVideoPlay.GetComplexityLevelInfo(hwPostProc, KTestComplexityLevel2, levInfo2);
1238 CMMFDevVideoPlay::TComplexityLevelInfo testInfo1 = GetTestLevelInfo(KTestComplexityLevel1);
1239 CMMFDevVideoPlay::TComplexityLevelInfo testInfo2 = GetTestLevelInfo(KTestComplexityLevel2);
1241 // check return values against test data
1242 if (!CompareLevelInfos(levInfo1, testInfo1) || !CompareLevelInfos(levInfo2, testInfo2))
1244 ERR_PRINTF1(_L("Error - comparison against test data failed!"));
1248 INFO_PRINTF1(_L("Comparison against test data passed ok."));
1249 INFO_PRINTF1(_L("GetComplexityLevelInfo() called successfully"));
1254 //------------------------------------------------------------------
1256 void CTestDevVideoPlayGetBuffer::MdvpoInitComplete(TInt aError)
1258 INFO_PRINTF2(_L("CTestDevVideoPlayGetBuffer::MdvpoInitComplete(): Error = %d"), aError);
1263 void CTestDevVideoPlayGetBuffer::MdvpoNewBuffers()
1265 INFO_PRINTF1(_L("CTestDevVideoPlayGetBuffer::MdvpoNewBuffers()"));
1266 iCalledBack = ETrue;
1269 CTestDevVideoPlayGetBuffer::CTestDevVideoPlayGetBuffer(const TDesC& aTestName, TTestType aTestType)
1270 :CTestDevVideoPlayStep(aTestName, aTestType)
1274 CTestDevVideoPlayGetBuffer* CTestDevVideoPlayGetBuffer::NewL(const TDesC& aTestName, TTestType aTestType)
1276 CTestDevVideoPlayGetBuffer* self = new(ELeave) CTestDevVideoPlayGetBuffer(aTestName, aTestType);
1280 TVerdict CTestDevVideoPlayGetBuffer::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1282 TVerdict ret = EPass;
1283 TInt expErr = KErrNone;
1285 INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBuffer"));
1288 if (iTestType != ETestValid)
1290 ERR_PRINTF1(_L("Error - invalid test step type"));
1291 return EInconclusive;
1294 TInt err = KErrNone;
1296 // THwDeviceId hwDecoder = 0;
1297 // THwDeviceId hwPostProc = 0;
1300 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1301 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
1302 if (err != KErrNone)
1304 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1305 return EInconclusive;
1308 // select post-processor
1309 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1310 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1311 if (err != KErrNone)
1313 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1314 return EInconclusive;
1317 // initialize CDevVideoPlay and wait for response
1318 // iError is set by the MdvpoInitComplete callback
1319 aDevVideoPlay.Initialize();
1321 if (iError != KErrNone)
1323 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1324 return EInconclusive;
1327 TVideoInputBuffer* newBuff = NULL;
1329 // get a buffer of a certain size from DevVideoPlay
1330 TRAP(err, newBuff = aDevVideoPlay.GetBufferL(KTestBufferSize) );
1331 // callback will occur and newBuff will be set to new buffer
1335 ERR_PRINTF3(_L("GetBufferL() gave error %d (expected %d)"),err, expErr);
1340 TBool buffSuccess = EFalse;
1342 // check callback has been called and buffer is correct
1343 if (newBuff && iCalledBack)
1345 TTimeIntervalMicroSeconds testTime(KTestBufferSize);
1346 if ( (newBuff->iDecodingTimestamp == testTime) &&
1347 (newBuff->iOptions == KTestBufferOptions) &&
1348 (newBuff->iData == KTestBufferString) )
1350 buffSuccess = ETrue;
1356 ERR_PRINTF1(_L("Received buffer is corrupt!"));
1361 INFO_PRINTF1(_L("Buffer received correctly"));
1362 INFO_PRINTF3(_L("GetBuffer(), %d = %d"), err, expErr);
1367 //------------------------------------------------------------------
1369 void CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(TInt aError)
1371 INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError);
1376 CTestDevVideoPlayWriteCodedData::CTestDevVideoPlayWriteCodedData(const TDesC& aTestName, TTestType aTestType)
1377 :CTestDevVideoPlayStep(aTestName, aTestType)
1381 CTestDevVideoPlayWriteCodedData* CTestDevVideoPlayWriteCodedData::NewL(const TDesC& aTestName, TTestType aTestType)
1383 CTestDevVideoPlayWriteCodedData* self = new(ELeave) CTestDevVideoPlayWriteCodedData(aTestName, aTestType);
1387 TVerdict CTestDevVideoPlayWriteCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1389 TVerdict ret = EPass;
1390 TInt expErr = KErrNone;
1392 INFO_PRINTF1(_L("CMMFDevVideoPlay: WriteCodedData"));
1395 if (iTestType != ETestValid)
1397 ERR_PRINTF1(_L("Error - invalid test step type"));
1398 return EInconclusive;
1401 TInt err = KErrNone;
1403 // THwDeviceId hwDecoder = 0;
1404 // THwDeviceId hwPostProc = 0;
1407 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1408 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
1409 if (err != KErrNone)
1411 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1412 return EInconclusive;
1415 // select post-processor
1416 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1417 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1418 if (err != KErrNone)
1420 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1421 return EInconclusive;
1424 // initialize CDevVideoPlay and wait for response
1425 // iError is set by the MdvpoInitComplete callback
1426 aDevVideoPlay.Initialize();
1428 if (iError != KErrNone)
1430 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1431 return EInconclusive;
1434 // construct a video input buffer structure with a valid timestamp and
1435 // write this DevVideoPlay. Call will leave on error.
1436 TVideoInputBuffer* newBuff = NULL;
1437 TPtrC8 testBufferStringPtr(KTestBufferString);
1438 TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length()));
1441 ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay"));
1442 return EInconclusive;
1445 // initialize newBuff with test data
1446 newBuff->iOptions = KTestBufferOptions;
1447 newBuff->iDecodingTimestamp = KTestBufferSize;
1448 newBuff->iData.Zero();
1449 newBuff->iData.Append(testBufferStringPtr);
1451 // write buffer to DevVideoPlay
1452 TRAP(err, aDevVideoPlay.WriteCodedDataL(newBuff) )
1456 ERR_PRINTF3(_L("WriteCodedDataL() gave error %d (expected %d)"),err, expErr);
1461 INFO_PRINTF1(_L("Coded data sent successfully"));
1462 INFO_PRINTF3(_L("WriteCodedDataL(), %d = %d"), err, expErr);
1466 //------------------------------------------------------------------
1468 void CTestDevVideoPlayScanAndCopyCodedData::MdvpoInitComplete(TInt aError)
1470 INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError);
1475 CTestDevVideoPlayScanAndCopyCodedData::CTestDevVideoPlayScanAndCopyCodedData(const TDesC& aTestName, TTestType aTestType)
1476 :CTestDevVideoPlayStep(aTestName, aTestType)
1480 CTestDevVideoPlayScanAndCopyCodedData* CTestDevVideoPlayScanAndCopyCodedData::NewL(const TDesC& aTestName, TTestType aTestType)
1482 CTestDevVideoPlayScanAndCopyCodedData* self = new(ELeave) CTestDevVideoPlayScanAndCopyCodedData(aTestName, aTestType);
1486 TVerdict CTestDevVideoPlayScanAndCopyCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1488 TVerdict ret = EPass;
1489 TInt expErr = KErrNone;
1491 INFO_PRINTF1(_L("MMMFVideoPlayHwDeviceExtensionScanCopy: ScanAndCopyCodedDataL"));
1494 if (iTestType != ETestValid)
1496 ERR_PRINTF1(_L("Error - invalid test step type"));
1497 return EInconclusive;
1500 TInt err = KErrNone;
1502 THwDeviceId hwDecoder = 0;
1505 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1506 if (err != KErrNone)
1508 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1509 return EInconclusive;
1512 // select post-processor
1513 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1514 if (err != KErrNone)
1516 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1517 return EInconclusive;
1520 // initialize CDevVideoPlay and wait for response
1521 // iError is set by the MdvpoInitComplete callback
1522 aDevVideoPlay.Initialize();
1524 if (iError != KErrNone)
1526 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1527 return EInconclusive;
1531 // construct a video input buffer structure with a valid timestamp and
1532 // write this DevVideoPlay. Call will leave on error.
1533 TVideoInputBuffer* newBuff = NULL;
1534 TPtrC8 testBufferStringPtr(KTestBufferString);
1535 TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length()));
1538 ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay"));
1539 return EInconclusive;
1542 //clean out pre-set stuff from buffer
1543 newBuff->iData.Zero();
1544 //set ptr to test data
1545 TPtrC8 testBufferString(KTestBufferString);
1546 HBufC8* bufferDataArea = testBufferString.AllocL();
1547 CleanupStack::PushL(bufferDataArea);
1548 TPtr8 dataAreaPtr = bufferDataArea->Des();
1549 TFramePortion framePortion = EFramePortionEndFragment;
1551 MMMFVideoPlayHwDeviceExtensionScanCopy* ciOne = static_cast<MMMFVideoPlayHwDeviceExtensionScanCopy*>(aDevVideoPlay.CustomInterface(hwDecoder, KUidDevVideoPlayHwDeviceExtensionScanCopy));
1554 // write buffer to DevVideoPlay using new interface
1555 TRAP(err, ciOne->ScanAndCopyCodedDataL(dataAreaPtr, newBuff, consumed, framePortion));
1557 //compare buffer to test data
1558 if ((newBuff->iData != KTestBufferString) || consumed != newBuff->iData.Length())
1565 ERR_PRINTF3(_L("ScanAndCopyCodedDataL() gave error %d (expected %d)"),err, expErr);
1570 INFO_PRINTF1(_L("Coded data sent successfully"));
1571 INFO_PRINTF3(_L("ScanAndCopyCodedDataL(), %d = %d"), err, expErr);
1573 CleanupStack::PopAndDestroy(bufferDataArea);
1577 //------------------------------------------------------------------
1579 void CTestDevVideoPlayExtensionWriteCodedData::MdvpoInitComplete(TInt aError)
1581 INFO_PRINTF2(_L("CTestDevVideoPlayWriteCodedData::MdvpoInitComplete(): Error = %d"), aError);
1586 CTestDevVideoPlayExtensionWriteCodedData::CTestDevVideoPlayExtensionWriteCodedData(const TDesC& aTestName, TTestType aTestType)
1587 :CTestDevVideoPlayStep(aTestName, aTestType)
1591 CTestDevVideoPlayExtensionWriteCodedData* CTestDevVideoPlayExtensionWriteCodedData::NewL(const TDesC& aTestName, TTestType aTestType)
1593 CTestDevVideoPlayExtensionWriteCodedData* self = new(ELeave) CTestDevVideoPlayExtensionWriteCodedData(aTestName, aTestType);
1597 TVerdict CTestDevVideoPlayExtensionWriteCodedData::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1599 TVerdict ret = EPass;
1600 TInt expErr = KErrNone;
1602 INFO_PRINTF1(_L("MMMFVideoPlayHwDeviceExtensionScanCopy: WriteCodedData"));
1605 if (iTestType != ETestValid)
1607 ERR_PRINTF1(_L("Error - invalid test step type"));
1608 return EInconclusive;
1611 TInt err = KErrNone;
1613 THwDeviceId hwDecoder = 0;
1616 TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1618 if (err != KErrNone)
1620 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1621 return EInconclusive;
1624 // select post-processor
1625 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1626 if (err != KErrNone)
1628 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1629 return EInconclusive;
1632 // initialize CDevVideoPlay and wait for response
1633 // iError is set by the MdvpoInitComplete callback
1634 aDevVideoPlay.Initialize();
1636 if (iError != KErrNone)
1638 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1639 return EInconclusive;
1642 // construct a video input buffer structure with a valid timestamp and
1643 // write this DevVideoPlay. Call will leave on error.
1644 TVideoInputBuffer* newBuff = NULL;
1645 TPtrC8 testBufferStringPtr(KTestBufferString);
1646 TRAP(err, newBuff = aDevVideoPlay.GetBufferL(testBufferStringPtr.Length()));
1649 ERR_PRINTF1(_L("Error - couldn't get buffer from DevVideoPlay"));
1650 return EInconclusive;
1653 // initialize newBuff with test data
1654 newBuff->iOptions = KTestBufferOptions;
1655 newBuff->iDecodingTimestamp = KTestBufferSize;
1656 newBuff->iData.Zero();
1657 newBuff->iData.Append(testBufferStringPtr);
1659 TFramePortion framePortion = EFramePortionEndFragment;
1661 MMMFVideoPlayHwDeviceExtensionScanCopy* ciOne = static_cast<MMMFVideoPlayHwDeviceExtensionScanCopy*>(aDevVideoPlay.CustomInterface(hwDecoder, KUidDevVideoPlayHwDeviceExtensionScanCopy));
1663 // write buffer to DevVideoPlay using new interface
1664 TRAP(err, ciOne->WriteCodedDataL(newBuff, framePortion));
1668 ERR_PRINTF3(_L("WriteCodedDataL() gave error %d (expected %d)"),err, expErr);
1673 INFO_PRINTF1(_L("Coded data sent successfully"));
1674 INFO_PRINTF3(_L("WriteCodedDataL(), %d = %d"), err, expErr);
1679 //------------------------------------------------------------------
1681 void CTestDevVideoPlayWritePicture::MdvpoInitComplete(TInt aError)
1683 INFO_PRINTF2(_L("CTestDevVideoPlayWritePicture::MdvpoInitComplete(): Error = %d"), aError);
1688 void CTestDevVideoPlayWritePicture::MdvpoReturnPicture(TVideoPicture* aPicture)
1690 INFO_PRINTF1(_L("CTestDevVideoPlayWritePicture::MdvpoReturnPicture()"));
1692 iPicture = aPicture;
1695 CTestDevVideoPlayWritePicture::CTestDevVideoPlayWritePicture(const TDesC& aTestName, TTestType aTestType)
1696 :CTestDevVideoPlayStep(aTestName, aTestType)
1700 CTestDevVideoPlayWritePicture* CTestDevVideoPlayWritePicture::NewL(const TDesC& aTestName, TTestType aTestType)
1702 CTestDevVideoPlayWritePicture* self = new(ELeave) CTestDevVideoPlayWritePicture(aTestName, aTestType);
1706 TVerdict CTestDevVideoPlayWritePicture::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1708 TVerdict ret = EPass;
1709 TInt expErr = KErrNone;
1711 INFO_PRINTF1(_L("CMMFDevVideoPlay: WritePicture"));
1714 if (iTestType != ETestValid)
1716 ERR_PRINTF1(_L("Error - invalid test step type"));
1717 return EInconclusive;
1720 TInt err = KErrNone;
1722 // THwDeviceId hwDecoder = 0;
1723 // THwDeviceId hwPostProc = 0;
1726 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1727 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
1728 if (err != KErrNone)
1730 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1731 return EInconclusive;
1734 // select post-processor
1735 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1736 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1737 if (err != KErrNone)
1739 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1740 return EInconclusive;
1743 // initialize CDevVideoPlay and wait for response
1744 // iError is set by the MdvpoInitComplete callback
1745 aDevVideoPlay.Initialize();
1747 if (iError != KErrNone)
1749 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1750 return EInconclusive;
1753 // construct a video picture structure with a valid timestamp and
1754 // write this DevVideoPlay. If the same picture comes back through the
1755 // MdvpoReturnPicture() callback then test has passed.
1756 TVideoPicture picture;
1757 TTimeIntervalMicroSeconds picTime(KTestPictureTimestamp);
1758 picture.iTimestamp = picTime;
1759 picture.iOptions = TVideoPicture::ETimestamp;
1761 // write picture to DevVideoPlay
1762 TRAP(err, aDevVideoPlay.WritePictureL(&picture) )
1766 ERR_PRINTF3(_L("WritePicture() gave error %d (expected %d)"),err, expErr);
1771 TBool picSuccess = EFalse;
1773 // check callback has been called and picture is correct
1776 if ( (iPicture->iTimestamp == picTime) &&
1777 (iPicture->iOptions == TVideoPicture::ETimestamp) )
1785 ERR_PRINTF1(_L("Received picture is corrupt!"));
1790 INFO_PRINTF1(_L("Original picture received correctly"));
1791 INFO_PRINTF3(_L("WritePicture(), %d = %d"), err, expErr);
1797 //------------------------------------------------------------------
1799 void CTestDevVideoPlayInputEnd::MdvpoInitComplete(TInt aError)
1801 INFO_PRINTF2(_L("CTestDevVideoPlayInputEnd::MdvpoInitComplete(): Error = %d"), aError);
1806 void CTestDevVideoPlayInputEnd::MdvpoStreamEnd()
1808 INFO_PRINTF1(_L("CTestDevVideoPlayInputEnd::MdvpoStreamEnd()"));
1810 // keep track on number of times this callback is called
1814 CTestDevVideoPlayInputEnd::CTestDevVideoPlayInputEnd(const TDesC& aTestName, TTestType aTestType)
1815 :CTestDevVideoPlayStep(aTestName, aTestType)
1819 CTestDevVideoPlayInputEnd* CTestDevVideoPlayInputEnd::NewL(const TDesC& aTestName, TTestType aTestType)
1821 CTestDevVideoPlayInputEnd* self = new(ELeave) CTestDevVideoPlayInputEnd(aTestName, aTestType);
1825 TVerdict CTestDevVideoPlayInputEnd::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1827 TVerdict ret = EPass;
1828 // TInt expErr = KErrNone;
1829 TBool selDec = ETrue;
1830 TBool selPost = ETrue;
1832 INFO_PRINTF1(_L("CMMFDevVideoPlay: InputEnd"));
1838 // expErr = KErrNone; // EABI warning removal
1840 case ETestDecoderOnly:
1843 case ETestPostProcOnly:
1847 ERR_PRINTF1(_L("Error - invalid test step type"));
1848 return EInconclusive;
1851 TInt err = KErrNone;
1853 // THwDeviceId hwDecoder = 0;
1854 // THwDeviceId hwPostProc = 0;
1859 // TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
1860 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
1861 if (err != KErrNone)
1863 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1864 return EInconclusive;
1868 // select post-processor
1871 // TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
1872 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1873 if (err != KErrNone)
1875 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1876 return EInconclusive;
1879 // initialize CDevVideoPlay and wait for response
1880 // iError is set by the MdvpoInitComplete callback
1881 aDevVideoPlay.Initialize();
1883 if (iError != KErrNone)
1885 ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
1886 return EInconclusive;
1889 // call input end on DevVideoPlay and check callback counter == 1
1890 aDevVideoPlay.InputEnd();
1894 ERR_PRINTF2(_L("Error - MdvpoStreamEnd only called %d times!"), iEndCount);
1898 INFO_PRINTF1(_L("InputEnd() called successfully"));
1902 //-------------------------------------------------------------------
1904 void CTestDevVideoGetBufferWithoutInitialize::MdvpoInitComplete(TInt aError)
1906 INFO_PRINTF2(_L("CTestGetBufferWithoutInitialize::MdvpoInitComplete(): Error = %d"), aError);
1911 void CTestDevVideoGetBufferWithoutInitialize::MdvpoNewBuffers()
1913 INFO_PRINTF1(_L("CTestGetBufferWithoutInitialize::MdvpoNewBuffers()"));
1914 iCalledBack = ETrue;
1917 CTestDevVideoGetBufferWithoutInitialize::CTestDevVideoGetBufferWithoutInitialize(const TDesC& aTestName, TTestType aTestType)
1918 :CTestDevVideoPlayStep(aTestName, aTestType)
1922 CTestDevVideoGetBufferWithoutInitialize* CTestDevVideoGetBufferWithoutInitialize::NewL(const TDesC& aTestName, TTestType aTestType)
1924 CTestDevVideoGetBufferWithoutInitialize* self = new(ELeave) CTestDevVideoGetBufferWithoutInitialize(aTestName, aTestType);
1928 TVerdict CTestDevVideoGetBufferWithoutInitialize::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
1930 TVerdict ret = EPass;
1931 TInt expErr = KErrNone;
1933 INFO_PRINTF1(_L("CMMFDevVideoPlay: GetBuffer"));
1934 INFO_PRINTF1(_L("To test the scenario wherein GetBufferL is called without calling initialize"));
1936 if (iTestType != ETestValid)
1938 ERR_PRINTF1(_L("Error - invalid test step type"));
1939 return EInconclusive;
1942 TInt err = KErrNone;
1944 TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice)); // EABI warning removal
1945 if (err != KErrNone)
1947 ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
1948 return EInconclusive;
1951 // select post-processor
1952 TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice)); // EABI warning removal
1953 if (err != KErrNone)
1955 ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
1956 return EInconclusive;
1958 TVideoInputBuffer* newBuff = NULL;
1959 // iError is set by the MdvpoInitComplete callback
1960 TRAP(err, newBuff = aDevVideoPlay.GetBufferL(KTestBufferSize) );
1961 // callback will occur and newBuff will be set to new buffer
1964 ERR_PRINTF3(_L("GetBufferL() gave error %d (expected %d)"),err, expErr);
1969 TBool buffSuccess = EFalse;
1971 // check callback has been called and buffer is correct
1972 if (newBuff && iCalledBack)
1974 TTimeIntervalMicroSeconds testTime(KTestBufferSize);
1975 if ( (newBuff->iDecodingTimestamp == testTime) &&
1976 (newBuff->iOptions == KTestBufferOptions) &&
1977 (newBuff->iData == KTestBufferString) )
1979 buffSuccess = ETrue;
1985 ERR_PRINTF1(_L("Received buffer is corrupt!"));
1990 INFO_PRINTF1(_L("Buffer received correctly"));
1991 INFO_PRINTF3(_L("GetBuffer(), %d = %d"), err, expErr);
1997 //-----------------------------------------------------------------------