sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef TESTRENDERER_H
|
sl@0
|
17 |
#define TESTRENDERER_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <testframework.h>
|
sl@0
|
20 |
#include <videorenderer.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
/*
|
sl@0
|
23 |
Basic test for video renderer in timed and non-timed mode
|
sl@0
|
24 |
MM-MMF-VIDREND-U-0002 and MM-MMF-VIDREND-U-0003
|
sl@0
|
25 |
*/
|
sl@0
|
26 |
class RTestRendererStep : public RTestStep, public MVideoRendererObserver
|
sl@0
|
27 |
{
|
sl@0
|
28 |
public:
|
sl@0
|
29 |
|
sl@0
|
30 |
enum TTestRendererEvents
|
sl@0
|
31 |
{
|
sl@0
|
32 |
EStartTest,
|
sl@0
|
33 |
EBufferAvailable,
|
sl@0
|
34 |
EBufferDisplayed,
|
sl@0
|
35 |
EBufferSkipped,
|
sl@0
|
36 |
ETimerExpired
|
sl@0
|
37 |
};
|
sl@0
|
38 |
|
sl@0
|
39 |
enum TTestRendererState
|
sl@0
|
40 |
{
|
sl@0
|
41 |
EStateIdle,
|
sl@0
|
42 |
EStateCreate,
|
sl@0
|
43 |
EStateUpdate,
|
sl@0
|
44 |
EStateReleaseBuffer,
|
sl@0
|
45 |
EStateReplaceSurface,
|
sl@0
|
46 |
EStateUpdateAfterReplace
|
sl@0
|
47 |
};
|
sl@0
|
48 |
|
sl@0
|
49 |
static RTestRendererStep* NewL(const TDesC& aStepName, TBool aTimed);
|
sl@0
|
50 |
|
sl@0
|
51 |
// from MVideoRendererObserver
|
sl@0
|
52 |
void MvroVideoBufferAvailable();
|
sl@0
|
53 |
void MvroBufferDisplayed(TInt aBufferId, const TTime& aTime);
|
sl@0
|
54 |
void MvroBufferSkipped(TInt aBufferId);
|
sl@0
|
55 |
|
sl@0
|
56 |
protected:
|
sl@0
|
57 |
RTestRendererStep(const TDesC& aStepName, TBool aTimed);
|
sl@0
|
58 |
|
sl@0
|
59 |
virtual void FsmL(TTestRendererEvents aEventCode);
|
sl@0
|
60 |
void InitWservL();
|
sl@0
|
61 |
void DeInitWserv();
|
sl@0
|
62 |
TInt SetBackgroundSurface(TSurfaceId& id);
|
sl@0
|
63 |
void RemoveBackgroundSurface();
|
sl@0
|
64 |
void EndTest(TVerdict aVerdict);
|
sl@0
|
65 |
void CreateRendererAndSurfaceL(TInt aNumBuffers);
|
sl@0
|
66 |
void CreateSurfaceL(TInt aNumBuffers);
|
sl@0
|
67 |
void GetNextBufferAndSubmitUpdateL(TInt aExpectedBufId, TRgb aColor, const TTime& aPresentationTime);
|
sl@0
|
68 |
TVideoFrameBuffer* GetNextBufferL(TInt aExpectedBufId, TRgb aColor);
|
sl@0
|
69 |
|
sl@0
|
70 |
// from RTestStep
|
sl@0
|
71 |
TVerdict DoTestStepPreambleL();
|
sl@0
|
72 |
TVerdict DoTestStepPostambleL();
|
sl@0
|
73 |
TVerdict DoTestStepL();
|
sl@0
|
74 |
|
sl@0
|
75 |
|
sl@0
|
76 |
protected:
|
sl@0
|
77 |
CActiveScheduler* iActiveScheduler;
|
sl@0
|
78 |
TBool iActiveSchedulerStarted;
|
sl@0
|
79 |
CVideoRenderer* iVideoRenderer;
|
sl@0
|
80 |
TBool iTimed;
|
sl@0
|
81 |
TSurfaceId iSurfaceId;
|
sl@0
|
82 |
|
sl@0
|
83 |
// Surface creation parameter
|
sl@0
|
84 |
TSize iSize;
|
sl@0
|
85 |
TUncompressedVideoFormat iVideoFormat;
|
sl@0
|
86 |
|
sl@0
|
87 |
// Window server related objects
|
sl@0
|
88 |
RWsSession iWs;
|
sl@0
|
89 |
CWsScreenDevice* iScreen;
|
sl@0
|
90 |
RWindow* iWindow;
|
sl@0
|
91 |
RWindowGroup iRootWindow;
|
sl@0
|
92 |
|
sl@0
|
93 |
TTestRendererState iFsmState;
|
sl@0
|
94 |
TInt iBuffAvailCallback;
|
sl@0
|
95 |
TInt iBuffDisplayCallback;
|
sl@0
|
96 |
TInt iBuffSkipCallback;
|
sl@0
|
97 |
|
sl@0
|
98 |
// values stored for Mvro callbacks
|
sl@0
|
99 |
TInt iBufferId;
|
sl@0
|
100 |
TTime iDisplayedTime;
|
sl@0
|
101 |
};
|
sl@0
|
102 |
|
sl@0
|
103 |
/*
|
sl@0
|
104 |
Test replacing surface in timed and non-timed mode
|
sl@0
|
105 |
MM-MMF-VIDREND-U-0010 and MM-MMF-VIDREND-U-0011
|
sl@0
|
106 |
*/
|
sl@0
|
107 |
class RTestRendererReplaceStep : public RTestRendererStep
|
sl@0
|
108 |
{
|
sl@0
|
109 |
public:
|
sl@0
|
110 |
static RTestRendererReplaceStep* NewL(const TDesC& aStepName, TBool aTimed);
|
sl@0
|
111 |
|
sl@0
|
112 |
protected:
|
sl@0
|
113 |
RTestRendererReplaceStep(const TDesC& aStepName, TBool aTimed);
|
sl@0
|
114 |
void FsmL(TTestRendererEvents aEventCode);
|
sl@0
|
115 |
void ReplaceSurfaceL();
|
sl@0
|
116 |
};
|
sl@0
|
117 |
|
sl@0
|
118 |
/*
|
sl@0
|
119 |
Timer callback class
|
sl@0
|
120 |
*/
|
sl@0
|
121 |
class CCallBackTimer : public CTimer
|
sl@0
|
122 |
{
|
sl@0
|
123 |
public:
|
sl@0
|
124 |
static CCallBackTimer* NewL(TCallBack aCallBack, TPriority aPriority = EPriorityStandard);
|
sl@0
|
125 |
|
sl@0
|
126 |
private:
|
sl@0
|
127 |
void RunL();
|
sl@0
|
128 |
CCallBackTimer(TCallBack aCallBack, TPriority aPriority);
|
sl@0
|
129 |
|
sl@0
|
130 |
private:
|
sl@0
|
131 |
TCallBack iCallBack;
|
sl@0
|
132 |
};
|
sl@0
|
133 |
|
sl@0
|
134 |
#endif // TESTRENDERER_H
|