os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestStepDevVideoAllocFailNew.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Header file: DevVideo alloc tests.
    15 // 
    16 //
    17 
    18 /**
    19  @file TestStepDevVideoAllocFailNew.h
    20 */
    21 
    22 #ifndef __TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__
    23 #define __TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__
    24 
    25 #include "TestDevVideoPlay.h"
    26 #include "TestDevVideoRecord.h"
    27 
    28 /**
    29  * DevVideoPlay alloc test base class
    30  *
    31  * @class CTestStepDevVideoPlayAllocFail
    32  *
    33  * Req. under test REQ1931.3
    34  */
    35 
    36 // inherits from CTestDevVideoStep because CTestDevVideoPlayStep instantiates
    37 // the CMMFDevVideoPlay class which we want to do ourselves
    38 class CTestStepDevVideoPlayAllocFail : public CTestDevVideoStep, public MMMFDevVideoPlayObserver
    39 	{
    40 public:
    41 	static CTestStepDevVideoPlayAllocFail* NewL(const TDesC& aTestName);
    42 	CTestStepDevVideoPlayAllocFail(const TDesC& aTestName);
    43 	~CTestStepDevVideoPlayAllocFail();
    44 	virtual TVerdict DoTestStepL();
    45 	virtual TVerdict DoTestL() = 0;
    46 
    47 	// MMMFDevVideoPlayObserver
    48     virtual void MdvpoNewBuffers();
    49     virtual void MdvpoReturnPicture(TVideoPicture* aPicture);
    50     virtual void MdvpoSupplementalInformation(const TDesC8& aData, 
    51 											  const TTimeIntervalMicroSeconds& aTimestamp, 
    52 											  const TPictureId& aPictureId);
    53 	virtual void MdvpoPictureLoss();
    54 	virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures);
    55 	virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
    56 	virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData);
    57     virtual void MdvpoTimedSnapshotComplete(TInt aError, 
    58 											TPictureData* aPictureData, 
    59 											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
    60 											const TPictureId& aPictureId);
    61     virtual void MdvpoNewPictures();
    62     virtual void MdvpoFatalError(TInt aError);
    63     virtual void MdvpoInitComplete(TInt aError);
    64     virtual void MdvpoStreamEnd();
    65 
    66 protected:
    67 	TInt iError;
    68 	CMMFDevVideoPlay* iDevVideoPlay;
    69 	};
    70 
    71 
    72 
    73 class CTestStepDevVideoPlayAllocFailNew : public CTestStepDevVideoPlayAllocFail
    74 	{
    75 public:
    76 	static CTestStepDevVideoPlayAllocFailNew* NewL(const TDesC& aTestName);
    77 	CTestStepDevVideoPlayAllocFailNew(const TDesC& aTestName);
    78 	~CTestStepDevVideoPlayAllocFailNew();
    79 	virtual TVerdict DoTestL();
    80 	};
    81 
    82 
    83 class CTestStepDevVideoPlayAllocFailFindPlugins : public CTestStepDevVideoPlayAllocFail
    84 	{
    85 public:
    86 	static CTestStepDevVideoPlayAllocFailFindPlugins* NewL(const TDesC& aTestName);
    87 	CTestStepDevVideoPlayAllocFailFindPlugins(const TDesC& aTestName);
    88 	~CTestStepDevVideoPlayAllocFailFindPlugins();
    89 	virtual TVerdict DoTestL();
    90 private:
    91 	void GetDecodersL();
    92 	void GetPostProcessorsL();
    93 	void FindDecodersL();
    94 	void FindPostProcessorsL();
    95 	void CheckPluginsL(const RArray<TUid>& aFoundPlugins, const RArray<TUid>& aExpectedPlugins, const RArray<TUid>& aUnExpectedPlugins);
    96 	};
    97 
    98 class CTestStepDevVideoPlayAllocFailInfoDecoder : public CTestStepDevVideoPlayAllocFail
    99 	{
   100 public:
   101 	static CTestStepDevVideoPlayAllocFailInfoDecoder* NewL(const TDesC& aTestName);
   102 	CTestStepDevVideoPlayAllocFailInfoDecoder(const TDesC& aTestName);
   103 	~CTestStepDevVideoPlayAllocFailInfoDecoder();
   104 	virtual TVerdict DoTestL();
   105 	};
   106 
   107 class CTestStepDevVideoPlayAllocFailInfoPostProc : public CTestStepDevVideoPlayAllocFail
   108 	{
   109 public:
   110 	static CTestStepDevVideoPlayAllocFailInfoPostProc* NewL(const TDesC& aTestName);
   111 	CTestStepDevVideoPlayAllocFailInfoPostProc(const TDesC& aTestName);
   112 	~CTestStepDevVideoPlayAllocFailInfoPostProc();
   113 	virtual TVerdict DoTestL();
   114 	};
   115 
   116 class CTestStepDevVideoPlayAllocFailGetPictures : public CTestStepDevVideoPlayAllocFail
   117 	{
   118 public:
   119 	static CTestStepDevVideoPlayAllocFailGetPictures* NewL(const TDesC& aTestName);
   120 	CTestStepDevVideoPlayAllocFailGetPictures(const TDesC& aTestName);
   121 	~CTestStepDevVideoPlayAllocFailGetPictures();
   122 	virtual TVerdict DoTestL();
   123 	void PerformTestL();
   124 	virtual void MdvpoInitComplete(TInt aError);
   125     virtual void MdvpoNewPictures();
   126 	void CheckNewPictureInfoL(TUint aNumPictures, const TTimeIntervalMicroSeconds& aFirst, const TTimeIntervalMicroSeconds& aLast);
   127 	void DoNewPicturesL();
   128 private:
   129 	TInt iCurrentPictureNumber;
   130 	TInt iTestError;
   131 	};
   132 
   133 
   134 // DEVVIDEORECORD //
   135 
   136 /**
   137  * DevVideoRecord alloc test base class
   138  *
   139  * @class CTestStepDevVideoRecordAllocFail
   140  *
   141  * Req. under test REQ1931.3
   142  */
   143 
   144 // inherits from CTestDevVideoStep because CTestDevVideoRecordStep instantiates
   145 // the CMMFDevVideoRecord class which we want to do ourselves
   146 class CTestStepDevVideoRecordAllocFail : public CTestDevVideoStep, public MMMFDevVideoRecordObserver
   147 	{
   148 public:
   149 	static CTestStepDevVideoRecordAllocFail* NewL(const TDesC& aTestName);
   150 	CTestStepDevVideoRecordAllocFail(const TDesC& aTestName);
   151 	~CTestStepDevVideoRecordAllocFail();
   152 	virtual TVerdict DoTestStepL();
   153 	virtual TVerdict DoTestL() = 0;
   154 
   155 	// MMMFDevVideoRecordObserver
   156     virtual void MdvroReturnPicture(TVideoPicture* aPicture);
   157     virtual void MdvroSupplementalInfoSent();
   158     virtual void MdvroNewBuffers();
   159     virtual void MdvroFatalError(TInt aError);
   160     virtual void MdvroInitializeComplete(TInt aError);
   161     virtual void MdvroStreamEnd();
   162 
   163 protected:
   164 	TInt iError;
   165 	CMMFDevVideoRecord* iDevVideoRecord;
   166 	};
   167 
   168 
   169 class CTestStepDevVideoRecordAllocFailNew : public CTestStepDevVideoRecordAllocFail
   170 	{
   171 public:
   172 	static CTestStepDevVideoRecordAllocFailNew* NewL(const TDesC& aTestName);
   173 	CTestStepDevVideoRecordAllocFailNew(const TDesC& aTestName);
   174 	~CTestStepDevVideoRecordAllocFailNew();
   175 	virtual TVerdict DoTestL();
   176 	};
   177 
   178 class CTestStepDevVideoRecordAllocFailInfoEncoder : public CTestStepDevVideoRecordAllocFail
   179 	{
   180 public:
   181 	static CTestStepDevVideoRecordAllocFailInfoEncoder* NewL(const TDesC& aTestName);
   182 	CTestStepDevVideoRecordAllocFailInfoEncoder(const TDesC& aTestName);
   183 	~CTestStepDevVideoRecordAllocFailInfoEncoder();
   184 	virtual TVerdict DoTestL();
   185 	};
   186 
   187 class CTestStepDevVideoRecordAllocFailInfoPreProc : public CTestStepDevVideoRecordAllocFail
   188 	{
   189 public:
   190 	static CTestStepDevVideoRecordAllocFailInfoPreProc* NewL(const TDesC& aTestName);
   191 	CTestStepDevVideoRecordAllocFailInfoPreProc(const TDesC& aTestName);
   192 	~CTestStepDevVideoRecordAllocFailInfoPreProc();
   193 	virtual TVerdict DoTestL();
   194 	};
   195 
   196 class CTestStepDevVideoRecordAllocFailFindPlugins : public CTestStepDevVideoRecordAllocFail
   197 	{
   198 public:
   199 	static CTestStepDevVideoRecordAllocFailFindPlugins* NewL(const TDesC& aTestName);
   200 	CTestStepDevVideoRecordAllocFailFindPlugins(const TDesC& aTestName);
   201 	~CTestStepDevVideoRecordAllocFailFindPlugins();
   202 	virtual TVerdict DoTestL();
   203 private:
   204 	void GetEncodersL();
   205 	void GetPreProcessorsL();
   206 	void FindEncodersL();
   207 	void FindPreProcessorsL();
   208 	void CheckPluginsL(const RArray<TUid>& aFoundPlugins, const RArray<TUid>& aExpectedPlugins, const RArray<TUid>& aUnExpectedPlugins);
   209 	};
   210 
   211 class CTestStepDevVideoRecordAllocFailGetBuffers : public CTestStepDevVideoRecordAllocFail
   212 	{
   213 public:
   214 	static CTestStepDevVideoRecordAllocFailGetBuffers* NewL(const TDesC& aTestName);
   215 	CTestStepDevVideoRecordAllocFailGetBuffers(const TDesC& aTestName);
   216 	~CTestStepDevVideoRecordAllocFailGetBuffers();
   217 	virtual TVerdict DoTestL();
   218 	void PerformTestL();
   219 	virtual void MdvpoInitComplete(TInt aError);
   220     virtual void MdvpoNewBuffers();
   221 	void CheckNewBufferInfoL(TUint aNumBuffers);
   222 	void DoNewBuffersL();
   223 private:
   224 	TInt iCurrentBufferNumber;
   225 	TInt iTestError;
   226 	};
   227 
   228 #endif //(__TEST_STEP_DEVVIDEO_ALLOCFAIL_NEW__)