omxilvideocomps/omxilgraphicsink/tsrc/src/omxilgraphicsinktestbase.h
author hgs
Fri, 08 Oct 2010 22:09:17 +0100
changeset 0 5d29cba61097
permissions -rw-r--r--
2010wk38_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     1
/*
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     3
* All rights reserved.
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     8
*
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    11
*
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    12
* Contributors:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    13
*
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    14
* Description: 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    15
*
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    16
*/
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    17
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    18
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    19
/**
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    20
 * @file 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    21
 * @internalTechnology
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    22
 */
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    23
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    24
#ifndef OMXILGRAPHICSINKTESTBASE_H
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    25
#define OMXILGRAPHICSINKTESTBASE_H
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    26
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    27
#include <test/testexecutestepbase.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    28
#include <e32msgqueue.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    29
#include <openmax/il/khronos/v1_x/OMX_Core.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    30
#include <graphics/surfacemanager.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    31
#include <graphics/surfaceupdateclient.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    32
#include <w32std.h>
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    33
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    34
#include "omxilmmbuffer.h"
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    35
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    36
const TInt KTSU_OMX_GS_Interval = 0x0500000;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    37
const TInt KTSU_OMX_GS_Pause_Interval = 0x0100000;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    38
const TInt KTSU_OMX_GS_Pause_Wait = 2000000;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    39
const TInt KTSU_OMX_GS_Pause_Video = 0x0050000;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    40
const TInt KTSU_OMX_GS_State_Transition_Interval = 2000000; // 2 Seconds
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    41
const TInt KTSU_OMX_GS_CALLBACK = 1000000 ;// 2 second timer for test shutdown
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    42
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    43
const TInt KMaxLenStateTransitionName = 126;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    44
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    45
const TInt KCameraVFPortIndex = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    46
const TInt KCameraVCPortIndex = 1;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    47
const TInt KCameraICPortIndex = 2;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    48
const TInt KCameraClockPortIndex = 3;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    49
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    50
_LIT(KMMTestCase, "RTestCase");
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    51
_LIT(KMMTestStep, "RTestStep");
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    52
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    53
// Forward declarations
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    54
struct OMX_COMPONENTTYPE;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    55
class COmxGsTestStateTransition;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    56
class COmxGsTestBase;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    57
class COmxGsTestShutdown;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    58
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    59
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    60
/**
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    61
 * OpenMAX call back handler used in the test code.
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    62
 */
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    63
class CCallbackHandler : public CActive
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    64
	{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    65
public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    66
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    67
	enum TMessageType
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    68
		{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    69
		EFillBufferCallback,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    70
		EEmptyBufferCallback,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    71
		EEventCallback
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    72
		};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    73
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    74
	class TEventParams
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    75
		{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    76
	public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    77
		OMX_EVENTTYPE iEvent;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    78
		TUint iData1;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    79
		TUint iData2;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    80
		TAny* iExtra;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    81
		};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    82
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    83
	class TOmxMessage
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    84
		{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    85
	public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    86
		TMessageType iType;   
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    87
		OMX_HANDLETYPE iComponent;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    88
		union
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    89
			{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    90
			TAny* iBuffer;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    91
			TEventParams iEventParams;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    92
			};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    93
		};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    94
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    95
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    96
	static const TInt KMaxMsgQueueEntries = 10;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    97
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    98
public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
    99
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   100
	static CCallbackHandler* NewL(COmxGsTestBase& aCameraSourceTest);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   101
	virtual ~CCallbackHandler();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   102
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   103
	operator OMX_CALLBACKTYPE*();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   104
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   105
	void RunL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   106
	void DoCancel();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   107
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   108
	static OMX_ERRORTYPE FillBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   109
										TAny* aAppData,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   110
										OMX_BUFFERHEADERTYPE* aBuffer);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   111
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   112
 	static OMX_ERRORTYPE EmptyBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   113
										 TAny* aAppData,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   114
										 OMX_BUFFERHEADERTYPE* aBuffer);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   115
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   116
	static OMX_ERRORTYPE EventHandler(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   117
									  TAny* aAppData,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   118
									  OMX_EVENTTYPE aEvent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   119
									  TUint32 aData1,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   120
									  TUint32 aData2,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   121
									  TAny* aExtra);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   122
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   123
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   124
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   125
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   126
	OMX_ERRORTYPE DoEventHandler(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   127
								 TEventParams aParams);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   128
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   129
	OMX_ERRORTYPE DoFillBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   130
								  OMX_BUFFERHEADERTYPE* aBufferHeader);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   131
								  
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   132
	OMX_ERRORTYPE DoEmptyBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   133
								   OMX_BUFFERHEADERTYPE* aBufferHeader);								 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   134
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   135
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   136
	void ConstructL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   137
	CCallbackHandler(COmxGsTestBase& aCameraSourceTest);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   138
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   139
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   140
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   141
	COmxGsTestBase& iCameraSourceTest;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   142
	RMsgQueue<TOmxMessage> iMsgQueue;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   143
	OMX_CALLBACKTYPE iHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   144
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   145
	};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   146
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   147
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   148
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   149
class COmxGsTestBase : public CTestStep
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   150
	{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   151
	friend class COmxGsTestShutdown;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   152
	friend class COmxGsTestStateTransition;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   153
public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   154
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   155
	COmxGsTestBase();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   156
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   157
	~COmxGsTestBase();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   158
	TVerdict doTestStepPreambleL(); 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   159
	TVerdict doTestStepPostambleL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   160
	virtual TVerdict doTestStepL() = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   161
	virtual void CloseTestStep() = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   162
	void CloseTest();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   163
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   164
	void InfoPrint1(const TDesC& aPrint);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   165
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   166
	virtual void DoFillBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   167
								  OMX_BUFFERHEADERTYPE* aBufferHeader) = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   168
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   169
	virtual void DoEmptyBufferDone(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   170
								   OMX_BUFFERHEADERTYPE* aBufferHeader) = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   171
   
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   172
	virtual void DoEventHandler(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   173
								OMX_EVENTTYPE aEvent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   174
								TUint aData1,	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   175
								TUint aData2,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   176
								TAny* aExtra) = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   177
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   178
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   179
	static OMX_ERRORTYPE ConvertSymbianErrorType(TInt aError);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   180
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   181
protected:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   182
	void PrintOmxState(OMX_STATETYPE aOmxState);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   183
	TInt PrintOmxError(OMX_ERRORTYPE aOmxError);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   184
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   185
	virtual void InitialiseOmxComponents();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   186
	virtual void InitialiseTestSpecificOmxComponents();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   187
	void CreateWindowL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   188
	void SendCommand(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   189
					OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   190
					OMX_COMMANDTYPE aCmd,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   191
					OMX_U32 aParam1,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   192
					OMX_PTR aCmdData,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   193
					OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   194
					
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   195
	void GetState(OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   196
				  OMX_STATETYPE* aState,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   197
				  OMX_STATETYPE aExpectedState = OMX_StateMax);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   198
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   199
	void SetParameter(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   200
					OMX_HANDLETYPE aComponent, 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   201
            		OMX_INDEXTYPE aIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   202
            		OMX_PTR aComponentParameterStructure,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   203
            		OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   204
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   205
	void GetParameter(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   206
					OMX_HANDLETYPE aComponent, 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   207
            		OMX_INDEXTYPE aIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   208
            		OMX_PTR aComponentParameterStructure,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   209
            		OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   210
            		
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   211
    void SetConfig(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   212
					OMX_HANDLETYPE aComponent, 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   213
            		OMX_INDEXTYPE aIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   214
            		OMX_PTR aComponentParameterStructure,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   215
            		OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   216
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   217
	void GetConfig(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   218
					OMX_HANDLETYPE aComponent, 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   219
            		OMX_INDEXTYPE aIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   220
            		OMX_PTR aComponentParameterStructure,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   221
            		OMX_ERRORTYPE aExpError = OMX_ErrorNone);        		
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   222
   
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   223
    void FreeBuffer(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   224
    		OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   225
            OMX_U32 aPortIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   226
            RPointerArray<OMX_BUFFERHEADERTYPE> aArrayBufferHeaderType,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   227
            OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   228
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   229
    void AllocateBuffer(
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   230
    		OMX_HANDLETYPE aComponent,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   231
    		OMX_BUFFERHEADERTYPE** aBufferHeaderType,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   232
            OMX_U32 aPortIndex,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   233
            OMX_PTR aAppPrivate,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   234
            OMX_U32 aSizeBytes,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   235
            RPointerArray<OMX_BUFFERHEADERTYPE>* aArrayBufferHeaderType,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   236
            OMX_U32 aCount,
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   237
            OMX_ERRORTYPE aExpError = OMX_ErrorNone);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   238
    
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   239
    void FreeHandles();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   240
    virtual TInt PostKickOffTestL(TInt aTimerId) = 0;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   241
	virtual TInt StateTransition(const TDesC& aStateTransitionName);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   242
	TInt InitialiseSurfaceManager();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   243
	TInt CreateAndMapSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   244
	void StartTimer();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   245
	void WaitForCallbacks();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   246
	void PauseTimer();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   247
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   248
protected:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   249
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   250
	CCallbackHandler* iCallbackHandler;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   251
//	OMX_COMPONENTTYPE* iCameraSourceCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   252
//	OMX_COMPONENTTYPE* iCameraSourceCompHandlePort1;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   253
	OMX_COMPONENTTYPE* iGraphicSinkCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   254
	OMX_COMPONENTTYPE* iGraphicSinkCompHandlePort1;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   255
	OMX_COMPONENTTYPE* iBufferSupplierComponent;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   256
	OMX_COMPONENTTYPE* iNonBufferSupplierComponent;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   257
//	OMX_COMPONENTTYPE* iFileSinkCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   258
//	OMX_COMPONENTTYPE* iJpegEncoderCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   259
//	OMX_COMPONENTTYPE* iXvidEncoderCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   260
//	OMX_COMPONENTTYPE* i3gpMuxerCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   261
//	OMX_COMPONENTTYPE* iClockCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   262
//	OMX_COMPONENTTYPE* iImageWriterCompHandle;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   263
	OMX_ERRORTYPE iError;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   264
	OMX_STATETYPE iState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   265
	OMX_INDEXTYPE iSurfaceConfigExt;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   266
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   267
	COmxGsTestShutdown* iTestShutdown;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   268
	COmxGsTestShutdown* iTestPause;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   269
	COmxGsTestStateTransition* iTestStateTransition;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   270
	TTimeIntervalMicroSeconds32 iInterval;	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   271
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   272
	volatile OMX_STATETYPE iCamPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   273
	volatile OMX_STATETYPE iGphxPrevState;	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   274
	volatile OMX_STATETYPE iBufferSupplierPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   275
	volatile OMX_STATETYPE iNonBufferSupplierPrevState;	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   276
	volatile OMX_STATETYPE iGphxPort1PrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   277
	volatile OMX_STATETYPE iFilePrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   278
	volatile OMX_STATETYPE iJpegEncoderPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   279
	volatile OMX_STATETYPE iXvidEncoderPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   280
	volatile OMX_STATETYPE i3gpMuxerPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   281
	volatile OMX_STATETYPE iClockPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   282
	volatile OMX_STATETYPE iImageWriterPrevState;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   283
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   284
	RWsSession              iWsSession;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   285
	RWindowGroup            iWindowGroup;  // Window group of the AO windows. 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   286
	TInt                    iWindowHandle; // Window handle(s) for the AO windows. This handle
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   287
	    	                                      //  is incremental and reused by various WServ artifacts. 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   288
	CWsScreenDevice         *iWsSd;        // Screen Device for this WServ session. 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   289
	CWindowGc               *iGc;     // Graphics Context associated with the window. 
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   290
	RWindow					*iWindow;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   291
	CWindowGc               *iGc2;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   292
	RWindow					*iWindow2;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   293
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   294
    RSurfaceManager         iSurfaceManager;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   295
    RSurfaceUpdateSession   iSurfaceUpdateSession;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   296
	RChunk iTestChunk;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   297
	TSurfaceId iSurfaceId;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   298
	CActiveScheduler* iScheduler;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   299
	};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   300
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   301
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   302
/**
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   303
 * Shutdown timer for tests.
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   304
 */
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   305
class COmxGsTestShutdown : public CTimer
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   306
	{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   307
public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   308
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   309
	static COmxGsTestShutdown* NewL(COmxGsTestBase* aOmxGsTest,TInt aTimerId = 1);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   310
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   311
	COmxGsTestShutdown(COmxGsTestBase* aOmxGsTest,TInt aTimerId = 1);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   312
	~COmxGsTestShutdown();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   313
	void ConstructL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   314
	void Start(TTimeIntervalMicroSeconds32 aInterval, TInt aReason, TVerdict aResult);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   315
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   316
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   317
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   318
	void RunL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   319
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   320
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   321
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   322
	COmxGsTestBase* iOmxGsTest;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   323
	TTimeIntervalMicroSeconds32 iInterval;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   324
	TInt iReason;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   325
	TVerdict iResult;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   326
	TInt iTimerId;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   327
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   328
	};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   329
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   330
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   331
class COmxGsTestStateTransition : public CTimer
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   332
	{
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   333
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   334
public:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   335
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   336
	static COmxGsTestStateTransition* NewL(COmxGsTestBase* aOmxGsTest,TInt aPriority);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   337
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   338
	COmxGsTestStateTransition(COmxGsTestBase* aOmxGsTest,TInt aPriority);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   339
	~COmxGsTestStateTransition();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   340
	void ConstructL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   341
	void Start(TTimeIntervalMicroSeconds32 aInterval,const TDesC& aStateTransitionName);
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   342
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   343
protected:	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   344
	TBuf<KMaxLenStateTransitionName> iStateTransitionName;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   345
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   346
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   347
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   348
	void RunL();
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   349
	
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   350
private:
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   351
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   352
	COmxGsTestBase* iOmxGsTest;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   353
	TTimeIntervalMicroSeconds32 iInterval;
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   354
	};
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   355
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   356
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   357
5d29cba61097 2010wk38_02
hgs
parents:
diff changeset
   358
#endif // OMXILGRAPHICSINKTESTBASE_H