sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef TESTRENDERER_H sl@0: #define TESTRENDERER_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /* sl@0: Basic test for video renderer in timed and non-timed mode sl@0: MM-MMF-VIDREND-U-0002 and MM-MMF-VIDREND-U-0003 sl@0: */ sl@0: class RTestRendererStep : public RTestStep, public MVideoRendererObserver sl@0: { sl@0: public: sl@0: sl@0: enum TTestRendererEvents sl@0: { sl@0: EStartTest, sl@0: EBufferAvailable, sl@0: EBufferDisplayed, sl@0: EBufferSkipped, sl@0: ETimerExpired sl@0: }; sl@0: sl@0: enum TTestRendererState sl@0: { sl@0: EStateIdle, sl@0: EStateCreate, sl@0: EStateUpdate, sl@0: EStateReleaseBuffer, sl@0: EStateReplaceSurface, sl@0: EStateUpdateAfterReplace sl@0: }; sl@0: sl@0: static RTestRendererStep* NewL(const TDesC& aStepName, TBool aTimed); sl@0: sl@0: // from MVideoRendererObserver sl@0: void MvroVideoBufferAvailable(); sl@0: void MvroBufferDisplayed(TInt aBufferId, const TTime& aTime); sl@0: void MvroBufferSkipped(TInt aBufferId); sl@0: sl@0: protected: sl@0: RTestRendererStep(const TDesC& aStepName, TBool aTimed); sl@0: sl@0: virtual void FsmL(TTestRendererEvents aEventCode); sl@0: void InitWservL(); sl@0: void DeInitWserv(); sl@0: TInt SetBackgroundSurface(TSurfaceId& id); sl@0: void RemoveBackgroundSurface(); sl@0: void EndTest(TVerdict aVerdict); sl@0: void CreateRendererAndSurfaceL(TInt aNumBuffers); sl@0: void CreateSurfaceL(TInt aNumBuffers); sl@0: void GetNextBufferAndSubmitUpdateL(TInt aExpectedBufId, TRgb aColor, const TTime& aPresentationTime); sl@0: TVideoFrameBuffer* GetNextBufferL(TInt aExpectedBufId, TRgb aColor); sl@0: sl@0: // from RTestStep sl@0: TVerdict DoTestStepPreambleL(); sl@0: TVerdict DoTestStepPostambleL(); sl@0: TVerdict DoTestStepL(); sl@0: sl@0: sl@0: protected: sl@0: CActiveScheduler* iActiveScheduler; sl@0: TBool iActiveSchedulerStarted; sl@0: CVideoRenderer* iVideoRenderer; sl@0: TBool iTimed; sl@0: TSurfaceId iSurfaceId; sl@0: sl@0: // Surface creation parameter sl@0: TSize iSize; sl@0: TUncompressedVideoFormat iVideoFormat; sl@0: sl@0: // Window server related objects sl@0: RWsSession iWs; sl@0: CWsScreenDevice* iScreen; sl@0: RWindow* iWindow; sl@0: RWindowGroup iRootWindow; sl@0: sl@0: TTestRendererState iFsmState; sl@0: TInt iBuffAvailCallback; sl@0: TInt iBuffDisplayCallback; sl@0: TInt iBuffSkipCallback; sl@0: sl@0: // values stored for Mvro callbacks sl@0: TInt iBufferId; sl@0: TTime iDisplayedTime; sl@0: }; sl@0: sl@0: /* sl@0: Test replacing surface in timed and non-timed mode sl@0: MM-MMF-VIDREND-U-0010 and MM-MMF-VIDREND-U-0011 sl@0: */ sl@0: class RTestRendererReplaceStep : public RTestRendererStep sl@0: { sl@0: public: sl@0: static RTestRendererReplaceStep* NewL(const TDesC& aStepName, TBool aTimed); sl@0: sl@0: protected: sl@0: RTestRendererReplaceStep(const TDesC& aStepName, TBool aTimed); sl@0: void FsmL(TTestRendererEvents aEventCode); sl@0: void ReplaceSurfaceL(); sl@0: }; sl@0: sl@0: /* sl@0: Timer callback class sl@0: */ sl@0: class CCallBackTimer : public CTimer sl@0: { sl@0: public: sl@0: static CCallBackTimer* NewL(TCallBack aCallBack, TPriority aPriority = EPriorityStandard); sl@0: sl@0: private: sl@0: void RunL(); sl@0: CCallBackTimer(TCallBack aCallBack, TPriority aPriority); sl@0: sl@0: private: sl@0: TCallBack iCallBack; sl@0: }; sl@0: sl@0: #endif // TESTRENDERER_H