mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestDevVideoPlayOne.cpp
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 
       
     2 // Copyright (c) 2003-2009 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 // TestDevVideoPlay.cpp
       
    16 // 
       
    17 //
       
    18 
       
    19 #include "TestDevVideoPlay.h"
       
    20 #include "TestDevVideoPlayTestData.h"
       
    21 #include "TestDevVideoPlugins/decoder.h"
       
    22 #include "TestDevVideoPlugins/postproc.h"
       
    23 #include <e32math.h>
       
    24 
       
    25 const TInt KTestScreenCount = 2;
       
    26 // DevVideoPlay base class
       
    27 
       
    28 const TUid KUidMDFVideoDecoderHwDeviceAdapter = { 0x102737ED };
       
    29 
       
    30 CTestDevVideoPlayStep::CTestDevVideoPlayStep(const TDesC& aTestName, TTestType aTestType)
       
    31 	{
       
    32 	// store the name of this test case
       
    33 	// this is the name that is used by the script file
       
    34 	// Each test step initialises it's own name
       
    35 	iTestStepName = aTestName;		
       
    36 	iTestType = aTestType;		// included in case needed in future
       
    37 	}
       
    38 	
       
    39 CTestDevVideoPlayStep::~CTestDevVideoPlayStep() 
       
    40 	{
       
    41 	delete iDevVideoPlay;
       
    42 	}
       
    43 
       
    44 TVerdict CTestDevVideoPlayStep::DoTestStepL()
       
    45 	{
       
    46 	// construct DevVideoPlay object
       
    47 	__UHEAP_MARK;
       
    48 	TRAPD(err, iDevVideoPlay = CMMFDevVideoPlay::NewL(*this));
       
    49 	if (err != KErrNone)
       
    50 		{
       
    51 		ERR_PRINTF1(_L("Could not create a CMMFDevVideoPlay class!"));
       
    52 		return EInconclusive;
       
    53 		}
       
    54 	
       
    55 	TVerdict ret = EFail;
       
    56 
       
    57 	// call the test step
       
    58 	ret = DoTestL(*iDevVideoPlay);
       
    59 		
       
    60 	INFO_PRINTF1(_L("CMMFDevVideoPlay: Destroying"));
       
    61 	delete iDevVideoPlay;
       
    62 	iDevVideoPlay = NULL;
       
    63 	__MM_HEAP_MARKEND;
       
    64 	if(iError != KErrNone)
       
    65 		ERR_PRINTF2( _L("CMMFDevVideoPlay failed with error %d"), iError );
       
    66 	
       
    67 	return ret;
       
    68 	}
       
    69 
       
    70 
       
    71 // MMMFDevVideoPlayObserver
       
    72 void CTestDevVideoPlayStep::MdvpoNewBuffers()
       
    73 	{
       
    74 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoNewBuffers()"));
       
    75 	}
       
    76 
       
    77 void CTestDevVideoPlayStep::MdvpoReturnPicture(TVideoPicture* /*aPicture*/)
       
    78 	{
       
    79 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoReturnPicture()"));
       
    80 	}
       
    81 
       
    82 void CTestDevVideoPlayStep::MdvpoSupplementalInformation(const TDesC8& /*aData*/, 
       
    83 								  const TTimeIntervalMicroSeconds& /*aTimestamp*/, 
       
    84 								  const TPictureId& /*aPictureId*/)
       
    85 	{
       
    86 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoSupplementalInformation()"));
       
    87 	}
       
    88 
       
    89 void CTestDevVideoPlayStep::MdvpoPictureLoss()
       
    90 	{
       
    91 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoPictureLoss()"));
       
    92 	}
       
    93 
       
    94 void CTestDevVideoPlayStep::MdvpoPictureLoss(const TArray<TPictureId>& /*aPictures*/)
       
    95 	{
       
    96 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoPictureLoss(TArray)"));
       
    97 	}
       
    98 
       
    99 void CTestDevVideoPlayStep::MdvpoSliceLoss(TUint /*aFirstMacroblock*/, TUint /*aNumMacroblocks*/, const TPictureId& /*aPicture*/)
       
   100 	{
       
   101 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoSliceLoss()"));
       
   102 	}
       
   103 
       
   104 void CTestDevVideoPlayStep::MdvpoReferencePictureSelection(const TDesC8& /*aSelectionData*/)
       
   105 	{
       
   106 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoReferencePictureSelection()"));
       
   107 	}
       
   108 
       
   109 void CTestDevVideoPlayStep::MdvpoTimedSnapshotComplete(TInt /*aError*/, 
       
   110 								TPictureData* /*aPictureData*/, 
       
   111 								const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/, 
       
   112 								const TPictureId& /*aPictureId*/)
       
   113 	{
       
   114 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoTimedSnapshotComplete()"));
       
   115 	}
       
   116 
       
   117 void CTestDevVideoPlayStep::MdvpoNewPictures()
       
   118 	{
       
   119 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoNewPictures()"));
       
   120 	}
       
   121 
       
   122 void CTestDevVideoPlayStep::MdvpoFatalError(TInt aError)
       
   123 	{
       
   124 	iError = aError;
       
   125 	INFO_PRINTF2(_L("CTestDevVideoPlayStep::MdvpoFatalError():  Error = %d"), aError);
       
   126 	}
       
   127 
       
   128 void CTestDevVideoPlayStep::MdvpoInitComplete(TInt aError)
       
   129 	{
       
   130 	iError = aError;
       
   131 	INFO_PRINTF2(_L("CTestDevVideoPlayStep::MdvpoInitComplete():  Error = %d"), aError);
       
   132 	}
       
   133 
       
   134 void CTestDevVideoPlayStep::MdvpoStreamEnd()
       
   135 	{
       
   136 	INFO_PRINTF1(_L("CTestDevVideoPlayStep::MdvpoStreamEnd()"));
       
   137 	}
       
   138 
       
   139 //------------------------------------------------------------------
       
   140 
       
   141 CTestDevVideoPlayCommonFormat::CTestDevVideoPlayCommonFormat(const TDesC& aTestName, TTestType aTestType)
       
   142 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   143 	{
       
   144 	}
       
   145 
       
   146 CTestDevVideoPlayCommonFormat* CTestDevVideoPlayCommonFormat::NewL(const TDesC& aTestName, TTestType aTestType)
       
   147 	{
       
   148 	CTestDevVideoPlayCommonFormat* self = new(ELeave) CTestDevVideoPlayCommonFormat(aTestName, aTestType);
       
   149 	return self;
       
   150 	}
       
   151 
       
   152 TVerdict CTestDevVideoPlayCommonFormat::DoTestL(CMMFDevVideoPlay& /*aDevVideoPlay*/)
       
   153 	{
       
   154 	TVerdict ret = EPass;
       
   155 	TBool expErr = ETrue;
       
   156 	
       
   157 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  Find common format"));
       
   158 	
       
   159 	// expected results
       
   160 	if (iTestType != ETestValid)
       
   161 		{
       
   162 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
   163 		return EInconclusive;
       
   164 		}
       
   165 	
       
   166 	// make a fake list of formats
       
   167 	RArray<TUncompressedVideoFormat> vFormats1;
       
   168 	RArray<TUncompressedVideoFormat> vFormats2;
       
   169 
       
   170 	TUncompressedVideoFormat commonFormat;
       
   171 	TUncompressedVideoFormat otherFormat;
       
   172 
       
   173 	// push arrays to cleanup stack
       
   174 	CleanupClosePushL(vFormats1);
       
   175 	CleanupClosePushL(vFormats2);
       
   176 
       
   177 	// setup vFormats1 
       
   178 	User::LeaveIfError(vFormats1.Append(KTestVidFormat1));
       
   179 	User::LeaveIfError(vFormats1.Append(KTestVidFormat2));
       
   180 
       
   181 	// setup vFormats2
       
   182 	User::LeaveIfError(vFormats2.Append(KTestVidFormat2));
       
   183 	User::LeaveIfError(vFormats2.Append(KTestVidFormat3));
       
   184 
       
   185 	TArray<TUncompressedVideoFormat> t1 = vFormats1.Array();
       
   186 	TArray<TUncompressedVideoFormat> t2 = vFormats2.Array();
       
   187 	TBool formatFound = EFalse;
       
   188 		
       
   189 	// attempt to find a common format
       
   190 	formatFound = CMMFDevVideoPlay::FindCommonFormat(t1, t2, commonFormat);
       
   191 
       
   192 	// now attempt to find a common format that doesn't exist
       
   193 	vFormats1.Reset();
       
   194 	User::LeaveIfError(vFormats1.Append(KTestVidFormat1));
       
   195 	User::LeaveIfError(vFormats1.Append(KTestVidFormat1));
       
   196 	TBool otherFormatFound = ETrue;
       
   197 
       
   198 	// perform search for non-existent common format
       
   199 	t1 = vFormats1.Array();	// need to get Array class again
       
   200 	otherFormatFound = CMMFDevVideoPlay::FindCommonFormat(t1, t2, otherFormat);
       
   201 
       
   202 	// close the arrays
       
   203 	CleanupStack::PopAndDestroy(2, &vFormats1);
       
   204 
       
   205 	// check format
       
   206 	if ( (!formatFound) || !(commonFormat == KTestVidFormat2) )
       
   207 		{
       
   208 		ret = EFail;
       
   209 		ERR_PRINTF1(_L("Error:  No common format found..."));
       
   210 		}
       
   211 	else if (otherFormatFound )
       
   212 		{
       
   213 		ret = EFail;
       
   214 		ERR_PRINTF1(_L("Error:  Found a common format when there wasn't one!"));
       
   215 		}
       
   216 	else
       
   217 		{
       
   218 		INFO_PRINTF3(_L("FindCommonFormat(), %d = %d"), formatFound, expErr);
       
   219 		}
       
   220 	return ret;
       
   221 	}
       
   222 
       
   223 
       
   224 //------------------------------------------------------------------
       
   225 
       
   226 
       
   227 
       
   228 //------------------------------------------------------------------
       
   229 
       
   230 CTestDevVideoPlayFindDecoders::CTestDevVideoPlayFindDecoders(const TDesC& aTestName, TTestType aTestType)
       
   231 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   232 	{
       
   233 	}
       
   234 
       
   235 CTestDevVideoPlayFindDecoders* CTestDevVideoPlayFindDecoders::NewL(const TDesC& aTestName, TTestType aTestType)
       
   236 	{
       
   237 	CTestDevVideoPlayFindDecoders* self = new(ELeave) CTestDevVideoPlayFindDecoders(aTestName, aTestType);
       
   238 	return self;
       
   239 	}
       
   240 
       
   241 TVerdict CTestDevVideoPlayFindDecoders::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
   242 	{
       
   243 	TVerdict ret = EFail;
       
   244 
       
   245 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  FindDecoders"));
       
   246 
       
   247 	RArray<TUid> foundDecoders;
       
   248 	CleanupClosePushL(foundDecoders);
       
   249 	RArray<TUid> expectedDecoders;
       
   250 	CleanupClosePushL(expectedDecoders);
       
   251 	RArray<TUid> unExpectedDecoders;
       
   252 	CleanupClosePushL(unExpectedDecoders);
       
   253 
       
   254 	TInt error = KErrNone;
       
   255 	TUint32 requestedPostProcType = 0;
       
   256 	
       
   257 	// Unsupported mime type
       
   258 	if (!error)
       
   259 		{
       
   260 		requestedPostProcType = 0;
       
   261 		_LIT8(KMimeType1, "VIDEO/mpeg21");
       
   262 		foundDecoders.Reset();
       
   263 		expectedDecoders.Reset();
       
   264 		unExpectedDecoders.Reset();
       
   265 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   266 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   267 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   268 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   269 
       
   270 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType1(), requestedPostProcType, foundDecoders, EFalse));
       
   271 
       
   272 		if (!error)
       
   273 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   274 		}
       
   275 
       
   276 	// Unsupported post proc type
       
   277 	if (!error)
       
   278 		{
       
   279 		requestedPostProcType = EPpOutputCrop|EPpInputCrop;
       
   280 		foundDecoders.Reset();
       
   281 		_LIT8(KMimeType2, "videO/duMMy");
       
   282 		expectedDecoders.Reset();
       
   283 		unExpectedDecoders.Reset();
       
   284 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   285 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   286 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   287 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   288 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   289 
       
   290 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType2(), requestedPostProcType, foundDecoders, EFalse));
       
   291 		if (error == KErrNotFound)//we actually expect KErrNotFound here
       
   292 			error = KErrNone;
       
   293 		else
       
   294 			error = KErrGeneral;
       
   295 
       
   296 		if (!error)
       
   297 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   298 		}
       
   299 
       
   300 	// Unsupported mime type (by exact match)
       
   301 	if (!error)
       
   302 		{
       
   303 		_LIT8(KMimeType3, "video/H263-2000; profile=45;level=40");
       
   304 		requestedPostProcType = 0;
       
   305 		foundDecoders.Reset();
       
   306 		expectedDecoders.Reset();
       
   307 		unExpectedDecoders.Reset();
       
   308 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   309 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   310 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   311 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   312 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   313 
       
   314 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType3(), requestedPostProcType, foundDecoders, ETrue));
       
   315 		if (error == KErrNotFound)//we actually expect KErrNotFound here
       
   316 			error = KErrNone;
       
   317 		else
       
   318 			error = KErrGeneral;
       
   319 
       
   320 		if (!error)
       
   321 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   322 		}
       
   323 	
       
   324 	// Supported mime type (by unexact match)
       
   325 	if (!error)
       
   326 		{
       
   327 		_LIT8(KMimeType4, "video/H263-2000; profile=1234;level=20");
       
   328 		requestedPostProcType = 0;
       
   329 		foundDecoders.Reset();
       
   330 		expectedDecoders.Reset();
       
   331 		unExpectedDecoders.Reset();
       
   332 		User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   333 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   334 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   335 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   336 		User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   337 
       
   338 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType4(), requestedPostProcType, foundDecoders, EFalse));
       
   339 
       
   340 		if (!error)
       
   341 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   342 		}
       
   343 	
       
   344 	// Supported mime type and post proc type (by exact match)
       
   345 	if (!error)
       
   346 		{
       
   347 		_LIT8(KMimeType5, "video/zippyvideo");
       
   348 		requestedPostProcType = EPpMirror|EPpInputCrop;
       
   349 		foundDecoders.Reset();
       
   350 		expectedDecoders.Reset();
       
   351 		unExpectedDecoders.Reset();
       
   352 		User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   353 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   354 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   355 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   356 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   357 
       
   358 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType5(), requestedPostProcType, foundDecoders, ETrue));
       
   359 
       
   360 		if (!error)
       
   361 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   362 		}
       
   363 	
       
   364 	//Added to check that the mimetype comparison is not case sensitive
       
   365 	if (!error)
       
   366 		{
       
   367 		_LIT8(KMimeType6, "VIDEO/ZIPPYvideo");
       
   368 		requestedPostProcType = EPpMirror|EPpInputCrop;
       
   369 		foundDecoders.Reset();
       
   370 		expectedDecoders.Reset();
       
   371 		unExpectedDecoders.Reset();
       
   372 		User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   373 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   374 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   375 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   376 		User::LeaveIfError(unExpectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   377 
       
   378 		INFO_PRINTF1(_L("To check that the mime type comparison is not case sensitive"));
       
   379 		TRAP(error, aDevVideoPlay.FindDecodersL(KMimeType6(), requestedPostProcType, foundDecoders, ETrue));
       
   380 		INFO_PRINTF2(_L("error = %d"),error);
       
   381 		if (!error)
       
   382 			error = CheckDecoders(foundDecoders, expectedDecoders, unExpectedDecoders);
       
   383 	
       
   384 		}
       
   385 
       
   386 	CleanupStack::PopAndDestroy(3); //foundDecoders, expectedDecoders, unExpectedDecoders
       
   387 
       
   388 	if (!error)
       
   389 		ret = EPass;
       
   390 		
       
   391 	return ret;
       
   392 	}
       
   393 
       
   394 TInt CTestDevVideoPlayFindDecoders::CheckDecoders(const RArray<TUid>& aFoundDecoders, 
       
   395 												  const RArray<TUid>& aExpectedDecoders, 
       
   396 												  const RArray<TUid>& aUnExpectedDecoders)
       
   397 	{
       
   398 	TInt ret = KErrGeneral;
       
   399 
       
   400 	TBool foundUnExpected = EFalse;
       
   401 	TInt numberToBeFoundInExpectedDecoders = aExpectedDecoders.Count();
       
   402 
       
   403 	for (TInt i=0; i<aFoundDecoders.Count(); i++)
       
   404 		{
       
   405 		TUid uidToLookFor = aFoundDecoders[i];
       
   406 		for (TInt j=0; j<aExpectedDecoders.Count(); j++)
       
   407 			{
       
   408 			if (aExpectedDecoders[j] == uidToLookFor)
       
   409 				{
       
   410 				numberToBeFoundInExpectedDecoders--;
       
   411 				break;//j
       
   412 				}
       
   413 			}
       
   414 		for (TInt k=0; k<aUnExpectedDecoders.Count(); k++)
       
   415 			{
       
   416 			if (aUnExpectedDecoders[k] == uidToLookFor)
       
   417 				{
       
   418 				foundUnExpected = ETrue;
       
   419 				break;//k
       
   420 				}
       
   421 			}
       
   422 		}
       
   423 
       
   424 	if ((!foundUnExpected) && (numberToBeFoundInExpectedDecoders==0))
       
   425 		ret = KErrNone;
       
   426 
       
   427 	return ret;
       
   428 	}
       
   429 
       
   430 
       
   431 
       
   432 //------------------------------------------------------------------
       
   433 
       
   434 CTestDevVideoPlayFindPostProc::CTestDevVideoPlayFindPostProc(const TDesC& aTestName, TTestType aTestType)
       
   435 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   436 	{
       
   437 	}
       
   438 
       
   439 CTestDevVideoPlayFindPostProc* CTestDevVideoPlayFindPostProc::NewL(const TDesC& aTestName, TTestType aTestType)
       
   440 	{
       
   441 	CTestDevVideoPlayFindPostProc* self = new(ELeave) CTestDevVideoPlayFindPostProc(aTestName, aTestType);
       
   442 	return self;
       
   443 	}
       
   444 
       
   445 TVerdict CTestDevVideoPlayFindPostProc::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
   446 	{
       
   447 	TVerdict ret = EFail;
       
   448 
       
   449 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  FindPostProc"));
       
   450 
       
   451 	RArray<TUid> foundPostProx;
       
   452 	CleanupClosePushL(foundPostProx);
       
   453 	RArray<TUid> expectedPostProx;
       
   454 	CleanupClosePushL(expectedPostProx);
       
   455 	RArray<TUid> unExpectedPostProx;
       
   456 	CleanupClosePushL(unExpectedPostProx);
       
   457 
       
   458 	TInt error = KErrNone;
       
   459 	TUint32 requestedPostProcType = 0;	
       
   460 
       
   461 	// First ask for post processor isn't supported
       
   462 	if (!error)
       
   463 		{
       
   464 		requestedPostProcType = EPpInputCrop|EPpMirror|EPpScale|EPpOutputPad|EPpNoiseFilter;
       
   465 		foundPostProx.Reset();
       
   466 		expectedPostProx.Reset();
       
   467 		unExpectedPostProx.Reset();
       
   468 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice1));
       
   469 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice2));
       
   470 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice3));
       
   471 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice4));
       
   472 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice5));
       
   473 		
       
   474 		TRAP(error, aDevVideoPlay.FindPostProcessorsL(requestedPostProcType, foundPostProx));
       
   475 		if (error == KErrNotFound)//we actually expect KErrNotFound here
       
   476 			error = KErrNone;
       
   477 		else
       
   478 			error = KErrGeneral;
       
   479 
       
   480 		if (!error)
       
   481 			error = CheckPostProx(foundPostProx, expectedPostProx, unExpectedPostProx);
       
   482 		}
       
   483 
       
   484 	// Next ask for all post processors
       
   485 	if (!error)
       
   486 		{
       
   487 		requestedPostProcType = 0;
       
   488 		foundPostProx.Reset();
       
   489 		expectedPostProx.Reset();
       
   490 		unExpectedPostProx.Reset();
       
   491 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice1));
       
   492 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice2));
       
   493 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice3));
       
   494 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice4));
       
   495 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice5));
       
   496 
       
   497 		TRAP(error, aDevVideoPlay.FindPostProcessorsL(requestedPostProcType, foundPostProx));
       
   498 		if (!error)
       
   499 			error = CheckPostProx(foundPostProx, expectedPostProx, unExpectedPostProx);
       
   500 		}
       
   501 
       
   502 	// Next ask for a specific subset of post processors
       
   503 	if (!error)
       
   504 		{
       
   505 		requestedPostProcType = EPpMirror;
       
   506 		foundPostProx.Reset();
       
   507 		expectedPostProx.Reset();
       
   508 		unExpectedPostProx.Reset();
       
   509 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice1));
       
   510 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice2));
       
   511 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice3));
       
   512 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice4));
       
   513 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice5));
       
   514 
       
   515 		TRAP(error, aDevVideoPlay.FindPostProcessorsL(requestedPostProcType, foundPostProx));
       
   516 		if (!error)
       
   517 			error = CheckPostProx(foundPostProx, expectedPostProx, unExpectedPostProx);
       
   518 		}
       
   519 	
       
   520 	// Next ask for another specific subset of post processors
       
   521 	if (!error)
       
   522 		{
       
   523 		requestedPostProcType = EPpMirror|EPpInputCrop;
       
   524 		foundPostProx.Reset();
       
   525 		expectedPostProx.Reset();
       
   526 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice1));
       
   527 		User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice2));
       
   528 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice3));
       
   529 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice4));
       
   530 		User::LeaveIfError(unExpectedPostProx.Append(KUidDevVideoTestPostProcHwDevice5));
       
   531 
       
   532 		TRAP(error, aDevVideoPlay.FindPostProcessorsL(requestedPostProcType, foundPostProx));
       
   533 		if (!error)
       
   534 			error = CheckPostProx(foundPostProx, expectedPostProx, unExpectedPostProx);
       
   535 		}
       
   536 
       
   537 	CleanupStack::PopAndDestroy(3);//foundPostProx, expectedPostProx, unExpectedPostProx
       
   538 	
       
   539 	if (!error)
       
   540 		ret = EPass;
       
   541 		
       
   542 	return ret;
       
   543 	}
       
   544 
       
   545 
       
   546 TInt CTestDevVideoPlayFindPostProc::CheckPostProx(const RArray<TUid>& aFoundPostProx, 
       
   547 												  const RArray<TUid>& aExpectedPostProx, 
       
   548 												  const RArray<TUid>& aUnExpectedPostProx)
       
   549 	{
       
   550 	TInt ret = KErrGeneral;
       
   551 
       
   552 	TBool foundUnExpected = EFalse;
       
   553 	TInt numberToBeFoundInExpectedPostProx = aExpectedPostProx.Count();
       
   554 
       
   555 	for (TInt i=0; i<aFoundPostProx.Count(); i++)
       
   556 		{
       
   557 		TUid uidToLookFor = aFoundPostProx[i];
       
   558 		for (TInt j=0; j<aExpectedPostProx.Count(); j++)
       
   559 			{
       
   560 			if (aExpectedPostProx[j] == uidToLookFor)
       
   561 				{
       
   562 				numberToBeFoundInExpectedPostProx--;
       
   563 				break;//j
       
   564 				}
       
   565 			}
       
   566 		for (TInt k=0; k<aUnExpectedPostProx.Count(); k++)
       
   567 			{
       
   568 			if (aUnExpectedPostProx[k] == uidToLookFor)
       
   569 				{
       
   570 				foundUnExpected = ETrue;
       
   571 				break;//k
       
   572 				}
       
   573 			}
       
   574 		}
       
   575 
       
   576 	if ((!foundUnExpected) && (numberToBeFoundInExpectedPostProx==0))
       
   577 		ret = KErrNone;
       
   578 
       
   579 	return ret;
       
   580 	}
       
   581 
       
   582 
       
   583 
       
   584 //------------------------------------------------------------------
       
   585 
       
   586 CTestDevVideoPlayListDecoders::CTestDevVideoPlayListDecoders(const TDesC& aTestName, TTestType aTestType)
       
   587 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   588 	{
       
   589 	}
       
   590 
       
   591 CTestDevVideoPlayListDecoders* CTestDevVideoPlayListDecoders::NewL(const TDesC& aTestName, TTestType aTestType)
       
   592 	{
       
   593 	CTestDevVideoPlayListDecoders* self = new(ELeave) CTestDevVideoPlayListDecoders(aTestName, aTestType);
       
   594 	return self;
       
   595 	}
       
   596 
       
   597 TVerdict CTestDevVideoPlayListDecoders::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
   598 	{
       
   599 	TVerdict ret = EFail;
       
   600 	
       
   601 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  ListDecoders"));
       
   602 		
       
   603 	RArray<TUid> foundDecoders;
       
   604 	CleanupClosePushL(foundDecoders);
       
   605 	RArray<TUid> expectedDecoders;
       
   606 	CleanupClosePushL(expectedDecoders);
       
   607 
       
   608 	User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice1));
       
   609 	User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice2));
       
   610 	User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice3));
       
   611 	User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice4));
       
   612 	User::LeaveIfError(expectedDecoders.Append(KUidDevVideoTestDecodeHwDevice5));
       
   613 
       
   614 	TRAPD(err, aDevVideoPlay.GetDecoderListL(foundDecoders));
       
   615 
       
   616 	if (!err)
       
   617 		{		
       
   618 		// Make sure that the video hardware device adapter is NOT in the array
       
   619 		TBool foundAdapter = EFalse;
       
   620 		for (TInt j = 0; j < foundDecoders.Count(); j++)
       
   621 			{
       
   622 			if (foundDecoders[j] == KUidMDFVideoDecoderHwDeviceAdapter)
       
   623 				{
       
   624 				foundAdapter = ETrue;
       
   625 				break;
       
   626 				}
       
   627 			}
       
   628 
       
   629 		// Make sure that all the UIDs of the test plugins are in the array..
       
   630 		TInt numberToBeFound = expectedDecoders.Count();
       
   631 		for (TInt i=0; i<expectedDecoders.Count(); i++)
       
   632 			{
       
   633 			TUid uidToFind = expectedDecoders[i];
       
   634 			for (TInt j=0; j<foundDecoders.Count(); j++)
       
   635 				{
       
   636 				if (foundDecoders[j] == uidToFind)
       
   637 					{
       
   638 					numberToBeFound--;
       
   639 					break;//j
       
   640 					}
       
   641 				}
       
   642 			}
       
   643 		if ((numberToBeFound == 0) && (!foundAdapter))
       
   644 			{
       
   645 			ret = EPass;
       
   646 			}
       
   647 		}
       
   648 
       
   649 	CleanupStack::PopAndDestroy(2);
       
   650 	
       
   651 	return ret;
       
   652 	}
       
   653 
       
   654 
       
   655 
       
   656 
       
   657 //------------------------------------------------------------------
       
   658 
       
   659 CTestDevVideoPlayListPostProc::CTestDevVideoPlayListPostProc(const TDesC& aTestName, TTestType aTestType)
       
   660 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   661 	{
       
   662 	}
       
   663 
       
   664 CTestDevVideoPlayListPostProc* CTestDevVideoPlayListPostProc::NewL(const TDesC& aTestName, TTestType aTestType)
       
   665 	{
       
   666 	CTestDevVideoPlayListPostProc* self = new(ELeave) CTestDevVideoPlayListPostProc(aTestName, aTestType);
       
   667 	return self;
       
   668 	}
       
   669 
       
   670 TVerdict CTestDevVideoPlayListPostProc::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
   671 	{
       
   672 	TVerdict ret = EFail;
       
   673 	
       
   674 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  ListPostProc"));
       
   675 		
       
   676 	RArray<TUid> foundPostProx;
       
   677 	CleanupClosePushL(foundPostProx);
       
   678 	RArray<TUid> expectedPostProx;
       
   679 	CleanupClosePushL(expectedPostProx);
       
   680 
       
   681 	User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice1));
       
   682 	User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice2));
       
   683 	User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice3));
       
   684 	User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice4));
       
   685 	User::LeaveIfError(expectedPostProx.Append(KUidDevVideoTestPostProcHwDevice5));
       
   686 
       
   687 	TRAPD(err, aDevVideoPlay.GetPostProcessorListL(foundPostProx));
       
   688 
       
   689 	if (!err)
       
   690 		{
       
   691 		// Make sure that all the UIDs of the test plugins are in the array..
       
   692 		TInt numberToBeFound = expectedPostProx.Count();
       
   693 		for (TInt i=0; i<expectedPostProx.Count(); i++)
       
   694 			{
       
   695 			TUid uidToFind = expectedPostProx[i];
       
   696 			for (TInt j=0; j<foundPostProx.Count(); j++)
       
   697 				{
       
   698 				if (foundPostProx[j] == uidToFind)
       
   699 					{
       
   700 					numberToBeFound--;
       
   701 					break;//j
       
   702 					}
       
   703 				}
       
   704 			}
       
   705 		if (numberToBeFound == 0)
       
   706 			ret = EPass;
       
   707 		}
       
   708 
       
   709 	CleanupStack::PopAndDestroy(2);
       
   710 
       
   711 	return ret;
       
   712 	}
       
   713 
       
   714 
       
   715 
       
   716 
       
   717 //------------------------------------------------------------------
       
   718 
       
   719 CTestDevVideoPlayGetDecoderInfo::CTestDevVideoPlayGetDecoderInfo(const TDesC& aTestName, TTestType aTestType)
       
   720 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   721 	{
       
   722 	}
       
   723 
       
   724 CTestDevVideoPlayGetDecoderInfo* CTestDevVideoPlayGetDecoderInfo::NewL(const TDesC& aTestName, TTestType aTestType)
       
   725 	{
       
   726 	CTestDevVideoPlayGetDecoderInfo* self = new(ELeave) CTestDevVideoPlayGetDecoderInfo(aTestName, aTestType);
       
   727 	return self;
       
   728 	}
       
   729 
       
   730 TBool CTestDevVideoPlayGetDecoderInfo::ValidDecoderInfo(CVideoDecoderInfo* aInfo)
       
   731 	{
       
   732 	// do null pointer check
       
   733 	if (!aInfo) 
       
   734 		{
       
   735 		ERR_PRINTF1(_L("Error - Decoder Info is NULL!"));
       
   736 		return EFalse;
       
   737 		}
       
   738 	
       
   739 	// check the decoder against test data
       
   740 	// need to check every call so as to keep code coverage
       
   741 	// and prevent a situation where if the first test fails
       
   742 	// then subsequent tests will not be called
       
   743 	TBool ret = ETrue;
       
   744 
       
   745 	// UID check
       
   746 	if (aInfo->Uid() != KUidDevVideoTestDecodeHwDevice)
       
   747 		{
       
   748 		ERR_PRINTF1(_L("Error - Decoder UID is incorrect!"));
       
   749 		ret = EFalse;
       
   750 		}
       
   751 	// Manufacturer check
       
   752 	if (!(aInfo->Manufacturer() == KTestDecoderInfoManufacturer))
       
   753 		{
       
   754 		ERR_PRINTF1(_L("Error - Manufacturer is incorrect!"));
       
   755 		ret = EFalse;
       
   756 		}
       
   757 	// Identifier check
       
   758 	if (!(aInfo->Identifier() == KTestDecoderInfoIdentifier))
       
   759 		{
       
   760 		ERR_PRINTF1(_L("Error - Identifier is incorrect!"));
       
   761 		ret = EFalse;
       
   762 		}
       
   763 	// Version check
       
   764 	TVersion decVer = aInfo->Version();
       
   765 	if ( (decVer.iMajor != KTestDecoderInfoVersionMaj) ||
       
   766 		 (decVer.iMinor != KTestDecoderInfoVersionMin) ||
       
   767 		 (decVer.iBuild != KTestDecoderInfoVersionBuild) )
       
   768 		{
       
   769 		ERR_PRINTF1(_L("Error - Version is incorrect!"));
       
   770 		ret = EFalse;
       
   771 		}
       
   772 	// Accelerated check
       
   773 	if (!aInfo->Accelerated())
       
   774 		{
       
   775 		ERR_PRINTF1(_L("Error - Accelerated = EFalse!"));
       
   776 		ret = EFalse;
       
   777 		}
       
   778 	// Direct display check
       
   779 	if (!aInfo->SupportsDirectDisplay())
       
   780 		{
       
   781 		ERR_PRINTF1(_L("Error - Supports Direct Display = EFalse!"));
       
   782 		ret = EFalse;
       
   783 		}
       
   784 
       
   785 	// Max picture size
       
   786 	TSize maxSize = aInfo->MaxPictureSize();
       
   787 	if (maxSize.iWidth != KTestDecoderInfoMaxSizeX || maxSize.iHeight != KTestDecoderInfoMaxSizeY)
       
   788 		{
       
   789 		ERR_PRINTF1(_L("Error - Max Picture Size is wrong!"));
       
   790 		ret = EFalse;
       
   791 		}
       
   792 
       
   793 	// Max Bitrate
       
   794 	if (aInfo->MaxBitrate() != KMaxTUint)
       
   795 		{
       
   796 		ERR_PRINTF1(_L("Error - Max Bitrate is wrong!"));
       
   797 		ret = EFalse;
       
   798 		}
       
   799 	
       
   800 	// Supports picture loss
       
   801 	if (!aInfo->SupportsPictureLoss())
       
   802 		{
       
   803 		ERR_PRINTF1(_L("Error - Supports Picture Loss = EFalse!"));
       
   804 		ret = EFalse;
       
   805 		}
       
   806 
       
   807 	// Supports slice loss
       
   808 	if (aInfo->SupportsSliceLoss())
       
   809 		{
       
   810 		ERR_PRINTF1(_L("Error - Supports Slice Loss = ETrue!"));
       
   811 		ret = EFalse;
       
   812 		}
       
   813 
       
   814 	// Coding standard info
       
   815 	if (!(aInfo->CodingStandardSpecificInfo() == KTestDecoderInfoCSInfo))
       
   816 		{
       
   817 		ERR_PRINTF1(_L("Error - Coding standard specific info is incorrect!"));
       
   818 		ret = EFalse;
       
   819 		}
       
   820 	// Implementation info
       
   821 	if (!(aInfo->ImplementationSpecificInfo() == KTestDecoderInfoISInfo))
       
   822 		{
       
   823 		ERR_PRINTF1(_L("Error - Implementation specific info is incorrect!"));
       
   824 		ret = EFalse;
       
   825 		}
       
   826 
       
   827 	if (!aInfo->SupportsContentProtected())//Check if flag is set indicating Content Protection is supported.
       
   828 		{
       
   829 		ERR_PRINTF1(_L("Error - Failed To get flag indicating support of Content Protection!"));
       
   830 		ret = EFalse;
       
   831 		}
       
   832 
       
   833 	// get some test compressed video formats
       
   834 	CCompressedVideoFormat* testFormat = NULL;
       
   835 	TInt err = KErrNone;
       
   836 
       
   837 	// get formats supported
       
   838 	const RPointerArray<CCompressedVideoFormat>& vidFormats = aInfo->SupportedFormats();
       
   839 
       
   840 	// get supported max picture rates
       
   841 	TPictureRateAndSize testRate;
       
   842 	const RArray<TPictureRateAndSize>& maxRates = aInfo->MaxPictureRates();
       
   843 
       
   844 	// test formats supported
       
   845 	for (TUint i = 0; i < KTestDecoderInfoCount; i++)
       
   846 		{
       
   847 		TPtrC8 mimeType = KTestDecoderInfoMimeArray[i];
       
   848 		TRAP(err, testFormat = GetTestCVFormatL(mimeType));
       
   849 		if (err != KErrNone)
       
   850 			{
       
   851 			ERR_PRINTF2(_L("Error - Failed to construct CCompressedVideoFormat: %d!"), i);
       
   852 			ret = EFalse;
       
   853 			if(testFormat != NULL)
       
   854 				{
       
   855 				delete testFormat;
       
   856 				testFormat=NULL;
       
   857 				}
       
   858 			break;
       
   859 			}
       
   860 
       
   861 		if (!(*testFormat == *(vidFormats[i])) || !(aInfo->SupportsFormat(*testFormat)))
       
   862 			{
       
   863 			ERR_PRINTF2(_L("Error - Video Format %d is corrupt!"), i);
       
   864 			ret = EFalse;
       
   865 			}
       
   866 
       
   867 		delete testFormat; 
       
   868 		testFormat = NULL;
       
   869 
       
   870 		// Test supported max picture rates
       
   871 		GetTestEncoderInfoRate(i, testRate);
       
   872 		if (!(testRate.iPictureSize == maxRates[i].iPictureSize) || 
       
   873 			!(testRate.iPictureRate == maxRates[i].iPictureRate) )
       
   874 			{
       
   875 			ERR_PRINTF2(_L("Error - picture rate %d is corrupt!"), i);
       
   876 			ret = EFalse;
       
   877 			}
       
   878 		}
       
   879 	//Screen information check
       
   880 #ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
       
   881 	RArray<TInt> supportedScreens;
       
   882 	TRAP(err, aInfo->GetSupportedScreensL(supportedScreens));
       
   883 	if(err != KErrNone)
       
   884 		{
       
   885 		ERR_PRINTF2(_L("GetSupportedScreensL leaves with %d"), err);
       
   886 		ret = EFalse;
       
   887 		}
       
   888 	if(supportedScreens.Count() != KTestScreenCount)
       
   889 		{
       
   890 		ERR_PRINTF1(_L("Error - Unexpected screen count"));
       
   891 		ret = EFalse;
       
   892 		}
       
   893 	err = supportedScreens.Find(KDecoderDefaultScreenNumber);
       
   894 	if(err == KErrNotFound)
       
   895 		{
       
   896 		ERR_PRINTF1(_L("Error - No support for primary screen"));
       
   897 		ret = EFalse;
       
   898 		}
       
   899 	err = supportedScreens.Find(KDecoderSecondaryScreenNumber);
       
   900 	if(err == KErrNotFound)
       
   901 		{
       
   902 		ERR_PRINTF1(_L("Error - No support for secondary screen"));
       
   903 		ret = EFalse;
       
   904 		}
       
   905 	supportedScreens.Close();
       
   906 #endif
       
   907 	// finally check a format which isn't supposed to be supported
       
   908 	TRAP(err, testFormat = GetTestCVFormatL(_L8("Frederick Bloggs and his amazing coloured dog")));
       
   909 	if (err != KErrNone)
       
   910 		{
       
   911 		ERR_PRINTF1(_L("Error - Failed to construct final CCompressedVideoFormat!"));
       
   912 		ret = EFalse;
       
   913 		}
       
   914 	else 
       
   915 		{
       
   916 		if (aInfo->SupportsFormat(*testFormat))
       
   917 			{
       
   918 			ERR_PRINTF1(_L("Error - Failed negative SupportsFormat() check!"));
       
   919 			ret = EFalse;
       
   920 			}
       
   921 		}
       
   922 
       
   923 	if(testFormat != NULL)
       
   924 		{
       
   925 		delete testFormat;
       
   926 		testFormat=NULL;
       
   927 		}
       
   928 	return ret;
       
   929 	}
       
   930 
       
   931 TVerdict CTestDevVideoPlayGetDecoderInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
   932 	{
       
   933 	TVerdict ret = EPass;
       
   934 	TInt expErr = KErrNone;
       
   935 	
       
   936 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetDecoderInfo"));
       
   937 
       
   938 	// expected results		
       
   939 	if (iTestType != ETestValid)
       
   940 		{
       
   941 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
   942 		return EInconclusive;
       
   943 		}
       
   944 	
       
   945 	TInt err = KErrNone;
       
   946 	CVideoDecoderInfo *decInfo = NULL;
       
   947 	TBool valid = EFalse;
       
   948 	
       
   949 	// get decoder information from test decoder plugin
       
   950 	
       
   951 	TRAP(err, 
       
   952 		decInfo = aDevVideoPlay.VideoDecoderInfoLC(KUidDevVideoTestDecodeHwDevice); 
       
   953 		valid = ValidDecoderInfo(decInfo);
       
   954 		CleanupStack::PopAndDestroy(decInfo); );
       
   955 	if (err != expErr)
       
   956 		{
       
   957 		ERR_PRINTF3(_L("VideoDecoderInfoLC() gave error %d (expected %d)"),err, expErr);
       
   958 		ret = EFail;
       
   959 		}
       
   960 	// check the Video Decoder
       
   961 	else if (!valid)
       
   962 		{
       
   963 		ERR_PRINTF1(_L("CVideoDecoderInfo class is corrupt!"));
       
   964 		ret = EFail;
       
   965 		}
       
   966 	else
       
   967 		{
       
   968 		INFO_PRINTF1(_L("CVideoDecoderInfo passed check successfully"));
       
   969 		INFO_PRINTF3(_L("VideoDecoderInfoLC(), %d = %d"), err, expErr);
       
   970 		}
       
   971 		
       
   972 	return ret;
       
   973 	}
       
   974 
       
   975 
       
   976 
       
   977 
       
   978 //------------------------------------------------------------------
       
   979 
       
   980 CTestDevVideoPlayGetPostProcInfo::CTestDevVideoPlayGetPostProcInfo(const TDesC& aTestName, TTestType aTestType)
       
   981 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
   982 	{
       
   983 	}
       
   984 
       
   985 CTestDevVideoPlayGetPostProcInfo* CTestDevVideoPlayGetPostProcInfo::NewL(const TDesC& aTestName, TTestType aTestType)
       
   986 	{
       
   987 	CTestDevVideoPlayGetPostProcInfo* self = new(ELeave) CTestDevVideoPlayGetPostProcInfo(aTestName, aTestType);
       
   988 	return self;
       
   989 	}
       
   990 
       
   991 TBool CTestDevVideoPlayGetPostProcInfo::ValidPostProcInfo(CPostProcessorInfo* aInfo)
       
   992 	{
       
   993 	// do null pointer check
       
   994 	if (!aInfo) 
       
   995 		{
       
   996 		ERR_PRINTF1(_L("Error - Post Processor Info is NULL!"));
       
   997 		return EFalse;
       
   998 		}
       
   999 	
       
  1000 	// check the post processor against test data
       
  1001 	// need to check every call so as to keep code coverage
       
  1002 	// and prevent a situation where if the first test fails
       
  1003 	// then subsequent tests will not be called
       
  1004 	TBool ret = ETrue;
       
  1005 
       
  1006 	// UID check
       
  1007 	if (aInfo->Uid() != KUidDevVideoTestPostProcHwDevice)
       
  1008 		{
       
  1009 		ERR_PRINTF1(_L("Error - Post Processor UID is incorrect!"));
       
  1010 		ret = EFalse;
       
  1011 		}
       
  1012 	// Manufacturer check
       
  1013 	if (!(aInfo->Manufacturer() == KTestPostProcInfoManufacturer))
       
  1014 		{
       
  1015 		ERR_PRINTF1(_L("Error - Manufacturer is incorrect!"));
       
  1016 		ret = EFalse;
       
  1017 		}
       
  1018 	// Identifier check
       
  1019 	if (!(aInfo->Identifier() == KTestPostProcInfoIdentifier))
       
  1020 		{
       
  1021 		ERR_PRINTF1(_L("Error - Identifier is incorrect!"));
       
  1022 		ret = EFalse;
       
  1023 		}
       
  1024 	// Version check
       
  1025 	TVersion posVer = aInfo->Version();
       
  1026 	if ( (posVer.iMajor != KTestPostProcInfoVersionMaj) ||
       
  1027 		 (posVer.iMinor != KTestPostProcInfoVersionMin) ||
       
  1028 		 (posVer.iBuild != KTestPostProcInfoVersionBuild) )
       
  1029 		{
       
  1030 		ERR_PRINTF1(_L("Error - Version is incorrect!"));
       
  1031 		ret = EFalse;
       
  1032 		}
       
  1033 	// Accelerated check
       
  1034 	if (!aInfo->Accelerated())
       
  1035 		{
       
  1036 		ERR_PRINTF1(_L("Error - Accelerated = EFalse!"));
       
  1037 		ret = EFalse;
       
  1038 		}
       
  1039 	// Direct display check
       
  1040 	if (!aInfo->SupportsDirectDisplay())
       
  1041 		{
       
  1042 		ERR_PRINTF1(_L("Error - Supports Direct Display = EFalse!"));
       
  1043 		ret = EFalse;
       
  1044 		}
       
  1045 	// YUVToRGB Capabilities
       
  1046 	if (!CompareYuvRgbCaps(aInfo->YuvToRgbCapabilities(), KTestPostProcInfoYuvToRgbCaps))
       
  1047 		{
       
  1048 		ERR_PRINTF1(_L("Error - YUV To RGB capabilities is incorrect!"));
       
  1049 		ret = EFalse;
       
  1050 		}
       
  1051 
       
  1052 	// Supported rotations
       
  1053 	if (aInfo->SupportedRotations() != KTestPostProcInfoRotations)
       
  1054 		{
       
  1055 		ERR_PRINTF1(_L("Error - Supported Rotations is incorrect!"));
       
  1056 		ret = EFalse;
       
  1057 		}
       
  1058 
       
  1059 	// Supports arbitrary scaling check
       
  1060 	if (!aInfo->AntiAliasedScaling())
       
  1061 		{
       
  1062 		ERR_PRINTF1(_L("Error - Anti-Aliased Scaling = EFalse!"));
       
  1063 		ret = EFalse;
       
  1064 		}
       
  1065 	// Supports anti-aliased scaling check
       
  1066 	if (!aInfo->SupportsArbitraryScaling())
       
  1067 		{
       
  1068 		ERR_PRINTF1(_L("Error - Supports Arbitrary Scaling = EFalse!"));
       
  1069 		ret = EFalse;
       
  1070 		}
       
  1071 	// Implementation info
       
  1072 	if (!(aInfo->ImplementationSpecificInfo() == KTestPostProcInfoISInfo))
       
  1073 		{
       
  1074 		ERR_PRINTF1(_L("Error - Implementation specific info is incorrect!"));
       
  1075 		ret = EFalse;
       
  1076 		}
       
  1077 
       
  1078 	// get some test compressed video formats
       
  1079 	TUncompressedVideoFormat testFormat;
       
  1080 	TUint32 testComb = 0;
       
  1081 	TScaleFactor testFactor = {0, 0};
       
  1082 
       
  1083 	// get supported formats
       
  1084 	const RArray<TUncompressedVideoFormat>& vidFormats = aInfo->SupportedFormats();
       
  1085 	
       
  1086 	// get supported combinations
       
  1087 	const RArray<TUint32>& suppCombs = aInfo->SupportedCombinations();
       
  1088 
       
  1089 	// get supported scale factors
       
  1090 	const RArray<TScaleFactor>& scaleFactors = aInfo->SupportedScaleFactors();
       
  1091 
       
  1092 	// test formats, combinations, and scale factors supported
       
  1093 	for (TUint i = 0; i < KTestPostProcInfoCount; i++)
       
  1094 		{
       
  1095 		testFormat = KTestPostProcInfoFormatArray[i];
       
  1096 		if (!(testFormat == (vidFormats[i])) || !(aInfo->SupportsFormat(testFormat)))
       
  1097 			{
       
  1098 			ERR_PRINTF2(_L("Error - Video Format %d is corrupt!"), i);
       
  1099 			ret = EFalse;
       
  1100 			}
       
  1101 
       
  1102 		testComb = KTestPostProcInfoCombsArray[i];
       
  1103 		if (!(testComb == (suppCombs[i])) || !(aInfo->SupportsCombination(testComb)))
       
  1104 			{
       
  1105 			ERR_PRINTF2(_L("Error - Combination %d is corrupt!"), i);
       
  1106 			ret = EFalse;
       
  1107 			}
       
  1108 
       
  1109 		testFactor = KTestPostProcInfoScaleFactorsArray[i];
       
  1110 		if (!CompareScaleFactors(testFactor, scaleFactors[i]))
       
  1111 			{
       
  1112 			ERR_PRINTF2(_L("Error - Scale factor %d is corrupt!"), i);
       
  1113 			ret = EFalse;
       
  1114 			}
       
  1115 		}
       
  1116 
       
  1117 	//Screen information check
       
  1118 #ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
       
  1119 	RArray<TInt> supportedScreens;
       
  1120 	TRAPD(err, aInfo->GetSupportedScreensL(supportedScreens));
       
  1121 	if(err != KErrNone)
       
  1122 		{
       
  1123 		ERR_PRINTF2(_L("GetSupportedScreensL leaves with %d"), err);
       
  1124 		ret = EFalse;
       
  1125 		}
       
  1126 	if(supportedScreens.Count() != KTestScreenCount)
       
  1127 		{
       
  1128 		ERR_PRINTF1(_L("Error - Unexpected screen count"));
       
  1129 		ret = EFalse;
       
  1130 		}
       
  1131 	err = supportedScreens.Find(KPostProcDefaultScreenNumber);
       
  1132 	if(err == KErrNotFound)
       
  1133 		{
       
  1134 		ERR_PRINTF1(_L("Error - No support for primary screen"));
       
  1135 		ret = EFalse;
       
  1136 		}
       
  1137 	err = supportedScreens.Find(KPostProcSecondaryScreenNumber);
       
  1138 	if(err == KErrNotFound)
       
  1139 		{
       
  1140 		ERR_PRINTF1(_L("Error - No support for secondary screen"));
       
  1141 		ret = EFalse;
       
  1142 		}
       
  1143 	supportedScreens.Close();
       
  1144 #endif
       
  1145 	// check a format that isn't supposed to be supported
       
  1146 	testFormat = KTestPostProcInfoNegativeFormat;
       
  1147 	testFormat.iYuvFormat = KTestYuvFormat1;
       
  1148 	if (aInfo->SupportsFormat(testFormat))
       
  1149 		{
       
  1150 		ERR_PRINTF1(_L("Error - Failed negative SupportsFormat() check!"));
       
  1151 		ret = EFalse;
       
  1152 		}
       
  1153 	
       
  1154 	// finally check a combination that isn't supposed to be supported
       
  1155 	testComb = KTestPostProcInfoNegativeComb;
       
  1156 	if (aInfo->SupportsCombination(testComb))
       
  1157 		{
       
  1158 		ERR_PRINTF1(_L("Error - Failed negative SupportsCombination() check!"));
       
  1159 		ret = EFalse;
       
  1160 		}
       
  1161 
       
  1162 	if (!aInfo->SupportsContentProtected())//Check if flah is set indicating Content Protection is supported.
       
  1163 		{
       
  1164 		ERR_PRINTF1(_L("Error - Failed To get flag indicating support of Content Protection!"));
       
  1165 		ret = EFalse;
       
  1166 		}
       
  1167 
       
  1168 	return ret;
       
  1169 	}
       
  1170 
       
  1171 TVerdict CTestDevVideoPlayGetPostProcInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1172 	{
       
  1173 	TVerdict ret = EPass;
       
  1174 	TInt expErr = KErrNone;
       
  1175 	
       
  1176 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetPostProcInfo"));
       
  1177 	
       
  1178 	// expected results
       
  1179 	if (iTestType != ETestValid)
       
  1180 		{
       
  1181 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1182 		return EInconclusive;
       
  1183 		}
       
  1184 	
       
  1185 	TInt err = KErrNone;
       
  1186 	CPostProcessorInfo *procInfo = NULL;
       
  1187 	TBool valid = EFalse;
       
  1188 	
       
  1189 	// get decoder information from test decoder plugin
       
  1190 	TRAP(err, 
       
  1191 		procInfo = aDevVideoPlay.PostProcessorInfoLC(KUidDevVideoTestPostProcHwDevice);
       
  1192 	        procInfo->SetSupportsContentProtected(ETrue);	
       
  1193 		valid = ValidPostProcInfo(procInfo);
       
  1194 		CleanupStack::PopAndDestroy(procInfo); );
       
  1195 
       
  1196 	if (err != expErr)
       
  1197 		{
       
  1198 		ERR_PRINTF3(_L("PostProcessorInfoLC() gave error %d (expected %d)"),err, expErr);
       
  1199 		ret = EFail;
       
  1200 		}
       
  1201 	// check the Video Post Processor
       
  1202 	else if (!valid)
       
  1203 		{
       
  1204 		ERR_PRINTF1(_L("CPostProcessorInfo class is corrupt!"));
       
  1205 		ret = EFail;
       
  1206 		}
       
  1207 	else
       
  1208 		{
       
  1209 		INFO_PRINTF1(_L("CPostProcessorInfo passed check successfully"));
       
  1210 		INFO_PRINTF3(_L("PostProcessorInfoLC(), %d = %d"), err, expErr);
       
  1211 		}
       
  1212 
       
  1213 	return ret;
       
  1214 	}
       
  1215 
       
  1216 //------------------------------------------------------------------
       
  1217 
       
  1218 CTestDevVideoPlaySelectDecoder::CTestDevVideoPlaySelectDecoder(const TDesC& aTestName, TTestType aTestType)
       
  1219 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1220 	{
       
  1221 	}
       
  1222 
       
  1223 CTestDevVideoPlaySelectDecoder* CTestDevVideoPlaySelectDecoder::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1224 	{
       
  1225 	CTestDevVideoPlaySelectDecoder* self = new(ELeave) CTestDevVideoPlaySelectDecoder(aTestName, aTestType);
       
  1226 	return self;
       
  1227 	}
       
  1228 
       
  1229 TVerdict CTestDevVideoPlaySelectDecoder::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1230 	{
       
  1231 	TVerdict ret = EPass;
       
  1232 	TInt expErr = KErrNone;
       
  1233 	
       
  1234 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SelectDecoder"));
       
  1235 	
       
  1236 	// expected results
       
  1237 	if (iTestType != ETestValid)
       
  1238 		{
       
  1239 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1240 		return EInconclusive;
       
  1241 		}
       
  1242 	
       
  1243 	iError = KErrNone;
       
  1244 
       
  1245 	// this will leave if an error occurs
       
  1246 	TRAP( iError, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice) );
       
  1247 
       
  1248 	if (iError != expErr)
       
  1249 		{
       
  1250 		ERR_PRINTF3(_L("SelectDecoderL() gave error %d (expected %d)"),iError, expErr);
       
  1251 		ret = EFail;
       
  1252 		}
       
  1253 	else
       
  1254 		INFO_PRINTF3(_L("SelectDecoderL(), %d = %d"), iError, expErr);
       
  1255 	
       
  1256 	return ret;
       
  1257 	}
       
  1258 
       
  1259 //------------------------------------------------------------------
       
  1260 
       
  1261 CTestDevVideoPlaySelectPostProc::CTestDevVideoPlaySelectPostProc(const TDesC& aTestName, TTestType aTestType)
       
  1262 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1263 	{
       
  1264 	}
       
  1265 
       
  1266 CTestDevVideoPlaySelectPostProc* CTestDevVideoPlaySelectPostProc::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1267 	{
       
  1268 	CTestDevVideoPlaySelectPostProc* self = new(ELeave) CTestDevVideoPlaySelectPostProc(aTestName, aTestType);
       
  1269 	return self;
       
  1270 	}
       
  1271 
       
  1272 TVerdict CTestDevVideoPlaySelectPostProc::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1273 	{
       
  1274 	TVerdict ret = EPass;
       
  1275 	TInt expErr = KErrNone;
       
  1276 	
       
  1277 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SelectPostProc"));
       
  1278 	
       
  1279 	// expected results
       
  1280 	if (iTestType != ETestValid)
       
  1281 		{
       
  1282 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1283 		return EInconclusive;
       
  1284 		}
       
  1285 	
       
  1286 	iError = KErrNone;
       
  1287 	
       
  1288 	// this will leave if an error occurs
       
  1289 	TRAP( iError, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice) );
       
  1290 
       
  1291 	if (iError != expErr)
       
  1292 		{
       
  1293 		ERR_PRINTF3(_L("SelectPostProcessorL() gave error %d (expected %d)"),iError, expErr);
       
  1294 		ret = EFail;
       
  1295 		}
       
  1296 	else
       
  1297 		INFO_PRINTF3(_L("SelectPostProcessorL(), %d = %d"), iError, expErr);
       
  1298 	
       
  1299 	return ret;
       
  1300 	}
       
  1301 
       
  1302 //------------------------------------------------------------------
       
  1303 
       
  1304 CTestDevVideoPlayGetHeaderInfo::CTestDevVideoPlayGetHeaderInfo(const TDesC& aTestName, TTestType aTestType)
       
  1305 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1306 	{
       
  1307 	}
       
  1308 
       
  1309 CTestDevVideoPlayGetHeaderInfo* CTestDevVideoPlayGetHeaderInfo::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1310 	{
       
  1311 	CTestDevVideoPlayGetHeaderInfo* self = new(ELeave) CTestDevVideoPlayGetHeaderInfo(aTestName, aTestType);
       
  1312 	return self;
       
  1313 	}
       
  1314 
       
  1315 TBool CTestDevVideoPlayGetHeaderInfo::ValidPictureHeader(const TVideoPictureHeader* aPictureHeader)
       
  1316 	{
       
  1317 	TBool ret = EFalse;
       
  1318 
       
  1319 	if (!aPictureHeader)
       
  1320 		{
       
  1321 		ERR_PRINTF1(_L("Error - Picture Header is NULL!"));
       
  1322 		return EFalse;
       
  1323 		}
       
  1324 
       
  1325 	TTimeIntervalMicroSeconds testTime(KTestInputBufferTimestamp);
       
  1326 
       
  1327 	// check the picture header
       
  1328 	if (aPictureHeader->iOptions != KTestPictureHeaderOptions)
       
  1329 		{
       
  1330 		ERR_PRINTF1(_L("Error - Options are incorrect!"));
       
  1331 		}
       
  1332 
       
  1333 	else if (!(aPictureHeader->iPresentationTimestamp == testTime))
       
  1334 		{
       
  1335 		ERR_PRINTF1(_L("Error - Timestamp is incorrect!"));
       
  1336 		}
       
  1337 	else if (!(*(aPictureHeader->iOptional) == KTestInputBufferData()))
       
  1338 		{	
       
  1339 		ERR_PRINTF1(_L("Error - Optional data is corrupt!"));
       
  1340 		}
       
  1341 	else 
       
  1342 		{
       
  1343 		INFO_PRINTF1(_L("Picture Header is valid"));
       
  1344 		ret = ETrue;
       
  1345 		}
       
  1346 
       
  1347 	return ret;
       
  1348 	}
       
  1349 
       
  1350 TVerdict CTestDevVideoPlayGetHeaderInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1351 	{
       
  1352 	TVerdict ret = EPass;
       
  1353 	TInt expErr = KErrNone;
       
  1354 	
       
  1355 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetHeaderInfo"));
       
  1356 	
       
  1357 	// expected results
       
  1358 	if (iTestType != ETestValid)
       
  1359 		{
       
  1360 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1361 		return EInconclusive;
       
  1362 		}
       
  1363 	
       
  1364 	TInt err = KErrNone;
       
  1365 //	THwDeviceId hwDecoder = 0;
       
  1366 
       
  1367 	// select decoder
       
  1368 //	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1369 	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
       
  1370 	if (err != KErrNone)
       
  1371 		{
       
  1372 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1373 		return EInconclusive;
       
  1374 		}
       
  1375 
       
  1376 	// construct a test video input buffer with a valid timestamp
       
  1377 	TPtrC8 testInputBufferDataLitCPtr(KTestInputBufferData);
       
  1378 	HBufC8* testInputBufferData = testInputBufferDataLitCPtr.AllocLC();
       
  1379 
       
  1380 	TVideoInputBuffer testBuffer;
       
  1381 	testBuffer.iOptions = KTestInputBufferOptions;
       
  1382 	testBuffer.iPresentationTimestamp = KTestInputBufferTimestamp;
       
  1383 	testBuffer.iData.Set(testInputBufferData->Des());
       
  1384 
       
  1385 	TVideoPictureHeader* picHeader = NULL;
       
  1386 	// get header information from test data unit
       
  1387 	TRAP(err, picHeader = aDevVideoPlay.GetHeaderInformationL(KTestDataUnitType, KTestDataUnitEncap, &testBuffer) );
       
  1388 
       
  1389 	if (err != expErr)
       
  1390 		{
       
  1391 		ERR_PRINTF3(_L("GetHeaderInformationL() gave error %d (expected %d)"),err, expErr);
       
  1392 		ret = EFail;
       
  1393 		}
       
  1394 	else if (!ValidPictureHeader(picHeader))
       
  1395 		{
       
  1396 		ERR_PRINTF1(_L("Picture header corrupt!"));
       
  1397 		ret = EFail;
       
  1398 		}
       
  1399 	else
       
  1400 		{
       
  1401 		INFO_PRINTF1(_L("Header information retrieved successfully"));
       
  1402 		INFO_PRINTF3(_L("GetHeaderInformationL(), %d = %d"), err, expErr);	
       
  1403 		}
       
  1404 
       
  1405 	CleanupStack::PopAndDestroy(testInputBufferData);
       
  1406 	
       
  1407 	return ret;
       
  1408 	}
       
  1409 
       
  1410 //------------------------------------------------------------------
       
  1411 
       
  1412 CTestDevVideoPlayReturnHeader::CTestDevVideoPlayReturnHeader(const TDesC& aTestName, TTestType aTestType)
       
  1413 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1414 	{
       
  1415 	}
       
  1416 
       
  1417 CTestDevVideoPlayReturnHeader* CTestDevVideoPlayReturnHeader::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1418 	{
       
  1419 	CTestDevVideoPlayReturnHeader* self = new(ELeave) CTestDevVideoPlayReturnHeader(aTestName, aTestType);
       
  1420 	return self;
       
  1421 	}
       
  1422 
       
  1423 TVerdict CTestDevVideoPlayReturnHeader::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1424 	{
       
  1425 	TVerdict ret = EPass;
       
  1426 	
       
  1427 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  ReturnHeader"));
       
  1428 	
       
  1429 	// expected results
       
  1430 	if (iTestType != ETestValid)
       
  1431 		{
       
  1432 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1433 		return EInconclusive;
       
  1434 		}
       
  1435 	
       
  1436 	TInt err = KErrNone;
       
  1437 //	THwDeviceId hwDecoder = 0;
       
  1438 
       
  1439 	// select decoder
       
  1440 //	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1441 	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
       
  1442 	if (err != KErrNone)
       
  1443 		{
       
  1444 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1445 		return EInconclusive;
       
  1446 		}
       
  1447 
       
  1448 	TVideoPictureHeader picHeader;
       
  1449 	picHeader.iOptions = KTestPictureHeaderOptions;
       
  1450 	TTimeIntervalMicroSeconds testTime(KTestPictureHeaderTimestamp);
       
  1451 	picHeader.iPresentationTimestamp = testTime;
       
  1452 
       
  1453 	// return picture header [can use a local TVideoPictureHeader because we
       
  1454 	// are testing a fake plugin - normally this would be a header supplied by
       
  1455 	// the video plugin].
       
  1456 	aDevVideoPlay.ReturnHeader(&picHeader);
       
  1457 	
       
  1458 	// if plugin didn't PANIC then test has passed
       
  1459 	INFO_PRINTF1(_L("Header information returned successfully"));
       
  1460 			
       
  1461 	return ret;
       
  1462 	}
       
  1463 
       
  1464 //------------------------------------------------------------------
       
  1465 
       
  1466 CTestDevVideoPlayConfigureDecoder::CTestDevVideoPlayConfigureDecoder(const TDesC& aTestName, TTestType aTestType)
       
  1467 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1468 	{
       
  1469 	}
       
  1470 
       
  1471 CTestDevVideoPlayConfigureDecoder* CTestDevVideoPlayConfigureDecoder::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1472 	{
       
  1473 	CTestDevVideoPlayConfigureDecoder* self = new(ELeave) CTestDevVideoPlayConfigureDecoder(aTestName, aTestType);
       
  1474 	return self;
       
  1475 	}
       
  1476 
       
  1477 TVerdict CTestDevVideoPlayConfigureDecoder::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1478 	{
       
  1479 	TVerdict ret = EPass;
       
  1480 	TInt expErr;
       
  1481 
       
  1482 	expErr = KErrNone;
       
  1483 	
       
  1484 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  ConfigureDecoderL"));
       
  1485 	
       
  1486 	// expected results
       
  1487 	if (iTestType != ETestValid)
       
  1488 		{
       
  1489 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1490 		return EInconclusive;
       
  1491 		}
       
  1492 	
       
  1493 	TInt err = KErrNone;
       
  1494 	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
       
  1495 	if (err != KErrNone)
       
  1496 		{
       
  1497 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1498 		return EInconclusive;
       
  1499 		}
       
  1500 
       
  1501 	//construct a test picture header
       
  1502 	TVideoPictureHeader pictureHeader;
       
  1503 	pictureHeader.iOptions = KTestPictureHeaderOptions;
       
  1504 	pictureHeader.iPresentationTimestamp = KTestInputBufferTimestamp;
       
  1505 
       
  1506 	TPtrC8 testInputBufferDataLitCPtr(KTestInputBufferData);
       
  1507 	pictureHeader.iOptional = &testInputBufferDataLitCPtr;
       
  1508 
       
  1509 	// get header information from test data unit
       
  1510 	TRAP(err, aDevVideoPlay.ConfigureDecoderL(pictureHeader));
       
  1511 
       
  1512 	if (err != expErr)
       
  1513 		{
       
  1514 		ERR_PRINTF3(_L("ConfigureDecoderL() gave error %d (expected %d)"),err, expErr);
       
  1515 		ret = EFail;
       
  1516 		}
       
  1517 	else
       
  1518 		{
       
  1519 		if (err == KErrNone)
       
  1520 			{
       
  1521 			INFO_PRINTF1(_L("Header information successfully configured in Decoder"));
       
  1522 			}
       
  1523 		INFO_PRINTF3(_L("ConfigureDecoderL(), error %d = expected %d"), err, expErr);	
       
  1524 		}
       
  1525 	
       
  1526 	return ret;
       
  1527 	}
       
  1528 
       
  1529 //------------------------------------------------------------------
       
  1530 
       
  1531 CTestDevVideoPlaySetInputFormatUC::CTestDevVideoPlaySetInputFormatUC(const TDesC& aTestName, TTestType aTestType)
       
  1532 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1533 	{
       
  1534 	}
       
  1535 
       
  1536 CTestDevVideoPlaySetInputFormatUC* CTestDevVideoPlaySetInputFormatUC::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1537 	{
       
  1538 	CTestDevVideoPlaySetInputFormatUC* self = new(ELeave) CTestDevVideoPlaySetInputFormatUC(aTestName, aTestType);
       
  1539 	return self;
       
  1540 	}
       
  1541 
       
  1542 TVerdict CTestDevVideoPlaySetInputFormatUC::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1543 	{
       
  1544 	TVerdict ret = EPass;
       
  1545 	TInt expErr = KErrNone;
       
  1546 	
       
  1547 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SetInputFormatUC"));
       
  1548 	
       
  1549 	// expected results
       
  1550 	if (iTestType != ETestValid)
       
  1551 		{
       
  1552 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1553 		return EInconclusive;
       
  1554 		}
       
  1555 
       
  1556 	TInt err = KErrNone;
       
  1557 
       
  1558 //	THwDeviceId hwDecoder = 0;
       
  1559 	THwDeviceId hwPostProc = 0;
       
  1560 
       
  1561 	// select decoder
       
  1562 //	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1563 	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
       
  1564 	if (err != KErrNone)
       
  1565 		{
       
  1566 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1567 		return EInconclusive;
       
  1568 		}
       
  1569 
       
  1570 	// select post-processor
       
  1571 	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
       
  1572 	if (err != KErrNone)
       
  1573 		{
       
  1574 		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
       
  1575 		return EInconclusive;
       
  1576 		}
       
  1577 
       
  1578 	// this will leave if an error occurs in either plugin
       
  1579 	TRAP(err, aDevVideoPlay.SetInputFormatL(hwPostProc, KTestVidFormat2) );
       
  1580 
       
  1581 	if ( err != expErr )
       
  1582 		{
       
  1583 		ERR_PRINTF3(_L("SetInputFormatL() on Post-Processor gave error %d (expected %d)"),err, expErr);
       
  1584 		ret = EFail;
       
  1585 		}
       
  1586 	else
       
  1587 		INFO_PRINTF3(_L("SetInputFormat(), %d = %d"), err, expErr);
       
  1588 	
       
  1589 	return ret;
       
  1590 	}
       
  1591 //------------------------------------------------------------------
       
  1592 
       
  1593 CTestDevVideoPlaySetInputFormat::CTestDevVideoPlaySetInputFormat(const TDesC& aTestName, TTestType aTestType)
       
  1594 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1595 	{
       
  1596 	}
       
  1597 
       
  1598 CTestDevVideoPlaySetInputFormat* CTestDevVideoPlaySetInputFormat::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1599 	{
       
  1600 	CTestDevVideoPlaySetInputFormat* self = new(ELeave) CTestDevVideoPlaySetInputFormat(aTestName, aTestType);
       
  1601 	return self;
       
  1602 	}
       
  1603 
       
  1604 TVerdict CTestDevVideoPlaySetInputFormat::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1605 	{
       
  1606 	TVerdict ret = EPass;
       
  1607 	TInt expErr = KErrNone;
       
  1608 	
       
  1609 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SetInputFormat"));
       
  1610 	
       
  1611 	// expected results
       
  1612 	if (iTestType != ETestValid)
       
  1613 		{
       
  1614 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1615 		return EInconclusive;
       
  1616 		}
       
  1617 
       
  1618 	TInt err = KErrNone;
       
  1619 
       
  1620 	THwDeviceId hwDecoder = 0;
       
  1621 //	THwDeviceId hwPostProc = 0;
       
  1622 
       
  1623 	// select decoder
       
  1624 	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1625 	if (err != KErrNone)
       
  1626 		{
       
  1627 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1628 		return EInconclusive;
       
  1629 		}
       
  1630 
       
  1631 	// select post-processor
       
  1632 //	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
       
  1633 	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
       
  1634 	if (err != KErrNone)
       
  1635 		{
       
  1636 		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
       
  1637 		return EInconclusive;
       
  1638 		}
       
  1639 
       
  1640 	// get a temporary compressed video class
       
  1641 	CCompressedVideoFormat *tempCFormat = NULL;
       
  1642 	TRAP(err, tempCFormat = GetTestCVFormatL(KTestMimeType1));
       
  1643 	if (err != KErrNone)
       
  1644 		{
       
  1645 		ERR_PRINTF1(_L("Error - couldn't initialize compressed video class"));
       
  1646 		return EInconclusive;
       
  1647 		}
       
  1648 
       
  1649 	// this will leave if an error occurs
       
  1650 	TRAP(err, aDevVideoPlay.SetInputFormatL(hwDecoder, *tempCFormat, KTestUnitType1, KTestEncapType1, ETrue) );
       
  1651 
       
  1652 	// delete compressed video class
       
  1653 	delete tempCFormat;	
       
  1654 	tempCFormat = NULL;
       
  1655 
       
  1656 	if ( err != expErr )
       
  1657 		{
       
  1658 		ERR_PRINTF3(_L("SetInputFormatL() on Decoder gave error %d (expected %d)"),err, expErr);
       
  1659 		ret = EFail;
       
  1660 		}
       
  1661 	else
       
  1662 		INFO_PRINTF3(_L("SetInputFormat(), %d = %d"), err, expErr);
       
  1663 	
       
  1664 	return ret;
       
  1665 	}
       
  1666 //------------------------------------------------------------------
       
  1667 
       
  1668 CTestDevVideoPlayGetOutputFormatList::CTestDevVideoPlayGetOutputFormatList(const TDesC& aTestName, TTestType aTestType)
       
  1669 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1670 	{
       
  1671 	}
       
  1672 
       
  1673 CTestDevVideoPlayGetOutputFormatList* CTestDevVideoPlayGetOutputFormatList::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1674 	{
       
  1675 	CTestDevVideoPlayGetOutputFormatList* self = new(ELeave) CTestDevVideoPlayGetOutputFormatList(aTestName, aTestType);
       
  1676 	return self;
       
  1677 	}
       
  1678 
       
  1679 TVerdict CTestDevVideoPlayGetOutputFormatList::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1680 	{
       
  1681 	TVerdict ret = EPass;
       
  1682 	TInt expErr = KErrNone;
       
  1683 	
       
  1684 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetOutputFormatList"));
       
  1685 	
       
  1686 	// expected results
       
  1687 	if (iTestType != ETestValid)
       
  1688 		{
       
  1689 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1690 		return EInconclusive;
       
  1691 		}
       
  1692 
       
  1693 	TInt err = KErrNone;
       
  1694 	TInt err2 = KErrNone;
       
  1695 
       
  1696 	THwDeviceId hwDecoder = 0;
       
  1697 	THwDeviceId hwPostProc = 0;
       
  1698 
       
  1699 	// select decoder
       
  1700 	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1701 	if (err != KErrNone)
       
  1702 		{
       
  1703 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1704 		return EInconclusive;
       
  1705 		}
       
  1706 
       
  1707 	// select post-processor
       
  1708 	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
       
  1709 	if (err != KErrNone)
       
  1710 		{
       
  1711 		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
       
  1712 		return EInconclusive;
       
  1713 		}
       
  1714 
       
  1715 	RArray<TUncompressedVideoFormat> decodeList;
       
  1716 	RArray<TUncompressedVideoFormat> postProcList;
       
  1717 
       
  1718 	// Get output format list for decoder
       
  1719 	TRAP(err, aDevVideoPlay.GetOutputFormatListL(hwDecoder, decodeList));
       
  1720 		
       
  1721 	// Get output format list for post-processor
       
  1722 	TRAP(err2, aDevVideoPlay.GetOutputFormatListL(hwPostProc, postProcList));
       
  1723 	
       
  1724 	if ((err != expErr) || (err2 != expErr))
       
  1725 		{
       
  1726 		ERR_PRINTF3(_L("GetOutputFormatListL() on Decoder gave error %d (expected %d)"),err, expErr);
       
  1727 		ERR_PRINTF3(_L("GetOutputFormatListL() on Post-Processor gave error %d (expected %d)"),err2, expErr);
       
  1728 		ret = EFail;
       
  1729 		}
       
  1730 	else
       
  1731 		{
       
  1732 		TBool decPass = EFalse;
       
  1733 		TBool posPass = EFalse;
       
  1734 
       
  1735 		// expecting KTestVidFormat1,2,3 - check
       
  1736 		TInt count = decodeList.Count();
       
  1737 		if (count == 3) 
       
  1738 			{
       
  1739 			if ((decodeList[0] == KTestVidFormat1) &&
       
  1740 				(decodeList[1] == KTestVidFormat2) &&
       
  1741 				(decodeList[2] == KTestVidFormat3) )
       
  1742 				{
       
  1743 				INFO_PRINTF1(_L("Decoder output list checks ok"));
       
  1744 				decPass = ETrue;
       
  1745 				}
       
  1746 			}
       
  1747 
       
  1748 		// expecting KTestVidFormat3,2,1 - check
       
  1749 		count = postProcList.Count();
       
  1750 		if (count == 3) 
       
  1751 			{
       
  1752 			if ((postProcList[0] == KTestVidFormat3) &&
       
  1753 				(postProcList[1] == KTestVidFormat2) &&
       
  1754 				(postProcList[2] == KTestVidFormat1) )
       
  1755 				{
       
  1756 				INFO_PRINTF1(_L("Post-Processor output list checks ok"));
       
  1757 				posPass = ETrue;
       
  1758 				}
       
  1759 			}
       
  1760 		
       
  1761 		if (!decPass)
       
  1762 			{
       
  1763 			ERR_PRINTF1(_L("Decoder output list corrupt!"));
       
  1764 			ret = EFail;
       
  1765 			}
       
  1766 		
       
  1767 		if (!posPass)
       
  1768 			{
       
  1769 			ERR_PRINTF1(_L("Post-Processor output list corrupt!"));
       
  1770 			ret = EFail;
       
  1771 			}
       
  1772 	
       
  1773 		INFO_PRINTF4(_L("GetOutputFormatListL(), %d, %d = %d"), err, err2, expErr);
       
  1774 		}	
       
  1775 
       
  1776 	// close the arrays
       
  1777 	decodeList.Reset();		
       
  1778 	decodeList.Close();
       
  1779 	
       
  1780 	postProcList.Reset();	
       
  1781 	postProcList.Close();
       
  1782 	
       
  1783 	return ret;
       
  1784 	}
       
  1785 //------------------------------------------------------------------
       
  1786 
       
  1787 CTestDevVideoPlaySetOutputFormat::CTestDevVideoPlaySetOutputFormat(const TDesC& aTestName, TTestType aTestType)
       
  1788 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1789 	{
       
  1790 	}
       
  1791 
       
  1792 CTestDevVideoPlaySetOutputFormat* CTestDevVideoPlaySetOutputFormat::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1793 	{
       
  1794 	CTestDevVideoPlaySetOutputFormat* self = new(ELeave) CTestDevVideoPlaySetOutputFormat(aTestName, aTestType);
       
  1795 	return self;
       
  1796 	}
       
  1797 
       
  1798 TVerdict CTestDevVideoPlaySetOutputFormat::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1799 	{
       
  1800 	TVerdict ret = EPass;
       
  1801 	TInt expErr = KErrNone;
       
  1802 	
       
  1803 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SetOutputFormat"));
       
  1804 	
       
  1805 	// expected results
       
  1806 	if (iTestType != ETestValid)
       
  1807 		{
       
  1808 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1809 		return EInconclusive;
       
  1810 		}
       
  1811 
       
  1812 	TInt err = KErrNone;
       
  1813 	TInt err2 = KErrNone;
       
  1814 
       
  1815 	THwDeviceId hwDecoder = 0;
       
  1816 	THwDeviceId hwPostProc = 0;
       
  1817 
       
  1818 	// select decoder
       
  1819 	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1820 	if (err != KErrNone)
       
  1821 		{
       
  1822 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1823 		return EInconclusive;
       
  1824 		}
       
  1825 
       
  1826 	// select post-processor
       
  1827 	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
       
  1828 	if (err != KErrNone)
       
  1829 		{
       
  1830 		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
       
  1831 		return EInconclusive;
       
  1832 		}
       
  1833 
       
  1834 	// set output format on decoder
       
  1835 	TRAP(err, aDevVideoPlay.SetOutputFormatL(hwDecoder, KTestVidFormat1) )
       
  1836 	
       
  1837 	// set output format on post-processor
       
  1838 	TRAP(err2, aDevVideoPlay.SetOutputFormatL(hwPostProc, KTestVidFormat2) )
       
  1839 
       
  1840 
       
  1841 	if ((err != expErr) || (err2 != expErr))
       
  1842 		{
       
  1843 		ERR_PRINTF3(_L("SetOutputFormatL() on Decoder gave error %d (expected %d)"),err, expErr);
       
  1844 		ERR_PRINTF3(_L("SetOutputFormatL() on Post-Processor gave error %d (expected %d)"),err2, expErr);
       
  1845 		ret = EFail;
       
  1846 		}
       
  1847 	else
       
  1848 		INFO_PRINTF4(_L("SetOutputFormat(), %d, %d= %d"), err, err2, expErr);
       
  1849 	
       
  1850 	return ret;
       
  1851 	}
       
  1852 //------------------------------------------------------------------
       
  1853 
       
  1854 CTestDevVideoPlaySetPostProcTypes::CTestDevVideoPlaySetPostProcTypes(const TDesC& aTestName, TTestType aTestType)
       
  1855 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1856 	{
       
  1857 	}
       
  1858 
       
  1859 CTestDevVideoPlaySetPostProcTypes* CTestDevVideoPlaySetPostProcTypes::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1860 	{
       
  1861 	CTestDevVideoPlaySetPostProcTypes* self = new(ELeave) CTestDevVideoPlaySetPostProcTypes(aTestName, aTestType);
       
  1862 	return self;
       
  1863 	}
       
  1864 
       
  1865 TVerdict CTestDevVideoPlaySetPostProcTypes::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  1866 	{
       
  1867 	TVerdict ret = EPass;
       
  1868 	TInt expErr = KErrNone;
       
  1869 	
       
  1870 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  SetPostProcTypes"));
       
  1871 	
       
  1872 	// expected results
       
  1873 	if (iTestType != ETestValid)
       
  1874 		{
       
  1875 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  1876 		return EInconclusive;
       
  1877 		}
       
  1878 
       
  1879 	TInt err = KErrNone;
       
  1880 	TInt err2 = KErrNone;
       
  1881 
       
  1882 	THwDeviceId hwDecoder = 0;
       
  1883 	THwDeviceId hwPostProc = 0;
       
  1884 
       
  1885 	// select decoder
       
  1886 	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
       
  1887 	if (err != KErrNone)
       
  1888 		{
       
  1889 		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
       
  1890 		return EInconclusive;
       
  1891 		}
       
  1892 
       
  1893 	// select post-processor
       
  1894 	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
       
  1895 	if (err != KErrNone)
       
  1896 		{
       
  1897 		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
       
  1898 		return EInconclusive;
       
  1899 		}
       
  1900 
       
  1901 	// set post-process types on decoder
       
  1902 	TRAP(err, aDevVideoPlay.SetPostProcessTypesL(hwDecoder, KTestProcessType1) )
       
  1903 	
       
  1904 	// set post-process types on post-processor
       
  1905 	TRAP(err2, aDevVideoPlay.SetPostProcessTypesL(hwPostProc, KTestProcessType2) )
       
  1906 
       
  1907 
       
  1908 	if ((err != expErr) || (err2 != expErr))
       
  1909 		{
       
  1910 		ERR_PRINTF3(_L("SetPostProcessTypesL() on Decoder gave error %d (expected %d)"),err, expErr);
       
  1911 		ERR_PRINTF3(_L("SetPostProcessTypesL() on Post-Processor gave error %d (expected %d)"),err2, expErr);
       
  1912 		ret = EFail;
       
  1913 		}
       
  1914 	else
       
  1915 		INFO_PRINTF4(_L("SetPostProcessTypes(), %d, %d= %d"), err, err2, expErr);
       
  1916 	
       
  1917 	return ret;
       
  1918 	}
       
  1919 //------------------------------------------------------------------
       
  1920 
       
  1921 CTestDevVideoPlayGetDecoderPostProcInfo::CTestDevVideoPlayGetDecoderPostProcInfo(const TDesC& aTestName, TTestType aTestType)
       
  1922 	:CTestDevVideoPlayStep(aTestName, aTestType)
       
  1923 	{
       
  1924 	}
       
  1925 
       
  1926 CTestDevVideoPlayGetDecoderPostProcInfo* CTestDevVideoPlayGetDecoderPostProcInfo::NewL(const TDesC& aTestName, TTestType aTestType)
       
  1927 	{
       
  1928 	CTestDevVideoPlayGetDecoderPostProcInfo* self = new(ELeave) CTestDevVideoPlayGetDecoderPostProcInfo(aTestName, aTestType);
       
  1929 	return self;
       
  1930 	}
       
  1931 
       
  1932 TBool CTestDevVideoPlayGetDecoderPostProcInfo::ValidPostProcInfo(CPostProcessorInfo* aInfo)
       
  1933 	{
       
  1934 	// do null pointer check
       
  1935 	if (!aInfo) 
       
  1936 		{
       
  1937 		ERR_PRINTF1(_L("Error - Post Processor Info is NULL!"));
       
  1938 		return EFalse;
       
  1939 		}
       
  1940 	
       
  1941 	// check the post processor against test data
       
  1942 	// need to check every call so as to keep code coverage
       
  1943 	// and prevent a situation where if the first test fails
       
  1944 	// then subsequent tests will not be called
       
  1945 	TBool ret = ETrue;
       
  1946 
       
  1947 	// UID check
       
  1948 	if (aInfo->Uid() != KUidDevVideoTestDecodeHwDevice)
       
  1949 		{
       
  1950 		ERR_PRINTF1(_L("Error - Decoder UID is incorrect!"));
       
  1951 		ret = EFalse;
       
  1952 		}
       
  1953 	// Manufacturer check
       
  1954 	if (!(aInfo->Manufacturer() == KTestPostProcInfoManufacturer))
       
  1955 		{
       
  1956 		ERR_PRINTF1(_L("Error - Manufacturer is incorrect!"));
       
  1957 		ret = EFalse;
       
  1958 		}
       
  1959 	// Identifier check
       
  1960 	if (!(aInfo->Identifier() == KTestPostProcInfoIdentifier))
       
  1961 		{
       
  1962 		ERR_PRINTF1(_L("Error - Identifier is incorrect!"));
       
  1963 		ret = EFalse;
       
  1964 		}
       
  1965 	// Version check
       
  1966 	TVersion posVer = aInfo->Version();
       
  1967 	if ( (posVer.iMajor != KTestPostProcInfoVersionMaj) ||
       
  1968 		 (posVer.iMinor != KTestPostProcInfoVersionMin) ||
       
  1969 		 (posVer.iBuild != KTestPostProcInfoVersionBuild) )
       
  1970 		{
       
  1971 		ERR_PRINTF1(_L("Error - Version is incorrect!"));
       
  1972 		ret = EFalse;
       
  1973 		}
       
  1974 	// Accelerated check
       
  1975 	if (!aInfo->Accelerated())
       
  1976 		{
       
  1977 		ERR_PRINTF1(_L("Error - Accelerated = EFalse!"));
       
  1978 		ret = EFalse;
       
  1979 		}
       
  1980 	// Direct display check
       
  1981 	if (!aInfo->SupportsDirectDisplay())
       
  1982 		{
       
  1983 		ERR_PRINTF1(_L("Error - Supports Direct Display = EFalse!"));
       
  1984 		ret = EFalse;
       
  1985 		}
       
  1986 	// YUVToRGB Capabilities
       
  1987 	if (!CompareYuvRgbCaps(aInfo->YuvToRgbCapabilities(), KTestPostProcInfoYuvToRgbCaps))
       
  1988 		{
       
  1989 		ERR_PRINTF1(_L("Error - YUV To RGB capabilities is incorrect!"));
       
  1990 		ret = EFalse;
       
  1991 		}
       
  1992 	//Content Protection	
       
  1993 	if (!aInfo->SupportsContentProtected())//Check if flag is set indicating Content Protection is supported.
       
  1994 		{
       
  1995 		ERR_PRINTF1(_L("Error - Failed To get flag indicating support of Content Protection!"));
       
  1996 		ret = EFalse;
       
  1997 		}
       
  1998 
       
  1999 	// Supported rotations
       
  2000 	if (aInfo->SupportedRotations() != KTestPostProcInfoRotations)
       
  2001 		{
       
  2002 		ERR_PRINTF1(_L("Error - Supported Rotations is incorrect!"));
       
  2003 		ret = EFalse;
       
  2004 		}
       
  2005 
       
  2006 	// Supports arbitrary scaling check
       
  2007 	if (!aInfo->AntiAliasedScaling())
       
  2008 		{
       
  2009 		ERR_PRINTF1(_L("Error - Anti-Aliased Scaling = EFalse!"));
       
  2010 		ret = EFalse;
       
  2011 		}
       
  2012 	// Supports anti-aliased scaling check
       
  2013 	if (!aInfo->SupportsArbitraryScaling())
       
  2014 		{
       
  2015 		ERR_PRINTF1(_L("Error - Supports Arbitrary Scaling = EFalse!"));
       
  2016 		ret = EFalse;
       
  2017 		}
       
  2018 	// Implementation info
       
  2019 	if (!(aInfo->ImplementationSpecificInfo() == KTestDecoderInfoISInfo))
       
  2020 		{
       
  2021 		ERR_PRINTF1(_L("Error - Implementation specific info is incorrect!"));
       
  2022 		ret = EFalse;
       
  2023 		}
       
  2024 
       
  2025 	// get some test compressed video formats
       
  2026 	TUncompressedVideoFormat testFormat;
       
  2027 	TUint32 testComb = 0;
       
  2028 	TScaleFactor testFactor = {0, 0};
       
  2029 
       
  2030 	// get supported formats
       
  2031 	const RArray<TUncompressedVideoFormat>& vidFormats = aInfo->SupportedFormats();
       
  2032 	
       
  2033 	// get supported combinations
       
  2034 	const RArray<TUint32>& suppCombs = aInfo->SupportedCombinations();
       
  2035 
       
  2036 	// get supported scale factors
       
  2037 	const RArray<TScaleFactor>& scaleFactors = aInfo->SupportedScaleFactors();
       
  2038 
       
  2039 	// test formats, combinations, and scale factors supported
       
  2040 	for (TUint i = 0; i < KTestPostProcInfoCount; i++)
       
  2041 		{
       
  2042 		testFormat = KTestPostProcInfoFormatArray[i];
       
  2043 		if (!(testFormat == (vidFormats[i])) || !(aInfo->SupportsFormat(testFormat)))
       
  2044 			{
       
  2045 			ERR_PRINTF2(_L("Error - Video Format %d is corrupt!"), i);
       
  2046 			ret = EFalse;
       
  2047 			}
       
  2048 
       
  2049 		testComb = KTestPostProcInfoCombsArray[i];
       
  2050 		if (!(testComb == (suppCombs[i])) || !(aInfo->SupportsCombination(testComb)))
       
  2051 			{
       
  2052 			ERR_PRINTF2(_L("Error - Combination %d is corrupt!"), i);
       
  2053 			ret = EFalse;
       
  2054 			}
       
  2055 
       
  2056 		testFactor = KTestPostProcInfoScaleFactorsArray[i];
       
  2057 		if (!CompareScaleFactors(testFactor, scaleFactors[i]))
       
  2058 			{
       
  2059 			ERR_PRINTF2(_L("Error - Scale factor %d is corrupt!"), i);
       
  2060 			ret = EFalse;
       
  2061 			}
       
  2062 		}
       
  2063 
       
  2064 	// check a format that isn't supposed to be supported
       
  2065 	testFormat = KTestPostProcInfoNegativeFormat;
       
  2066 	testFormat.iYuvFormat = KTestYuvFormat1;
       
  2067 	if (aInfo->SupportsFormat(testFormat))
       
  2068 		{
       
  2069 		ERR_PRINTF1(_L("Error - Failed negative SupportsFormat() check!"));
       
  2070 		ret = EFalse;
       
  2071 		}
       
  2072 	
       
  2073 	// finally check a combination that isn't supposed to be supported
       
  2074 	testComb = KTestPostProcInfoNegativeComb;
       
  2075 	if (aInfo->SupportsCombination(testComb))
       
  2076 		{
       
  2077 		ERR_PRINTF1(_L("Error - Failed negative SupportsCombination() check!"));
       
  2078 		ret = EFalse;
       
  2079 		}
       
  2080 
       
  2081 	if (!aInfo->SupportsContentProtected())
       
  2082 		{
       
  2083 		ERR_PRINTF1(_L("Error - Failed to Set Content Protected Support!"));
       
  2084 		ret = EFalse;
       
  2085 		}
       
  2086 
       
  2087 	return ret;
       
  2088 	}
       
  2089 
       
  2090 TVerdict CTestDevVideoPlayGetDecoderPostProcInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
       
  2091 	{
       
  2092 	TVerdict ret = EPass;
       
  2093 	TInt expErr = KErrNone;
       
  2094 	
       
  2095 	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetPostProcInfo"));
       
  2096 	
       
  2097 	// expected results
       
  2098 	if (iTestType != ETestValid)
       
  2099 		{
       
  2100 		ERR_PRINTF1(_L("Error - invalid test step type"));
       
  2101 		return EInconclusive;
       
  2102 		}
       
  2103 	
       
  2104 	TInt err = KErrNone;
       
  2105 	CPostProcessorInfo *procInfo = NULL;
       
  2106 	TBool valid = EFalse;
       
  2107 	
       
  2108 	// get decoder information from test decoder plugin
       
  2109 	TRAP(err, 
       
  2110 		procInfo = aDevVideoPlay.PostProcessorInfoLC(KUidDevVideoTestDecodeHwDevice); 
       
  2111 		procInfo->SetSupportsContentProtected(ETrue);
       
  2112 		valid = ValidPostProcInfo(procInfo);
       
  2113 		CleanupStack::PopAndDestroy(procInfo); );
       
  2114 
       
  2115 	if (err != expErr)
       
  2116 		{
       
  2117 		ERR_PRINTF3(_L("PostProcessorInfoLC() gave error %d (expected %d)"),err, expErr);
       
  2118 		ret = EFail;
       
  2119 		}
       
  2120 	// check the Video Decoder
       
  2121 	else if (!valid)
       
  2122 		{
       
  2123 		ERR_PRINTF1(_L("CPostProcessorInfo class is corrupt!"));
       
  2124 		ret = EFail;
       
  2125 		}
       
  2126 	else
       
  2127 		{
       
  2128 		INFO_PRINTF1(_L("CPostProcessorInfo passed check successfully"));
       
  2129 		INFO_PRINTF3(_L("PostProcessorInfoLC(), %d = %d"), err, expErr);
       
  2130 		}
       
  2131 
       
  2132 	return ret;
       
  2133 	}