0
|
1 |
/*
|
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include "graphicsinktestbase.h"
|
|
20 |
#include <e32math.h>
|
|
21 |
#include <openmax/il/shai/OMX_Symbian_ExtensionNames.h>
|
|
22 |
#include <openmax/il/shai/OMX_Symbian_ComponentExt.h>
|
|
23 |
|
|
24 |
const TInt MAXNUMOFBUFFERS = 30; // Due to the size of buffers we limit the max number of buffers
|
|
25 |
|
|
26 |
/*
|
|
27 |
* There are known issues due to limitations in the OMX core with tests that repeatedly load
|
|
28 |
* and unload buffers. If left to run until the timer runs out they inevitably end up failing
|
|
29 |
* and causing problems for subsequent test steps due to iffy clean-up. This constant is therefore
|
|
30 |
* used to limit the amount of test iterations to a "safe" number.
|
|
31 |
*/
|
|
32 |
const TInt KMaxTestIterations = 25;
|
|
33 |
|
|
34 |
CGraphicsSinkTestBase::CGraphicsSinkTestBase()
|
|
35 |
{
|
|
36 |
iTestIteration = 0;
|
|
37 |
iTestTimedOut = EFalse;
|
|
38 |
iWaitForResources = EFalse;
|
|
39 |
iExecuteToIdleCount = 0;
|
|
40 |
iDoEmptyBufferDoneLimit = 20;
|
|
41 |
iExecutingToIdle = ETrue;
|
|
42 |
iDoEmptyBufferDoneCount = 0;
|
|
43 |
iIdleToExecuteCount = 0;
|
|
44 |
iPauseStateCount = 0;
|
|
45 |
}
|
|
46 |
|
|
47 |
CGraphicsSinkTestBase::~CGraphicsSinkTestBase()
|
|
48 |
{
|
|
49 |
|
|
50 |
}
|
|
51 |
|
|
52 |
void CGraphicsSinkTestBase::WaitForEvent(OMX_EVENTTYPE aEvent)
|
|
53 |
{
|
|
54 |
INFO_PRINTF2(_L("Wait for event %d cmd"),aEvent);
|
|
55 |
iEventToWaitFor = aEvent;
|
|
56 |
CActiveScheduler::Start();
|
|
57 |
}
|
|
58 |
|
|
59 |
void CGraphicsSinkTestBase::DoFillBufferDone(OMX_HANDLETYPE /*aComponent*/,OMX_BUFFERHEADERTYPE* /*aBufferHeader*/)
|
|
60 |
{
|
|
61 |
// Should never be called as graphic sink does not support this
|
|
62 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoFillBufferDone"));
|
|
63 |
}
|
|
64 |
|
|
65 |
void CGraphicsSinkTestBase::DoEmptyBufferDone(OMX_HANDLETYPE aComponent,OMX_BUFFERHEADERTYPE* aBufferHeader)
|
|
66 |
{
|
|
67 |
// INFO_PRINTF3(_L("CGraphicsSinkTestBase::DoEmptyBufferDone: Count %d Limit %d"), iDoEmptyBufferDoneCount,iDoEmptyBufferDoneLimit);
|
|
68 |
|
|
69 |
//INFO_PRINTF2(_L("CGraphicsSinkTestBase::DoEmptyBufferDone: Received pBuffer 0x%08x"), aBufferHeader->pBuffer );
|
|
70 |
|
|
71 |
TInt error = iInputBufferHeaders.Append(aBufferHeader);
|
|
72 |
if (error != KErrNone)
|
|
73 |
{
|
|
74 |
ERR_PRINTF1(_L("OOM ERROR"));
|
|
75 |
CActiveScheduler::Stop();
|
|
76 |
return SetTestStepError(error);
|
|
77 |
}
|
|
78 |
|
|
79 |
if (iIgnoreNextBufferDone)
|
|
80 |
{
|
|
81 |
iIgnoreNextBufferDone = EFalse;
|
|
82 |
return;
|
|
83 |
}
|
|
84 |
|
|
85 |
if (iInputBufferHeaders.Count() == 0)
|
|
86 |
{
|
|
87 |
ERR_PRINTF1(_L("iInputBufferHeaders count has dropped to 0"));
|
|
88 |
CActiveScheduler::Stop();
|
|
89 |
return SetTestStepResult(EFail);
|
|
90 |
}
|
|
91 |
|
|
92 |
iDoEmptyBufferDoneCount++;
|
|
93 |
|
|
94 |
OMX_COMPONENTTYPE* comp = static_cast<OMX_COMPONENTTYPE*>(aComponent);
|
|
95 |
|
|
96 |
if (iTestCase == 10)
|
|
97 |
{
|
|
98 |
if ((iDoEmptyBufferDoneCount < iDoEmptyBufferDoneLimit || iDoEmptyBufferDoneLimit == 0) && !iTestTimedOut)
|
|
99 |
{
|
|
100 |
iInputBufferHeader = iInputBufferHeaders[0];
|
|
101 |
iInputBufferHeaders.Remove(0);
|
|
102 |
|
|
103 |
iInputBufferHeader->nFilledLen = iOmxParamPortInput.format.video.nFrameWidth *
|
|
104 |
COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat) *
|
|
105 |
iOmxParamPortInput.format.video.nFrameHeight;
|
|
106 |
|
|
107 |
iInputBufferHeader->nFlags = OMX_BUFFERFLAG_SYNCFRAME;
|
|
108 |
|
|
109 |
iOmxErrorType = comp->EmptyThisBuffer(comp,iInputBufferHeader);
|
|
110 |
if (OMX_ErrorNone != iOmxErrorType)
|
|
111 |
{
|
|
112 |
ERR_PRINTF1(_L("EmptyThisBuffer returned an error"));
|
|
113 |
PrintOmxError(iOmxErrorType);
|
|
114 |
return SetTestStepError(iOmxErrorType);
|
|
115 |
}
|
|
116 |
|
|
117 |
if (iTestStep == 6)
|
|
118 |
{
|
|
119 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
120 |
}
|
|
121 |
}
|
|
122 |
else
|
|
123 |
{
|
|
124 |
iDoEmptyBufferDoneCount = 0;
|
|
125 |
iIgnoreNextBufferDone = ETrue;
|
|
126 |
if (iTestStep != 5 && iTestStep != 6)
|
|
127 |
{
|
|
128 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
129 |
}
|
|
130 |
}
|
|
131 |
}
|
|
132 |
else
|
|
133 |
{
|
|
134 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-005-05-HP")))
|
|
135 |
{
|
|
136 |
iDoEmptyBufferDoneCount = 0;
|
|
137 |
}
|
|
138 |
|
|
139 |
if (iDoEmptyBufferDoneCount < iDoEmptyBufferDoneLimit && !iTestTimedOut)
|
|
140 |
{
|
|
141 |
//INFO_PRINTF2(_L("CGraphicsSinkTestBase::DoEmptyBufferDone: Sending pBuffer 0x%08x"), iInputBufferHeaders[0]->pBuffer );
|
|
142 |
|
|
143 |
iInputBufferHeader = iInputBufferHeaders[0];
|
|
144 |
iInputBufferHeaders.Remove(0);
|
|
145 |
|
|
146 |
TInt bytesperpixel = COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
147 |
iInputBufferHeader->nFilledLen = iOmxParamPortInput.format.video.nFrameWidth * bytesperpixel *
|
|
148 |
iOmxParamPortInput.format.video.nFrameHeight;
|
|
149 |
iInputBufferHeader->nOffset = aBufferHeader->nOffset;
|
|
150 |
iInputBufferHeader->nFlags = OMX_BUFFERFLAG_SYNCFRAME;
|
|
151 |
|
|
152 |
iOmxErrorType = comp->EmptyThisBuffer(comp,iInputBufferHeader);
|
|
153 |
if (OMX_ErrorNone != iOmxErrorType)
|
|
154 |
{
|
|
155 |
ERR_PRINTF1(_L("EmptyThisBuffer returned an error"));
|
|
156 |
PrintOmxError(iOmxErrorType);
|
|
157 |
return SetTestStepError(iOmxErrorType);
|
|
158 |
}
|
|
159 |
}
|
|
160 |
else
|
|
161 |
{
|
|
162 |
iDoEmptyBufferDoneCount = 0;
|
|
163 |
iIgnoreNextBufferDone = ETrue;
|
|
164 |
if (TestStepName() != (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
165 |
{
|
|
166 |
if (iExecutingToIdle)
|
|
167 |
{
|
|
168 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
169 |
}
|
|
170 |
else
|
|
171 |
{
|
|
172 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StatePause,0);
|
|
173 |
}
|
|
174 |
}
|
|
175 |
}
|
|
176 |
}
|
|
177 |
}
|
|
178 |
|
|
179 |
|
|
180 |
TVerdict CGraphicsSinkTestBase::DoGSCompAllocTestL()
|
|
181 |
{
|
|
182 |
TVerdict result = EPass;
|
|
183 |
|
|
184 |
// Create a callback handler, graphic sink handle and destroy it
|
|
185 |
iError = OMX_Init();
|
|
186 |
if(iError != OMX_ErrorNone)
|
|
187 |
{
|
|
188 |
iError = OMX_Deinit();
|
|
189 |
User::Leave(KErrNoMemory);
|
|
190 |
}
|
|
191 |
|
|
192 |
delete iCallbackHandler;
|
|
193 |
iCallbackHandler = NULL;
|
|
194 |
TRAPD(error, iCallbackHandler = CCallbackHandler::NewL(*this));
|
|
195 |
|
|
196 |
if (!error)
|
|
197 |
{
|
|
198 |
OMX_CALLBACKTYPE* omxCallbacks = *iCallbackHandler;
|
|
199 |
OMX_PTR appData = iCallbackHandler;
|
|
200 |
OMX_HANDLETYPE graphicsSinkHandle = NULL;
|
|
201 |
OMX_STRING graphicsSinkComponentName = "OMX.SYMBIAN.VIDEO.GRAPHICSINK";
|
|
202 |
|
|
203 |
iError = OMX_GetHandle(
|
|
204 |
&graphicsSinkHandle,
|
|
205 |
graphicsSinkComponentName,
|
|
206 |
appData,
|
|
207 |
omxCallbacks);
|
|
208 |
|
|
209 |
if (iError == OMX_ErrorNone)
|
|
210 |
{
|
|
211 |
iGraphicSinkCompHandle = (OMX_COMPONENTTYPE*)graphicsSinkHandle;
|
|
212 |
OMX_FreeHandle(iGraphicSinkCompHandle);
|
|
213 |
delete iCallbackHandler;
|
|
214 |
iCallbackHandler = NULL;
|
|
215 |
iError = OMX_Deinit();
|
|
216 |
if(iError != OMX_ErrorNone)
|
|
217 |
{
|
|
218 |
User::Leave(KErrGeneral);
|
|
219 |
}
|
|
220 |
}
|
|
221 |
else
|
|
222 |
{
|
|
223 |
result = EFail;
|
|
224 |
PrintOmxError(iError);
|
|
225 |
ERR_PRINTF2(_L("Unexpected %d return OMX_GetHandle"), iError);
|
|
226 |
delete iCallbackHandler;
|
|
227 |
iCallbackHandler = NULL;
|
|
228 |
iError = OMX_Deinit();
|
|
229 |
User::Leave(KErrNoMemory);
|
|
230 |
}
|
|
231 |
}
|
|
232 |
else
|
|
233 |
{
|
|
234 |
ERR_PRINTF2(_L("Unexpected %d return CCallbackHandler::NewL()"), iError);
|
|
235 |
result = EFail;
|
|
236 |
iError = OMX_Deinit();
|
|
237 |
User::Leave(KErrNoMemory);
|
|
238 |
}
|
|
239 |
|
|
240 |
return result;
|
|
241 |
}
|
|
242 |
|
|
243 |
|
|
244 |
void CGraphicsSinkTestBase::DoEventHandler(OMX_HANDLETYPE aComponent, OMX_EVENTTYPE aEvent,
|
|
245 |
TUint aData1, TUint aData2, TAny* aExtra)
|
|
246 |
{
|
|
247 |
/* OMX_COMPONENTTYPE* comp = static_cast<OMX_COMPONENTTYPE*>(aComponent);
|
|
248 |
if (comp == iCameraSourceCompHandle &&
|
|
249 |
aEvent == OMX_EventCmdComplete &&
|
|
250 |
aData1 == OMX_CommandPortDisable &&
|
|
251 |
(aData2 == KCameraVCPortIndex || aData2 == KCameraClockPortIndex))
|
|
252 |
{
|
|
253 |
return;
|
|
254 |
}
|
|
255 |
*/
|
|
256 |
OMX_ERRORTYPE errorEvent = static_cast<OMX_ERRORTYPE>( aData1 );
|
|
257 |
|
|
258 |
switch (aEvent)
|
|
259 |
{
|
|
260 |
case OMX_EventError:
|
|
261 |
{
|
|
262 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-001-01-HP")))
|
|
263 |
{
|
|
264 |
ErrorEventTask_001(errorEvent);
|
|
265 |
}
|
|
266 |
else
|
|
267 |
{
|
|
268 |
switch (errorEvent)
|
|
269 |
{
|
|
270 |
case OMX_ErrorFormatNotDetected:
|
|
271 |
{
|
|
272 |
// INFO_PRINTF1(_L("DoEventHandler: OMX_EventError [OMX_ErrorFormatNotDetected]"));
|
|
273 |
PrintOmxError(OMX_ErrorFormatNotDetected);
|
|
274 |
CActiveScheduler::Stop();
|
|
275 |
return SetTestStepError(KErrGeneral);
|
|
276 |
}
|
|
277 |
case OMX_ErrorIncorrectStateOperation:
|
|
278 |
{
|
|
279 |
// INFO_PRINTF1(_L("DoEventHandler: OMX_EventError [OMX_ErrorIncorrectStateOperation]"));
|
|
280 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-002-04-HP")))
|
|
281 |
{
|
|
282 |
CActiveScheduler::Stop();
|
|
283 |
return SetTestStepResult(EPass);
|
|
284 |
}
|
|
285 |
CActiveScheduler::Stop();
|
|
286 |
return SetTestStepError(PrintOmxError(OMX_ErrorIncorrectStateOperation));
|
|
287 |
}
|
|
288 |
case OMX_ErrorInvalidState:
|
|
289 |
{
|
|
290 |
// INFO_PRINTF1(_L("DoEventHandler: OMX_EventError [OMX_ErrorInvalidState]"));
|
|
291 |
CActiveScheduler::Stop();
|
|
292 |
PrintOmxError(OMX_ErrorInvalidState);
|
|
293 |
return SetTestStepError(KErrGeneral);
|
|
294 |
}
|
|
295 |
case OMX_ErrorPortUnpopulated:
|
|
296 |
{
|
|
297 |
// INFO_PRINTF1(_L("DoEventHandler: OMX_EventError [OMX_ErrorPortUnpopulated]"));
|
|
298 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-006-02-HP")))
|
|
299 |
{
|
|
300 |
if (--iInputBufferHeadersCount == 0)
|
|
301 |
CActiveScheduler::Stop();
|
|
302 |
return SetTestStepResult(EPass);
|
|
303 |
}
|
|
304 |
}
|
|
305 |
default:
|
|
306 |
{
|
|
307 |
INFO_PRINTF2(_L("DoEventHandler: OMX_EventError [%d]"), aData1);
|
|
308 |
CActiveScheduler::Stop();
|
|
309 |
return SetTestStepError(KErrGeneral);
|
|
310 |
}
|
|
311 |
}
|
|
312 |
}
|
|
313 |
}
|
|
314 |
case OMX_EventBufferFlag:
|
|
315 |
{
|
|
316 |
break;
|
|
317 |
}
|
|
318 |
case OMX_EventCmdComplete:
|
|
319 |
{
|
|
320 |
InitiateNextStateTransition(aComponent, aData1, aData2, aExtra);
|
|
321 |
break;
|
|
322 |
}
|
|
323 |
case OMX_EventPortSettingsChanged:
|
|
324 |
{
|
|
325 |
if(iEventToWaitFor == aEvent)
|
|
326 |
{
|
|
327 |
iEventToWaitFor = OMX_EventMax;
|
|
328 |
CActiveScheduler::Stop();
|
|
329 |
return SetTestStepResult(EPass);
|
|
330 |
}
|
|
331 |
else
|
|
332 |
{
|
|
333 |
UpdateSettingChanged(aComponent, aData1, aData2, aExtra);
|
|
334 |
}
|
|
335 |
break;
|
|
336 |
}
|
|
337 |
|
|
338 |
/* case OMX_EventNokiaFirstFrameDisplayed:
|
|
339 |
{
|
|
340 |
break;
|
|
341 |
}*/
|
|
342 |
|
|
343 |
default:
|
|
344 |
{
|
|
345 |
INFO_PRINTF2(_L("DoEventHandler: OMX Event [%d]"), aEvent);
|
|
346 |
CActiveScheduler::Stop();
|
|
347 |
return SetTestStepError(KErrGeneral);
|
|
348 |
}
|
|
349 |
}
|
|
350 |
}
|
|
351 |
|
|
352 |
void CGraphicsSinkTestBase::InitiateNextStateTransition(OMX_HANDLETYPE /*aComponent*/, TUint /*aData1*/,
|
|
353 |
TUint aData2, TAny* /*aExtra*/)
|
|
354 |
{
|
|
355 |
switch(aData2)
|
|
356 |
{
|
|
357 |
case OMX_StateLoaded:
|
|
358 |
{
|
|
359 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-002-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-002-02-HP"))
|
|
360 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-002-03-HP")))
|
|
361 |
{
|
|
362 |
LoadedStateTask_002();
|
|
363 |
}
|
|
364 |
else
|
|
365 |
{
|
|
366 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-003-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-003-02-HP"))
|
|
367 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-003-03-HP")))
|
|
368 |
{
|
|
369 |
LoadedStateTask_003();
|
|
370 |
}
|
|
371 |
else
|
|
372 |
{
|
|
373 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-004-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-02-HP"))
|
|
374 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-04-HP"))
|
|
375 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-05-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
376 |
{
|
|
377 |
LoadedStateTask_004();
|
|
378 |
}
|
|
379 |
else
|
|
380 |
{
|
|
381 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-005-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-02-HP"))
|
|
382 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-04-HP"))
|
|
383 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-05-HP")))
|
|
384 |
{
|
|
385 |
LoadedStateTask_005();
|
|
386 |
}
|
|
387 |
else
|
|
388 |
{
|
|
389 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-006-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-006-02-HP")))
|
|
390 |
{
|
|
391 |
LoadedStateTask_006();
|
|
392 |
}
|
|
393 |
else
|
|
394 |
{
|
|
395 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-007-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-02-HP")) ||
|
|
396 |
TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP")))
|
|
397 |
{
|
|
398 |
LoadedStateTask_007();
|
|
399 |
}
|
|
400 |
else
|
|
401 |
{
|
|
402 |
if (iTestCase == 9)
|
|
403 |
{
|
|
404 |
LoadedStateTransitionTask();
|
|
405 |
}
|
|
406 |
else
|
|
407 |
{
|
|
408 |
if (iTestCase == 10)
|
|
409 |
{
|
|
410 |
LoadedStateBufferTask();
|
|
411 |
}
|
|
412 |
else
|
|
413 |
{
|
|
414 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoEventHandler State set to OMX_StateLoaded"));
|
|
415 |
}
|
|
416 |
}
|
|
417 |
}
|
|
418 |
}
|
|
419 |
}
|
|
420 |
}
|
|
421 |
}
|
|
422 |
}
|
|
423 |
break;
|
|
424 |
}
|
|
425 |
case OMX_StateWaitForResources:
|
|
426 |
{
|
|
427 |
if (iTestCase == 9)
|
|
428 |
{
|
|
429 |
WaitForResourcesTransitionTask();
|
|
430 |
}
|
|
431 |
else
|
|
432 |
{
|
|
433 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoEventHandler State set to OMX_StateWaitForResources"));
|
|
434 |
}
|
|
435 |
break;
|
|
436 |
}
|
|
437 |
case OMX_StateIdle:
|
|
438 |
{
|
|
439 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-002-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-002-02-HP"))
|
|
440 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-002-03-HP")))
|
|
441 |
{
|
|
442 |
IdleStateTask_002();
|
|
443 |
}
|
|
444 |
else
|
|
445 |
{
|
|
446 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-003-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-003-02-HP"))
|
|
447 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-003-03-HP")))
|
|
448 |
{
|
|
449 |
IdleStateTask_003();
|
|
450 |
}
|
|
451 |
else
|
|
452 |
{
|
|
453 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-004-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-02-HP"))
|
|
454 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-04-HP"))
|
|
455 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-05-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
456 |
{
|
|
457 |
IdleStateTask_004();
|
|
458 |
}
|
|
459 |
else
|
|
460 |
{
|
|
461 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-005-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-02-HP"))
|
|
462 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-04-HP"))
|
|
463 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-05-HP")))
|
|
464 |
{
|
|
465 |
IdleStateTask_005();
|
|
466 |
}
|
|
467 |
else
|
|
468 |
{
|
|
469 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-006-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-006-02-HP")))
|
|
470 |
{
|
|
471 |
IdleStateTask_006();
|
|
472 |
}
|
|
473 |
else
|
|
474 |
{
|
|
475 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-007-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-02-HP")) ||
|
|
476 |
TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP")))
|
|
477 |
{
|
|
478 |
IdleStateTask_007();
|
|
479 |
}
|
|
480 |
else
|
|
481 |
{
|
|
482 |
if (iTestCase == 9)
|
|
483 |
{
|
|
484 |
IdleStateTransitionTask();
|
|
485 |
}
|
|
486 |
else
|
|
487 |
{
|
|
488 |
if (iTestCase == 10)
|
|
489 |
{
|
|
490 |
IdleStateBufferTask();
|
|
491 |
}
|
|
492 |
else
|
|
493 |
{
|
|
494 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoEventHandler State set to OMX_StateIdle"));
|
|
495 |
}
|
|
496 |
}
|
|
497 |
}
|
|
498 |
}
|
|
499 |
}
|
|
500 |
}
|
|
501 |
}
|
|
502 |
}
|
|
503 |
break;
|
|
504 |
}
|
|
505 |
case OMX_StateExecuting:
|
|
506 |
{
|
|
507 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-004-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-02-HP"))
|
|
508 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-04-HP"))
|
|
509 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-05-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
510 |
{
|
|
511 |
ExecutingStateTask_004();
|
|
512 |
}
|
|
513 |
else
|
|
514 |
{
|
|
515 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-005-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-02-HP"))
|
|
516 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-005-04-HP"))
|
|
517 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-005-05-HP")))
|
|
518 |
{
|
|
519 |
ExecutingStateTask_005();
|
|
520 |
}
|
|
521 |
else
|
|
522 |
{
|
|
523 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-007-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-02-HP"))
|
|
524 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")))
|
|
525 |
{
|
|
526 |
ExecutingStateTask_007();
|
|
527 |
}
|
|
528 |
else
|
|
529 |
{
|
|
530 |
if (iTestCase == 9)
|
|
531 |
{
|
|
532 |
ExecutingStateTransitionTask();
|
|
533 |
}
|
|
534 |
else
|
|
535 |
{
|
|
536 |
if (iTestCase == 10)
|
|
537 |
{
|
|
538 |
ExecutingStateBufferTask();
|
|
539 |
}
|
|
540 |
else
|
|
541 |
{
|
|
542 |
switch(iPreviousState)
|
|
543 |
{
|
|
544 |
case OMX_StateIdle:
|
|
545 |
{
|
|
546 |
iPreviousState = OMX_StateExecuting;
|
|
547 |
EmptyThisBufferTask();
|
|
548 |
break;
|
|
549 |
}
|
|
550 |
case OMX_StatePause:
|
|
551 |
{
|
|
552 |
iPreviousState = OMX_StateExecuting;
|
|
553 |
EmptyThisBufferTask();
|
|
554 |
break;
|
|
555 |
}
|
|
556 |
}
|
|
557 |
}
|
|
558 |
}
|
|
559 |
}
|
|
560 |
}
|
|
561 |
}
|
|
562 |
break;
|
|
563 |
}
|
|
564 |
case OMX_StatePause:
|
|
565 |
{
|
|
566 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-007-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-02-HP")) ||
|
|
567 |
TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP")))
|
|
568 |
{
|
|
569 |
PauseStateTask_007();
|
|
570 |
}
|
|
571 |
else
|
|
572 |
{
|
|
573 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoEventHandler State set to OMX_StatePause"));
|
|
574 |
}
|
|
575 |
break;
|
|
576 |
}
|
|
577 |
case OMX_StateInvalid:
|
|
578 |
{
|
|
579 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-001-01-HP")))
|
|
580 |
{
|
|
581 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::GSTest001: Loaded to Invalid"));
|
|
582 |
// Not really intended for loaded to invalid test but booleon needed
|
|
583 |
iExecutingToIdle = EFalse;
|
|
584 |
}
|
|
585 |
else
|
|
586 |
{
|
|
587 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::DoEventHandler State set to OMX_StateInvalid"));
|
|
588 |
}
|
|
589 |
break;
|
|
590 |
}
|
|
591 |
}
|
|
592 |
}
|
|
593 |
|
|
594 |
void CGraphicsSinkTestBase::UpdateSettingChanged(OMX_HANDLETYPE /*aComponent*/,TUint aData1,TUint /*aData2*/,TAny* /*aExtra*/)
|
|
595 |
{
|
|
596 |
TInt err = KErrGeneral;
|
|
597 |
|
|
598 |
if(aData1 == iSurfaceConfigExt ||
|
|
599 |
aData1 == OMX_IndexConfigCommonScale ||
|
|
600 |
aData1 == OMX_IndexConfigCommonOutputSize ||
|
|
601 |
aData1 == OMX_IndexConfigCommonInputCrop ||
|
|
602 |
aData1 == OMX_IndexConfigCommonOutputCrop ||
|
|
603 |
aData1 == OMX_IndexConfigCommonExclusionRect)
|
|
604 |
{
|
|
605 |
// port setting has been changed with Configs
|
|
606 |
TSurfaceId surfaceId;
|
|
607 |
(*iSurfaceConfig).GetSurfaceId(surfaceId);
|
|
608 |
// INFO_PRINTF2(_L("Surface Id:%d"),surfaceId);
|
|
609 |
err = iWindow->SetBackgroundSurface(*iSurfaceConfig, ETrue);
|
|
610 |
if(KErrNone != err)
|
|
611 |
{
|
|
612 |
ERR_PRINTF2(_L("SetSurfaceId fails with error: %d"),err);
|
|
613 |
SetTestStepError(KErrGeneral);
|
|
614 |
return SetTestStepResult(EFail);
|
|
615 |
}
|
|
616 |
// SetBackgroundSurface OK
|
|
617 |
}
|
|
618 |
}
|
|
619 |
|
|
620 |
|
|
621 |
void CGraphicsSinkTestBase::CloseTestStep()
|
|
622 |
{
|
|
623 |
delete iCamOutputBuffer;
|
|
624 |
|
|
625 |
FreeBuffer( iGraphicSinkCompHandle, 0, iInputBufferHeaders, OMX_ErrorNone );
|
|
626 |
iInputBufferHeaders.Reset();
|
|
627 |
|
|
628 |
COmxGsTestBase::CloseTest();
|
|
629 |
}
|
|
630 |
|
|
631 |
void CGraphicsSinkTestBase::EmptyThisBufferTask()
|
|
632 |
{
|
|
633 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::EmptyThisBufferTask: Empty this buffer task Count %d"),iDoEmptyBufferDoneCount);
|
|
634 |
|
|
635 |
TInt bytesperpixel = COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
636 |
// CGraphicsSinkTestBase::EmptyThisBufferTask: Fill COmxILMMBuffer* with colour
|
|
637 |
FillCCamBuffer(iChunk, iOmxParamPortInput.format.video.nFrameWidth,iOmxParamPortInput.format.video.nFrameHeight,bytesperpixel,iOmxParamPortInput.nBufferCountActual);
|
|
638 |
|
|
639 |
//INFO_PRINTF2(_L("CGraphicsSinkTestBase::EmptyThisBufferTask: Sending pBuffer 0x%08x"), iInputBufferHeaders[0]->pBuffer );
|
|
640 |
|
|
641 |
iInputBufferHeader = iInputBufferHeaders[0];
|
|
642 |
iInputBufferHeader->nFilledLen = iOmxParamPortInput.format.video.nFrameWidth *
|
|
643 |
COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat) *
|
|
644 |
iOmxParamPortInput.format.video.nFrameHeight;
|
|
645 |
iInputBufferHeaders.Remove(0);
|
|
646 |
iOmxErrorType = iGraphicSinkCompHandle->EmptyThisBuffer(iGraphicSinkCompHandle,iInputBufferHeader);
|
|
647 |
|
|
648 |
|
|
649 |
if (OMX_ErrorNone != iOmxErrorType)
|
|
650 |
{
|
|
651 |
ERR_PRINTF1(_L("EmptyThisBuffer returned an error"));
|
|
652 |
return SetTestStepError(KErrGeneral);
|
|
653 |
}
|
|
654 |
|
|
655 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
656 |
{
|
|
657 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle, 0);
|
|
658 |
}
|
|
659 |
else
|
|
660 |
{
|
|
661 |
if( iIgnoreNextBufferDone ){
|
|
662 |
iIgnoreNextBufferDone = EFalse;
|
|
663 |
return;
|
|
664 |
}
|
|
665 |
// else...
|
|
666 |
|
|
667 |
//INFO_PRINTF2(_L("CGraphicsSinkTestBase::EmptyThisBufferTask: Sending pBuffer 0x%08x"), iInputBufferHeaders[0]->pBuffer );
|
|
668 |
|
|
669 |
iInputBufferHeader = iInputBufferHeaders[0];
|
|
670 |
iInputBufferHeaders.Remove(0);
|
|
671 |
iInputBufferHeader->nFilledLen = iOmxParamPortInput.format.video.nFrameWidth *
|
|
672 |
COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat) *
|
|
673 |
iOmxParamPortInput.format.video.nFrameHeight;
|
|
674 |
iInputBufferHeader->nFlags = OMX_BUFFERFLAG_SYNCFRAME;
|
|
675 |
iOmxErrorType = iGraphicSinkCompHandle->EmptyThisBuffer(iGraphicSinkCompHandle,iInputBufferHeader);
|
|
676 |
if (OMX_ErrorNone != iOmxErrorType)
|
|
677 |
{
|
|
678 |
ERR_PRINTF1(_L("EmptyThisBuffer returned an error"));
|
|
679 |
return SetTestStepError(KErrGeneral);
|
|
680 |
}
|
|
681 |
}
|
|
682 |
}
|
|
683 |
|
|
684 |
void CGraphicsSinkTestBase::DoROmxGsTestSetup()
|
|
685 |
{
|
|
686 |
TRAPD(err,CreateWindowL());
|
|
687 |
if(err != KErrNone)
|
|
688 |
{
|
|
689 |
ERR_PRINTF2(_L("CreateWindow Failed %d"),err);
|
|
690 |
return SetTestStepError(err);
|
|
691 |
}
|
|
692 |
|
|
693 |
OMX_INDEXTYPE videoSurfaceConfigIndex = OMX_IndexMax;
|
|
694 |
|
|
695 |
iError = iGraphicSinkCompHandle->GetExtensionIndex(iGraphicSinkCompHandle, const_cast<char*>(sOmxSymbianGfxSurfaceConfig), &videoSurfaceConfigIndex);
|
|
696 |
if(OMX_ErrorNone != iError)
|
|
697 |
{
|
|
698 |
ERR_PRINTF1(_L("OMX_GetExtensionIndex Failed"));
|
|
699 |
PrintOmxError(iError);
|
|
700 |
return SetTestStepError(KErrGeneral);
|
|
701 |
}
|
|
702 |
|
|
703 |
OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION surfaceConfig;
|
|
704 |
surfaceConfig.nSize = sizeof(OMX_SYMBIAN_VIDEO_PARAM_SURFACECONFIGURATION);
|
|
705 |
surfaceConfig.nVersion = TOmxILSpecVersion();
|
|
706 |
surfaceConfig.nPortIndex = 0;
|
|
707 |
|
|
708 |
GetParameter(iGraphicSinkCompHandle, videoSurfaceConfigIndex, &surfaceConfig);
|
|
709 |
if(NULL == surfaceConfig.pSurfaceConfig)
|
|
710 |
{
|
|
711 |
ERR_PRINTF1(_L("GetParameter Failed 01"));
|
|
712 |
return SetTestStepError(KErrGeneral);
|
|
713 |
}
|
|
714 |
|
|
715 |
iSurfaceConfig = reinterpret_cast<TSurfaceConfiguration*>(surfaceConfig.pSurfaceConfig);
|
|
716 |
// INFO_PRINTF2(_L("SurfaceConfig : %x"), iSurfaceConfig);
|
|
717 |
TSurfaceId surfaceId;
|
|
718 |
(*iSurfaceConfig).GetSurfaceId(surfaceId);
|
|
719 |
// INFO_PRINTF2(_L("Surface Id:%d: "),surfaceId);
|
|
720 |
|
|
721 |
// Get default OMX_PARAM_PORTDEFINITIONTYPE paramaters
|
|
722 |
iOmxParamPortInput.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
|
|
723 |
iOmxParamPortInput.nVersion = TOmxILSpecVersion();
|
|
724 |
iOmxParamPortInput.nPortIndex = 0;
|
|
725 |
GetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
726 |
|
|
727 |
// Set the color format to the supported type OMX_COLOR_FormatCbYCrY
|
|
728 |
// initial settings
|
|
729 |
iOmxParamPortInput.format.video.eColorFormat = OMX_COLOR_FormatCbYCrY;
|
|
730 |
iOmxParamPortInput.format.video.nFrameWidth = 320;
|
|
731 |
iOmxParamPortInput.format.video.nFrameHeight = 240;
|
|
732 |
iOmxParamPortInput.format.video.nStride = 320*2;
|
|
733 |
iOmxParamPortInput.format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
|
|
734 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
735 |
}
|
|
736 |
|
|
737 |
void CGraphicsSinkTestBase::DeleteCCameraBuf()
|
|
738 |
{
|
|
739 |
// Clean up from AllocateCCameraBuf
|
|
740 |
if (iCamOutputBuffer)
|
|
741 |
{
|
|
742 |
delete iCamOutputBuffer;
|
|
743 |
iCamOutputBuffer = NULL;
|
|
744 |
|
|
745 |
iTestChunk.Close();
|
|
746 |
iSurfaceUpdateSession.CancelAllUpdateNotifications();
|
|
747 |
iSurfaceUpdateSession.Close();
|
|
748 |
iSurfaceManager.CloseSurface(iSurfaceId);
|
|
749 |
iSurfaceId = TSurfaceId::CreateNullId();
|
|
750 |
iSurfaceManager.Close();
|
|
751 |
}
|
|
752 |
}
|
|
753 |
|
|
754 |
void CGraphicsSinkTestBase::AllocateCCameraBuf()
|
|
755 |
{
|
|
756 |
// Setting paramters for surface manager
|
|
757 |
iOmxParamPortInput.format.video.eColorFormat = OMX_COLOR_FormatCbYCrY;
|
|
758 |
iOmxParamPortInput.format.video.xFramerate = 0;
|
|
759 |
iOmxParamPortInput.format.video.nFrameHeight = 320;
|
|
760 |
iOmxParamPortInput.format.video.nFrameWidth = 240;
|
|
761 |
iOmxParamPortInput.format.video.nStride = iOmxParamPortInput.format.video.nFrameWidth * COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
762 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
763 |
GetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
764 |
|
|
765 |
// Create surface manager
|
|
766 |
RSurfaceManager::TSurfaceCreationAttributesBuf bf;
|
|
767 |
RSurfaceManager::TSurfaceCreationAttributes& b = bf();
|
|
768 |
|
|
769 |
b.iSize.iWidth = iOmxParamPortInput.format.video.nFrameWidth;
|
|
770 |
b.iSize.iHeight = iOmxParamPortInput.format.video.nFrameHeight;
|
|
771 |
b.iBuffers = iOmxParamPortInput.nBufferCountActual;
|
|
772 |
b.iPixelFormat = EUidPixelFormatRGB_565; // Look for conversion method
|
|
773 |
b.iStride = iOmxParamPortInput.format.video.nStride;
|
|
774 |
b.iOffsetToFirstBuffer = 0;
|
|
775 |
b.iOffsetBetweenBuffers = 0; // let surfacemanager choose.
|
|
776 |
#ifndef __WINSCW__
|
|
777 |
b.iAlignment = RSurfaceManager::EPageAligned;
|
|
778 |
#else
|
|
779 |
b.iAlignment = 2; //TBC //working algn = 2z
|
|
780 |
#endif
|
|
781 |
b.iContiguous = ETrue;
|
|
782 |
b.iMappable = ETrue;
|
|
783 |
|
|
784 |
TInt grapherr = InitialiseSurfaceManager();
|
|
785 |
if(grapherr != KErrNone && grapherr != KErrAlreadyExists)
|
|
786 |
{
|
|
787 |
ERR_PRINTF1(_L("CGraphicsSurfaceSink::NewL FAILED"));
|
|
788 |
return SetTestStepError(grapherr);
|
|
789 |
}
|
|
790 |
|
|
791 |
TRAPD(error, iCamOutputBuffer = COmxILMMBuffer::NewL(iTestChunk));
|
|
792 |
if(error != KErrNone)
|
|
793 |
{
|
|
794 |
ERR_PRINTF1(_L("COmxILMMBuffer::NewL FAILED"));
|
|
795 |
return SetTestStepError(error);
|
|
796 |
}
|
|
797 |
|
|
798 |
TInt ret = CreateAndMapSurface(bf, iCamOutputBuffer->SurfaceId());
|
|
799 |
if(ret != KErrNone)
|
|
800 |
{
|
|
801 |
ERR_PRINTF2(_L("CreateAndMapSurfaceL FAILED: %d"), ret);
|
|
802 |
return SetTestStepError(ret);
|
|
803 |
}
|
|
804 |
//INFO_PRINTF2(_L("CGraphicsSinkTestBase::UseBufferTask: Chunk size: %d"),iCamOutputBuffer->Chunk().Size());
|
|
805 |
|
|
806 |
RSurfaceManager::TInfoBuf surfacebuf;
|
|
807 |
ret = iSurfaceManager.SurfaceInfo(iCamOutputBuffer->SurfaceId(), surfacebuf);
|
|
808 |
if(ret != KErrNone)
|
|
809 |
{
|
|
810 |
ERR_PRINTF1(_L("RSurfaceManager::SurfaceInfo FAILED"));
|
|
811 |
return SetTestStepError(ret);
|
|
812 |
}
|
|
813 |
|
|
814 |
// INFO_PRINTF2(_L("Surface Id:%d "),iCamOutputBuffer->SurfaceId());
|
|
815 |
iCamOutputBuffer->SurfaceInfoV01() = surfacebuf();
|
|
816 |
// INFO_PRINTF2(_L("Handle of RChunk graph: %d"),iCamOutputBuffer->Chunk().Handle());
|
|
817 |
|
|
818 |
TInt numberofbuffer = b.iBuffers;
|
|
819 |
for(TInt i = 0 ; i < numberofbuffer; i++ )
|
|
820 |
{
|
|
821 |
TInt offset;
|
|
822 |
iSurfaceManager.GetBufferOffset(iCamOutputBuffer->SurfaceId(),i,offset);
|
|
823 |
|
|
824 |
//INFO_PRINTF3(_L("CGraphicsSinkTestBase::AllocateCCameraBuf() offset no %d = %d"), i , offset);
|
|
825 |
|
|
826 |
iCamOutputBuffer->OffsetInfoArray().Append(offset);
|
|
827 |
}
|
|
828 |
|
|
829 |
}
|
|
830 |
|
|
831 |
void CGraphicsSinkTestBase::AllocateBufferTask()
|
|
832 |
{
|
|
833 |
TInt bytesperpixel = COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
834 |
TInt size = bytesperpixel * iOmxParamPortInput.format.video.nFrameWidth * iOmxParamPortInput.format.video.nFrameHeight;
|
|
835 |
|
|
836 |
// Assume that allocate buffer is only called in state loaded
|
|
837 |
iPreviousState = OMX_StateLoaded;
|
|
838 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
839 |
AllocateBuffer(iGraphicSinkCompHandle,&iInputBufferHeader,0,NULL,size,&iInputBufferHeaders,iOmxParamPortInput.nBufferCountActual);
|
|
840 |
// This also confirms that the buffer count is correct, as is shouldnt be zero
|
|
841 |
if (iInputBufferHeaders.Count() == 0)
|
|
842 |
{
|
|
843 |
ERR_PRINTF2(_L("CGraphicsSinkTestBase::AllocateBufferTask: iInputBufferHeaders Count %d"),iInputBufferHeaders.Count());
|
|
844 |
CActiveScheduler::Stop();
|
|
845 |
return SetTestStepError(KErrGeneral);
|
|
846 |
}
|
|
847 |
iInputBufferHeadersCount = iInputBufferHeaders.Count();
|
|
848 |
// Create COmxILMMBuffer*
|
|
849 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::AllocateBufferTask: reinterpret_cast COmxILMMBuffer* %d"),iInputBufferHeaders[0]->pInputPortPrivate);
|
|
850 |
|
|
851 |
|
|
852 |
// duplicate chunk given from component by getconfig
|
|
853 |
OMX_INDEXTYPE sharedChunkMetadataExtensionIndex;
|
|
854 |
// due to chunk extension support in gfx
|
|
855 |
if (OMX_ErrorNone == OMX_GetExtensionIndex(
|
|
856 |
iGraphicSinkCompHandle,
|
|
857 |
OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME,
|
|
858 |
&sharedChunkMetadataExtensionIndex))
|
|
859 |
{
|
|
860 |
// Communicate the shared chunk metadata to the tunnelled
|
|
861 |
// component
|
|
862 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE configSharedChunkMetadata;
|
|
863 |
configSharedChunkMetadata.nSize = sizeof(OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE);
|
|
864 |
configSharedChunkMetadata.nVersion = TOmxILSpecVersion();
|
|
865 |
configSharedChunkMetadata.nPortIndex = 0;
|
|
866 |
|
|
867 |
(void) OMX_GetConfig(iGraphicSinkCompHandle,
|
|
868 |
sharedChunkMetadataExtensionIndex,
|
|
869 |
&configSharedChunkMetadata);
|
|
870 |
|
|
871 |
|
|
872 |
//map the chunk into this process
|
|
873 |
RThread chunkOwnerThread;
|
|
874 |
User::LeaveIfError(chunkOwnerThread.Open(TThreadId(configSharedChunkMetadata.nOwnerThreadId)));
|
|
875 |
CleanupClosePushL(chunkOwnerThread);
|
|
876 |
|
|
877 |
iChunk.SetHandle(configSharedChunkMetadata.nHandleId);
|
|
878 |
User::LeaveIfError(iChunk.Duplicate(chunkOwnerThread));
|
|
879 |
CleanupStack::PopAndDestroy(&chunkOwnerThread);
|
|
880 |
|
|
881 |
}
|
|
882 |
else
|
|
883 |
{
|
|
884 |
ERR_PRINTF1(_L("Failed to fetch shared chunk metadata from gfx sink."));
|
|
885 |
CActiveScheduler::Stop();
|
|
886 |
return SetTestStepError( KErrGeneral );
|
|
887 |
}
|
|
888 |
|
|
889 |
}
|
|
890 |
|
|
891 |
void CGraphicsSinkTestBase::UseBufferTask()
|
|
892 |
{
|
|
893 |
TInt size = 0;
|
|
894 |
if( iCamOutputBuffer->OffsetInfoArray().Count() < 2 ){
|
|
895 |
iSurfaceManager.GetBufferOffset( iCamOutputBuffer->SurfaceId(), 0, size );
|
|
896 |
}
|
|
897 |
else{
|
|
898 |
size = iCamOutputBuffer->OffsetInfoArray()[1] - iCamOutputBuffer->OffsetInfoArray()[0];
|
|
899 |
}
|
|
900 |
|
|
901 |
// Assume that use buffer is only called in state loaded
|
|
902 |
iPreviousState = OMX_StateLoaded;
|
|
903 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
904 |
|
|
905 |
// due to chunk extension support in gfx
|
|
906 |
OMX_INDEXTYPE sharedChunkMetadataExtensionIndex;
|
|
907 |
if (OMX_ErrorNone == OMX_GetExtensionIndex(
|
|
908 |
iGraphicSinkCompHandle,
|
|
909 |
OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME,
|
|
910 |
&sharedChunkMetadataExtensionIndex))
|
|
911 |
{
|
|
912 |
// Communicate the shared chunk metadata to the tunnelled
|
|
913 |
// component
|
|
914 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE configSharedChunkMetadata;
|
|
915 |
configSharedChunkMetadata.nSize = sizeof(OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE);
|
|
916 |
configSharedChunkMetadata.nVersion = TOmxILSpecVersion();
|
|
917 |
configSharedChunkMetadata.nPortIndex = 0;
|
|
918 |
configSharedChunkMetadata.nHandleId = iCamOutputBuffer->Chunk().Handle();
|
|
919 |
configSharedChunkMetadata.nOwnerThreadId = RThread().Id().Id();
|
|
920 |
|
|
921 |
iError = OMX_SetConfig(iGraphicSinkCompHandle,
|
|
922 |
sharedChunkMetadataExtensionIndex,
|
|
923 |
&configSharedChunkMetadata);
|
|
924 |
|
|
925 |
if (OMX_ErrorNone != iError)
|
|
926 |
{
|
|
927 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::UseBufferTask: Set shared chunk config error!"));
|
|
928 |
return SetTestStepError(PrintOmxError(iError));
|
|
929 |
}
|
|
930 |
}
|
|
931 |
|
|
932 |
|
|
933 |
for (TInt i = 0 ; i < iOmxParamPortInput.nBufferCountActual; i++)
|
|
934 |
{
|
|
935 |
//INFO_PRINTF4(_L("CGraphicsSinkTestBase::UseBufferTask: size = %d, chunk base = 0x%08x, offset = %d.") , size, iCamOutputBuffer->Chunk().Base(), iCamOutputBuffer->OffsetInfoArray()[i] );
|
|
936 |
iError = iGraphicSinkCompHandle->UseBuffer(iGraphicSinkCompHandle,
|
|
937 |
&iOutputBufferHeader,
|
|
938 |
0, // input port
|
|
939 |
NULL, /*iCamOutputBuffer,*/ // pAppPrivate
|
|
940 |
size, // update
|
|
941 |
iCamOutputBuffer->Chunk().Base() + iCamOutputBuffer->OffsetInfoArray()[i] /* // change made due to OMXILBufferClass */); //
|
|
942 |
if (OMX_ErrorNone != iError)
|
|
943 |
{
|
|
944 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::UseBufferTask: UseBuffer Error"));
|
|
945 |
return SetTestStepError(PrintOmxError(iError));
|
|
946 |
}
|
|
947 |
// INFO_PRINTF2(_L("surface ID y : %d"), iCamOutputBuffer->SurfaceId());
|
|
948 |
// INFO_PRINTF2(_L("Buffer offset : %d"), iCamOutputBuffer->iBufferOffset);
|
|
949 |
if (iOutputBufferHeaders.Append(iOutputBufferHeader) != KErrNone)
|
|
950 |
{
|
|
951 |
ERR_PRINTF1(_L("OOM ERROR"));
|
|
952 |
return SetTestStepError(KErrGeneral);
|
|
953 |
}
|
|
954 |
}
|
|
955 |
}
|
|
956 |
|
|
957 |
void CGraphicsSinkTestBase::AllocateBufferTaskStress()
|
|
958 |
{
|
|
959 |
// Color format should be default value: OMX_COLOR_Format16bitRGB565
|
|
960 |
TInt bytesperpixel = COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
961 |
TInt size = bytesperpixel * iOmxParamPortInput.format.video.nFrameWidth * iOmxParamPortInput.format.video.nFrameHeight;
|
|
962 |
|
|
963 |
// Assume that allocate buffer is only called in state loaded
|
|
964 |
iPreviousState = OMX_StateLoaded;
|
|
965 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
966 |
|
|
967 |
for(TInt i = 0 ; i < iOmxParamPortInput.nBufferCountActual; i++ )
|
|
968 |
{
|
|
969 |
iOmxErrorType = iGraphicSinkCompHandle->AllocateBuffer(iGraphicSinkCompHandle,&iInputBufferHeader,0,NULL,size);
|
|
970 |
if (iOmxErrorType != OMX_ErrorNone)
|
|
971 |
{
|
|
972 |
if (iOmxErrorType == OMX_ErrorInsufficientResources)
|
|
973 |
{
|
|
974 |
INFO_PRINTF2(_L("CGraphicsSinkTestBase::AllocateBufferTaskStress: AllocateBuffer returned InsufficientResources & nBufferCountActual was set to %d"),iOmxParamPortInput.nBufferCountActual);
|
|
975 |
CActiveScheduler::Stop();
|
|
976 |
return SetTestStepResult(EPass);
|
|
977 |
}
|
|
978 |
else
|
|
979 |
{
|
|
980 |
CActiveScheduler::Stop();
|
|
981 |
return SetTestStepError(PrintOmxError(iOmxErrorType));
|
|
982 |
}
|
|
983 |
}
|
|
984 |
|
|
985 |
// Used for tracking
|
|
986 |
TRAPD(err,iInputBufferHeaders.AppendL(iInputBufferHeader));
|
|
987 |
if(err != KErrNone)
|
|
988 |
{
|
|
989 |
ERR_PRINTF2(_L("AppendL Buffer Failed %d"),err);
|
|
990 |
CActiveScheduler::Stop();
|
|
991 |
return SetTestStepError(err);
|
|
992 |
}
|
|
993 |
}
|
|
994 |
|
|
995 |
// This also confirms that the buffer count is correct, as is shouldnt be zero
|
|
996 |
if (iInputBufferHeaders.Count() == 0)
|
|
997 |
{
|
|
998 |
ERR_PRINTF2(_L("CGraphicsSinkTestBase::AllocateBufferTaskStress: iInputBufferHeaders Count %d"),iInputBufferHeaders.Count());
|
|
999 |
CActiveScheduler::Stop();
|
|
1000 |
return SetTestStepError(KErrGeneral);
|
|
1001 |
}
|
|
1002 |
|
|
1003 |
// Create COmxILMMBuffer*
|
|
1004 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::AllocateBufferTaskStress: reinterpret_cast COmxILMMBuffer* %d"),iInputBufferHeaders[0]->pInputPortPrivate);
|
|
1005 |
//iCamBuf = static_cast<COmxILMMBuffer*>(iInputBufferHeaders[0]->pInputPortPrivate);
|
|
1006 |
// duplicate chunk given from component by getconfig
|
|
1007 |
OMX_INDEXTYPE sharedChunkMetadataExtensionIndex;
|
|
1008 |
// due to chunk extension support in gfx
|
|
1009 |
if (OMX_ErrorNone == OMX_GetExtensionIndex(
|
|
1010 |
iGraphicSinkCompHandle,
|
|
1011 |
OMX_SYMBIAN_INDEX_CONFIG_SHAREDCHUNKMETADATA_NAME,
|
|
1012 |
&sharedChunkMetadataExtensionIndex))
|
|
1013 |
{
|
|
1014 |
// Communicate the shared chunk metadata to the tunnelled
|
|
1015 |
// component
|
|
1016 |
OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE configSharedChunkMetadata;
|
|
1017 |
configSharedChunkMetadata.nSize = sizeof(OMX_SYMBIAN_CONFIG_SHAREDCHUNKMETADATATYPE);
|
|
1018 |
configSharedChunkMetadata.nVersion = TOmxILSpecVersion();
|
|
1019 |
configSharedChunkMetadata.nPortIndex = 0;
|
|
1020 |
|
|
1021 |
(void) OMX_GetConfig(iGraphicSinkCompHandle,
|
|
1022 |
sharedChunkMetadataExtensionIndex,
|
|
1023 |
&configSharedChunkMetadata);
|
|
1024 |
|
|
1025 |
|
|
1026 |
//map the chunk into this process
|
|
1027 |
RThread chunkOwnerThread;
|
|
1028 |
User::LeaveIfError(chunkOwnerThread.Open(TThreadId(configSharedChunkMetadata.nOwnerThreadId)));
|
|
1029 |
CleanupClosePushL(chunkOwnerThread);
|
|
1030 |
|
|
1031 |
iChunk.SetHandle(configSharedChunkMetadata.nHandleId);
|
|
1032 |
User::LeaveIfError(iChunk.Duplicate(chunkOwnerThread));
|
|
1033 |
CleanupStack::PopAndDestroy(&chunkOwnerThread);
|
|
1034 |
|
|
1035 |
}
|
|
1036 |
else
|
|
1037 |
{
|
|
1038 |
ERR_PRINTF1(_L("Failed to fetch shared chunk metadata from gfx sink."));
|
|
1039 |
CActiveScheduler::Stop();
|
|
1040 |
return SetTestStepError( KErrGeneral );
|
|
1041 |
}
|
|
1042 |
}
|
|
1043 |
|
|
1044 |
void CGraphicsSinkTestBase::FreeBufferTask(RPointerArray<OMX_BUFFERHEADERTYPE>* aBufferHeaders,
|
|
1045 |
OMX_U32 aPortIndex,TBool aSendCommand)
|
|
1046 |
{
|
|
1047 |
if (aSendCommand)
|
|
1048 |
{
|
|
1049 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1050 |
}
|
|
1051 |
|
|
1052 |
FreeBuffer(iGraphicSinkCompHandle,aPortIndex,*aBufferHeaders);
|
|
1053 |
aBufferHeaders->Reset();
|
|
1054 |
}
|
|
1055 |
|
|
1056 |
void CGraphicsSinkTestBase::FreeBufferTaskAlt(RPointerArray<OMX_BUFFERHEADERTYPE> aBufferHeaders,
|
|
1057 |
OMX_U32 aPortIndex,TBool aSendCommand)
|
|
1058 |
{
|
|
1059 |
if (aSendCommand)
|
|
1060 |
{
|
|
1061 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1062 |
}
|
|
1063 |
|
|
1064 |
FreeBuffer(iGraphicSinkCompHandle,aPortIndex,aBufferHeaders);
|
|
1065 |
}
|
|
1066 |
|
|
1067 |
void CGraphicsSinkTestBase::FillCCamBuffer(const RChunk& aCamBuf, OMX_U32 aFrameWidth,
|
|
1068 |
OMX_U32 aFrameHeight, TInt aBytePerPixel, TInt aNumOfActualBuffer)
|
|
1069 |
{
|
|
1070 |
// FillThisBuffer
|
|
1071 |
TRgb red_col(255,0,0);
|
|
1072 |
TRgb blue_col(0,255,0);
|
|
1073 |
TRgb green_col(0,0,255);
|
|
1074 |
TRgb black_col(0,0,0);
|
|
1075 |
TUint32 red_color = red_col.Color64K();
|
|
1076 |
TUint32 blue_color = blue_col.Color64K();
|
|
1077 |
TUint32 green_color = green_col.Color64K();
|
|
1078 |
TUint32 black_color = black_col.Color64K();
|
|
1079 |
TUint32 col[] = {red_color, blue_color, green_color, black_color};
|
|
1080 |
|
|
1081 |
TInt stride = aFrameWidth * aBytePerPixel;
|
|
1082 |
TInt colIndex = 0;
|
|
1083 |
for(TInt index=0; index<aNumOfActualBuffer; ++index)
|
|
1084 |
{
|
|
1085 |
//TODO: TUint8* surfacePtr = aCamBuf->Chunk().Base() + aCamBuf->BufferOffset();
|
|
1086 |
TUint8* surfacePtr = aCamBuf.Base() + (iOmxParamPortInput.nBufferSize * index);
|
|
1087 |
TUint8* linePtr = surfacePtr;
|
|
1088 |
|
|
1089 |
TUint16* ptr = reinterpret_cast<TUint16*>(surfacePtr);
|
|
1090 |
|
|
1091 |
// Fill first line
|
|
1092 |
for (TInt xx = 0; xx < aFrameWidth; xx++)
|
|
1093 |
{
|
|
1094 |
colIndex = Math::Random() % 4;
|
|
1095 |
ptr[xx] = (TUint16)col[colIndex];
|
|
1096 |
//ptr[xx] = (TUint16)col[colIndex%4];
|
|
1097 |
colIndex++;
|
|
1098 |
}
|
|
1099 |
|
|
1100 |
// Now copy that to the other lines
|
|
1101 |
for (TInt yy = 1; yy < aFrameHeight; yy++)
|
|
1102 |
{
|
|
1103 |
linePtr += stride;
|
|
1104 |
Mem::Move(linePtr, surfacePtr, stride);
|
|
1105 |
}
|
|
1106 |
}
|
|
1107 |
}
|
|
1108 |
|
|
1109 |
void CGraphicsSinkTestBase::CreateOmxParamPortDefinitionType(OMX_PARAM_PORTDEFINITIONTYPE* aOmxParamPortType)
|
|
1110 |
{
|
|
1111 |
aOmxParamPortType->nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
|
|
1112 |
aOmxParamPortType->nVersion = TOmxILSpecVersion();
|
|
1113 |
aOmxParamPortType->nPortIndex = 0;
|
|
1114 |
GetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,aOmxParamPortType,OMX_ErrorNone);
|
|
1115 |
// initial settings
|
|
1116 |
aOmxParamPortType->format.video.nFrameWidth = 320;
|
|
1117 |
aOmxParamPortType->format.video.nFrameHeight = 240;
|
|
1118 |
aOmxParamPortType->format.video.eColorFormat = OMX_COLOR_FormatCbYCrY;
|
|
1119 |
aOmxParamPortType->format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
|
|
1120 |
aOmxParamPortType->format.video.xFramerate = 0;
|
|
1121 |
aOmxParamPortType->format.video.nStride = 320*2;
|
|
1122 |
aOmxParamPortType->format.video.nSliceHeight = 10;
|
|
1123 |
aOmxParamPortType->format.video.nBitrate = 96000;
|
|
1124 |
}
|
|
1125 |
|
|
1126 |
void CGraphicsSinkTestBase::CreateOmxVideoParamPortFormatType(OMX_VIDEO_PARAM_PORTFORMATTYPE* aOmxVideoParamPortType)
|
|
1127 |
{
|
|
1128 |
aOmxVideoParamPortType->nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);
|
|
1129 |
aOmxVideoParamPortType->nVersion = TOmxILSpecVersion();
|
|
1130 |
aOmxVideoParamPortType->nPortIndex = 0;
|
|
1131 |
aOmxVideoParamPortType->nIndex = 0;
|
|
1132 |
// The following 2 values should be over written by the correct ones for this index
|
|
1133 |
aOmxVideoParamPortType->eCompressionFormat = OMX_VIDEO_CodingUnused;
|
|
1134 |
aOmxVideoParamPortType->eColorFormat = OMX_COLOR_FormatCrYCbY;
|
|
1135 |
aOmxVideoParamPortType->xFramerate = 0;
|
|
1136 |
GetParameter(iGraphicSinkCompHandle,OMX_IndexParamVideoPortFormat,aOmxVideoParamPortType,OMX_ErrorNone);
|
|
1137 |
}
|
|
1138 |
|
|
1139 |
void CGraphicsSinkTestBase::CompareU32Param(OMX_U32 aSetParamType, OMX_U32 aGetParamType)
|
|
1140 |
{
|
|
1141 |
if (aSetParamType != aGetParamType)
|
|
1142 |
{
|
|
1143 |
ERR_PRINTF3(_L("Comparison failed: Set value: %d Get value: %d"),aSetParamType,aGetParamType);
|
|
1144 |
return SetTestStepError(KErrGeneral);
|
|
1145 |
}
|
|
1146 |
}
|
|
1147 |
|
|
1148 |
void CGraphicsSinkTestBase::CompareCFTParam(OMX_COLOR_FORMATTYPE aInputParamType, OMX_COLOR_FORMATTYPE aOutputParamType, OMX_INDEXTYPE aIndexType)
|
|
1149 |
{
|
|
1150 |
if (aInputParamType != aOutputParamType)
|
|
1151 |
{
|
|
1152 |
ERR_PRINTF3(_L("Comparison failed: set value: %d Index : %X"),aInputParamType,aIndexType);
|
|
1153 |
ERR_PRINTF3(_L("Comparison failed: get value: %d Index : %X"),aOutputParamType,aIndexType);
|
|
1154 |
return SetTestStepError(KErrGeneral);
|
|
1155 |
}
|
|
1156 |
}
|
|
1157 |
|
|
1158 |
void CGraphicsSinkTestBase::CompareVCTParam(OMX_VIDEO_CODINGTYPE aInputParamType, OMX_VIDEO_CODINGTYPE aOutputParamType, OMX_INDEXTYPE aIndexType)
|
|
1159 |
{
|
|
1160 |
if (aInputParamType != aOutputParamType)
|
|
1161 |
{
|
|
1162 |
ERR_PRINTF3(_L("Comparison failed: set value: %d Index : %X"),aInputParamType,aIndexType);
|
|
1163 |
ERR_PRINTF3(_L("Comparison failed: get value: %d Index : %X"),aOutputParamType,aIndexType);
|
|
1164 |
return SetTestStepError(KErrGeneral);
|
|
1165 |
}
|
|
1166 |
}
|
|
1167 |
|
|
1168 |
void CGraphicsSinkTestBase::CompareBoolParam(OMX_BOOL aInputParamType, OMX_BOOL aOutputParamType, OMX_INDEXTYPE aIndexType)
|
|
1169 |
{
|
|
1170 |
if (aInputParamType != aOutputParamType)
|
|
1171 |
{
|
|
1172 |
ERR_PRINTF3(_L("Comparison failed: set value: %d Index : %X"),aInputParamType,aIndexType);
|
|
1173 |
ERR_PRINTF3(_L("Comparison failed: get value: %d Index : %X"),aOutputParamType,aIndexType);
|
|
1174 |
return SetTestStepError(KErrGeneral);
|
|
1175 |
}
|
|
1176 |
}
|
|
1177 |
|
|
1178 |
TInt CGraphicsSinkTestBase::PostKickOffTestL(TInt aTimerId)
|
|
1179 |
{
|
|
1180 |
if (aTimerId == 1)
|
|
1181 |
{
|
|
1182 |
iTestTimedOut = ETrue;
|
|
1183 |
return KErrNone;
|
|
1184 |
}
|
|
1185 |
else
|
|
1186 |
{
|
|
1187 |
if (iPreviousState == OMX_StatePause && (TestStepName() == (_L("MMVIDEO-OMX-GS-007-01-HP")) ||
|
|
1188 |
TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP"))))
|
|
1189 |
{
|
|
1190 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1191 |
return KErrNone;
|
|
1192 |
}
|
|
1193 |
else
|
|
1194 |
{
|
|
1195 |
if (iPreviousState == OMX_StatePause && (TestStepName() == (_L("MMVIDEO-OMX-GS-007-02-HP")) ||
|
|
1196 |
TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP"))))
|
|
1197 |
{
|
|
1198 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
1199 |
return KErrNone;
|
|
1200 |
}
|
|
1201 |
}
|
|
1202 |
}
|
|
1203 |
return KErrNone;
|
|
1204 |
}
|
|
1205 |
|
|
1206 |
void CGraphicsSinkTestBase::ErrorEventTask_001(OMX_ERRORTYPE aOmxError)
|
|
1207 |
{
|
|
1208 |
// INFO_PRINTF2(_L("GSTest001: EventError iteration: %d"), iTestIteration);
|
|
1209 |
if (iTestIteration == 0)
|
|
1210 |
{
|
|
1211 |
if (aOmxError == OMX_ErrorIncorrectStateTransition)
|
|
1212 |
{
|
|
1213 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateLoaded);
|
|
1214 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StatePause,0,OMX_ErrorNone);
|
|
1215 |
}
|
|
1216 |
else
|
|
1217 |
{
|
|
1218 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::ErrorEventTask_001: Invoked incorrect error event"));
|
|
1219 |
CActiveScheduler::Stop();
|
|
1220 |
return SetTestStepError(KErrGeneral);
|
|
1221 |
}
|
|
1222 |
}
|
|
1223 |
if (iTestIteration == 1)
|
|
1224 |
{
|
|
1225 |
if (aOmxError == OMX_ErrorIncorrectStateTransition)
|
|
1226 |
{
|
|
1227 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateLoaded);
|
|
1228 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0,OMX_ErrorNone);
|
|
1229 |
}
|
|
1230 |
else
|
|
1231 |
{
|
|
1232 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::ErrorEventTask_001: Invoked incorrect error event"));
|
|
1233 |
CActiveScheduler::Stop();
|
|
1234 |
return SetTestStepError(KErrGeneral);
|
|
1235 |
}
|
|
1236 |
}
|
|
1237 |
if (iTestIteration == 2)
|
|
1238 |
{
|
|
1239 |
if (aOmxError == OMX_ErrorSameState)
|
|
1240 |
{
|
|
1241 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateLoaded);
|
|
1242 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateInvalid,0,OMX_ErrorNone);
|
|
1243 |
}
|
|
1244 |
else
|
|
1245 |
{
|
|
1246 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::ErrorEventTask_001: Invoked incorrect error event"));
|
|
1247 |
CActiveScheduler::Stop();
|
|
1248 |
return SetTestStepError(KErrGeneral);
|
|
1249 |
}
|
|
1250 |
}
|
|
1251 |
if (iTestIteration == 3)
|
|
1252 |
{
|
|
1253 |
if (iExecutingToIdle == EFalse && aOmxError == OMX_ErrorInvalidState)
|
|
1254 |
{
|
|
1255 |
// INFO_PRINTF1(_L("CGraphicsSinkTestBase::ErrorEventTask_001: Invoked correct error event"));
|
|
1256 |
CActiveScheduler::Stop();
|
|
1257 |
return SetTestStepResult(EPass);
|
|
1258 |
}
|
|
1259 |
else
|
|
1260 |
{
|
|
1261 |
ERR_PRINTF1(_L("CGraphicsSinkTestBase::ErrorEventTask_001: Invoked incorrect error event"));
|
|
1262 |
CActiveScheduler::Stop();
|
|
1263 |
return SetTestStepResult(EPass);
|
|
1264 |
}
|
|
1265 |
}
|
|
1266 |
iTestIteration++;
|
|
1267 |
}
|
|
1268 |
|
|
1269 |
|
|
1270 |
void CGraphicsSinkTestBase::LoadedStateTask_002()
|
|
1271 |
{
|
|
1272 |
iPreviousState = OMX_StateLoaded;
|
|
1273 |
// INFO_PRINTF2(_L("GSTest002: Test complete iteration: %d"), iTestIteration);
|
|
1274 |
iTestIteration++;
|
|
1275 |
|
|
1276 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-002-01-HP")))
|
|
1277 |
{
|
|
1278 |
if (iTestIteration == 1)
|
|
1279 |
{
|
|
1280 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_002: __MM_HEAP_MARK"));
|
|
1281 |
__UHEAP_MARK;
|
|
1282 |
}
|
|
1283 |
else
|
|
1284 |
{
|
|
1285 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_002: __MM_HEAP_MARKEND"));
|
|
1286 |
__UHEAP_MARKEND;
|
|
1287 |
iTestTimedOut = ETrue;
|
|
1288 |
}
|
|
1289 |
}
|
|
1290 |
|
|
1291 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-002-03-HP")))
|
|
1292 |
{
|
|
1293 |
// Only increase the buffer count every 5 times
|
|
1294 |
iOmxParamPortInput.nBufferCountActual = iOmxParamPortInput.nBufferCountMin + iTestIteration/5;
|
|
1295 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::LoadedStateTask_002: Setting nBufferCountActual: %d"), iOmxParamPortInput.nBufferCountActual);
|
|
1296 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1297 |
}
|
|
1298 |
|
|
1299 |
if(iTestIteration < KMaxTestIterations && !iTestTimedOut)
|
|
1300 |
{
|
|
1301 |
AllocateBufferTask();
|
|
1302 |
}
|
|
1303 |
else
|
|
1304 |
{
|
|
1305 |
CActiveScheduler::Stop();
|
|
1306 |
return SetTestStepResult(EPass);
|
|
1307 |
}
|
|
1308 |
}
|
|
1309 |
|
|
1310 |
void CGraphicsSinkTestBase::IdleStateTask_002()
|
|
1311 |
{
|
|
1312 |
iPreviousState = OMX_StateIdle;
|
|
1313 |
FreeBufferTask(&iInputBufferHeaders,0);
|
|
1314 |
}
|
|
1315 |
|
|
1316 |
void CGraphicsSinkTestBase::LoadedStateTask_003()
|
|
1317 |
{
|
|
1318 |
iPreviousState = OMX_StateLoaded;
|
|
1319 |
// INFO_PRINTF2(_L("GSTest003: Test complete iteration: %d"), iTestIteration);
|
|
1320 |
iTestIteration++;
|
|
1321 |
|
|
1322 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-003-01-HP")))
|
|
1323 |
{
|
|
1324 |
if (iTestIteration == 1)
|
|
1325 |
{
|
|
1326 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_003: __MM_HEAP_MARK"));
|
|
1327 |
__UHEAP_MARK;
|
|
1328 |
}
|
|
1329 |
else
|
|
1330 |
{
|
|
1331 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_003: __MM_HEAP_MARKEND"));
|
|
1332 |
DeleteCCameraBuf();
|
|
1333 |
__UHEAP_MARKEND;
|
|
1334 |
iTestTimedOut = ETrue;
|
|
1335 |
}
|
|
1336 |
}
|
|
1337 |
|
|
1338 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-003-03-HP")))
|
|
1339 |
{
|
|
1340 |
// Only increase the buffer count every 5 times
|
|
1341 |
iOmxParamPortInput.nBufferCountActual = iOmxParamPortInput.nBufferCountMin + iTestIteration/5;
|
|
1342 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::LoadedStateTask_003: Setting nBufferCountActual: %d"), iOmxParamPortOutput.nBufferCountActual);
|
|
1343 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1344 |
}
|
|
1345 |
|
|
1346 |
if(!iTestTimedOut)
|
|
1347 |
{
|
|
1348 |
DeleteCCameraBuf();
|
|
1349 |
AllocateCCameraBuf();
|
|
1350 |
UseBufferTask();
|
|
1351 |
}
|
|
1352 |
else
|
|
1353 |
{
|
|
1354 |
CActiveScheduler::Stop();
|
|
1355 |
return SetTestStepResult(EPass);
|
|
1356 |
}
|
|
1357 |
}
|
|
1358 |
|
|
1359 |
void CGraphicsSinkTestBase::IdleStateTask_003()
|
|
1360 |
{
|
|
1361 |
iPreviousState = OMX_StateIdle;
|
|
1362 |
FreeBufferTask(&iOutputBufferHeaders,0);
|
|
1363 |
}
|
|
1364 |
|
|
1365 |
void CGraphicsSinkTestBase::LoadedStateTask_004()
|
|
1366 |
{
|
|
1367 |
// INFO_PRINTF2(_L("GSTest004: Test complete iteration: %d"), iTestIteration);
|
|
1368 |
iTestIteration++;
|
|
1369 |
|
|
1370 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateLoaded);
|
|
1371 |
iPreviousState = OMX_StateLoaded;
|
|
1372 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-004-01-HP")))
|
|
1373 |
{
|
|
1374 |
if (iTestIteration == 1)
|
|
1375 |
{
|
|
1376 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_004: __MM_HEAP_MARK"));
|
|
1377 |
__UHEAP_MARK;
|
|
1378 |
}
|
|
1379 |
else
|
|
1380 |
{
|
|
1381 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_004: __MM_HEAP_MARKEND"));
|
|
1382 |
__UHEAP_MARKEND;
|
|
1383 |
iTestTimedOut = ETrue;
|
|
1384 |
}
|
|
1385 |
}
|
|
1386 |
|
|
1387 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-004-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-05-HP")))
|
|
1388 |
{
|
|
1389 |
iOmxParamPortInput.nBufferCountActual = 5 + iTestIteration/5;
|
|
1390 |
INFO_PRINTF2(_L("CGraphicsSinkTestBase::LoadedStateTask_004: Setting nBufferCountActual: %d"), iOmxParamPortInput.nBufferCountActual);
|
|
1391 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1392 |
}
|
|
1393 |
|
|
1394 |
if(iTestIteration < KMaxTestIterations && !iTestTimedOut)
|
|
1395 |
{
|
|
1396 |
AllocateBufferTask();
|
|
1397 |
}
|
|
1398 |
else
|
|
1399 |
{
|
|
1400 |
CActiveScheduler::Stop();
|
|
1401 |
return SetTestStepResult(EPass);
|
|
1402 |
}
|
|
1403 |
}
|
|
1404 |
|
|
1405 |
void CGraphicsSinkTestBase::IdleStateTask_004()
|
|
1406 |
{
|
|
1407 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateIdle);
|
|
1408 |
if(iPreviousState == OMX_StateLoaded)
|
|
1409 |
{
|
|
1410 |
iPreviousState = OMX_StateIdle;
|
|
1411 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1412 |
}
|
|
1413 |
else if(iPreviousState == OMX_StateExecuting)
|
|
1414 |
{
|
|
1415 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::IdleStateTask_004: Executing to Idle task Count %d"),iExecuteToIdleCount);
|
|
1416 |
iExecuteToIdleCount++;
|
|
1417 |
iPreviousState = OMX_StateIdle;
|
|
1418 |
|
|
1419 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-004-01-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-02-HP"))
|
|
1420 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-03-HP")))
|
|
1421 |
{
|
|
1422 |
FreeBufferTask(&iInputBufferHeaders,0);
|
|
1423 |
}
|
|
1424 |
|
|
1425 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-004-04-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-004-05-HP"))
|
|
1426 |
|| TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
1427 |
{
|
|
1428 |
if (iExecuteToIdleCount < 20)
|
|
1429 |
{
|
|
1430 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1431 |
}
|
|
1432 |
else
|
|
1433 |
{
|
|
1434 |
FreeBufferTask(&iInputBufferHeaders,0);
|
|
1435 |
}
|
|
1436 |
}
|
|
1437 |
}
|
|
1438 |
}
|
|
1439 |
|
|
1440 |
void CGraphicsSinkTestBase::ExecutingStateTask_004()
|
|
1441 |
{
|
|
1442 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateExecuting);
|
|
1443 |
iPreviousState = OMX_StateExecuting;
|
|
1444 |
|
|
1445 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-004-06-HP")))
|
|
1446 |
{
|
|
1447 |
iExecuteToIdleCount = 20;
|
|
1448 |
iTestTimedOut = ETrue;
|
|
1449 |
EmptyThisBufferTask();
|
|
1450 |
}
|
|
1451 |
else
|
|
1452 |
{
|
|
1453 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle, 0);
|
|
1454 |
}
|
|
1455 |
}
|
|
1456 |
|
|
1457 |
void CGraphicsSinkTestBase::LoadedStateTask_005()
|
|
1458 |
{
|
|
1459 |
// INFO_PRINTF2(_L("GSTest005: Test complete iteration: %d"), iTestIteration);
|
|
1460 |
iTestIteration++;
|
|
1461 |
|
|
1462 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateLoaded);
|
|
1463 |
iPreviousState = OMX_StateLoaded;
|
|
1464 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-005-01-HP")))
|
|
1465 |
{
|
|
1466 |
if (iTestIteration == 1)
|
|
1467 |
{
|
|
1468 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_005: __MM_HEAP_MARK"));
|
|
1469 |
__UHEAP_MARK;
|
|
1470 |
}
|
|
1471 |
else
|
|
1472 |
{
|
|
1473 |
INFO_PRINTF1(_L("CGraphicsSinkTestBase::LoadedStateTask_005: __MM_HEAP_MARKEND"));
|
|
1474 |
__UHEAP_MARKEND;
|
|
1475 |
iTestTimedOut = ETrue;
|
|
1476 |
}
|
|
1477 |
}
|
|
1478 |
|
|
1479 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-005-03-HP")))
|
|
1480 |
{
|
|
1481 |
iOmxParamPortInput.nBufferCountActual = Min(5 + iTestIteration, 100); // let's cap the amount of buffers :-)
|
|
1482 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::LoadedStateTask_005: Setting nBufferCountActual: %d"), iOmxParamPortInput.nBufferCountActual);
|
|
1483 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1484 |
}
|
|
1485 |
|
|
1486 |
if(iTestIteration < KMaxTestIterations && !iTestTimedOut)
|
|
1487 |
{
|
|
1488 |
AllocateBufferTask();
|
|
1489 |
}
|
|
1490 |
else
|
|
1491 |
{
|
|
1492 |
|
|
1493 |
CActiveScheduler::Stop();
|
|
1494 |
return SetTestStepResult(EPass);
|
|
1495 |
}
|
|
1496 |
}
|
|
1497 |
|
|
1498 |
void CGraphicsSinkTestBase::IdleStateTask_005()
|
|
1499 |
{
|
|
1500 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateIdle);
|
|
1501 |
if(iPreviousState == OMX_StateLoaded)
|
|
1502 |
{
|
|
1503 |
iPreviousState = OMX_StateIdle;
|
|
1504 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1505 |
}
|
|
1506 |
if(iPreviousState == OMX_StateExecuting)
|
|
1507 |
{
|
|
1508 |
iPreviousState = OMX_StateIdle;
|
|
1509 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-005-04-HP")) && !iTestTimedOut)
|
|
1510 |
{
|
|
1511 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::IdleStateTask_005: Test complete iteration: %d"), iTestIteration);
|
|
1512 |
iTestIteration++;
|
|
1513 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1514 |
}
|
|
1515 |
else
|
|
1516 |
{
|
|
1517 |
FreeBufferTask(&iInputBufferHeaders,0);
|
|
1518 |
}
|
|
1519 |
}
|
|
1520 |
}
|
|
1521 |
|
|
1522 |
void CGraphicsSinkTestBase::ExecutingStateTask_005()
|
|
1523 |
{
|
|
1524 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateExecuting);
|
|
1525 |
iPreviousState = OMX_StateExecuting;
|
|
1526 |
EmptyThisBufferTask();
|
|
1527 |
}
|
|
1528 |
|
|
1529 |
void CGraphicsSinkTestBase::LoadedStateTask_006()
|
|
1530 |
{
|
|
1531 |
// INFO_PRINTF2(_L("GSTest006: Test complete iteration: %d"), iTestIteration);
|
|
1532 |
iTestIteration++;
|
|
1533 |
|
|
1534 |
iPreviousState = OMX_StateLoaded;
|
|
1535 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-006-01-HP")) && !iTestTimedOut)
|
|
1536 |
{
|
|
1537 |
iOmxParamPortInput.nBufferCountActual = iOmxParamPortInput.nBufferCountActual + 1;
|
|
1538 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1539 |
AllocateBufferTaskStress();
|
|
1540 |
}
|
|
1541 |
else
|
|
1542 |
{
|
|
1543 |
CActiveScheduler::Stop();
|
|
1544 |
return SetTestStepResult(EPass);
|
|
1545 |
}
|
|
1546 |
}
|
|
1547 |
|
|
1548 |
void CGraphicsSinkTestBase::IdleStateTask_006()
|
|
1549 |
{
|
|
1550 |
iPreviousState = OMX_StateIdle;
|
|
1551 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-006-01-HP")))
|
|
1552 |
{
|
|
1553 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1554 |
|
|
1555 |
FreeBuffer(iGraphicSinkCompHandle,0,iInputBufferHeaders);
|
|
1556 |
iInputBufferHeaders.Reset();
|
|
1557 |
}
|
|
1558 |
if(TestStepName() == (_L("MMVIDEO-OMX-GS-006-02-HP")))
|
|
1559 |
{
|
|
1560 |
// Allocate to many buffers
|
|
1561 |
TInt bytesperpixel = COmxILMMBuffer::BytesPerPixel(iOmxParamPortInput.format.video.eColorFormat);
|
|
1562 |
TInt size = bytesperpixel * iOmxParamPortInput.format.video.nFrameWidth * iOmxParamPortInput.format.video.nFrameHeight;
|
|
1563 |
|
|
1564 |
iOmxErrorType = iGraphicSinkCompHandle->AllocateBuffer(iGraphicSinkCompHandle,&iInputBufferHeader,0,NULL,size);
|
|
1565 |
if (OMX_ErrorIncorrectStateOperation != iOmxErrorType)
|
|
1566 |
{
|
|
1567 |
ERR_PRINTF1(_L("AllocateBuffer failed to return error"));
|
|
1568 |
CActiveScheduler::Stop();
|
|
1569 |
return SetTestStepError(PrintOmxError(iOmxErrorType));
|
|
1570 |
}
|
|
1571 |
|
|
1572 |
// Confirm state remains OMX_StateIdle
|
|
1573 |
GetState(iGraphicSinkCompHandle,&iOmxStateType,OMX_StateIdle);
|
|
1574 |
|
|
1575 |
// FreeBuffer without calling SendCommand to OMX_StateLoaded
|
|
1576 |
FreeBuffer(iGraphicSinkCompHandle, 0, iInputBufferHeaders);
|
|
1577 |
iInputBufferHeaders.Reset();
|
|
1578 |
}
|
|
1579 |
}
|
|
1580 |
|
|
1581 |
void CGraphicsSinkTestBase::LoadedStateTask_007()
|
|
1582 |
{
|
|
1583 |
switch (iPreviousState)
|
|
1584 |
{
|
|
1585 |
case OMX_StateIdle:
|
|
1586 |
{
|
|
1587 |
iPreviousState = OMX_StateLoaded;
|
|
1588 |
CActiveScheduler::Stop();
|
|
1589 |
return SetTestStepResult(EPass);
|
|
1590 |
}
|
|
1591 |
case OMX_StateWaitForResources:
|
|
1592 |
{
|
|
1593 |
// State is OMX_StateIdle from OMX_StateWaitForResources
|
|
1594 |
break;
|
|
1595 |
}
|
|
1596 |
}
|
|
1597 |
}
|
|
1598 |
|
|
1599 |
void CGraphicsSinkTestBase::IdleStateTask_007()
|
|
1600 |
{
|
|
1601 |
switch (iPreviousState)
|
|
1602 |
{
|
|
1603 |
case OMX_StateLoaded:
|
|
1604 |
{
|
|
1605 |
iPreviousState = OMX_StateIdle;
|
|
1606 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) || TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP")))
|
|
1607 |
{
|
|
1608 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StatePause,0);
|
|
1609 |
}
|
|
1610 |
else
|
|
1611 |
{
|
|
1612 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1613 |
}
|
|
1614 |
break;
|
|
1615 |
}
|
|
1616 |
case OMX_StateExecuting:
|
|
1617 |
{
|
|
1618 |
iPreviousState = OMX_StateIdle;
|
|
1619 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) && !iTestTimedOut)
|
|
1620 |
{
|
|
1621 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StatePause,0);
|
|
1622 |
}
|
|
1623 |
else
|
|
1624 |
{
|
|
1625 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::IdleStateTask_007:: Executing to Idle task Count %d"),iExecuteToIdleCount);
|
|
1626 |
iExecuteToIdleCount++;
|
|
1627 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1628 |
|
|
1629 |
FreeBuffer(iGraphicSinkCompHandle,0,iInputBufferHeaders);
|
|
1630 |
iInputBufferHeaders.Reset();
|
|
1631 |
}
|
|
1632 |
break;
|
|
1633 |
}
|
|
1634 |
case OMX_StatePause:
|
|
1635 |
{
|
|
1636 |
iPreviousState = OMX_StateIdle;
|
|
1637 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-007-04-HP")) && !iTestTimedOut)
|
|
1638 |
{
|
|
1639 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StatePause,0);
|
|
1640 |
}
|
|
1641 |
else
|
|
1642 |
{
|
|
1643 |
if (iTestTimedOut)
|
|
1644 |
{
|
|
1645 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::IdleStateTask_007:: Executing to Idle task Count %d"),iExecuteToIdleCount);
|
|
1646 |
iExecuteToIdleCount++;
|
|
1647 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1648 |
|
|
1649 |
FreeBuffer(iGraphicSinkCompHandle,0,iInputBufferHeaders);
|
|
1650 |
iInputBufferHeaders.Reset();
|
|
1651 |
}
|
|
1652 |
else
|
|
1653 |
{
|
|
1654 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1655 |
}
|
|
1656 |
}
|
|
1657 |
}
|
|
1658 |
}
|
|
1659 |
}
|
|
1660 |
|
|
1661 |
void CGraphicsSinkTestBase::PauseStateTask_007()
|
|
1662 |
{
|
|
1663 |
iPreviousState = OMX_StatePause;
|
|
1664 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::PauseStateTask_007:: Pause state task count %d"),iPauseStateCount);
|
|
1665 |
if(++iPauseStateCount == 5)
|
|
1666 |
{
|
|
1667 |
iTestTimedOut = ETrue;
|
|
1668 |
}
|
|
1669 |
|
|
1670 |
if(iTestShutdown)
|
|
1671 |
{
|
|
1672 |
delete iTestShutdown;
|
|
1673 |
}
|
|
1674 |
|
|
1675 |
TRAPD(err, iTestShutdown = COmxGsTestShutdown::NewL(this,2));
|
|
1676 |
if(err)
|
|
1677 |
{
|
|
1678 |
ERR_PRINTF1(_L("OOM ERROR"));
|
|
1679 |
CActiveScheduler::Stop();
|
|
1680 |
return SetTestStepError(err);
|
|
1681 |
}
|
|
1682 |
iInterval = KTSU_OMX_GS_PAUSE;
|
|
1683 |
iTestShutdown->Start(iInterval,KErrGeneral, EPass);
|
|
1684 |
}
|
|
1685 |
|
|
1686 |
void CGraphicsSinkTestBase::ExecutingStateTask_007()
|
|
1687 |
{
|
|
1688 |
iPreviousState = OMX_StateExecuting;
|
|
1689 |
// INFO_PRINTF2(_L("CGraphicsSinkTestBase::ExecutingStateTask_007 Idle to Executing task Count %d"),iIdleToExecuteCount);
|
|
1690 |
iIdleToExecuteCount++;
|
|
1691 |
|
|
1692 |
if (TestStepName() == (_L("MMVIDEO-OMX-GS-007-03-HP")) || iTestTimedOut)
|
|
1693 |
{
|
|
1694 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
1695 |
}
|
|
1696 |
else
|
|
1697 |
{
|
|
1698 |
EmptyThisBufferTask();
|
|
1699 |
}
|
|
1700 |
}
|
|
1701 |
|
|
1702 |
void CGraphicsSinkTestBase::StartStateTransitionTask()
|
|
1703 |
{
|
|
1704 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateLoaded);
|
|
1705 |
iGphxPrevState = iState;
|
|
1706 |
|
|
1707 |
if (iTestStep == 4)
|
|
1708 |
{
|
|
1709 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateWaitForResources,0);
|
|
1710 |
}
|
|
1711 |
else
|
|
1712 |
{
|
|
1713 |
AllocateBufferTask();
|
|
1714 |
}
|
|
1715 |
}
|
|
1716 |
|
|
1717 |
void CGraphicsSinkTestBase::WaitForResourcesTransitionTask()
|
|
1718 |
{
|
|
1719 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateWaitForResources);
|
|
1720 |
iGphxPrevState = iState;
|
|
1721 |
|
|
1722 |
if (iTestStep == 4)
|
|
1723 |
{
|
|
1724 |
iWaitForResources = ETrue;
|
|
1725 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateLoaded,0);
|
|
1726 |
}
|
|
1727 |
}
|
|
1728 |
|
|
1729 |
void CGraphicsSinkTestBase::LoadedStateTransitionTask()
|
|
1730 |
{
|
|
1731 |
//INFO_PRINTF3(_L("GSTest00%d: Test complete iteration: %d"), iTestCase, iTestIteration);
|
|
1732 |
iTestIteration++;
|
|
1733 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateLoaded);
|
|
1734 |
|
|
1735 |
iGphxPrevState = iState;
|
|
1736 |
if(iTestStep == 1)
|
|
1737 |
{
|
|
1738 |
if (iTestIteration == 1)
|
|
1739 |
{
|
|
1740 |
INFO_PRINTF3(_L("LoadedStateTransitionTask_00%d_0%d: __MM_HEAP_MARK"), iTestCase,iTestStep);
|
|
1741 |
__UHEAP_MARK;
|
|
1742 |
}
|
|
1743 |
else
|
|
1744 |
{
|
|
1745 |
INFO_PRINTF3(_L("LoadedStateTransitionTask_00%d_0%d: __MM_HEAP_MARKEND"), iTestCase,iTestStep);
|
|
1746 |
__UHEAP_MARKEND;
|
|
1747 |
iTestTimedOut = ETrue;
|
|
1748 |
}
|
|
1749 |
}
|
|
1750 |
|
|
1751 |
if(iTestStep == 3)
|
|
1752 |
{
|
|
1753 |
if ((iOmxParamPortInput.nBufferCountMin + iTestIteration/10) <= MAXNUMOFBUFFERS)
|
|
1754 |
{
|
|
1755 |
iOmxParamPortInput.nBufferCountActual = iOmxParamPortInput.nBufferCountMin + iTestIteration/10;
|
|
1756 |
//INFO_PRINTF3(_L("GSTest00%d: Setting INPUT nBufferCountActual: %d"),iTestCase,iOmxParamPortInput.nBufferCountActual);
|
|
1757 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1758 |
}
|
|
1759 |
}
|
|
1760 |
|
|
1761 |
if(iTestIteration < KMaxTestIterations && !iTestTimedOut)
|
|
1762 |
{
|
|
1763 |
if (iTestStep == 4 && iWaitForResources)
|
|
1764 |
{
|
|
1765 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateWaitForResources,0);
|
|
1766 |
}
|
|
1767 |
else
|
|
1768 |
{
|
|
1769 |
iWaitForResources = EFalse;
|
|
1770 |
AllocateBufferTask();
|
|
1771 |
}
|
|
1772 |
}
|
|
1773 |
else
|
|
1774 |
{
|
|
1775 |
CActiveScheduler::Stop();
|
|
1776 |
}
|
|
1777 |
}
|
|
1778 |
|
|
1779 |
void CGraphicsSinkTestBase::IdleStateTransitionTask()
|
|
1780 |
{
|
|
1781 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateIdle);
|
|
1782 |
if(iGphxPrevState == OMX_StateLoaded)
|
|
1783 |
{
|
|
1784 |
iGphxPrevState = iState;
|
|
1785 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1786 |
}
|
|
1787 |
else if(iGphxPrevState == OMX_StateExecuting)
|
|
1788 |
{
|
|
1789 |
iGphxPrevState = iState;
|
|
1790 |
FreeBufferTaskAlt(iInputBufferHeaders,0);
|
|
1791 |
iInputBufferHeaders.Reset();
|
|
1792 |
}
|
|
1793 |
}
|
|
1794 |
|
|
1795 |
void CGraphicsSinkTestBase::ExecutingStateTransitionTask()
|
|
1796 |
{
|
|
1797 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateExecuting);
|
|
1798 |
iGphxPrevState = iState;
|
|
1799 |
|
|
1800 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
1801 |
}
|
|
1802 |
|
|
1803 |
void CGraphicsSinkTestBase::StartBufferDoneTask()
|
|
1804 |
{
|
|
1805 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateLoaded);
|
|
1806 |
iGphxPrevState = iState;
|
|
1807 |
|
|
1808 |
AllocateBufferTask();
|
|
1809 |
}
|
|
1810 |
|
|
1811 |
void CGraphicsSinkTestBase::LoadedStateBufferTask()
|
|
1812 |
{
|
|
1813 |
// INFO_PRINTF3(_L("GSTest00%d: Test complete iteration: %d"), iTestCase, iTestIteration);
|
|
1814 |
iTestIteration++;
|
|
1815 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateLoaded);
|
|
1816 |
iGphxPrevState = iState;
|
|
1817 |
if(iTestStep == 1 || iTestStep == 5|| iTestStep == 6)
|
|
1818 |
{
|
|
1819 |
if (iTestIteration == 1)
|
|
1820 |
{
|
|
1821 |
INFO_PRINTF3(_L("LoadedStateTransitionTask_00%d_0%d: __MM_HEAP_MARK"), iTestCase,iTestStep);
|
|
1822 |
__UHEAP_MARK;
|
|
1823 |
}
|
|
1824 |
else
|
|
1825 |
{
|
|
1826 |
INFO_PRINTF3(_L("LoadedStateTransitionTask_00%d_0%d: __MM_HEAP_MARKEND"), iTestCase,iTestStep);
|
|
1827 |
__UHEAP_MARKEND;
|
|
1828 |
iTestTimedOut = ETrue;
|
|
1829 |
}
|
|
1830 |
}
|
|
1831 |
|
|
1832 |
if(iTestStep == 3)
|
|
1833 |
{
|
|
1834 |
OMX_U32 setbuffercount = iOmxParamPortInput.nBufferCountMin + iTestIteration/10;
|
|
1835 |
if (setbuffercount <= MAXNUMOFBUFFERS && setbuffercount != iOmxParamPortInput.nBufferCountActual)
|
|
1836 |
{
|
|
1837 |
iOmxParamPortInput.nBufferCountActual = iOmxParamPortInput.nBufferCountMin + iTestIteration/10;
|
|
1838 |
iDoEmptyBufferDoneLimit = iOmxParamPortInput.nBufferCountActual;
|
|
1839 |
INFO_PRINTF4(_L("GSTest00%d: Setting INPUT nBufferCountActual: %d DoEmptyBufferDoneLimit: %d")
|
|
1840 |
,iTestCase,iOmxParamPortInput.nBufferCountActual,iDoEmptyBufferDoneLimit);
|
|
1841 |
SetParameter(iGraphicSinkCompHandle,OMX_IndexParamPortDefinition,&iOmxParamPortInput);
|
|
1842 |
}
|
|
1843 |
}
|
|
1844 |
|
|
1845 |
if(iTestIteration < KMaxTestIterations && !iTestTimedOut)
|
|
1846 |
{
|
|
1847 |
iWaitForResources = EFalse;
|
|
1848 |
AllocateBufferTask();
|
|
1849 |
}
|
|
1850 |
else
|
|
1851 |
{
|
|
1852 |
CActiveScheduler::Stop(); // End the test
|
|
1853 |
}
|
|
1854 |
}
|
|
1855 |
|
|
1856 |
void CGraphicsSinkTestBase::IdleStateBufferTask()
|
|
1857 |
{
|
|
1858 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateIdle);
|
|
1859 |
if(iGphxPrevState == OMX_StateLoaded)
|
|
1860 |
{
|
|
1861 |
iGphxPrevState = iState;
|
|
1862 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateExecuting,0);
|
|
1863 |
}
|
|
1864 |
else if(iGphxPrevState == OMX_StateExecuting)
|
|
1865 |
{
|
|
1866 |
iGphxPrevState = iState;
|
|
1867 |
FreeBufferTaskAlt(iInputBufferHeaders,0);
|
|
1868 |
iInputBufferHeaders.Reset();
|
|
1869 |
}
|
|
1870 |
}
|
|
1871 |
|
|
1872 |
void CGraphicsSinkTestBase::ExecutingStateBufferTask()
|
|
1873 |
{
|
|
1874 |
GetState(iGraphicSinkCompHandle,&iState,OMX_StateExecuting);
|
|
1875 |
iGphxPrevState = iState;
|
|
1876 |
|
|
1877 |
EmptyThisBufferTask();
|
|
1878 |
if (iTestStep == 5)
|
|
1879 |
{
|
|
1880 |
SendCommand(iGraphicSinkCompHandle,OMX_CommandStateSet,OMX_StateIdle,0);
|
|
1881 |
}
|
|
1882 |
}
|