First public contribution.
1 // Copyright (c) 2006-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.
17 #ifndef TSU_MMF_AVICTRLPLAY_H
18 #define TSU_MMF_AVICTRLPLAY_H
20 #include "tsu_mmf_avictrl_teststep.h"
22 #ifdef SYMBIAN_BUILD_GCE
23 #include <mmf/common/mmfvideosurfacecustomcommands.h>
24 #endif // SYMBIAN_BUILD_GCE
25 #define KMaxChunks 50 //The maximum chunks that can be allocated
26 //Has been adjusted such that we dont need higher than this
29 This class tests playing an avi file completely and checks for
30 playcompletion event with KErrNone from the aviplaycontroller.
32 class RTestStepAviPlayCtrlPlay : public RTestStepAviCtrlPlayBase
35 RTestStepAviPlayCtrlPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
36 virtual TVerdict DoTestStepL( );
39 This class tests setting the volume on AviPlayController in Stopped, Primed and Playing states
40 and checks if the volume set is same as the volume got.
42 class RTestStepAviPlayCtrlVolume : public RTestStepAviCtrlPlayBase
45 RTestStepAviPlayCtrlVolume(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
46 virtual TVerdict DoTestStepL( );
50 This class tests setting the PlayBalance on AviPlayController in Stopped, Primed and Playing states
51 and checks if the PlayBalance set is same as the PlayBalance got.
53 class RTestStepAviPlayCtrlPlayBalance : public RTestStepAviCtrlPlayBase
56 RTestStepAviPlayCtrlPlayBalance(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
57 virtual TVerdict DoTestStepL( );
61 This class tests the duration of the file using AviPlayController.
63 class RTestStepAviPlayCtrlDuration : public RTestStepAviCtrlPlayBase
66 RTestStepAviPlayCtrlDuration(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
67 virtual TVerdict DoTestStepL( );
71 This class tests pause functionality of AviPlayController in Stopped, Primed and Playing states and checks
72 if the play starts from the current position during playing state.
74 class RTestStepAviPlayCtrlPause : public RTestStepAviCtrlPlayBase
77 RTestStepAviPlayCtrlPause(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
78 virtual TVerdict DoTestStepL( );
82 This class tests stop functionality of AviPlayController in Stopped, Primed and Playing
83 states and checks if the play starts from the initial position during playing state
85 class RTestStepAviPlayCtrlStop : public RTestStepAviCtrlPlayBase
88 RTestStepAviPlayCtrlStop(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
89 virtual TVerdict DoTestStepL( );
93 This class tests to set and get the crop region using AviPlayController.
95 class RTestStepAviPlayCtrlSetGetCropRegion : public RTestStepAviCtrlPlayBase
98 RTestStepAviPlayCtrlSetGetCropRegion(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
99 virtual TVerdict DoTestStepL( );
103 This class tests to set and get the framerate of the file using AviPlayController.
105 class RTestStepAviPlayCtrlSetGetFrameRate : public RTestStepAviCtrlPlayBase
108 RTestStepAviPlayCtrlSetGetFrameRate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
109 virtual TVerdict DoTestStepL( );
113 This class tests to get the frame size using AviPlayController.
115 class RTestStepAviPlayCtrlGetFrameSize : public RTestStepAviCtrlPlayBase
118 RTestStepAviPlayCtrlGetFrameSize(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
119 virtual TVerdict DoTestStepL( );
123 This class tests to get the audio codec installed in the file using AviPlayController.
125 class RTestStepAviPlayCtrlGetAudioDataType : public RTestStepAviCtrlPlayBase
128 RTestStepAviPlayCtrlGetAudioDataType(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
129 virtual TVerdict DoTestStepL( );
133 This class tests to get the video codec installed in the file using AviPlayController.
135 class RTestStepAviPlayCtrlGetVideoDataType : public RTestStepAviCtrlPlayBase
138 RTestStepAviPlayCtrlGetVideoDataType(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
139 virtual TVerdict DoTestStepL( );
143 This class tests metadata support of the AviPlayController.
145 class RTestStepAviPlayCtrlMetaData : public RTestStepAviCtrlPlayBase
148 RTestStepAviPlayCtrlMetaData(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
149 virtual TVerdict DoTestStepL( );
153 This class tests Rotation api of the AviPlayController.
155 class RTestStepAviPlayCtrlSetGetRotation : public RTestStepAviCtrlPlayBase
158 RTestStepAviPlayCtrlSetGetRotation(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
159 virtual TVerdict DoTestStepL( );
162 This class tests Rotation api of the AviPlayController.
164 class RTestStepAviPlayCtrlSetGetScaling : public RTestStepAviCtrlPlayBase
167 RTestStepAviPlayCtrlSetGetScaling(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
168 virtual TVerdict DoTestStepL( );
172 This class tests Position api of the AviPlayController.
174 class RTestStepAviPlayCtrlSetPosition : public RTestStepAviCtrlPlayBase
177 RTestStepAviPlayCtrlSetPosition(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
178 virtual TVerdict DoTestStepL( );
182 This class tests getting video bit rate of the AviPlayController.
184 class RTestStepAviPlayCtrlGetVideoBitrate : public RTestStepAviCtrlPlayBase
187 RTestStepAviPlayCtrlGetVideoBitrate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
188 virtual TVerdict DoTestStepL( );
192 This class tests getting audio bit rate of the AviPlayController.
194 class RTestStepAviPlayCtrlGetAudioBitrate : public RTestStepAviCtrlPlayBase
197 RTestStepAviPlayCtrlGetAudioBitrate(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
198 virtual TVerdict DoTestStepL( );
202 This class tests for direct screen access of aviplaycontroller
204 class RTestStepAviCtrlDirectScreenAccess : public RTestStepAviCtrlPlayBase
207 RTestStepAviCtrlDirectScreenAccess(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
208 virtual TVerdict DoTestStepL(void);
212 This class tests for Play window property for .avi play controller
214 class RTestStepAviCtrlSetPlayWindow : public RTestStepAviCtrlPlayBase
217 RTestStepAviCtrlSetPlayWindow(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
218 virtual TVerdict DoTestStepL(void);
224 This class tests opening an invalid file using AviPlayController.
226 class RTestStepAviCtrlPlayInvalid : public RTestStepAviCtrlPlayBase
229 RTestStepAviCtrlPlayInvalid(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
230 virtual TVerdict DoTestStepPreambleL(void);
231 virtual TVerdict DoTestStepL(void);
235 This class tests for volume and balance when audio is not enabled in the file.
237 class RTestStepAviCtrlNotAudioEnabled : public RTestStepAviCtrlPlayBase
240 RTestStepAviCtrlNotAudioEnabled(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
241 virtual TVerdict DoTestStepL(void);
245 This class tests playing an avi file on primary or secondary screen depending on the screen number set during its
246 construction and checks for playcompletion event with KErrNone from the aviplaycontroller.
248 class RTestStepAviPlayCtrlSetScrnPlay : public RTestStepAviCtrlPlayBase
251 RTestStepAviPlayCtrlSetScrnPlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber);
252 virtual TVerdict DoTestStepPreambleL(void);
253 virtual TVerdict DoTestStepL(void);
255 //from MMMFControllerEventMonitorObserver
256 void HandleEvent(const TMMFEvent& aEvent);
262 This class tests setting an invalid screen id on AviPlayController.
264 class RTestStepAviPlayCtrlSetInvalidScrn : public RTestStepAviCtrlPlayBase
267 RTestStepAviPlayCtrlSetInvalidScrn(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber);
268 virtual TVerdict DoTestStepPreambleL(void);
269 virtual TVerdict DoTestStepL(void);
275 This class tests setting the invalid screen id after adding the datasink to the AviPlayController.
276 It resets the controller and adds the datasink for the secondtime and expects KErrNotSupported.
278 class RTestStepAviPlayCtrlAddDataSinkTwice : public RTestStepAviPlayCtrlSetScrnPlay
281 RTestStepAviPlayCtrlAddDataSinkTwice(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid, TInt aScreenNumber);
282 virtual TVerdict DoTestStepPreambleL(void);
283 virtual TVerdict DoTestStepL(void);
288 This class tests playing an avi file when the xvid decoder finds low memory
289 conditions. The codec will inform back to the controlller that a fatal error
290 occured. After that, the memory conditions are returned back to normal and the
291 video playback is restarted to demonstrate that DevVideo is recreated after the
292 failure and that the video is played succesfully.
294 class RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap :
295 public RAsyncTestStepAviCtrlPlayBase,
296 public MMMFControllerEventMonitorObserver
300 static const TUint KMaxFreeRamForTest = 0x4fff00; // 5-32k MB, this is adjusted
301 // to leave just enough
302 // memory for the xvid
306 RTestStepAviPlayNotEnoughMemoryForXvidCodecHeap(
307 const TDesC& aTestName, const TDesC& aSectName,
308 const TDesC& aKeyName, TUid aControllerUid);
310 // from RAsyncTestStep
316 // from MMMFControllerEventMonitorObserver
317 void HandleEvent(const TMMFEvent& aEvent);
320 static TInt AllocChunkCallBack(TAny* aPtr);
321 void DoAllocChunkCallBack();
322 static TInt PrimeControllerCallBack(TAny* aPtr);
323 void DoPrimeControllerCallBack();
324 static TInt PlayControllerCallBack(TAny* aPtr);
325 void DoPlayControllerCallBack();
326 static TInt ReturnChunckAndStopControllerCallBack(TAny* aPtr);
327 void DoReturnChunckAndStopControllerCallBack();
332 // Set of states for simple state machine
336 EStateLoadKickoffTestLComplete,
337 EStateAllocChunkCallBackComplete,
338 EStatePrimeControllerCallBackComplete1,
339 EStatePlayControllerCallBackComplete1,
340 EStateReturnChunckAndStopControllerCallBackComplete,
341 EStatePrimeControllerCallBackComplete2,
342 EStatePlayControllerCallBackComplete2
345 TTestState iTestState;
346 RChunk iRChunk[KMaxChunks];
347 TInt iNumAllocatedChunks;
348 CAsyncCallBack* iKickoff01;
349 CAsyncCallBack* iKickoff02;
350 CAsyncCallBack* iKickoff03;
351 CAsyncCallBack* iKickoff04;
352 CAsyncCallBack* iKickoff05;
353 CAsyncCallBack* iKickoff06;
357 This class tests OOM situation on several controller functions.
358 (e.g. AddSource/Sink)
360 class RTestStepAviPlayCtrlMemAlloc1 : public RTestStepAviCtrlBase
363 RTestStepAviPlayCtrlMemAlloc1(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
364 virtual TVerdict DoTestStepL( );
366 //from MMMFControllerEventMonitorObserver
367 void HandleEvent(const TMMFEvent& aEvent);
371 This class tests OOM situation on several controller functions.
374 class RTestStepAviPlayCtrlMemAlloc2 : public RTestStepAviCtrlBase
377 RTestStepAviPlayCtrlMemAlloc2(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
378 virtual TVerdict DoTestStepL( );
380 //from MMMFControllerEventMonitorObserver
381 void HandleEvent(const TMMFEvent& aEvent);
385 This class tests OOM situation on several controller functions.
388 class RTestStepAviPlayCtrlMemAlloc3 : public RTestStepAviCtrlBase
391 RTestStepAviPlayCtrlMemAlloc3(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
392 virtual TVerdict DoTestStepL( );
394 //from MMMFControllerEventMonitorObserver
395 void HandleEvent(const TMMFEvent& aEvent);
398 #ifdef SYMBIAN_BUILD_GCE
399 // Surface support positive tests:
402 Test surface support in the AVI play controller. It enables surfaces, adds a rendering
403 target display, gets the surface parameter, updates the display and finally removes the display.
405 class RTestStepAviPlayCtrlSurfaceSupport : public RAsyncTestStepAviCtrlPlayBase
408 RTestStepAviPlayCtrlSurfaceSupport(const TDesC& aTestName, const TDesC& aSecName, const TDesC& aKeyName, TUid aControllerUid);
410 // from RAsyncTestStep
411 virtual void KickoffTestL();
412 virtual void CloseTest();
414 // from MMMFControllerEventMonitorObserver
415 virtual void HandleEvent(const TMMFEvent& aEvent);
418 virtual TVerdict CheckTestResult();
420 // Call back functions
421 static TInt UseSurfacesCallBack(TAny* aPtr);
422 void DoUseSurfacesCallBack();
424 static TInt PrimeControllerCallBack(TAny* aPtr);
425 void DoPrimeControllerCallBack();
427 static TInt PlayControllerCallBack(TAny* aPtr);
428 void DoPlayControllerCallBack();
431 TBool iSurfaceCreated;
432 TSurfaceId iSurfaceId;
434 CAsyncCallBack* iKickoffUseSurfaces;
435 CAsyncCallBack* iKickoffUseSurfaces2;
436 CAsyncCallBack* iKickoffPrimeController;
437 CAsyncCallBack* iKickoffPlayController;
439 RMMFVideoPlaySurfaceSupportCustomCommands iVpsCommands;
442 // Surface support negative tests:
445 Test surface support in the AVI play controller. We expect a failure when we call surface removed
446 without first callng UseSurfaces.
448 class RTestStepAviPlayCtrlSurfaceRemovedNoUS : public RAsyncTestStepAviCtrlPlayBase
451 RTestStepAviPlayCtrlSurfaceRemovedNoUS(const TDesC& aTestName, const TDesC& aSecName, const TDesC& aKeyName, TUid aControllerUid);
453 // from RAsyncTestStep
454 virtual void KickoffTestL();
455 virtual void CloseTest();
458 // Call back functions
459 static TInt SurfaceRemovedCallBack(TAny* aPtr);
460 void DoSurfaceRemovedCallBack();
463 CAsyncCallBack* iKickoffSurfaceRemoved;
465 TSurfaceId iSurfaceId;
467 RMMFVideoPlaySurfaceSupportCustomCommands iVpsCommands;
471 Test surface support in the AVI play controller. We expect a failure when we get the surface parameters
472 without first callng UseSurfaces.
474 class RTestStepAviPlayCtrlGetSurfaceParametersNoUS : public RAsyncTestStepAviCtrlPlayBase
477 RTestStepAviPlayCtrlGetSurfaceParametersNoUS(const TDesC& aTestName, const TDesC& aSecName, const TDesC& aKeyName, TUid aControllerUid);
479 // from RAsyncTestStep
480 virtual void KickoffTestL();
481 virtual void CloseTest();
484 // Call back functions
485 static TInt GetSurfaceParametersCallBack(TAny* aPtr);
486 void DoGetSurfaceParametersCallBack();
489 CAsyncCallBack* iKickoffGetSurfaceParameters;
491 RMMFVideoPlaySurfaceSupportCustomCommands iVpsCommands;
495 Test surface support in the AVI play controller. We expect a failure when we call surface removed
496 after callng UseSurfaces with a null surface Id
498 class RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId : public RAsyncTestStepAviCtrlPlayBase
501 RTestStepAviPlayCtrlSurfaceRemovedNullSurfaceId(const TDesC& aTestName, const TDesC& aSecName, const TDesC& aKeyName, TUid aControllerUid);
503 // from RAsyncTestStep
504 virtual void KickoffTestL();
505 virtual void CloseTest();
508 // Call back functions
509 static TInt SurfaceRemovedCallBack(TAny* aPtr);
510 void DoSurfaceRemovedCallBack();
511 static TInt UseSurfacesCallBack(TAny* aPtr);
512 void DoUseSurfacesCallBack();
515 CAsyncCallBack* iKickoffSurfaceRemoved;
516 CAsyncCallBack* iKickoffUseSurfaces;
518 TSurfaceId iSurfaceId;
520 RMMFVideoPlaySurfaceSupportCustomCommands iVpsCommands;
524 Test surface support in the AVI play controller. We expect a failure when we call surface removed
525 after calling UseSurfaces with an invalid surface Id
527 class RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId : public RAsyncTestStepAviCtrlPlayBase
530 RTestStepAviPlayCtrlSurfaceRemovedInvalidSurfaceId(const TDesC& aTestName, const TDesC& aSecName, const TDesC& aKeyName, TUid aControllerUid);
532 // from RAsyncTestStep
533 virtual void KickoffTestL();
534 virtual void CloseTest();
537 // Call back functions
538 static TInt SurfaceRemovedCallBack(TAny* aPtr);
539 void DoSurfaceRemovedCallBack();
540 static TInt UseSurfacesCallBack(TAny* aPtr);
541 void DoUseSurfacesCallBack();
544 CAsyncCallBack* iKickoffSurfaceRemoved;
545 CAsyncCallBack* iKickoffUseSurfaces;
547 TSurfaceId iSurfaceId;
549 RMMFVideoPlaySurfaceSupportCustomCommands iVpsCommands;
552 #endif // SYMBIAN_BUILD_GCE
554 #ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
557 * MM-MMF-AVICTRL-U-0100-HP
559 class RAsyncTestSubtitlePlay : public RAsyncTestStepSubtitleBase
562 RAsyncTestSubtitlePlay(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
565 // From RAsyncTestStepSubtitleBase
566 void OnOpenCompleteL();
567 void OnPlayCompleteL();
571 * MM-MMF-AVICTRL-U-0101-HP
573 class RAsyncTestSubtitleUpdateConfig : public RAsyncTestStepSubtitleBase
576 RAsyncTestSubtitleUpdateConfig(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
579 // From RAsyncTestStepSubtitleBase
580 void OnOpenCompleteL();
581 void OnPlayCompleteL();
584 class CCallBackTimer : public CTimer
587 static CCallBackTimer* NewL(const TCallBack& aCallBack, TInt aPriority);
593 CCallBackTimer(const TCallBack& aCallBack, TInt aPriority);
600 * MM-MMF-AVICTRL-U-0102-HP
602 class RAsyncTestSubtitleUpdateDuring : public RAsyncTestStepSubtitleBase
605 RAsyncTestSubtitleUpdateDuring(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
607 //From RAsyncTestStep
612 // From RAsyncTestStepSubtitleBase
613 void OnOpenCompleteL();
614 void OnPlayCompleteL();
616 static TInt DuringPlaybackCallBack(TAny* aPtr);
617 void OnDuringPlayback();
620 CCallBackTimer* iCallBackTimer;
625 * MM-MMF-AVICTRL-U-0103-HP
627 class RAsyncTestSubtitleRemoveAdd : public RAsyncTestStepSubtitleBase
630 RAsyncTestSubtitleRemoveAdd(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
633 // From RAsyncTestStepSubtitleBase
634 void OnOpenCompleteL();
635 void OnPlayCompleteL();
639 * MM-MMF-AVICTRL-U-0200-HP
641 class RAsyncTestSubtitleNotEnabled : public RAsyncTestStepSubtitleBase
644 RAsyncTestSubtitleNotEnabled(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
647 // From RAsyncTestStepSubtitleBase
648 void OnOpenCompleteL();
649 void OnPlayCompleteL();
653 * MM-MMF-AVICTRL-U-0201-HP
655 class RAsyncTestSubtitleNotAvailable : public RAsyncTestStepSubtitleBase
658 RAsyncTestSubtitleNotAvailable(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
661 // From RAsyncTestStepSubtitleBase
662 void OnOpenCompleteL();
663 void OnPlayCompleteL();
667 * MM-MMF-AVICTRL-U-0202-HP
669 class RAsyncTestSubtitleMismatchedId : public RAsyncTestStepSubtitleBase
672 RAsyncTestSubtitleMismatchedId(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
675 // From RAsyncTestStepSubtitleBase
676 void OnOpenCompleteL();
680 * MM-MMF-AVICTRL-U-0203-HP
682 class RAsyncTestSubtitleDoubleCall : public RAsyncTestStepSubtitleBase
685 RAsyncTestSubtitleDoubleCall(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
688 // From RAsyncTestStepSubtitleBase
689 void OnOpenCompleteL();
690 void OnPlayCompleteL();
694 * MM-MMF-AVICTRL-U-0204-HP
696 class RAsyncTestSubtitleMultipleConfigs : public RAsyncTestStepSubtitleBase
699 RAsyncTestSubtitleMultipleConfigs(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TUid aControllerUid);
702 // From RAsyncTestStepSubtitleBase
703 void OnOpenCompleteL();
706 #endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
707 #endif //(tsu_mmf_avictrlplay.h)