omxilvideocomps/omxilgraphicsink/tsrc/src/graphicsinktestbase.h
changeset 0 5d29cba61097
equal deleted inserted replaced
-1:000000000000 0:5d29cba61097
       
     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 /**
       
    20  * @file
       
    21  * @internalTechnology
       
    22  */
       
    23 
       
    24 #ifndef GRAPHICSINKTESTBASE_H
       
    25 #define GRAPHICSINKTESTBASE_H
       
    26 
       
    27 #include <openmax/il/extensions/omxilsymbianvideographicsinkextensions.h>
       
    28 #include <graphics/surfaceconfiguration.h>
       
    29 #include <graphics/surfaceupdateclient.h>
       
    30 #include <openmax/il/common/omxilspecversion.h>
       
    31 
       
    32 #include "omxilgraphicsinktestbase.h"
       
    33 
       
    34 const TInt KTSU_OMX_GS_PAUSE = 2000000;// 2 second timer for test shutdown
       
    35 
       
    36 class CGraphicsSinkTestBase : public COmxGsTestBase
       
    37 	{
       
    38 public:
       
    39 	CGraphicsSinkTestBase();
       
    40 	~CGraphicsSinkTestBase();
       
    41 
       
    42 public:
       
    43 	void CloseTestStep();
       
    44 	// Functions to act on callbackhandler functions
       
    45 	void DoFillBufferDone(OMX_HANDLETYPE aComponent,
       
    46 			  	OMX_BUFFERHEADERTYPE* aBufferHeader);
       
    47 
       
    48 	void DoEmptyBufferDone(OMX_HANDLETYPE aComponent,
       
    49 			   	OMX_BUFFERHEADERTYPE* aBufferHeader);
       
    50 
       
    51 	void DoEventHandler(OMX_HANDLETYPE aComponent,OMX_EVENTTYPE aEvent,
       
    52 				TUint aData1,TUint aData2,TAny* aExtra);
       
    53 	// End of callbackhandler functions
       
    54 
       
    55 	void InitiateNextStateTransition(OMX_HANDLETYPE aComponent, TUint aData1, 
       
    56 				TUint aData2, TAny* aExtra);
       
    57 
       
    58 	void UpdateSettingChanged(OMX_HANDLETYPE aComponent, TUint aData1, 
       
    59 				TUint aData2, TAny* aExtra);
       
    60 
       
    61 	
       
    62 protected:
       
    63 	
       
    64 	void ErrorEventTask_001(
       
    65 			OMX_ERRORTYPE aOmxError);
       
    66 
       
    67 	TVerdict DoGSCompAllocTestL();
       
    68 
       
    69 	void LoadedStateTask_002();
       
    70 	void IdleStateTask_002();
       
    71 
       
    72 	void LoadedStateTask_003();
       
    73 	void IdleStateTask_003();
       
    74 
       
    75 	void LoadedStateTask_004();
       
    76 	void IdleStateTask_004();
       
    77 	void ExecutingStateTask_004();
       
    78 	
       
    79 	void LoadedStateTask_005();
       
    80 	void IdleStateTask_005();
       
    81 	void ExecutingStateTask_005();
       
    82 	
       
    83 	void LoadedStateTask_006();
       
    84 	void IdleStateTask_006();
       
    85 
       
    86 	void LoadedStateTask_007();
       
    87 	void IdleStateTask_007();
       
    88 	void PauseStateTask_007();
       
    89 	void ExecutingStateTask_007();
       
    90 
       
    91 	void StartStateTransitionTask();
       
    92 	void WaitForResourcesTransitionTask();
       
    93 	void LoadedStateTransitionTask();
       
    94 	void IdleStateTransitionTask();
       
    95 	void ExecutingStateTransitionTask();
       
    96 	
       
    97 	void StartBufferDoneTask();
       
    98 	void LoadedStateBufferTask();
       
    99 	void IdleStateBufferTask();
       
   100 	void ExecutingStateBufferTask();
       
   101 	
       
   102 	void DoROmxGsTestSetup();
       
   103 	void AllocateCCameraBuf();
       
   104 	void DeleteCCameraBuf();
       
   105 	void AllocateBufferTask();
       
   106 	void AllocateBufferTaskStress();
       
   107 	void UseBufferTask();
       
   108 	void FreeBufferTask(RPointerArray<OMX_BUFFERHEADERTYPE>* aBufferHeaders,
       
   109 			OMX_U32 aPortIndex,TBool aSendCommand = ETrue);
       
   110 	void FreeBufferTaskAlt(RPointerArray<OMX_BUFFERHEADERTYPE> aBufferHeaders,
       
   111 			OMX_U32 aPortIndex,TBool aSendCommand = ETrue);
       
   112 	void EmptyThisBufferTask();
       
   113 	void FillCCamBuffer(
       
   114 				const RChunk& aCamBuf, 
       
   115 				OMX_U32 aFrameWidth, 
       
   116 				OMX_U32 aFrameHeight, 
       
   117 				TInt aBytePerPixel, 
       
   118 				TInt aNumOfActualBuffer);
       
   119 	void CreateOmxParamPortDefinitionType(OMX_PARAM_PORTDEFINITIONTYPE* aOmxParamPortType);
       
   120 	void CreateOmxVideoParamPortFormatType(OMX_VIDEO_PARAM_PORTFORMATTYPE* aOmxVideoParamPortType);
       
   121 	
       
   122 	TInt PostKickOffTestL(TInt aTimerId);
       
   123 	// General functions used to test the outcome of Get and Set tests.
       
   124 	void CompareVCTParam(OMX_VIDEO_CODINGTYPE aInputParamType, OMX_VIDEO_CODINGTYPE aOutputParamType, OMX_INDEXTYPE aIndexType);
       
   125 	void CompareU32Param(OMX_U32 aInputParamType, OMX_U32 aOutputParamType);
       
   126 	void CompareCFTParam(OMX_COLOR_FORMATTYPE aInputParamType, OMX_COLOR_FORMATTYPE aOutputParamType, OMX_INDEXTYPE aIndexType);
       
   127 	void CompareBoolParam(OMX_BOOL aInputParamType, OMX_BOOL aOutputParamType, OMX_INDEXTYPE aIndexType);
       
   128 
       
   129 	void WaitForEvent(OMX_EVENTTYPE aEvent);
       
   130 
       
   131 protected:
       
   132 	//COmxILMMBuffer* iCamBuf;
       
   133 	RChunk iChunk; // to replace with COmxILMMBuffer
       
   134 	COmxILMMBuffer* iCamOutputBuffer;
       
   135 	
       
   136 	OMX_BUFFERHEADERTYPE* iInputBufferHeader;
       
   137 	OMX_BUFFERHEADERTYPE* iOutputBufferHeader;
       
   138 	RPointerArray<OMX_BUFFERHEADERTYPE> iInputBufferHeaders;
       
   139 	RPointerArray<OMX_BUFFERHEADERTYPE> iOutputBufferHeaders;
       
   140 	
       
   141 	OMX_PARAM_PORTDEFINITIONTYPE iOmxParamPortInput;
       
   142 	
       
   143 	OMX_STATETYPE iOmxStateType;
       
   144 	OMX_ERRORTYPE iOmxErrorType;
       
   145 
       
   146 	TUint iPreviousState;
       
   147 	TInt iDoEmptyBufferDoneCount;
       
   148 	TInt iDoEmptyBufferDoneLimit;
       
   149 	TInt iColSwitch;
       
   150 	TInt iExecuteToIdleCount;
       
   151 	TInt iIdleToLoadedCount;
       
   152 	TInt iPauseStateCount;
       
   153 	TInt iIdleToExecuteCount;
       
   154 	TBool iExecutingToIdle;
       
   155 
       
   156     TSurfaceConfiguration* iSurfaceConfig;
       
   157     
       
   158     TInt iTestIteration;
       
   159     volatile TBool iTestTimedOut;
       
   160     volatile TBool iWaitForResources;
       
   161 	TInt iInputBufferHeadersCount;
       
   162 	
       
   163 	OMX_EVENTTYPE iEventToWaitFor;
       
   164 	
       
   165 	TInt iTestCase;
       
   166 	TInt iTestStep;
       
   167 
       
   168 	TBool iIgnoreNextBufferDone;
       
   169     };
       
   170 
       
   171 #endif //GRAPHICSINKTESTBASE_H