sl@0: 
sl@0: // Copyright (c) 2001-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: // Header file: Basic  tests.
sl@0: // 
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file TESTPLAYER.h
sl@0: */
sl@0: 
sl@0: #ifndef TESTPLAYER_H__
sl@0: #define TESTPLAYER_H__
sl@0: 
sl@0: #include "TSI_MMFVCLNT.h"
sl@0: 
sl@0: /**
sl@0:  * Load and initialise a video file.
sl@0:  *
sl@0:  * @class CTestVclntVideoFile
sl@0:  *
sl@0:  * Req. under test REQ172.2.4           REQ172.2.7        REQ172.2.10
sl@0:  */
sl@0: class CTestVclntVideoFile : public CTestMmfVclntStep , public MVideoPlayerUtilityObserver
sl@0: 	{
sl@0: public:
sl@0: 	CTestVclntVideoFile(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	static CTestVclntVideoFile* NewL(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	static CTestVclntVideoFile* NewLC(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	virtual TVerdict DoTestStepL();
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aVideo);
sl@0: 	// MVideoPlayerUtilityObserver
sl@0: 	virtual void MvpuoOpenComplete(TInt aError);
sl@0: 	virtual void MvpuoPrepareComplete(TInt aError);
sl@0: 	virtual void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError);
sl@0: 	virtual void MvpuoPlayComplete(TInt aError);
sl@0: 	virtual void MvpuoEvent(const TMMFEvent& aEvent);
sl@0: protected:
sl@0: 	TBuf<KNameBufSize> iSectName;			// Section name for retrieving filename
sl@0: 	TBuf<KNameBufSize> iKeyName;			// Key name for retrieving filename
sl@0: 	TInt iError;
sl@0: 	const TBool iPlay;						// Does this test require playing the video
sl@0: 	TTimeIntervalMicroSeconds iDuration;	// Stores duration of video
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Load and initialise an video descriptor.
sl@0:  *
sl@0:  * @class CTestVclntVideoDes
sl@0:  *
sl@0:  * Req. under test REQ172.2.4        REQ172.2.8        REQ172.2.10
sl@0:  */
sl@0: class CTestVclntVideoDes : public CTestMmfVclntStep , public MVideoPlayerUtilityObserver
sl@0: 	{
sl@0: public:
sl@0: 	CTestVclntVideoDes(const TDesC& aTestName,const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay) ;
sl@0: 	static CTestVclntVideoDes* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	static CTestVclntVideoDes* NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	virtual TVerdict DoTestStepL();
sl@0: 	virtual TVerdict DoTestStepPreambleL();
sl@0: 	virtual TVerdict DoTestStepPostambleL();
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: 	// MVideoPlayerUtilityObserver
sl@0: 	virtual void MvpuoOpenComplete(TInt aError);
sl@0: 	virtual void MvpuoPrepareComplete(TInt aError);
sl@0: 	virtual void MvpuoFrameReady(CFbsBitmap& aFrame, TInt aError);
sl@0: 	virtual void MvpuoPlayComplete(TInt aError);
sl@0: 	virtual void MvpuoEvent(const TMMFEvent& aEvent);
sl@0: 
sl@0: protected:
sl@0: 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
sl@0: 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
sl@0: 	HBufC8* iVideo;						// Buffer for holding video descriptor data
sl@0: 	TTimeIntervalMicroSeconds iDuration;// Stores duration of video
sl@0: 	TInt iError;						// Stores error values for testing
sl@0: 	const TBool iPlay;					// Does this test require playing the video
sl@0: 	} ;
sl@0: 
sl@0: /**
sl@0:  * Open video form a URL and play.
sl@0:  *
sl@0:  * @class CTestVclntVideoUrl
sl@0:  *
sl@0:  */
sl@0: class CTestVclntVideoUrl : public CTestMmfVclntStep , public MVideoPlayerUtilityObserver
sl@0: 	{
sl@0: public:
sl@0: 	CTestVclntVideoUrl(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	static CTestVclntVideoUrl* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	static CTestVclntVideoUrl* NewLC(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName,const TBool aPlay);
sl@0: 	virtual TVerdict DoTestStepL();
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: 	// MVideoPlayerUtilityObserver
sl@0: 	virtual void MvpuoOpenComplete(TInt aError);
sl@0: 	virtual void MvpuoPrepareComplete(TInt aError);
sl@0: 	virtual void MvpuoFrameReady(CFbsBitmap& aFrame, TInt aError);
sl@0: 	virtual void MvpuoPlayComplete(TInt aError);
sl@0: 	virtual void MvpuoEvent(const TMMFEvent& aEvent);	
sl@0: 
sl@0: protected:
sl@0: 	TBuf<KNameBufSize> iSectName;		// Section name for retrieving filename
sl@0: 	TBuf<KNameBufSize> iKeyName;		// Key name for retrieving filename
sl@0: 	TTimeIntervalMicroSeconds iDuration;// Stores duration of video
sl@0: 	TInt iError;						// Stores error values for testing
sl@0: 	const TBool iPlay;					// Does this test require playing the video
sl@0: 	HBufC8* iVideo;						// Buffer for holding video descriptor data
sl@0: 	};
sl@0: 
sl@0: /**
sl@0:  * Set and enquire framerate
sl@0:  *
sl@0:  * @class CTestVclntEnqFrameRate
sl@0:  *
sl@0:  * Req. under test REQ172.2.28      
sl@0:  */
sl@0: class CTestVclntEnqFrameRate : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntEnqFrameRate* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aFrameRate);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntEnqFrameRate(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aFrameRate);
sl@0: 
sl@0: private:
sl@0: 	TInt iFrameRate;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * set position and play form this position.
sl@0:  * 
sl@0:  * @class CTestVclntPosition
sl@0:  *
sl@0:  * Req. under test REQ172.2.13 REQ172.2.14
sl@0:  */
sl@0: class CTestVclntPosition : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntPosition* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aPosition);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntPosition(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aPosition);
sl@0: 
sl@0: private:
sl@0: 	TTimeIntervalMicroSeconds iPosition;
sl@0: 	};
sl@0: 
sl@0: /**
sl@0:  * Video priority
sl@0:  * 
sl@0:  * @class CTestVclntPriority
sl@0:  *
sl@0:  * Req. under test REQ172.2.25
sl@0:  */
sl@0: class CTestVclntPriority : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntPriority* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aPriority);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntPriority(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aPriority);
sl@0: 
sl@0: private:
sl@0: 	TInt iPriority;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video duration
sl@0:  * 
sl@0:  * @class CTestVclntDuration
sl@0:  *
sl@0:  * Req. under test REQ172.2.15
sl@0:  */
sl@0: class CTestVclntDuration : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntDuration* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aDuration);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntDuration(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aDuration);
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video Volume
sl@0:  * 
sl@0:  * @class CTestVclntVolume
sl@0:  *
sl@0:  * Req. under test REQ172.2.16        REQ172.2.17        REQ172.2.18
sl@0:  */
sl@0: class CTestVclntVolume : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntVolume* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aVolume);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntVolume(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aVolume);
sl@0: 
sl@0: private:
sl@0: 	TInt iVolume;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video open, close and then open again.
sl@0:  * 
sl@0:  * @class CTestVclntCloseOpen
sl@0:  *
sl@0:  * Req. under test REQ172.2.4        REQ172.2.5       REQ172.2.6
sl@0:  */
sl@0: class CTestVclntCloseOpen : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntCloseOpen* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntCloseOpen(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	};
sl@0: 
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video pause.
sl@0:  * 
sl@0:  * @class CTestVclntPause
sl@0:  *
sl@0:  * Req. under test REQ172.2.10     REQ172.2.11
sl@0:  */
sl@0: class CTestVclntPause : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntPause* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntPause(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video pause.
sl@0:  * 
sl@0:  * @class CTestVclntBalance
sl@0:  *
sl@0:  * Req. under test REQ172.2.30       REQ172.2.31
sl@0:  */
sl@0: class CTestVclntBalance : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntBalance* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aBalance);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntBalance(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aBalance);
sl@0: 
sl@0: private:
sl@0: 	TInt iBalance;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video set play window and delete play window.
sl@0:  * 
sl@0:  * @class CTestVclntPlayWindow
sl@0:  *
sl@0:  * Req. under test REQ172.2.21          REQ172.2.22
sl@0:  */
sl@0: class CTestVclntPlayWindow : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntPlayWindow* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aStart, const TTimeIntervalMicroSeconds aEnd);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntPlayWindow(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TTimeIntervalMicroSeconds aStart, const TTimeIntervalMicroSeconds aEnd);
sl@0: 
sl@0: private:
sl@0: 	TTimeIntervalMicroSeconds iStart;
sl@0: 	TTimeIntervalMicroSeconds iEnd;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video get meta data.
sl@0:  * 
sl@0:  * @class CTestVclntMeta
sl@0:  *
sl@0:  * Req. under test REQ172.2.20
sl@0:  */
sl@0: class CTestVclntMeta : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntMeta* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntMeta(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 
sl@0: private:
sl@0: 	TTimeIntervalMicroSeconds iStart;
sl@0: 	TTimeIntervalMicroSeconds iEnd;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video get framesize.
sl@0:  * 
sl@0:  * @class CTestVclntFrameSize
sl@0:  *
sl@0:  * Req. under test REQ172.2.27
sl@0:  */
sl@0: class CTestVclntFrameSize : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntFrameSize* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aFrameSize);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntFrameSize(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aFrameSize);
sl@0: 
sl@0: private:
sl@0: 	TInt iFrameSize;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video get mime type.
sl@0:  * 
sl@0:  * @class CTestVclntMimeType
sl@0:  *
sl@0:  * Req. not mapped
sl@0:  */
sl@0: class CTestVclntMimeType : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntMimeType* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntMimeType(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video rebuffering.
sl@0:  * 
sl@0:  * @class CTestVclntRebuffering
sl@0:  *
sl@0:  * Req. not mapped
sl@0:  */
sl@0: class CTestVclntRebuffering : public CTestVclntVideoFile, public MVideoLoadingObserver
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntRebuffering* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: 	void MvloLoadingStarted();
sl@0: 	void MvloLoadingComplete();
sl@0: private:
sl@0: 	CTestVclntRebuffering(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 
sl@0: 	};
sl@0: 
sl@0: /**
sl@0:  * Video get framesize.
sl@0:  * 
sl@0:  * @class CTestVclntRepeat
sl@0:  *
sl@0:  * Req. under test REQ172.2.23
sl@0:  */
sl@0: class CTestVclntRepeat : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntRepeat* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aRepeat);
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntRepeat(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName, const TInt aRepeat);
sl@0: 
sl@0: private:
sl@0: 	TInt iRepeat;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: 
sl@0: /**
sl@0:  * Video Delete object while playing
sl@0:  * 
sl@0:  * @class CTestVclntDelete
sl@0:  *
sl@0:  * Req. under test REQ172.2.4           REQ172.2.7        REQ172.2.10
sl@0:  */
sl@0: class CTestVclntDelete : public CTestVclntVideoFile
sl@0: 	{
sl@0: public:
sl@0: 	static CTestVclntDelete* NewL(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	virtual TVerdict DoTestStepL();
sl@0: 	virtual TVerdict DoTestL(CVideoPlayerUtility* aPlayer);
sl@0: private:
sl@0: 	CTestVclntDelete(const TDesC& aTestName, const TDesC& aSectName,const TDesC& aKeyName);
sl@0: 	};
sl@0: 
sl@0: 
sl@0: #endif