First public contribution.
1 // Copyright (c) 2005-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 Tests.
18 #ifndef __TESTVIDEOPLAYER_H__
19 #define __TESTVIDEOPLAYER_H__
21 #include "tsi_mmf_vclntavi_stepbase.h"
23 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
24 #include <mmf/common/mmfvideoenums.h>
29 * Load and initialise a video file.
31 * RTestVclntPlayAviFile
34 class RTestVclntPlayAviFile : public RTestVclntAviPlayerStep
37 RTestVclntPlayAviFile(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
38 static RTestVclntPlayAviFile* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
39 static RTestVclntPlayAviFile* NewLC(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
40 virtual TVerdict DoTestStepL();
41 virtual TVerdict DoTestL(CVideoPlayerUtility* aVideo);
42 virtual void FsmL(TVclntTestPlayEvents aEventCode);
43 virtual TVerdict SetCacheSize();
46 TTimeIntervalMicroSeconds iDuration;
51 * Load and initialise an video descriptor.
53 * RTestVclntPlayAviDes
56 class RTestVclntPlayAviDes : public RTestVclntAviPlayerStep
59 RTestVclntPlayAviDes(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError,const TBool aPlay) ;
60 static RTestVclntPlayAviDes* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError,const TBool aPlay);
61 static RTestVclntPlayAviDes* NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError,const TBool aPlay);
62 virtual TVerdict DoTestStepL();
63 virtual TVerdict DoTestStepPreambleL();
64 virtual TVerdict DoTestStepPostambleL();
65 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
66 virtual void FsmL(TVclntTestPlayEvents aEventCode);
68 HBufC8* iVideo; // Buffer for holding video descriptor data
69 TTimeIntervalMicroSeconds iDuration;// Stores duration of video
70 const TBool iPlay; // Does this test require playing the video
74 * Open video from a URL and play.
76 * RTestVclntPlayAviUrl
80 class RTestVclntPlayAviUrl : public RTestVclntAviPlayerStep
83 RTestVclntPlayAviUrl(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
84 static RTestVclntPlayAviUrl* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
85 static RTestVclntPlayAviUrl* NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TBool aPlay);
86 virtual TVerdict DoTestStepL();
87 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
88 virtual void FsmL(TVclntTestPlayEvents aEventCode);
90 TTimeIntervalMicroSeconds iDuration;// Stores duration of video
91 const TBool iPlay; // Does this test require playing the video
95 * Set and enquire framerate
97 * RTestVclntEnqFrameRate
100 class RTestVclntEnqFrameRate : public RTestVclntPlayAviFile
103 static RTestVclntEnqFrameRate* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aFrameRate);
104 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
107 RTestVclntEnqFrameRate(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aFrameRate);
115 * set position and play form this position.
120 class RTestVclntPosition : public RTestVclntPlayAviFile
123 static RTestVclntPosition* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aPosition);
124 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
126 RTestVclntPosition(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aPosition);
129 TTimeIntervalMicroSeconds iPosition;
138 class RTestVclntPriority : public RTestVclntPlayAviFile
141 static RTestVclntPriority* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aPriority);
142 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
144 RTestVclntPriority(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aPriority);
157 class RTestVclntDuration : public RTestVclntPlayAviFile
160 static RTestVclntDuration* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aDuration);
161 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
162 virtual TVerdict SetCacheSize();
164 RTestVclntDuration(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aDuration);
165 SVMCacheInfo iCurrentCacheSize;
166 TVerdict CheckCacheError(TInt aError);
176 class RTestVclntVolume : public RTestVclntPlayAviFile
179 static RTestVclntVolume* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aVolume);
180 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
182 RTestVclntVolume(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aVolume);
190 * Video open, close and then open again.
192 * RTestVclntCloseOpen
195 class RTestVclntCloseOpen : public RTestVclntPlayAviFile
198 static RTestVclntCloseOpen* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
199 virtual TVerdict DoTestStepL();
200 virtual void FsmL(TVclntTestPlayEvents aEventCode);
202 RTestVclntCloseOpen(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
214 class RTestVclntPause : public RTestVclntPlayAviFile
217 static RTestVclntPause* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
218 virtual TVerdict DoTestStepL();
219 virtual void FsmL(TVclntTestPlayEvents aEventCode);
221 RTestVclntPause(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
222 TUint iPlayerDuration;
223 TUint iActualDuration;
233 class RTestVclntBalance : public RTestVclntPlayAviFile
236 static RTestVclntBalance* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aBalance);
237 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
239 RTestVclntBalance(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aBalance);
248 * Video set play window and delete play window.
250 * RTestVclntPlayWindow
253 class RTestVclntPlayWindow : public RTestVclntPlayAviFile
256 static RTestVclntPlayWindow* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aStart, const TTimeIntervalMicroSeconds aEnd);
257 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
259 RTestVclntPlayWindow(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TTimeIntervalMicroSeconds aStart, const TTimeIntervalMicroSeconds aEnd);
262 TTimeIntervalMicroSeconds iStart;
263 TTimeIntervalMicroSeconds iEnd;
268 * Video get meta data.
273 class RTestVclntMeta : public RTestVclntPlayAviFile
276 static RTestVclntMeta* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
277 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
279 RTestVclntMeta(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
282 TTimeIntervalMicroSeconds iStart;
283 TTimeIntervalMicroSeconds iEnd;
288 * Video get framesize.
290 * RTestVclntFrameSize
293 class RTestVclntFrameSize : public RTestVclntPlayAviFile
296 static RTestVclntFrameSize* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
297 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
299 RTestVclntFrameSize(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
306 * Video get mime type.
311 class RTestVclntMimeType : public RTestVclntPlayAviFile
314 static RTestVclntMimeType* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
315 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
317 RTestVclntMimeType(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
322 * Video player scale values test.
327 class RTestVclntScale : public RTestVclntPlayAviFile
330 static RTestVclntScale* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
331 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
333 RTestVclntScale(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
337 * Crop test for video
342 class RTestVclntCrop : public RTestVclntPlayAviFile
345 static RTestVclntCrop* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
346 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
348 RTestVclntCrop(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
351 #ifdef SYMBIAN_BUILD_GCE
354 Auto scale test for video
357 class RTestVclntAutoScale : public RTestVclntPlayAviFile
360 static RTestVclntAutoScale* NewL(const TDesC& aTestName);
361 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
363 RTestVclntAutoScale(const TDesC& aTestName);
366 #endif // SYMBIAN_BUILD_GCE
369 * Frame test for video.
374 class RTestVclntGetFrame : public RTestVclntPlayAviFile
377 static RTestVclntGetFrame* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TBool aUseIntentAPI);
378 virtual TVerdict DoTestStepL();
379 virtual void FsmL(TVclntTestPlayEvents aEventCode);
381 virtual void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
383 RTestVclntGetFrame(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TBool aUseIntentAPI);
391 * RTestVclntRebuffering
394 class RTestVclntRebuffering : public RTestVclntPlayAviFile, public MVideoLoadingObserver
397 static RTestVclntRebuffering* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
398 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
399 void MvloLoadingStarted();
400 void MvloLoadingComplete();
402 RTestVclntRebuffering(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
406 * Video get framesize.
411 class RTestVclntRepeat : public RTestVclntPlayAviFile
414 static RTestVclntRepeat* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aRepeat);
415 virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
417 RTestVclntRepeat(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, const TInt aRepeat);
425 * Video Delete object while playing
430 class RTestVclntDelete : public RTestVclntPlayAviFile
433 static RTestVclntDelete* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
434 virtual TVerdict DoTestStepL();
435 virtual void FsmL(TVclntTestPlayEvents aEventCode);
437 RTestVclntDelete(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError);
443 * RTestVclntPlayAviFileHandle
446 class RTestVclntPlayAviFileHandle : public RTestVclntAviPlayerStep
449 RTestVclntPlayAviFileHandle(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, const TBool aAlloc);
450 static RTestVclntPlayAviFileHandle* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, const TBool aAlloc);
451 static RTestVclntPlayAviFileHandle* NewLC(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, const TBool aAlloc);
452 virtual TVerdict DoTestStepL();
453 virtual void FsmL(TVclntTestPlayEvents aEventCode);
454 virtual TInt SetCacheSize();
455 virtual TInt CheckCacheError(TInt aError);
458 TVerdict PerformTestStepL();
459 const TBool iAlloc; // Is this test an Alloc test
460 TTimeIntervalMicroSeconds iDuration; // Stores duration of video
468 RTestVideoPlayCapabilityVelocity
471 class RTestVideoPlayCapabilityVelocity: public RTestVclntAviPlayerStep
474 RTestVideoPlayCapabilityVelocity(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
475 static RTestVideoPlayCapabilityVelocity* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
476 virtual TVerdict DoTestStepL();
477 virtual void FsmL(TVclntTestPlayEvents aEventCode);
479 TVideoPlayRateCapabilities iVideoPlayRateCapabilities;
487 RTestVideoPlayStepFrame
490 class RTestVideoPlayStepFrame: public RTestVclntAviPlayerStep
493 RTestVideoPlayStepFrame(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
494 static RTestVideoPlayStepFrame* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
495 virtual TVerdict DoTestStepL();
496 virtual void FsmL(TVclntTestPlayEvents aEventCode);
497 static TInt TimerCallback(TAny* aPtr);
499 TVideoPlayRateCapabilities iVideoPlayRateCapabilities;
508 RTestVideoPlayCapabilityVelocity
511 class RTestVideoPlayAudVidEnable: public RTestVclntAviPlayerStep
514 RTestVideoPlayAudVidEnable(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
515 static RTestVideoPlayAudVidEnable* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
516 virtual TVerdict DoTestStepL();
517 virtual void FsmL(TVclntTestPlayEvents aEventCode);
526 RTestVideoPlayAutoScale
529 class RTestVideoPlayAutoScale: public RTestVclntAviPlayerStep
532 RTestVideoPlayAutoScale(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
533 static RTestVideoPlayAutoScale* NewL(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError);
534 virtual TVerdict DoTestStepL();
535 virtual void FsmL(TVclntTestPlayEvents aEventCode);
542 #endif //__TESTVIDEOPLAYER_H__