Update contrib.
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.
16 #ifndef TESTRENDERER_H
17 #define TESTRENDERER_H
19 #include <testframework.h>
20 #include <videorenderer.h>
23 Basic test for video renderer in timed and non-timed mode
24 MM-MMF-VIDREND-U-0002 and MM-MMF-VIDREND-U-0003
26 class RTestRendererStep : public RTestStep, public MVideoRendererObserver
30 enum TTestRendererEvents
39 enum TTestRendererState
46 EStateUpdateAfterReplace
49 static RTestRendererStep* NewL(const TDesC& aStepName, TBool aTimed);
51 // from MVideoRendererObserver
52 void MvroVideoBufferAvailable();
53 void MvroBufferDisplayed(TInt aBufferId, const TTime& aTime);
54 void MvroBufferSkipped(TInt aBufferId);
57 RTestRendererStep(const TDesC& aStepName, TBool aTimed);
59 virtual void FsmL(TTestRendererEvents aEventCode);
62 TInt SetBackgroundSurface(TSurfaceId& id);
63 void RemoveBackgroundSurface();
64 void EndTest(TVerdict aVerdict);
65 void CreateRendererAndSurfaceL(TInt aNumBuffers);
66 void CreateSurfaceL(TInt aNumBuffers);
67 void GetNextBufferAndSubmitUpdateL(TInt aExpectedBufId, TRgb aColor, const TTime& aPresentationTime);
68 TVideoFrameBuffer* GetNextBufferL(TInt aExpectedBufId, TRgb aColor);
71 TVerdict DoTestStepPreambleL();
72 TVerdict DoTestStepPostambleL();
73 TVerdict DoTestStepL();
77 CActiveScheduler* iActiveScheduler;
78 TBool iActiveSchedulerStarted;
79 CVideoRenderer* iVideoRenderer;
81 TSurfaceId iSurfaceId;
83 // Surface creation parameter
85 TUncompressedVideoFormat iVideoFormat;
87 // Window server related objects
89 CWsScreenDevice* iScreen;
91 RWindowGroup iRootWindow;
93 TTestRendererState iFsmState;
94 TInt iBuffAvailCallback;
95 TInt iBuffDisplayCallback;
96 TInt iBuffSkipCallback;
98 // values stored for Mvro callbacks
100 TTime iDisplayedTime;
104 Test replacing surface in timed and non-timed mode
105 MM-MMF-VIDREND-U-0010 and MM-MMF-VIDREND-U-0011
107 class RTestRendererReplaceStep : public RTestRendererStep
110 static RTestRendererReplaceStep* NewL(const TDesC& aStepName, TBool aTimed);
113 RTestRendererReplaceStep(const TDesC& aStepName, TBool aTimed);
114 void FsmL(TTestRendererEvents aEventCode);
115 void ReplaceSurfaceL();
121 class CCallBackTimer : public CTimer
124 static CCallBackTimer* NewL(TCallBack aCallBack, TPriority aPriority = EPriorityStandard);
128 CCallBackTimer(TCallBack aCallBack, TPriority aPriority);
134 #endif // TESTRENDERER_H