First public contribution.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Header file: Video Player 2 Tests.
18 #ifndef TESTVIDEOPLAYER2_H
19 #define TESTVIDEOPLAYER2_H
21 #include "tsi_mmf_vclntavi_stepbase.h"
22 #include <surfaceeventhandler.h>
25 * Load and play a video file using graphics surface
30 class RTestVclnt2PlayFile : public RTestVclnt2AviPlayerStep
33 static RTestVclnt2PlayFile* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
36 virtual TVerdict DoTestStepPreambleL();
37 virtual TVerdict DoTestStepPostambleL();
39 virtual void FsmL(TVclntTestPlayEvents aEventCode);
41 virtual void HandleIdleL();
42 virtual void HandleOpenCompleteL();
43 virtual void HandlePrepareCompleteL();
44 virtual void HandlePlayCompleteL();
46 // called by HandlePrepareCompleteL to trigger the video playback
47 virtual void StartPlayback();
50 RTestVclnt2PlayFile(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
52 #ifdef SYMBIAN_BUILD_GCE
54 * Test CMediaClientVideoDisplay.This test makes sure that the new dll
55 * (mediaclientvideodisplay) is loaded and used.
57 * RTestMediaClientVideoDisplay
60 class RTestMediaClientVideoDisplay : public RTestVclnt2AviPlayerStep
63 static RTestMediaClientVideoDisplay* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
66 virtual TVerdict DoTestStepPreambleL();
67 virtual TVerdict DoTestStepPostambleL();
69 virtual void FsmL(TVclntTestPlayEvents aEventCode);
71 virtual void HandleIdleL();
72 virtual void HandleOpenCompleteL();
73 virtual void HandlePrepareCompleteL();
74 virtual void HandlePlayCompleteL();
76 // called by HandlePrepareCompleteL to trigger the video playback
77 virtual void StartPlayback();
80 RTestMediaClientVideoDisplay(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
87 * Load and play a video file using graphics surface with default window position, video
88 * extent and clip rect, then during playback, perform some actions specified within the
89 * implementation of the function DoThisActionDuringPlaybackL(). Before exiting
90 * DoThisActionDuringPlaybackL, SetActionPerformed() should be called to signal that
91 * all user action to be performed during video playback is completed.
93 * RTestVclnt2ActionDuringVideoPlayback
96 class RTestVclnt2PerformActionDuringVideoPlayback : public RTestVclnt2PlayFile
99 RTestVclnt2PerformActionDuringVideoPlayback(const TDesC& aTestName,
100 const TDesC& aSectName,
101 const TDesC& aKeyName,
102 TInt aExpectedError);
104 // overriden in this class to trigger start video playback and then proceed to
105 // perform the action detailed within DoThisActionDuringPlaybackL
106 virtual void StartPlayback();
108 virtual void HandlePlayCompleteL();
109 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer) = 0;
117 * Load and play a video file using graphics surface with specific window position, video
118 * extent and clip rect
123 class RTestVclnt2AddWin : public RTestVclnt2PlayFile
126 static RTestVclnt2AddWin* NewL(const TDesC& aTestName,
127 const TDesC& aSectName,
128 const TDesC& aKeyName,
129 TInt aExpectedError);
133 RTestVclnt2AddWin(const TDesC& aTestName,
134 const TDesC& aSectName,
135 const TDesC& aKeyName,
136 TInt aExpectedError);
138 virtual void HandlePrepareCompleteL();
143 * Load and play a video file using graphics surface, then change the display window during playback
145 * RTestVclnt2RemoveWin
148 class RTestVclnt2RemoveWin : public RTestVclnt2PerformActionDuringVideoPlayback
151 static RTestVclnt2RemoveWin* NewL(const TDesC& aTestName,
152 const TDesC& aSectName,
153 const TDesC& aKeyName,
158 virtual void HandlePrepareCompleteL();
159 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
163 RTestVclnt2RemoveWin(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TBool aAddBack);
166 /** If true, Add the display back again after removing it. */
172 * Load and play a video file using graphics surface, then change the window position during playback
177 class RTestVclnt2WinPos : public RTestVclnt2PerformActionDuringVideoPlayback
180 static RTestVclnt2WinPos* NewL(const TDesC& aTestName,
181 const TDesC& aSectName,
182 const TDesC& aKeyName,
183 TInt aExpectedError);
186 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
189 RTestVclnt2WinPos(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
194 * Load and play a video file using graphics surface, then change the video extent during playback
196 * RTestVclnt2VideoExt
199 class RTestVclnt2VideoExt : public RTestVclnt2PerformActionDuringVideoPlayback
202 static RTestVclnt2VideoExt* NewL(const TDesC& aTestName,
203 const TDesC& aSectName,
204 const TDesC& aKeyName,
205 TInt aExpectedError);
208 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
212 RTestVclnt2VideoExt(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
217 * Load and play a video file using graphics surface, then change the clipping rect during playback
219 * RTestVclnt2ClipRect
222 class RTestVclnt2ClipRect : public RTestVclnt2PerformActionDuringVideoPlayback
225 static RTestVclnt2ClipRect* NewL(const TDesC& aTestName,
226 const TDesC& aSectName,
227 const TDesC& aKeyName,
228 TInt aExpectedError);
231 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
234 RTestVclnt2ClipRect(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
239 * Load and play a video file using graphics surface, then change the scale factor during playback
244 class RTestVclnt2Scale : public RTestVclnt2PerformActionDuringVideoPlayback
247 static RTestVclnt2Scale* NewL(const TDesC& aTestName,
248 const TDesC& aSectName,
249 const TDesC& aKeyName,
250 TInt aExpectedError);
253 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
255 virtual void HandlePrepareCompleteL();
259 RTestVclnt2Scale(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
263 * Load a video file, set the crop region and then play video using graphics surface with non-default window
264 * clipping rect or video extent
266 * RTestVclnt2Viewport
269 class RTestVclnt2Viewport : public RTestVclnt2PlayFile
272 static RTestVclnt2Viewport* NewL(const TDesC& aTestName,
273 const TDesC& aSectName,
274 const TDesC& aKeyName,
275 const TSize& aViewportSize,
276 TInt aExpectedError = KErrNone);
279 virtual void HandlePrepareCompleteL();
282 void HandlePrepareCompleteL(const TRect& aCropRegion, const TRect& aVideoExtent, const TRect& aClipRect);
285 RTestVclnt2Viewport(const TDesC& aTestName,
286 const TDesC& aSectName,
287 const TDesC& aKeyName,
288 const TSize& aViewportSize,
289 TInt aExpectedError);
296 * Load a video file, set an invalid crop region and then play video using graphics surface
298 * RTestVclnt2InvalidViewport
301 class RTestVclnt2InvalidViewport : public RTestVclnt2PlayFile
304 static RTestVclnt2InvalidViewport* NewL(const TDesC& aTestName,
305 const TDesC& aSectName,
306 const TDesC& aKeyName,
307 TInt aExpectedError = KErrNone);
310 virtual void HandlePrepareCompleteL();
314 RTestVclnt2InvalidViewport(const TDesC& aTestName,
315 const TDesC& aSectName,
316 const TDesC& aKeyName,
317 TInt aExpectedError);
321 * Load and play a video file using graphics surface with rotation set
323 * RTestVclnt2Rotation
326 class RTestVclnt2Rotation : public RTestVclnt2PlayFile
329 static RTestVclnt2Rotation* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
332 virtual void HandlePrepareCompleteL();
336 RTestVclnt2Rotation(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError) ;
341 * Load and play a video file using graphics surface with specific crop region, autoscale,
342 * video extent and clip rect settings.
344 * RTestVclnt2Settings
347 class RTestVclnt2Settings : public RTestVclnt2PlayFile
350 static RTestVclnt2Settings* NewL(const TDesC& aTestName,
351 const TDesC& aSectName,
352 const TDesC& aKeyName,
353 TInt aExpectedError = KErrNone);
356 virtual void HandlePrepareCompleteL();
360 RTestVclnt2Settings(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError) ;
364 * Load and play a video file using graphics surface with specific crop region, content alignment,
365 * scale factor, video extent and clip rect settings. The video clip will be playbacked multiple times,
366 * each with a different combination of the settings.
368 * RTestVclnt2SettingsAndAlignments
371 class RTestVclnt2SettingsAndAlignments : public RTestVclnt2PlayFile
374 static RTestVclnt2SettingsAndAlignments* NewL(const TDesC& aTestName,
375 const TDesC& aSectName,
376 const TDesC& aKeyName,
377 TInt aExpectedError = KErrNone);
380 virtual void HandlePrepareCompleteL();
381 virtual void HandlePlayCompleteL();
382 virtual TVerdict DoTestStepPreambleL();
386 RTestVclnt2SettingsAndAlignments(const TDesC& aTestName,
387 const TDesC& aSectName,
388 const TDesC& aKeyName,
389 TInt aExpectedError);
392 void AddDisplayWindowL(const TRect& aCropRegion);
393 void SetCropRegionL(TRect& aCropRegion);
394 void SetContentOffsetL();
395 void SetScaleFactorL();
396 void SetContentAlignmentL();
404 * Load and play a video file using graphics surface on a second display
406 * RTestVclnt2SecDisplay
409 class RTestVclnt2SecDisplay : public RTestVclnt2PlayFile
412 static RTestVclnt2SecDisplay* NewL(const TDesC& aTestName,
413 const TDesC& aSectName,
414 const TDesC& aKeyName,
415 TInt aExpectedError = KErrNone);
419 virtual TVerdict DoTestStepPreambleL();
420 virtual TVerdict DoTestStepPostambleL();
422 virtual void HandlePrepareCompleteL();
426 RTestVclnt2SecDisplay(const TDesC& aTestName,
427 const TDesC& aSectName,
428 const TDesC& aKeyName,
429 TInt aExpectedError);
432 CWsScreenDevice* iSecondScreen;
437 * Load and play a video file using graphics surface, then pause the video and attempt
438 * to change the crop region and continue to playback the video.
440 * RTestVclnt2CropRectPause
443 class RTestVclnt2CropRectPause : public RTestVclnt2PerformActionDuringVideoPlayback
446 static RTestVclnt2CropRectPause* NewL(const TDesC& aTestName,
447 const TDesC& aSectName,
448 const TDesC& aKeyName,
449 TInt aExpectedError = KErrNone);
452 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayfser);
455 RTestVclnt2CropRectPause(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
460 * Load and play a video file using graphics surface with overlay graphics on top of video picture
465 class RTestVclnt2Overlay : public RTestVclnt2PlayFile
468 static RTestVclnt2Overlay* NewL(const TDesC& aTestName,
469 const TDesC& aSectName,
470 const TDesC& aKeyName,
471 TInt aExpectedError);
475 RTestVclnt2Overlay(const TDesC& aTestName,
476 const TDesC& aSectName,
477 const TDesC& aKeyName,
478 TInt aExpectedError);
480 virtual TVerdict DoTestStepPreambleL();
481 virtual TVerdict DoTestStepPostambleL();
483 virtual void HandlePrepareCompleteL();
490 * Load and play a video file using graphics surface and attempting to add the same display window twice
491 * using default values
496 class RTestVclnt2AddWin2 : public RTestVclnt2PlayFile
499 static RTestVclnt2AddWin2* NewL(const TDesC& aTestName,
500 const TDesC& aSectName,
501 const TDesC& aKeyName,
502 TInt aExpectedError);
506 RTestVclnt2AddWin2(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
508 virtual void HandlePrepareCompleteL();
512 * Load and play a video file using graphics surface and attempting to add the display window with specific
513 * settings then add the same display window using default values again
515 * RTestVclnt2AddWin2WithSettings
518 class RTestVclnt2AddWin2WithSettings : public RTestVclnt2PlayFile
521 static RTestVclnt2AddWin2WithSettings* NewL(const TDesC& aTestName,
522 const TDesC& aSectName,
523 const TDesC& aKeyName,
524 TInt aExpectedError);
528 RTestVclnt2AddWin2WithSettings(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
531 virtual void HandlePrepareCompleteL();
535 * Load and play a video file using graphics surface and set content offset and/or content alignment
537 * RTestVclnt2ContOffset
540 class RTestVclnt2ContOffset : public RTestVclnt2PlayFile
543 static RTestVclnt2ContOffset* NewL(const TDesC& aTestName,
544 const TDesC& aSectName,
545 const TDesC& aKeyName,
546 TInt aExpectedError);
550 virtual void HandlePrepareCompleteL();
554 RTestVclnt2ContOffset(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
558 * Load and play a video file using graphics surface and set content offset during playback
560 * RTestVclnt2ContOffsetAtPlay
563 class RTestVclnt2ContOffsetAtPlay : public RTestVclnt2PerformActionDuringVideoPlayback
566 static RTestVclnt2ContOffsetAtPlay* NewL(const TDesC& aTestName,
567 const TDesC& aSectName,
568 const TDesC& aKeyName,
569 TInt aExpectedError);
572 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
576 RTestVclnt2ContOffsetAtPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
580 * Load and play a video file using graphics surface and set content aligment during playback
585 class RTestVclnt2Align : public RTestVclnt2PerformActionDuringVideoPlayback
588 static RTestVclnt2Align* NewL(const TDesC& aTestName,
589 const TDesC& aSectName,
590 const TDesC& aKeyName,
591 TInt aExpectedError);
594 virtual void HandlePrepareCompleteL();
595 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
599 RTestVclnt2Align(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
603 * Load and play a video file using graphics surface and set auto scale
605 * RTestVclnt2AutoScale
608 class RTestVclnt2AutoScale : public RTestVclnt2PerformActionDuringVideoPlayback
611 static RTestVclnt2AutoScale* NewL(const TDesC& aTestName,
612 const TDesC& aSectName,
613 const TDesC& aKeyName,
614 TInt aExpectedError);
617 virtual void HandlePrepareCompleteL();
618 virtual void DoThisActionDuringPlaybackL(CVideoPlayerUtility2& aPlayer);
621 RTestVclnt2AutoScale(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
625 * Load and play a video file using graphics surface
627 * RTestVclnt2PlayFile
630 class RTestVclnt2OldController : public RTestVclnt2PlayFile
633 static RTestVclnt2OldController* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
636 virtual void HandleIdleL();
637 virtual void HandlePrepareCompleteL();
640 RTestVclnt2OldController(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
644 * Without opening a file, try doing surface related functions
649 class RTestVclnt2NoFile : public RTestVclnt2PlayFile
652 static RTestVclnt2NoFile* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
655 virtual void HandleIdleL();
658 RTestVclnt2NoFile(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
662 * Attempt to play video without display
664 * RTestVclnt2PlayAfterRemoveWin
667 class RTestVclnt2PlayAfterRemoveWin : public RTestVclnt2PlayFile
670 static RTestVclnt2PlayAfterRemoveWin* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
673 virtual void HandlePrepareCompleteL();
674 virtual void HandlePlayCompleteL();
677 RTestVclnt2PlayAfterRemoveWin(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
684 * Use surface utility API without GCE support
689 class RTestVclnt2NoGce : public RTestVclnt2PlayFile
692 static RTestVclnt2NoGce* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
695 virtual void HandleIdleL();
696 virtual void HandleOpenCompleteL();
699 RTestVclnt2NoGce(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
703 * Alloc tests (using Client heap) for Video Player utility 2.
708 class RTestVclnt2Alloc : public RTestVclnt2PlayFile
711 static RTestVclnt2Alloc* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
712 virtual TVerdict DoTestStepL();
715 virtual TVerdict DoTestStepPreambleL();
716 virtual TVerdict PerformTestL();
719 RTestVclnt2Alloc(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
722 class RTestVclnt2InvalidScaleFactor : public RTestVclnt2PlayFile
725 static RTestVclnt2InvalidScaleFactor* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
728 // From RTestVclnt2PlayFile
729 void HandlePrepareCompleteL();
732 RTestVclnt2InvalidScaleFactor(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
735 #endif // TESTVIDEOPLAYER2_H