sl@0
|
1 |
// Copyright (c) 2006-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 |
#include "testvideoplayer_secdisp.h"
|
sl@0
|
17 |
|
sl@0
|
18 |
//
|
sl@0
|
19 |
// RTestVclntSetScrIdAndPlayBase
|
sl@0
|
20 |
//
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
* RTestVclntSetScrIdAndPlayBase::Constructor
|
sl@0
|
24 |
*/
|
sl@0
|
25 |
RTestVclntSetScrIdAndPlayBase::RTestVclntSetScrIdAndPlayBase(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
26 |
: RTestVclntAviPlayerStep(aTestName, aSectName, aKeyName, aExpectedError)
|
sl@0
|
27 |
{
|
sl@0
|
28 |
iHeapSize = 1000000; //1MB
|
sl@0
|
29 |
iScreenNumber = aScreenNumber;
|
sl@0
|
30 |
iCurrentScreenNumber = 0;
|
sl@0
|
31 |
}
|
sl@0
|
32 |
|
sl@0
|
33 |
/**
|
sl@0
|
34 |
*
|
sl@0
|
35 |
* Finished()
|
sl@0
|
36 |
*
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
void RTestVclntSetScrIdAndPlayBase::FinishedL()
|
sl@0
|
39 |
{
|
sl@0
|
40 |
INFO_PRINTF1(_L("RTestVclntSetScrIdAndPlayBase::FinishedL"));
|
sl@0
|
41 |
//overridden in play/stop and play/pause tests.
|
sl@0
|
42 |
}
|
sl@0
|
43 |
|
sl@0
|
44 |
/**
|
sl@0
|
45 |
* RTestVclntAviPlayerStep::MvpuoOpenComplete
|
sl@0
|
46 |
* Callback function for CVideoPlayerUtility
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
void RTestVclntSetScrIdAndPlayBase::MvpuoOpenComplete(TInt aError)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
iError = aError;
|
sl@0
|
51 |
INFO_PRINTF2(_L("iVideoPlayer - Open Complete callback returned with error %d"), iError);
|
sl@0
|
52 |
#ifdef SYMBIAN_VARIABLE_BITRATE_CODEC
|
sl@0
|
53 |
#if defined (__EABI__) || defined(__X86GCC__) // secondary screen is not supported in HW.
|
sl@0
|
54 |
if ((iCurrentScreenNumber != 0) && (iError == KErrNotSupported))
|
sl@0
|
55 |
{
|
sl@0
|
56 |
iTestStepResult = EKnownFailure;
|
sl@0
|
57 |
INFO_PRINTF1(_L("The secondary screen is not supported in HW"));
|
sl@0
|
58 |
CActiveScheduler::Stop();
|
sl@0
|
59 |
}
|
sl@0
|
60 |
else if((iCurrentScreenNumber == 0) && (iError == KErrNone))
|
sl@0
|
61 |
{
|
sl@0
|
62 |
TRAPD(err, FsmL(EVPOpenComplete));
|
sl@0
|
63 |
if (err != KErrNone)
|
sl@0
|
64 |
{
|
sl@0
|
65 |
iError = err;
|
sl@0
|
66 |
}
|
sl@0
|
67 |
}
|
sl@0
|
68 |
else
|
sl@0
|
69 |
{
|
sl@0
|
70 |
iTestStepResult = EFail;
|
sl@0
|
71 |
ERR_PRINTF2(_L("Unexpected error in MvpuoOpenComplete %d"), iError);
|
sl@0
|
72 |
CActiveScheduler::Stop();
|
sl@0
|
73 |
}
|
sl@0
|
74 |
#else
|
sl@0
|
75 |
TRAPD(err, FsmL(EVPOpenComplete));
|
sl@0
|
76 |
if (err != KErrNone)
|
sl@0
|
77 |
{
|
sl@0
|
78 |
iError = err;
|
sl@0
|
79 |
CActiveScheduler::Stop();
|
sl@0
|
80 |
}
|
sl@0
|
81 |
#endif // __EABI__
|
sl@0
|
82 |
#else
|
sl@0
|
83 |
if(iError == KErrNotSupported)
|
sl@0
|
84 |
{
|
sl@0
|
85 |
iTestStepResult = EKnownFailure;
|
sl@0
|
86 |
INFO_PRINTF1(_L("The AVI Play Controller is not available in this OS version, hence KNOWN FAILURE"));
|
sl@0
|
87 |
}
|
sl@0
|
88 |
else
|
sl@0
|
89 |
{
|
sl@0
|
90 |
iTestStepResult = EFail;
|
sl@0
|
91 |
ERR_PRINTF2(_L("Unexpected error in MvpuoOpenComplete %d"), iError);
|
sl@0
|
92 |
}
|
sl@0
|
93 |
CActiveScheduler::Stop();
|
sl@0
|
94 |
#endif // SYMBIAN_VARIABLE_BITRATE_CODEC
|
sl@0
|
95 |
}
|
sl@0
|
96 |
//
|
sl@0
|
97 |
// RTestVclntSetScrIdAndPlayAviFile
|
sl@0
|
98 |
//
|
sl@0
|
99 |
|
sl@0
|
100 |
/**
|
sl@0
|
101 |
* RTestVclntSetScrIdAndPlayAviFile::Constructor
|
sl@0
|
102 |
*/
|
sl@0
|
103 |
RTestVclntSetScrIdAndPlayAviFile::RTestVclntSetScrIdAndPlayAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
104 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
}
|
sl@0
|
107 |
|
sl@0
|
108 |
/**
|
sl@0
|
109 |
* RTestVclntSetScrIdAndPlayAviFile::NewL
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
RTestVclntSetScrIdAndPlayAviFile* RTestVclntSetScrIdAndPlayAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
112 |
{
|
sl@0
|
113 |
RTestVclntSetScrIdAndPlayAviFile* self = new (ELeave) RTestVclntSetScrIdAndPlayAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
114 |
return self;
|
sl@0
|
115 |
}
|
sl@0
|
116 |
|
sl@0
|
117 |
/**
|
sl@0
|
118 |
* RTestVclntSetScrIdAndPlayAviFile::DoTestStepL
|
sl@0
|
119 |
*/
|
sl@0
|
120 |
TVerdict RTestVclntSetScrIdAndPlayAviFile::DoTestStepL()
|
sl@0
|
121 |
{
|
sl@0
|
122 |
iTestStepResult = EFail;
|
sl@0
|
123 |
// Call the state handler from IDLE state
|
sl@0
|
124 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
125 |
if (err == KErrNone)
|
sl@0
|
126 |
{
|
sl@0
|
127 |
// Start the scheduler - Done only once !
|
sl@0
|
128 |
CActiveScheduler::Start();
|
sl@0
|
129 |
}
|
sl@0
|
130 |
return iTestStepResult;
|
sl@0
|
131 |
}
|
sl@0
|
132 |
|
sl@0
|
133 |
/**
|
sl@0
|
134 |
* RTestVclntSetScrIdAndPlayAviFile::FsmL
|
sl@0
|
135 |
*/
|
sl@0
|
136 |
void RTestVclntSetScrIdAndPlayAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
137 |
{
|
sl@0
|
138 |
if (FsmCheck(aEventCode))
|
sl@0
|
139 |
{
|
sl@0
|
140 |
switch (aEventCode)
|
sl@0
|
141 |
{
|
sl@0
|
142 |
case EVPIdle:
|
sl@0
|
143 |
{
|
sl@0
|
144 |
// Set iScreenNumber
|
sl@0
|
145 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
146 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
147 |
TInt err = KErrNone;
|
sl@0
|
148 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
149 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
150 |
if (err != KErrNone)
|
sl@0
|
151 |
{
|
sl@0
|
152 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
153 |
User::Leave(err);
|
sl@0
|
154 |
}
|
sl@0
|
155 |
#else
|
sl@0
|
156 |
if (err == KErrNotSupported)
|
sl@0
|
157 |
{
|
sl@0
|
158 |
iTestStepResult = EKnownFailure;
|
sl@0
|
159 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
160 |
}
|
sl@0
|
161 |
else
|
sl@0
|
162 |
{
|
sl@0
|
163 |
iTestStepResult = EFail;
|
sl@0
|
164 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
165 |
}
|
sl@0
|
166 |
User::Leave(err);
|
sl@0
|
167 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
168 |
// Open iVideoPlayer
|
sl@0
|
169 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
170 |
if (iBinaryCompatibility)
|
sl@0
|
171 |
{
|
sl@0
|
172 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
173 |
}
|
sl@0
|
174 |
else
|
sl@0
|
175 |
{
|
sl@0
|
176 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
177 |
}
|
sl@0
|
178 |
|
sl@0
|
179 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
180 |
break;
|
sl@0
|
181 |
}
|
sl@0
|
182 |
case EVPOpenComplete:
|
sl@0
|
183 |
{
|
sl@0
|
184 |
// Prepare iVideoPlayer
|
sl@0
|
185 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
186 |
iVideoPlayer->Prepare();
|
sl@0
|
187 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
188 |
break;
|
sl@0
|
189 |
}
|
sl@0
|
190 |
case EVPPrepareComplete:
|
sl@0
|
191 |
{
|
sl@0
|
192 |
iError = KErrTimedOut;
|
sl@0
|
193 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
194 |
iVideoPlayer->Play();
|
sl@0
|
195 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
196 |
break;
|
sl@0
|
197 |
}
|
sl@0
|
198 |
case EVPPlayComplete:
|
sl@0
|
199 |
{
|
sl@0
|
200 |
iTestStepResult = EPass;
|
sl@0
|
201 |
CActiveScheduler::Stop();
|
sl@0
|
202 |
break;
|
sl@0
|
203 |
}
|
sl@0
|
204 |
}
|
sl@0
|
205 |
}
|
sl@0
|
206 |
}
|
sl@0
|
207 |
|
sl@0
|
208 |
//
|
sl@0
|
209 |
// RTestVclntSetScrIdAndPlayAviDes
|
sl@0
|
210 |
//
|
sl@0
|
211 |
|
sl@0
|
212 |
/**
|
sl@0
|
213 |
* RTestVclntSetScrIdAndPlayAviDes::Constructor
|
sl@0
|
214 |
*/
|
sl@0
|
215 |
RTestVclntSetScrIdAndPlayAviDes::RTestVclntSetScrIdAndPlayAviDes(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
216 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
217 |
{
|
sl@0
|
218 |
iHeapSize = 500000;
|
sl@0
|
219 |
}
|
sl@0
|
220 |
|
sl@0
|
221 |
/**
|
sl@0
|
222 |
* RTestVclntSetScrIdAndPlayAviDes::NewL
|
sl@0
|
223 |
*/
|
sl@0
|
224 |
RTestVclntSetScrIdAndPlayAviDes* RTestVclntSetScrIdAndPlayAviDes::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
225 |
{
|
sl@0
|
226 |
RTestVclntSetScrIdAndPlayAviDes* self = new (ELeave) RTestVclntSetScrIdAndPlayAviDes(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
227 |
return self;
|
sl@0
|
228 |
}
|
sl@0
|
229 |
|
sl@0
|
230 |
/**
|
sl@0
|
231 |
* RTestVclntSetScrIdAndPlayAviDes::DoTestStepPreambleL
|
sl@0
|
232 |
*/
|
sl@0
|
233 |
TVerdict RTestVclntSetScrIdAndPlayAviDes::DoTestStepPreambleL()
|
sl@0
|
234 |
{
|
sl@0
|
235 |
TVerdict preamRes = EPass;
|
sl@0
|
236 |
|
sl@0
|
237 |
// Base DoTestStepPreambleL
|
sl@0
|
238 |
preamRes = RTestVclntAviPlayerStep::DoTestStepPreambleL();
|
sl@0
|
239 |
if (preamRes != EPass)
|
sl@0
|
240 |
{
|
sl@0
|
241 |
return preamRes;
|
sl@0
|
242 |
}
|
sl@0
|
243 |
|
sl@0
|
244 |
RFs fs;
|
sl@0
|
245 |
RFile file;
|
sl@0
|
246 |
TInt size = 0;
|
sl@0
|
247 |
|
sl@0
|
248 |
// connect to file system and open file
|
sl@0
|
249 |
User::LeaveIfError(fs.Connect());
|
sl@0
|
250 |
CleanupClosePushL(fs);
|
sl@0
|
251 |
User::LeaveIfError(file.Open(fs,iFilename,EFileRead));
|
sl@0
|
252 |
CleanupClosePushL(file);
|
sl@0
|
253 |
|
sl@0
|
254 |
// Set HBuf size
|
sl@0
|
255 |
User::LeaveIfError(file.Size(size));
|
sl@0
|
256 |
INFO_PRINTF2(_L("size of file = %d\n"),size);//Statement Changed under DEF105143
|
sl@0
|
257 |
|
sl@0
|
258 |
iVideo = HBufC8::NewMaxL(size);
|
sl@0
|
259 |
|
sl@0
|
260 |
// read data into Hbuf
|
sl@0
|
261 |
TPtr8 bufferDes(iVideo->Des());
|
sl@0
|
262 |
User::LeaveIfError(file.Read(bufferDes));
|
sl@0
|
263 |
|
sl@0
|
264 |
CleanupStack::PopAndDestroy(2, &fs); //fs, file
|
sl@0
|
265 |
|
sl@0
|
266 |
return preamRes;
|
sl@0
|
267 |
}
|
sl@0
|
268 |
|
sl@0
|
269 |
/**
|
sl@0
|
270 |
* RTestVclntSetScrIdAndPlayAviDes::DoTestStepPostambleL
|
sl@0
|
271 |
*/
|
sl@0
|
272 |
TVerdict RTestVclntSetScrIdAndPlayAviDes::DoTestStepPostambleL()
|
sl@0
|
273 |
{
|
sl@0
|
274 |
delete iVideo;
|
sl@0
|
275 |
iVideo = NULL;
|
sl@0
|
276 |
return RTestVclntAviPlayerStep::DoTestStepPostambleL();
|
sl@0
|
277 |
}
|
sl@0
|
278 |
|
sl@0
|
279 |
/**
|
sl@0
|
280 |
* Load and initialise an video descriptor.
|
sl@0
|
281 |
*/
|
sl@0
|
282 |
TVerdict RTestVclntSetScrIdAndPlayAviDes::DoTestStepL()
|
sl@0
|
283 |
{
|
sl@0
|
284 |
iTestStepResult = EFail;
|
sl@0
|
285 |
// Call the state handler from IDLE state
|
sl@0
|
286 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
287 |
if (err == KErrNone)
|
sl@0
|
288 |
{
|
sl@0
|
289 |
// Start the scheduler - Done only once !
|
sl@0
|
290 |
CActiveScheduler::Start();
|
sl@0
|
291 |
}
|
sl@0
|
292 |
return iTestStepResult;
|
sl@0
|
293 |
}
|
sl@0
|
294 |
|
sl@0
|
295 |
/**
|
sl@0
|
296 |
* RTestVclntSetScrIdAndPlayAviDes::FsmL
|
sl@0
|
297 |
*/
|
sl@0
|
298 |
void RTestVclntSetScrIdAndPlayAviDes::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
299 |
{
|
sl@0
|
300 |
if (FsmCheck(aEventCode))
|
sl@0
|
301 |
{
|
sl@0
|
302 |
switch (aEventCode)
|
sl@0
|
303 |
{
|
sl@0
|
304 |
case EVPIdle:
|
sl@0
|
305 |
{
|
sl@0
|
306 |
// Set iScreenNumber
|
sl@0
|
307 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
308 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
309 |
TInt err = KErrNone;
|
sl@0
|
310 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
311 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
312 |
if (err != KErrNone)
|
sl@0
|
313 |
{
|
sl@0
|
314 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
315 |
User::Leave(err);
|
sl@0
|
316 |
}
|
sl@0
|
317 |
#else
|
sl@0
|
318 |
if (err == KErrNotSupported)
|
sl@0
|
319 |
{
|
sl@0
|
320 |
iTestStepResult = EKnownFailure;
|
sl@0
|
321 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
322 |
}
|
sl@0
|
323 |
else
|
sl@0
|
324 |
{
|
sl@0
|
325 |
iTestStepResult = EFail;
|
sl@0
|
326 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
327 |
}
|
sl@0
|
328 |
User::Leave(err);
|
sl@0
|
329 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
330 |
// Open iVideoPlayer
|
sl@0
|
331 |
INFO_PRINTF2(_L("iVideoPlayer->OpenDesL() %S"), &iFilename);
|
sl@0
|
332 |
iVideoPlayer->OpenDesL(iVideo->Des());
|
sl@0
|
333 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
334 |
break;
|
sl@0
|
335 |
}
|
sl@0
|
336 |
case EVPOpenComplete:
|
sl@0
|
337 |
{
|
sl@0
|
338 |
// Prepare iVideoPlayer
|
sl@0
|
339 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
340 |
iVideoPlayer->Prepare();
|
sl@0
|
341 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
342 |
break;
|
sl@0
|
343 |
}
|
sl@0
|
344 |
case EVPPrepareComplete:
|
sl@0
|
345 |
{
|
sl@0
|
346 |
iError = KErrTimedOut;
|
sl@0
|
347 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
348 |
iVideoPlayer->Play();
|
sl@0
|
349 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
350 |
break;
|
sl@0
|
351 |
}
|
sl@0
|
352 |
case EVPPlayComplete:
|
sl@0
|
353 |
{
|
sl@0
|
354 |
iTestStepResult = EPass;
|
sl@0
|
355 |
CActiveScheduler::Stop();
|
sl@0
|
356 |
break;
|
sl@0
|
357 |
}
|
sl@0
|
358 |
}
|
sl@0
|
359 |
}
|
sl@0
|
360 |
}
|
sl@0
|
361 |
|
sl@0
|
362 |
//
|
sl@0
|
363 |
// RTestVclntSetScrIdAndPlayAviUrl
|
sl@0
|
364 |
//
|
sl@0
|
365 |
|
sl@0
|
366 |
/**
|
sl@0
|
367 |
* RTestVclntSetScrIdAndPlayAviUrl::Constructor
|
sl@0
|
368 |
*/
|
sl@0
|
369 |
|
sl@0
|
370 |
RTestVclntSetScrIdAndPlayAviUrl::RTestVclntSetScrIdAndPlayAviUrl(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
371 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
372 |
{
|
sl@0
|
373 |
}
|
sl@0
|
374 |
|
sl@0
|
375 |
/**
|
sl@0
|
376 |
* RTestVclntSetScrIdAndPlayAviUrl::NewL
|
sl@0
|
377 |
*/
|
sl@0
|
378 |
|
sl@0
|
379 |
RTestVclntSetScrIdAndPlayAviUrl* RTestVclntSetScrIdAndPlayAviUrl::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
380 |
{
|
sl@0
|
381 |
RTestVclntSetScrIdAndPlayAviUrl* self = new (ELeave) RTestVclntSetScrIdAndPlayAviUrl(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
382 |
return self;
|
sl@0
|
383 |
}
|
sl@0
|
384 |
|
sl@0
|
385 |
/**
|
sl@0
|
386 |
* RTestVclntSetScrIdAndPlayAviUrl::Constructor
|
sl@0
|
387 |
*/
|
sl@0
|
388 |
|
sl@0
|
389 |
TVerdict RTestVclntSetScrIdAndPlayAviUrl::DoTestStepL()
|
sl@0
|
390 |
{
|
sl@0
|
391 |
iTestStepResult = EFail;
|
sl@0
|
392 |
// Call the state handler from IDLE state
|
sl@0
|
393 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
394 |
if (err == KErrNone)
|
sl@0
|
395 |
{
|
sl@0
|
396 |
// Start the scheduler - Done only once !
|
sl@0
|
397 |
CActiveScheduler::Start();
|
sl@0
|
398 |
}
|
sl@0
|
399 |
return iTestStepResult;
|
sl@0
|
400 |
}
|
sl@0
|
401 |
|
sl@0
|
402 |
/**
|
sl@0
|
403 |
* RTestVclntSetScrIdAndPlayAviUrl::FsmL
|
sl@0
|
404 |
*/
|
sl@0
|
405 |
|
sl@0
|
406 |
void RTestVclntSetScrIdAndPlayAviUrl::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
407 |
{
|
sl@0
|
408 |
if (FsmCheck(aEventCode))
|
sl@0
|
409 |
{
|
sl@0
|
410 |
switch (aEventCode)
|
sl@0
|
411 |
{
|
sl@0
|
412 |
case EVPIdle:
|
sl@0
|
413 |
{
|
sl@0
|
414 |
// Set iScreenNumber
|
sl@0
|
415 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
416 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
417 |
TInt err = KErrNone;
|
sl@0
|
418 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
419 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
420 |
if (err != KErrNone)
|
sl@0
|
421 |
{
|
sl@0
|
422 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
423 |
User::Leave(err);
|
sl@0
|
424 |
}
|
sl@0
|
425 |
#else
|
sl@0
|
426 |
if (err == KErrNotSupported)
|
sl@0
|
427 |
{
|
sl@0
|
428 |
iTestStepResult = EKnownFailure;
|
sl@0
|
429 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
430 |
}
|
sl@0
|
431 |
else
|
sl@0
|
432 |
{
|
sl@0
|
433 |
iTestStepResult = EFail;
|
sl@0
|
434 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
435 |
}
|
sl@0
|
436 |
User::Leave(err);
|
sl@0
|
437 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
438 |
// Open iVideoPlayer
|
sl@0
|
439 |
INFO_PRINTF2(_L("iVideoPlayer->OpenUrlL() %S"), &iFilename);
|
sl@0
|
440 |
iVideoPlayer->OpenUrlL(iFilename);
|
sl@0
|
441 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
442 |
break;
|
sl@0
|
443 |
}
|
sl@0
|
444 |
case EVPOpenComplete:
|
sl@0
|
445 |
{
|
sl@0
|
446 |
// Prepare iVideoPlayer
|
sl@0
|
447 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
448 |
iVideoPlayer->Prepare();
|
sl@0
|
449 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
450 |
break;
|
sl@0
|
451 |
}
|
sl@0
|
452 |
case EVPPrepareComplete:
|
sl@0
|
453 |
{
|
sl@0
|
454 |
iError = KErrTimedOut;
|
sl@0
|
455 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
456 |
iVideoPlayer->Play();
|
sl@0
|
457 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
458 |
break;
|
sl@0
|
459 |
}
|
sl@0
|
460 |
case EVPPlayComplete:
|
sl@0
|
461 |
{
|
sl@0
|
462 |
CActiveScheduler::Stop();
|
sl@0
|
463 |
iTestStepResult = EPass;
|
sl@0
|
464 |
break;
|
sl@0
|
465 |
}
|
sl@0
|
466 |
}
|
sl@0
|
467 |
}
|
sl@0
|
468 |
}
|
sl@0
|
469 |
|
sl@0
|
470 |
//
|
sl@0
|
471 |
// RTestVclntSetScrIdAndPlayStopAviFile
|
sl@0
|
472 |
//
|
sl@0
|
473 |
|
sl@0
|
474 |
/**
|
sl@0
|
475 |
* RTestVclntSetScrIdAndPlayStopAviFile::Constructor
|
sl@0
|
476 |
*/
|
sl@0
|
477 |
RTestVclntSetScrIdAndPlayStopAviFile::RTestVclntSetScrIdAndPlayStopAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber, TInt aScreenNumber2)
|
sl@0
|
478 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
479 |
{
|
sl@0
|
480 |
iScreenNumber2 = aScreenNumber2;
|
sl@0
|
481 |
iPlayTimer = NULL;
|
sl@0
|
482 |
iRestarted = EFalse;
|
sl@0
|
483 |
}
|
sl@0
|
484 |
|
sl@0
|
485 |
/**
|
sl@0
|
486 |
* RTestVclntSetScrIdAndPlayStopAviFile::NewL
|
sl@0
|
487 |
*/
|
sl@0
|
488 |
RTestVclntSetScrIdAndPlayStopAviFile* RTestVclntSetScrIdAndPlayStopAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber, TInt aScreenNumber2)
|
sl@0
|
489 |
{
|
sl@0
|
490 |
RTestVclntSetScrIdAndPlayStopAviFile* self = new (ELeave) RTestVclntSetScrIdAndPlayStopAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber, aScreenNumber2);
|
sl@0
|
491 |
return self;
|
sl@0
|
492 |
}
|
sl@0
|
493 |
|
sl@0
|
494 |
/**
|
sl@0
|
495 |
* set finished on callback from a timer
|
sl@0
|
496 |
*/
|
sl@0
|
497 |
void RTestVclntSetScrIdAndPlayStopAviFile::FinishedL()
|
sl@0
|
498 |
{
|
sl@0
|
499 |
INFO_PRINTF1(_L("-- iVideoPlayer->Stop();"));
|
sl@0
|
500 |
iVideoPlayer->Stop();
|
sl@0
|
501 |
iRestarted = EFalse;
|
sl@0
|
502 |
FsmL(EVPPlayStopped);
|
sl@0
|
503 |
}
|
sl@0
|
504 |
|
sl@0
|
505 |
/**
|
sl@0
|
506 |
* RTestVclntSetScrIdAndPlayStopAviFile::DoTestStepL
|
sl@0
|
507 |
*/
|
sl@0
|
508 |
TVerdict RTestVclntSetScrIdAndPlayStopAviFile::DoTestStepL()
|
sl@0
|
509 |
{
|
sl@0
|
510 |
iTestStepResult = EFail;
|
sl@0
|
511 |
iCountNumber = 0;
|
sl@0
|
512 |
iError = 0;
|
sl@0
|
513 |
// Get the filename
|
sl@0
|
514 |
TPtrC tmpFilename;
|
sl@0
|
515 |
if(!GetStringFromConfig(iSectName, _L("filename2"), tmpFilename))
|
sl@0
|
516 |
{
|
sl@0
|
517 |
ERR_PRINTF1(_L("ERROR : Cannot Get value from Config."));
|
sl@0
|
518 |
return EInconclusive;
|
sl@0
|
519 |
}
|
sl@0
|
520 |
GetDriveName(iFilename2);
|
sl@0
|
521 |
iFilename2.Append(tmpFilename);
|
sl@0
|
522 |
// Call the state handler from IDLE state
|
sl@0
|
523 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
524 |
if (err == KErrNone)
|
sl@0
|
525 |
{
|
sl@0
|
526 |
// Start the scheduler - Done only once !
|
sl@0
|
527 |
CActiveScheduler::Start();
|
sl@0
|
528 |
}
|
sl@0
|
529 |
return iTestStepResult;
|
sl@0
|
530 |
}
|
sl@0
|
531 |
|
sl@0
|
532 |
/**
|
sl@0
|
533 |
* RTestVclntSetScrIdAndPlayStopAviFile::FsmL
|
sl@0
|
534 |
*/
|
sl@0
|
535 |
void RTestVclntSetScrIdAndPlayStopAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
536 |
{
|
sl@0
|
537 |
if (FsmCheck(aEventCode))
|
sl@0
|
538 |
{
|
sl@0
|
539 |
switch (aEventCode)
|
sl@0
|
540 |
{
|
sl@0
|
541 |
case EVPIdle:
|
sl@0
|
542 |
{
|
sl@0
|
543 |
// Set iScreenNumber
|
sl@0
|
544 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
545 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
546 |
TInt err = KErrNone;
|
sl@0
|
547 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
548 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
549 |
if (err != KErrNone)
|
sl@0
|
550 |
{
|
sl@0
|
551 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
552 |
User::Leave(err);
|
sl@0
|
553 |
}
|
sl@0
|
554 |
#else
|
sl@0
|
555 |
if (err == KErrNotSupported)
|
sl@0
|
556 |
{
|
sl@0
|
557 |
iTestStepResult = EKnownFailure;
|
sl@0
|
558 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
559 |
}
|
sl@0
|
560 |
else
|
sl@0
|
561 |
{
|
sl@0
|
562 |
iTestStepResult = EFail;
|
sl@0
|
563 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
564 |
}
|
sl@0
|
565 |
User::Leave(err);
|
sl@0
|
566 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
567 |
// Open iVideoPlayer
|
sl@0
|
568 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
569 |
if (iBinaryCompatibility)
|
sl@0
|
570 |
{
|
sl@0
|
571 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
572 |
}
|
sl@0
|
573 |
else
|
sl@0
|
574 |
{
|
sl@0
|
575 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
576 |
}
|
sl@0
|
577 |
|
sl@0
|
578 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
579 |
break;
|
sl@0
|
580 |
}
|
sl@0
|
581 |
case EVPOpenComplete:
|
sl@0
|
582 |
{
|
sl@0
|
583 |
// Prepare iVideoPlayer
|
sl@0
|
584 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
585 |
iVideoPlayer->Prepare();
|
sl@0
|
586 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
587 |
break;
|
sl@0
|
588 |
}
|
sl@0
|
589 |
case EVPPrepareComplete:
|
sl@0
|
590 |
{
|
sl@0
|
591 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
592 |
iVideoPlayer->Play();
|
sl@0
|
593 |
if (iCountNumber == 0)
|
sl@0
|
594 |
{
|
sl@0
|
595 |
// initialise and start the timer. the file is short and so decode occur rapidly
|
sl@0
|
596 |
// hence the short time passed to After()
|
sl@0
|
597 |
TRAPD(err, iPlayTimer = CTestVclntAviPlayTimer::NewL(this, 2000000));
|
sl@0
|
598 |
if (err != KErrNone)
|
sl@0
|
599 |
{
|
sl@0
|
600 |
ERR_PRINTF2(_L("CTestVclntAviPlayTimer::NewL left with error = %d"), err);
|
sl@0
|
601 |
CActiveScheduler::Stop();
|
sl@0
|
602 |
break;
|
sl@0
|
603 |
}
|
sl@0
|
604 |
iPlayTimer->Start();
|
sl@0
|
605 |
// For first time we are expecting to stop the play after some second,
|
sl@0
|
606 |
// and second time it should play till the end of file.
|
sl@0
|
607 |
PrepareState(EVPPlayStopped, KErrNone);
|
sl@0
|
608 |
}
|
sl@0
|
609 |
else
|
sl@0
|
610 |
{
|
sl@0
|
611 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
612 |
}
|
sl@0
|
613 |
break;
|
sl@0
|
614 |
}
|
sl@0
|
615 |
case EVPPlayStopped:
|
sl@0
|
616 |
{
|
sl@0
|
617 |
// Cancel the timer
|
sl@0
|
618 |
iPlayTimer->Cancel();
|
sl@0
|
619 |
delete iPlayTimer;
|
sl@0
|
620 |
iPlayTimer = NULL;
|
sl@0
|
621 |
// Set iScreenNumber
|
sl@0
|
622 |
iCurrentScreenNumber = iScreenNumber2;
|
sl@0
|
623 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber2);
|
sl@0
|
624 |
TInt err = KErrNone;
|
sl@0
|
625 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber2);
|
sl@0
|
626 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
627 |
if (err != KErrNone)
|
sl@0
|
628 |
{
|
sl@0
|
629 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
630 |
CActiveScheduler::Stop();
|
sl@0
|
631 |
User::Leave(err);
|
sl@0
|
632 |
}
|
sl@0
|
633 |
#else
|
sl@0
|
634 |
if (err == KErrNotSupported)
|
sl@0
|
635 |
{
|
sl@0
|
636 |
iTestStepResult = EKnownFailure;
|
sl@0
|
637 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
638 |
}
|
sl@0
|
639 |
else
|
sl@0
|
640 |
{
|
sl@0
|
641 |
iTestStepResult = EFail;
|
sl@0
|
642 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
643 |
}
|
sl@0
|
644 |
CActiveScheduler::Stop();
|
sl@0
|
645 |
User::Leave(err);
|
sl@0
|
646 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
647 |
iCountNumber++;
|
sl@0
|
648 |
// Open iVideoPlayer
|
sl@0
|
649 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename2);
|
sl@0
|
650 |
if (iBinaryCompatibility)
|
sl@0
|
651 |
{
|
sl@0
|
652 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename2, ControllerUid()));
|
sl@0
|
653 |
}
|
sl@0
|
654 |
else
|
sl@0
|
655 |
{
|
sl@0
|
656 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename2));
|
sl@0
|
657 |
}
|
sl@0
|
658 |
|
sl@0
|
659 |
if (iError != KErrNone)
|
sl@0
|
660 |
{
|
sl@0
|
661 |
ERR_PRINTF2(_L("iVideoPlayer->OpenFileL() left with error = %d"), iError);
|
sl@0
|
662 |
CActiveScheduler::Stop();
|
sl@0
|
663 |
}
|
sl@0
|
664 |
else
|
sl@0
|
665 |
{
|
sl@0
|
666 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
667 |
}
|
sl@0
|
668 |
break;
|
sl@0
|
669 |
}
|
sl@0
|
670 |
case EVPPlayComplete:
|
sl@0
|
671 |
{
|
sl@0
|
672 |
iTestStepResult = EPass;
|
sl@0
|
673 |
CActiveScheduler::Stop();
|
sl@0
|
674 |
break;
|
sl@0
|
675 |
}
|
sl@0
|
676 |
}
|
sl@0
|
677 |
}
|
sl@0
|
678 |
}
|
sl@0
|
679 |
|
sl@0
|
680 |
//
|
sl@0
|
681 |
// RTestVclntSetScrIdAndPlayPauseAviFile
|
sl@0
|
682 |
//
|
sl@0
|
683 |
|
sl@0
|
684 |
/**
|
sl@0
|
685 |
* RTestVclntSetScrIdAndPlayPauseAviFile::Constructor
|
sl@0
|
686 |
*/
|
sl@0
|
687 |
RTestVclntSetScrIdAndPlayPauseAviFile::RTestVclntSetScrIdAndPlayPauseAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber, TInt aScreenNumber2)
|
sl@0
|
688 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
689 |
{
|
sl@0
|
690 |
iScreenNumber2 = aScreenNumber2;
|
sl@0
|
691 |
}
|
sl@0
|
692 |
|
sl@0
|
693 |
/**
|
sl@0
|
694 |
* RTestVclntSetScrIdAndPlayPauseAviFile::NewL
|
sl@0
|
695 |
*/
|
sl@0
|
696 |
RTestVclntSetScrIdAndPlayPauseAviFile* RTestVclntSetScrIdAndPlayPauseAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber, TInt aScreenNumber2)
|
sl@0
|
697 |
{
|
sl@0
|
698 |
RTestVclntSetScrIdAndPlayPauseAviFile* self = new (ELeave) RTestVclntSetScrIdAndPlayPauseAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber, aScreenNumber2);
|
sl@0
|
699 |
return self;
|
sl@0
|
700 |
}
|
sl@0
|
701 |
|
sl@0
|
702 |
/**
|
sl@0
|
703 |
* set finished on callback from a timer
|
sl@0
|
704 |
*/
|
sl@0
|
705 |
void RTestVclntSetScrIdAndPlayPauseAviFile::FinishedL()
|
sl@0
|
706 |
{
|
sl@0
|
707 |
// We cannot use the logger until after OpenL is called again in EVPPlayPaused because
|
sl@0
|
708 |
// of the way the scheduler works. The current thread is suspended until the video is
|
sl@0
|
709 |
// finished playing if a synchronous call is made in WINSCW.
|
sl@0
|
710 |
TRAPD(err,iVideoPlayer->PauseL());
|
sl@0
|
711 |
if (err != KErrNotSupported)
|
sl@0
|
712 |
{
|
sl@0
|
713 |
INFO_PRINTF2(_L("Pause() returns with error : %d"),err);
|
sl@0
|
714 |
iTestStepResult = EFail;
|
sl@0
|
715 |
CActiveScheduler::Stop();
|
sl@0
|
716 |
}
|
sl@0
|
717 |
iRestarted = EFalse;
|
sl@0
|
718 |
FsmL(EVPPlayPaused);
|
sl@0
|
719 |
}
|
sl@0
|
720 |
|
sl@0
|
721 |
/**
|
sl@0
|
722 |
* RTestVclntSetScrIdAndPlayPauseAviFile::DoTestStepL
|
sl@0
|
723 |
*/
|
sl@0
|
724 |
TVerdict RTestVclntSetScrIdAndPlayPauseAviFile::DoTestStepL()
|
sl@0
|
725 |
{
|
sl@0
|
726 |
iTestStepResult = EFail;
|
sl@0
|
727 |
iCountNumber = 0;
|
sl@0
|
728 |
iError = 0;
|
sl@0
|
729 |
// Get the filename
|
sl@0
|
730 |
TPtrC tmpFilename;
|
sl@0
|
731 |
if(!GetStringFromConfig(iSectName, _L("filename2"), tmpFilename))
|
sl@0
|
732 |
{
|
sl@0
|
733 |
ERR_PRINTF1(_L("ERROR : Cannot Get value from Config."));
|
sl@0
|
734 |
return EInconclusive;
|
sl@0
|
735 |
}
|
sl@0
|
736 |
GetDriveName(iFilename2);
|
sl@0
|
737 |
iFilename2.Append(tmpFilename);
|
sl@0
|
738 |
// Call the state handler from IDLE state
|
sl@0
|
739 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
740 |
if (err == KErrNone)
|
sl@0
|
741 |
{
|
sl@0
|
742 |
// Start the scheduler - Done only once !
|
sl@0
|
743 |
CActiveScheduler::Start();
|
sl@0
|
744 |
}
|
sl@0
|
745 |
return iTestStepResult;
|
sl@0
|
746 |
}
|
sl@0
|
747 |
|
sl@0
|
748 |
/**
|
sl@0
|
749 |
* RTestVclntSetScrIdAndPlayPauseAviFile::FsmL
|
sl@0
|
750 |
*/
|
sl@0
|
751 |
void RTestVclntSetScrIdAndPlayPauseAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
752 |
{
|
sl@0
|
753 |
if (FsmCheck(aEventCode))
|
sl@0
|
754 |
{
|
sl@0
|
755 |
switch (aEventCode)
|
sl@0
|
756 |
{
|
sl@0
|
757 |
case EVPIdle:
|
sl@0
|
758 |
{
|
sl@0
|
759 |
// Set iScreenNumber
|
sl@0
|
760 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
761 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
762 |
TInt err = KErrNone;
|
sl@0
|
763 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
764 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
765 |
if (err != KErrNone)
|
sl@0
|
766 |
{
|
sl@0
|
767 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
768 |
User::Leave(err);
|
sl@0
|
769 |
}
|
sl@0
|
770 |
#else
|
sl@0
|
771 |
if (err == KErrNotSupported)
|
sl@0
|
772 |
{
|
sl@0
|
773 |
iTestStepResult = EKnownFailure;
|
sl@0
|
774 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
775 |
}
|
sl@0
|
776 |
else
|
sl@0
|
777 |
{
|
sl@0
|
778 |
iTestStepResult = EFail;
|
sl@0
|
779 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
780 |
}
|
sl@0
|
781 |
User::Leave(err);
|
sl@0
|
782 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
783 |
// Open iVideoPlayer
|
sl@0
|
784 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
785 |
if (iBinaryCompatibility)
|
sl@0
|
786 |
{
|
sl@0
|
787 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
788 |
}
|
sl@0
|
789 |
else
|
sl@0
|
790 |
{
|
sl@0
|
791 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
792 |
}
|
sl@0
|
793 |
|
sl@0
|
794 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
795 |
break;
|
sl@0
|
796 |
}
|
sl@0
|
797 |
case EVPOpenComplete:
|
sl@0
|
798 |
{
|
sl@0
|
799 |
// Prepare iVideoPlayer
|
sl@0
|
800 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
801 |
iVideoPlayer->Prepare();
|
sl@0
|
802 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
803 |
break;
|
sl@0
|
804 |
}
|
sl@0
|
805 |
case EVPPrepareComplete:
|
sl@0
|
806 |
{
|
sl@0
|
807 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
808 |
// We cannot use the logger until after OpenL is called again in EVPPlayPaused because
|
sl@0
|
809 |
// of the way the scheduler works. The current thread is suspended until the video is
|
sl@0
|
810 |
// finished playing if a synchronous call is made in WINSCW.
|
sl@0
|
811 |
iVideoPlayer->Play();
|
sl@0
|
812 |
if (iCountNumber == 0)
|
sl@0
|
813 |
{
|
sl@0
|
814 |
// initialise and start the timer. the file is short and so decode occur rapidly
|
sl@0
|
815 |
// hence the short time passed to After()
|
sl@0
|
816 |
TRAPD(err, iPlayTimer = CTestVclntAviPlayTimer::NewL(this, 1000000));
|
sl@0
|
817 |
if (err != KErrNone)
|
sl@0
|
818 |
{
|
sl@0
|
819 |
ERR_PRINTF2(_L("CTestVclntAviPlayTimer::NewL left with error = %d"), err);
|
sl@0
|
820 |
CActiveScheduler::Stop();
|
sl@0
|
821 |
break;
|
sl@0
|
822 |
}
|
sl@0
|
823 |
|
sl@0
|
824 |
iPlayTimer->Start();
|
sl@0
|
825 |
PrepareState(EVPPlayPaused, KErrNone);
|
sl@0
|
826 |
}
|
sl@0
|
827 |
else
|
sl@0
|
828 |
{
|
sl@0
|
829 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
830 |
}
|
sl@0
|
831 |
break;
|
sl@0
|
832 |
}
|
sl@0
|
833 |
case EVPPlayPaused:
|
sl@0
|
834 |
{
|
sl@0
|
835 |
// Cancel the timer
|
sl@0
|
836 |
iPlayTimer->Cancel();
|
sl@0
|
837 |
delete iPlayTimer;
|
sl@0
|
838 |
iPlayTimer = NULL;
|
sl@0
|
839 |
|
sl@0
|
840 |
// Set iScreenNumber
|
sl@0
|
841 |
iCurrentScreenNumber = iScreenNumber2;
|
sl@0
|
842 |
TInt err = iVideoPlayer->SetInitScreenNumber(iScreenNumber2);
|
sl@0
|
843 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
844 |
if (err != KErrNone)
|
sl@0
|
845 |
{
|
sl@0
|
846 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
847 |
CActiveScheduler::Stop();
|
sl@0
|
848 |
User::Leave(err);
|
sl@0
|
849 |
}
|
sl@0
|
850 |
#else
|
sl@0
|
851 |
if (err == KErrNotSupported)
|
sl@0
|
852 |
{
|
sl@0
|
853 |
iTestStepResult = EKnownFailure;
|
sl@0
|
854 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
855 |
}
|
sl@0
|
856 |
else
|
sl@0
|
857 |
{
|
sl@0
|
858 |
iTestStepResult = EFail;
|
sl@0
|
859 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
860 |
}
|
sl@0
|
861 |
CActiveScheduler::Stop();
|
sl@0
|
862 |
User::Leave(err);
|
sl@0
|
863 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
864 |
iCountNumber++;
|
sl@0
|
865 |
// Open iVideoPlayer
|
sl@0
|
866 |
if (iBinaryCompatibility)
|
sl@0
|
867 |
{
|
sl@0
|
868 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename2, ControllerUid()));
|
sl@0
|
869 |
}
|
sl@0
|
870 |
else
|
sl@0
|
871 |
{
|
sl@0
|
872 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename2));
|
sl@0
|
873 |
}
|
sl@0
|
874 |
|
sl@0
|
875 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename2);
|
sl@0
|
876 |
|
sl@0
|
877 |
if (iError != KErrNone)
|
sl@0
|
878 |
{
|
sl@0
|
879 |
ERR_PRINTF2(_L("iVideoPlayer->OpenFileL() left with error = %d"), iError);
|
sl@0
|
880 |
CActiveScheduler::Stop();
|
sl@0
|
881 |
}
|
sl@0
|
882 |
else
|
sl@0
|
883 |
{
|
sl@0
|
884 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
885 |
}
|
sl@0
|
886 |
break;
|
sl@0
|
887 |
}
|
sl@0
|
888 |
case EVPPlayComplete:
|
sl@0
|
889 |
{
|
sl@0
|
890 |
iTestStepResult = EPass;
|
sl@0
|
891 |
CActiveScheduler::Stop();
|
sl@0
|
892 |
break;
|
sl@0
|
893 |
}
|
sl@0
|
894 |
}
|
sl@0
|
895 |
}
|
sl@0
|
896 |
}
|
sl@0
|
897 |
|
sl@0
|
898 |
//
|
sl@0
|
899 |
// RTestVclntSetScrIdAfterPlayAndPlayAviFile
|
sl@0
|
900 |
//
|
sl@0
|
901 |
|
sl@0
|
902 |
/**
|
sl@0
|
903 |
* RTestVclntSetScrIdAfterPlayAndPlayAviFile::Constructor
|
sl@0
|
904 |
*/
|
sl@0
|
905 |
RTestVclntSetScrIdAfterPlayAndPlayAviFile::RTestVclntSetScrIdAfterPlayAndPlayAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
906 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
907 |
{
|
sl@0
|
908 |
}
|
sl@0
|
909 |
|
sl@0
|
910 |
/**
|
sl@0
|
911 |
* RTestVclntSetScrIdAfterPlayAndPlayAviFile::NewL
|
sl@0
|
912 |
*/
|
sl@0
|
913 |
RTestVclntSetScrIdAfterPlayAndPlayAviFile* RTestVclntSetScrIdAfterPlayAndPlayAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
914 |
{
|
sl@0
|
915 |
RTestVclntSetScrIdAfterPlayAndPlayAviFile* self = new (ELeave) RTestVclntSetScrIdAfterPlayAndPlayAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
916 |
return self;
|
sl@0
|
917 |
}
|
sl@0
|
918 |
|
sl@0
|
919 |
/**
|
sl@0
|
920 |
* RTestVclntSetScrIdAfterPlayAndPlayAviFile::DoTestStepL
|
sl@0
|
921 |
*/
|
sl@0
|
922 |
TVerdict RTestVclntSetScrIdAfterPlayAndPlayAviFile::DoTestStepL()
|
sl@0
|
923 |
{
|
sl@0
|
924 |
iTestStepResult = EFail;
|
sl@0
|
925 |
iCountNumber = 0;
|
sl@0
|
926 |
iError = 0;
|
sl@0
|
927 |
// Call the state handler from IDLE state
|
sl@0
|
928 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
929 |
if (err == KErrNone)
|
sl@0
|
930 |
{
|
sl@0
|
931 |
// Start the scheduler - Done only once !
|
sl@0
|
932 |
CActiveScheduler::Start();
|
sl@0
|
933 |
}
|
sl@0
|
934 |
return iTestStepResult;
|
sl@0
|
935 |
}
|
sl@0
|
936 |
|
sl@0
|
937 |
/**
|
sl@0
|
938 |
* RTestVclntSetScrIdAfterPlayAndPlayAviFile::FsmL
|
sl@0
|
939 |
*/
|
sl@0
|
940 |
void RTestVclntSetScrIdAfterPlayAndPlayAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
941 |
{
|
sl@0
|
942 |
if (FsmCheck(aEventCode))
|
sl@0
|
943 |
{
|
sl@0
|
944 |
switch (aEventCode)
|
sl@0
|
945 |
{
|
sl@0
|
946 |
case EVPIdle:
|
sl@0
|
947 |
{
|
sl@0
|
948 |
// Open iVideoPlayer
|
sl@0
|
949 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
950 |
if (iBinaryCompatibility)
|
sl@0
|
951 |
{
|
sl@0
|
952 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
953 |
}
|
sl@0
|
954 |
else
|
sl@0
|
955 |
{
|
sl@0
|
956 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
957 |
}
|
sl@0
|
958 |
|
sl@0
|
959 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
960 |
break;
|
sl@0
|
961 |
}
|
sl@0
|
962 |
case EVPOpenComplete:
|
sl@0
|
963 |
{
|
sl@0
|
964 |
// Prepare iVideoPlayer
|
sl@0
|
965 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
966 |
iVideoPlayer->Prepare();
|
sl@0
|
967 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
968 |
break;
|
sl@0
|
969 |
}
|
sl@0
|
970 |
case EVPPrepareComplete:
|
sl@0
|
971 |
{
|
sl@0
|
972 |
iError = KErrTimedOut;
|
sl@0
|
973 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
974 |
iVideoPlayer->Play();
|
sl@0
|
975 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
976 |
break;
|
sl@0
|
977 |
}
|
sl@0
|
978 |
case EVPPlayComplete:
|
sl@0
|
979 |
{
|
sl@0
|
980 |
if (iCountNumber == 0)
|
sl@0
|
981 |
{
|
sl@0
|
982 |
// Set iScreenNumber
|
sl@0
|
983 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
984 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
985 |
TInt err = KErrNone;
|
sl@0
|
986 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
987 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
988 |
if (err != KErrNone)
|
sl@0
|
989 |
{
|
sl@0
|
990 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
991 |
CActiveScheduler::Stop();
|
sl@0
|
992 |
User::Leave(err);
|
sl@0
|
993 |
}
|
sl@0
|
994 |
#else
|
sl@0
|
995 |
if (err == KErrNotSupported)
|
sl@0
|
996 |
{
|
sl@0
|
997 |
iTestStepResult = EKnownFailure;
|
sl@0
|
998 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
999 |
}
|
sl@0
|
1000 |
else
|
sl@0
|
1001 |
{
|
sl@0
|
1002 |
iTestStepResult = EFail;
|
sl@0
|
1003 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
1004 |
}
|
sl@0
|
1005 |
CActiveScheduler::Stop();
|
sl@0
|
1006 |
User::Leave(err);
|
sl@0
|
1007 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
1008 |
iCountNumber++;
|
sl@0
|
1009 |
// Open iVideoPlayer
|
sl@0
|
1010 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
1011 |
if (iBinaryCompatibility)
|
sl@0
|
1012 |
{
|
sl@0
|
1013 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename, ControllerUid()));
|
sl@0
|
1014 |
}
|
sl@0
|
1015 |
else
|
sl@0
|
1016 |
{
|
sl@0
|
1017 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename));
|
sl@0
|
1018 |
}
|
sl@0
|
1019 |
|
sl@0
|
1020 |
if (iError != KErrNone)
|
sl@0
|
1021 |
{
|
sl@0
|
1022 |
ERR_PRINTF2(_L("iVideoPlayer->OpenFileL() left with error = %d"), iError);
|
sl@0
|
1023 |
CActiveScheduler::Stop();
|
sl@0
|
1024 |
}
|
sl@0
|
1025 |
else
|
sl@0
|
1026 |
{
|
sl@0
|
1027 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
1028 |
}
|
sl@0
|
1029 |
break;
|
sl@0
|
1030 |
}
|
sl@0
|
1031 |
else
|
sl@0
|
1032 |
{
|
sl@0
|
1033 |
iTestStepResult = EPass;
|
sl@0
|
1034 |
CActiveScheduler::Stop();
|
sl@0
|
1035 |
}
|
sl@0
|
1036 |
break;
|
sl@0
|
1037 |
}
|
sl@0
|
1038 |
}
|
sl@0
|
1039 |
}
|
sl@0
|
1040 |
}
|
sl@0
|
1041 |
|
sl@0
|
1042 |
//
|
sl@0
|
1043 |
// RTestVclntSetScrIdAfterOpenAndPlayAviFile
|
sl@0
|
1044 |
//
|
sl@0
|
1045 |
|
sl@0
|
1046 |
/**
|
sl@0
|
1047 |
* RTestVclntSetScrIdAfterOpenAndPlayAviFile::Constructor
|
sl@0
|
1048 |
*/
|
sl@0
|
1049 |
RTestVclntSetScrIdAfterOpenAndPlayAviFile::RTestVclntSetScrIdAfterOpenAndPlayAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
1050 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
1051 |
{
|
sl@0
|
1052 |
}
|
sl@0
|
1053 |
|
sl@0
|
1054 |
/**
|
sl@0
|
1055 |
* RTestVclntSetScrIdAfterOpenAndPlayAviFile::NewL
|
sl@0
|
1056 |
*/
|
sl@0
|
1057 |
RTestVclntSetScrIdAfterOpenAndPlayAviFile* RTestVclntSetScrIdAfterOpenAndPlayAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
1058 |
{
|
sl@0
|
1059 |
RTestVclntSetScrIdAfterOpenAndPlayAviFile* self = new (ELeave) RTestVclntSetScrIdAfterOpenAndPlayAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
1060 |
return self;
|
sl@0
|
1061 |
}
|
sl@0
|
1062 |
|
sl@0
|
1063 |
/**
|
sl@0
|
1064 |
* RTestVclntSetScrIdAfterOpenAndPlayAviFile::DoTestStepL
|
sl@0
|
1065 |
*/
|
sl@0
|
1066 |
TVerdict RTestVclntSetScrIdAfterOpenAndPlayAviFile::DoTestStepL()
|
sl@0
|
1067 |
{
|
sl@0
|
1068 |
iTestStepResult = EFail;
|
sl@0
|
1069 |
iCountNumber = 0;
|
sl@0
|
1070 |
iError = 0;
|
sl@0
|
1071 |
// Call the state handler from IDLE state
|
sl@0
|
1072 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
1073 |
if (err == KErrNone)
|
sl@0
|
1074 |
{
|
sl@0
|
1075 |
// Start the scheduler - Done only once !
|
sl@0
|
1076 |
CActiveScheduler::Start();
|
sl@0
|
1077 |
}
|
sl@0
|
1078 |
return iTestStepResult;
|
sl@0
|
1079 |
}
|
sl@0
|
1080 |
|
sl@0
|
1081 |
/**
|
sl@0
|
1082 |
* RTestVclntSetScrIdAfterOpenAndPlayAviFile::FsmL
|
sl@0
|
1083 |
*/
|
sl@0
|
1084 |
void RTestVclntSetScrIdAfterOpenAndPlayAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
1085 |
{
|
sl@0
|
1086 |
if (FsmCheck(aEventCode))
|
sl@0
|
1087 |
{
|
sl@0
|
1088 |
switch (aEventCode)
|
sl@0
|
1089 |
{
|
sl@0
|
1090 |
case EVPIdle:
|
sl@0
|
1091 |
{
|
sl@0
|
1092 |
// Open iVideoPlayer
|
sl@0
|
1093 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
1094 |
if (iBinaryCompatibility)
|
sl@0
|
1095 |
{
|
sl@0
|
1096 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
1097 |
}
|
sl@0
|
1098 |
else
|
sl@0
|
1099 |
{
|
sl@0
|
1100 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
1101 |
}
|
sl@0
|
1102 |
|
sl@0
|
1103 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
1104 |
break;
|
sl@0
|
1105 |
}
|
sl@0
|
1106 |
case EVPOpenComplete:
|
sl@0
|
1107 |
{
|
sl@0
|
1108 |
if (iCountNumber == 0)
|
sl@0
|
1109 |
{
|
sl@0
|
1110 |
// Set iScreenNumber
|
sl@0
|
1111 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
1112 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
1113 |
TInt err = 0;
|
sl@0
|
1114 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
1115 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
1116 |
if (err != KErrNone)
|
sl@0
|
1117 |
{
|
sl@0
|
1118 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
1119 |
CActiveScheduler::Stop();
|
sl@0
|
1120 |
User::Leave(err);
|
sl@0
|
1121 |
}
|
sl@0
|
1122 |
#else
|
sl@0
|
1123 |
if (err == KErrNotSupported)
|
sl@0
|
1124 |
{
|
sl@0
|
1125 |
iTestStepResult = EKnownFailure;
|
sl@0
|
1126 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
1127 |
}
|
sl@0
|
1128 |
else
|
sl@0
|
1129 |
{
|
sl@0
|
1130 |
iTestStepResult = EFail;
|
sl@0
|
1131 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
1132 |
}
|
sl@0
|
1133 |
CActiveScheduler::Stop();
|
sl@0
|
1134 |
User::Leave(err);
|
sl@0
|
1135 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
1136 |
}
|
sl@0
|
1137 |
// Prepare iVideoPlayer
|
sl@0
|
1138 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
1139 |
iVideoPlayer->Prepare();
|
sl@0
|
1140 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
1141 |
break;
|
sl@0
|
1142 |
}
|
sl@0
|
1143 |
case EVPPrepareComplete:
|
sl@0
|
1144 |
{
|
sl@0
|
1145 |
iError = KErrTimedOut;
|
sl@0
|
1146 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
1147 |
iVideoPlayer->Play();
|
sl@0
|
1148 |
// When playing for the first time open the file again else play till the end.
|
sl@0
|
1149 |
if (iCountNumber == 0)
|
sl@0
|
1150 |
{
|
sl@0
|
1151 |
iCountNumber++;
|
sl@0
|
1152 |
// Open iVideoPlayer
|
sl@0
|
1153 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
1154 |
if (iBinaryCompatibility)
|
sl@0
|
1155 |
{
|
sl@0
|
1156 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename, ControllerUid()));
|
sl@0
|
1157 |
}
|
sl@0
|
1158 |
else
|
sl@0
|
1159 |
{
|
sl@0
|
1160 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename));
|
sl@0
|
1161 |
}
|
sl@0
|
1162 |
|
sl@0
|
1163 |
if (iError != KErrNone)
|
sl@0
|
1164 |
{
|
sl@0
|
1165 |
ERR_PRINTF2(_L("iVideoPlayer->OpenFileL() left with error = %d"), iError);
|
sl@0
|
1166 |
CActiveScheduler::Stop();
|
sl@0
|
1167 |
}
|
sl@0
|
1168 |
else
|
sl@0
|
1169 |
{
|
sl@0
|
1170 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
1171 |
}
|
sl@0
|
1172 |
break;
|
sl@0
|
1173 |
}
|
sl@0
|
1174 |
else
|
sl@0
|
1175 |
{
|
sl@0
|
1176 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
1177 |
}
|
sl@0
|
1178 |
break;
|
sl@0
|
1179 |
}
|
sl@0
|
1180 |
case EVPPlayComplete:
|
sl@0
|
1181 |
{
|
sl@0
|
1182 |
iTestStepResult = EPass;
|
sl@0
|
1183 |
CActiveScheduler::Stop();
|
sl@0
|
1184 |
break;
|
sl@0
|
1185 |
}
|
sl@0
|
1186 |
}
|
sl@0
|
1187 |
}
|
sl@0
|
1188 |
}
|
sl@0
|
1189 |
|
sl@0
|
1190 |
//
|
sl@0
|
1191 |
// RTestVclntSetScrIdDuringPlayAndPlayAviFile
|
sl@0
|
1192 |
//
|
sl@0
|
1193 |
|
sl@0
|
1194 |
/**
|
sl@0
|
1195 |
* RTestVclntSetScrIdDuringPlayAndPlayAviFile::Constructor
|
sl@0
|
1196 |
*/
|
sl@0
|
1197 |
RTestVclntSetScrIdDuringPlayAndPlayAviFile::RTestVclntSetScrIdDuringPlayAndPlayAviFile(const TDesC& aTestName, const TDesC& aSectName, const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
1198 |
: RTestVclntSetScrIdAndPlayBase(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber)
|
sl@0
|
1199 |
{
|
sl@0
|
1200 |
}
|
sl@0
|
1201 |
|
sl@0
|
1202 |
/**
|
sl@0
|
1203 |
* RTestVclntSetScrIdDuringPlayAndPlayAviFile::NewL
|
sl@0
|
1204 |
*/
|
sl@0
|
1205 |
RTestVclntSetScrIdDuringPlayAndPlayAviFile* RTestVclntSetScrIdDuringPlayAndPlayAviFile::NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, TInt aExpectedError, TInt aScreenNumber)
|
sl@0
|
1206 |
{
|
sl@0
|
1207 |
RTestVclntSetScrIdDuringPlayAndPlayAviFile* self = new (ELeave) RTestVclntSetScrIdDuringPlayAndPlayAviFile(aTestName, aSectName, aKeyName, aExpectedError, aScreenNumber);
|
sl@0
|
1208 |
return self;
|
sl@0
|
1209 |
}
|
sl@0
|
1210 |
|
sl@0
|
1211 |
/**
|
sl@0
|
1212 |
* RTestVclntSetScrIdDuringPlayAndPlayAviFile::DoTestStepL
|
sl@0
|
1213 |
*/
|
sl@0
|
1214 |
TVerdict RTestVclntSetScrIdDuringPlayAndPlayAviFile::DoTestStepL()
|
sl@0
|
1215 |
{
|
sl@0
|
1216 |
iTestStepResult = EFail;
|
sl@0
|
1217 |
iCountNumber = 0;
|
sl@0
|
1218 |
iError = 0;
|
sl@0
|
1219 |
// Call the state handler from IDLE state
|
sl@0
|
1220 |
TRAPD(err, FsmL(EVPIdle));
|
sl@0
|
1221 |
if (err == KErrNone)
|
sl@0
|
1222 |
{
|
sl@0
|
1223 |
// Start the scheduler - Done only once !
|
sl@0
|
1224 |
CActiveScheduler::Start();
|
sl@0
|
1225 |
}
|
sl@0
|
1226 |
return iTestStepResult;
|
sl@0
|
1227 |
}
|
sl@0
|
1228 |
|
sl@0
|
1229 |
/**
|
sl@0
|
1230 |
* RTestVclntSetScrIdDuringPlayAndPlayAviFile::FsmL
|
sl@0
|
1231 |
*/
|
sl@0
|
1232 |
void RTestVclntSetScrIdDuringPlayAndPlayAviFile::FsmL(TVclntTestPlayEvents aEventCode)
|
sl@0
|
1233 |
{
|
sl@0
|
1234 |
if (FsmCheck(aEventCode))
|
sl@0
|
1235 |
{
|
sl@0
|
1236 |
switch (aEventCode)
|
sl@0
|
1237 |
{
|
sl@0
|
1238 |
case EVPIdle:
|
sl@0
|
1239 |
{
|
sl@0
|
1240 |
// Open iVideoPlayer
|
sl@0
|
1241 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
1242 |
if (iBinaryCompatibility)
|
sl@0
|
1243 |
{
|
sl@0
|
1244 |
iVideoPlayer->OpenFileL(iFilename, ControllerUid());
|
sl@0
|
1245 |
}
|
sl@0
|
1246 |
else
|
sl@0
|
1247 |
{
|
sl@0
|
1248 |
iVideoPlayer->OpenFileL(iFilename);
|
sl@0
|
1249 |
}
|
sl@0
|
1250 |
|
sl@0
|
1251 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
1252 |
break;
|
sl@0
|
1253 |
}
|
sl@0
|
1254 |
case EVPOpenComplete:
|
sl@0
|
1255 |
{
|
sl@0
|
1256 |
// Prepare iVideoPlayer
|
sl@0
|
1257 |
INFO_PRINTF1(_L("iVideoPlayer->Prepare()"));
|
sl@0
|
1258 |
iVideoPlayer->Prepare();
|
sl@0
|
1259 |
PrepareState(EVPPrepareComplete, KErrNone);
|
sl@0
|
1260 |
break;
|
sl@0
|
1261 |
}
|
sl@0
|
1262 |
case EVPPrepareComplete:
|
sl@0
|
1263 |
{
|
sl@0
|
1264 |
iError = KErrTimedOut;
|
sl@0
|
1265 |
INFO_PRINTF1(_L("iVideoPlayer->Play()"));
|
sl@0
|
1266 |
iVideoPlayer->Play();
|
sl@0
|
1267 |
if (iCountNumber == 0)
|
sl@0
|
1268 |
{
|
sl@0
|
1269 |
// Set iScreenNumber
|
sl@0
|
1270 |
iCurrentScreenNumber = iScreenNumber;
|
sl@0
|
1271 |
INFO_PRINTF2(_L("iVideoPlayer->SetInitScreenNumber(%d)"), iScreenNumber);
|
sl@0
|
1272 |
TInt err = KErrNone;
|
sl@0
|
1273 |
err = iVideoPlayer->SetInitScreenNumber(iScreenNumber);
|
sl@0
|
1274 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
1275 |
if (err != KErrNone)
|
sl@0
|
1276 |
{
|
sl@0
|
1277 |
ERR_PRINTF2(_L("ScreenNumber failed with error : %d"), err);
|
sl@0
|
1278 |
CActiveScheduler::Stop();
|
sl@0
|
1279 |
User::Leave(err);
|
sl@0
|
1280 |
}
|
sl@0
|
1281 |
#else
|
sl@0
|
1282 |
if (err == KErrNotSupported)
|
sl@0
|
1283 |
{
|
sl@0
|
1284 |
iTestStepResult = EKnownFailure;
|
sl@0
|
1285 |
INFO_PRINTF2(_L("SetInitScreenNumber() is not supported in this OS, returned %d"), err);
|
sl@0
|
1286 |
}
|
sl@0
|
1287 |
else
|
sl@0
|
1288 |
{
|
sl@0
|
1289 |
iTestStepResult = EFail;
|
sl@0
|
1290 |
ERR_PRINTF2(_L("SetInitScreenNumber() failed with error : %d"), err);
|
sl@0
|
1291 |
}
|
sl@0
|
1292 |
CActiveScheduler::Stop();
|
sl@0
|
1293 |
User::Leave(err);
|
sl@0
|
1294 |
#endif // SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
1295 |
iCountNumber++;
|
sl@0
|
1296 |
// Open iVideoPlayer
|
sl@0
|
1297 |
INFO_PRINTF2(_L("iVideoPlayer->OpenFileL() %S"), &iFilename);
|
sl@0
|
1298 |
if (iBinaryCompatibility)
|
sl@0
|
1299 |
{
|
sl@0
|
1300 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename, ControllerUid()));
|
sl@0
|
1301 |
}
|
sl@0
|
1302 |
else
|
sl@0
|
1303 |
{
|
sl@0
|
1304 |
TRAP(iError, iVideoPlayer->OpenFileL(iFilename));
|
sl@0
|
1305 |
}
|
sl@0
|
1306 |
|
sl@0
|
1307 |
if (iError != KErrNone)
|
sl@0
|
1308 |
{
|
sl@0
|
1309 |
ERR_PRINTF2(_L("iVideoPlayer->OpenFileL() left with error = %d"), iError);
|
sl@0
|
1310 |
CActiveScheduler::Stop();
|
sl@0
|
1311 |
}
|
sl@0
|
1312 |
else
|
sl@0
|
1313 |
{
|
sl@0
|
1314 |
PrepareState(EVPOpenComplete, KErrNone);
|
sl@0
|
1315 |
}
|
sl@0
|
1316 |
break;
|
sl@0
|
1317 |
}
|
sl@0
|
1318 |
else
|
sl@0
|
1319 |
{
|
sl@0
|
1320 |
PrepareState(EVPPlayComplete, KErrNone);
|
sl@0
|
1321 |
}
|
sl@0
|
1322 |
break;
|
sl@0
|
1323 |
}
|
sl@0
|
1324 |
case EVPPlayComplete:
|
sl@0
|
1325 |
{
|
sl@0
|
1326 |
iTestStepResult = EPass;
|
sl@0
|
1327 |
CActiveScheduler::Stop();
|
sl@0
|
1328 |
break;
|
sl@0
|
1329 |
}
|
sl@0
|
1330 |
}
|
sl@0
|
1331 |
}
|
sl@0
|
1332 |
}
|
sl@0
|
1333 |
|
sl@0
|
1334 |
//
|
sl@0
|
1335 |
// CTestVclntAviPlayTimer
|
sl@0
|
1336 |
//
|
sl@0
|
1337 |
|
sl@0
|
1338 |
/**
|
sl@0
|
1339 |
* NewL
|
sl@0
|
1340 |
*/
|
sl@0
|
1341 |
CTestVclntAviPlayTimer* CTestVclntAviPlayTimer::NewL(RTestVclntSetScrIdAndPlayBase* aParent, TTimeIntervalMicroSeconds32 aWaitTime)
|
sl@0
|
1342 |
{
|
sl@0
|
1343 |
CTestVclntAviPlayTimer* self = new (ELeave) CTestVclntAviPlayTimer(aParent, aWaitTime);
|
sl@0
|
1344 |
CleanupStack::PushL(self);
|
sl@0
|
1345 |
self->ConstructL();
|
sl@0
|
1346 |
CleanupStack::Pop(self);
|
sl@0
|
1347 |
return self;
|
sl@0
|
1348 |
}
|
sl@0
|
1349 |
|
sl@0
|
1350 |
/**
|
sl@0
|
1351 |
* Constructor
|
sl@0
|
1352 |
*/
|
sl@0
|
1353 |
CTestVclntAviPlayTimer::CTestVclntAviPlayTimer(RTestVclntSetScrIdAndPlayBase* aParent, TTimeIntervalMicroSeconds32 aWaitTime)
|
sl@0
|
1354 |
: CTimer(EPriorityHigh), iParent(aParent), iWaitTime(aWaitTime)
|
sl@0
|
1355 |
{
|
sl@0
|
1356 |
CActiveScheduler::Add(this);
|
sl@0
|
1357 |
}
|
sl@0
|
1358 |
|
sl@0
|
1359 |
/**
|
sl@0
|
1360 |
* Start() - Start the timer
|
sl@0
|
1361 |
*/
|
sl@0
|
1362 |
void CTestVclntAviPlayTimer::Start()
|
sl@0
|
1363 |
{
|
sl@0
|
1364 |
After(iWaitTime);
|
sl@0
|
1365 |
}
|
sl@0
|
1366 |
|
sl@0
|
1367 |
/**
|
sl@0
|
1368 |
* RunL() - see CActive class for more info
|
sl@0
|
1369 |
*/
|
sl@0
|
1370 |
void CTestVclntAviPlayTimer::RunL()
|
sl@0
|
1371 |
{
|
sl@0
|
1372 |
// (iParent->Finished() should call Stop() or not, as we decide)
|
sl@0
|
1373 |
iParent->FinishedL();
|
sl@0
|
1374 |
}
|
sl@0
|
1375 |
|
sl@0
|
1376 |
/**
|
sl@0
|
1377 |
* RunError() - see CActive class for more info
|
sl@0
|
1378 |
*/
|
sl@0
|
1379 |
TInt CTestVclntAviPlayTimer::RunError(TInt aError)
|
sl@0
|
1380 |
{
|
sl@0
|
1381 |
CActiveScheduler::Stop();
|
sl@0
|
1382 |
return aError;
|
sl@0
|
1383 |
}
|