os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/TestDevVideoPlayFour.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description:
sl@0
    15
// TestDevVideoPlay.cpp
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
#include "TestDevVideoPlay.h"
sl@0
    20
#include "TestDevVideoPlayTestData.h"
sl@0
    21
#include "TestDevVideoPlugins/decoder.h"
sl@0
    22
#include "TestDevVideoPlugins/postproc.h"
sl@0
    23
#include <e32math.h>
sl@0
    24
sl@0
    25
void CTestDevVideoPlayGetNewPictureInfo::MdvpoInitComplete(TInt aError)
sl@0
    26
	{
sl@0
    27
	INFO_PRINTF2(_L("CTestDevVideoPlayGetNewPictureInfo::MdvpoInitComplete():  Error = %d"), aError);
sl@0
    28
	
sl@0
    29
	iError = aError;
sl@0
    30
	}
sl@0
    31
sl@0
    32
CTestDevVideoPlayGetNewPictureInfo::CTestDevVideoPlayGetNewPictureInfo(const TDesC& aTestName, TTestType aTestType)
sl@0
    33
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
    34
	{
sl@0
    35
	}
sl@0
    36
sl@0
    37
CTestDevVideoPlayGetNewPictureInfo* CTestDevVideoPlayGetNewPictureInfo::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
    38
	{
sl@0
    39
	CTestDevVideoPlayGetNewPictureInfo* self = new(ELeave) CTestDevVideoPlayGetNewPictureInfo(aTestName, aTestType);
sl@0
    40
	return self;
sl@0
    41
	}
sl@0
    42
sl@0
    43
TVerdict CTestDevVideoPlayGetNewPictureInfo::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
    44
	{
sl@0
    45
	TVerdict ret = EFail;
sl@0
    46
	
sl@0
    47
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetNewPictureInfo"));
sl@0
    48
	
sl@0
    49
	// expected results
sl@0
    50
	if (iTestType != ETestValid)
sl@0
    51
		{
sl@0
    52
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
    53
		return EInconclusive;
sl@0
    54
		}
sl@0
    55
sl@0
    56
	TInt err = KErrNone;
sl@0
    57
sl@0
    58
//	THwDeviceId hwDecoder = 0;
sl@0
    59
//	THwDeviceId hwPostProc = 0;
sl@0
    60
sl@0
    61
	// select decoder
sl@0
    62
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
    63
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
    64
	if (err != KErrNone)
sl@0
    65
		{
sl@0
    66
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
    67
			return EInconclusive;
sl@0
    68
		}
sl@0
    69
sl@0
    70
	// select post-processor
sl@0
    71
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
    72
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
    73
	if (err != KErrNone)
sl@0
    74
		{
sl@0
    75
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
    76
			return EInconclusive;
sl@0
    77
		}
sl@0
    78
sl@0
    79
	//Tell plugin to start creating pictures.
sl@0
    80
	TRAP(iError, aDevVideoPlay.SetVideoDestScreenL(EFalse));
sl@0
    81
	if (iError != KErrNone)
sl@0
    82
		{
sl@0
    83
		ERR_PRINTF1(_L("Error - couldn't SetVideoDestScreen"));
sl@0
    84
			return EInconclusive;
sl@0
    85
		}
sl@0
    86
sl@0
    87
	// initialize CDevVideoPlay and wait for response
sl@0
    88
	// iError is set by the MdvpoInitComplete callback
sl@0
    89
	aDevVideoPlay.Initialize();
sl@0
    90
sl@0
    91
	if (iError != KErrNone)
sl@0
    92
		{
sl@0
    93
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
    94
			return EInconclusive;
sl@0
    95
		}
sl@0
    96
sl@0
    97
	aDevVideoPlay.Start();
sl@0
    98
sl@0
    99
	TUint numPictures = 0;
sl@0
   100
	TTimeIntervalMicroSeconds earliestTimeStamp(0);
sl@0
   101
	TTimeIntervalMicroSeconds latestTimeStamp(0);
sl@0
   102
sl@0
   103
sl@0
   104
	aDevVideoPlay.GetNewPictureInfo(numPictures, earliestTimeStamp, latestTimeStamp);
sl@0
   105
sl@0
   106
	if ((numPictures == 1)
sl@0
   107
		&& (earliestTimeStamp == TTimeIntervalMicroSeconds(0))
sl@0
   108
		&& (latestTimeStamp == TTimeIntervalMicroSeconds(0)))
sl@0
   109
		{
sl@0
   110
		ret = EPass;
sl@0
   111
		}
sl@0
   112
	
sl@0
   113
	return ret;
sl@0
   114
	}
sl@0
   115
//------------------------------------------------------------------
sl@0
   116
sl@0
   117
void CTestDevVideoPlayNextPicture::MdvpoInitComplete(TInt aError)
sl@0
   118
	{
sl@0
   119
	INFO_PRINTF2(_L("CTestDevVideoPlayNextPicture::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   120
	
sl@0
   121
	iError = aError;
sl@0
   122
	}
sl@0
   123
sl@0
   124
CTestDevVideoPlayNextPicture::CTestDevVideoPlayNextPicture(const TDesC& aTestName, TTestType aTestType)
sl@0
   125
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   126
	{
sl@0
   127
	}
sl@0
   128
sl@0
   129
CTestDevVideoPlayNextPicture* CTestDevVideoPlayNextPicture::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   130
	{
sl@0
   131
	CTestDevVideoPlayNextPicture* self = new(ELeave) CTestDevVideoPlayNextPicture(aTestName, aTestType);
sl@0
   132
	return self;
sl@0
   133
	}
sl@0
   134
sl@0
   135
TVerdict CTestDevVideoPlayNextPicture::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   136
	{
sl@0
   137
	TVerdict ret = EPass;
sl@0
   138
	
sl@0
   139
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  NextPicture"));
sl@0
   140
	
sl@0
   141
	// expected results
sl@0
   142
	if (iTestType != ETestValid)
sl@0
   143
		{
sl@0
   144
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   145
		return EInconclusive;
sl@0
   146
		}
sl@0
   147
sl@0
   148
	TInt err = KErrNone;
sl@0
   149
sl@0
   150
//	THwDeviceId hwDecoder = 0;
sl@0
   151
//	THwDeviceId hwPostProc = 0;
sl@0
   152
sl@0
   153
	// select decoder
sl@0
   154
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   155
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));// EABI warning removal
sl@0
   156
	if (err != KErrNone)
sl@0
   157
		{
sl@0
   158
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   159
			return EInconclusive;
sl@0
   160
		}
sl@0
   161
sl@0
   162
	// select post-processor
sl@0
   163
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   164
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
   165
	if (err != KErrNone)
sl@0
   166
		{
sl@0
   167
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   168
			return EInconclusive;
sl@0
   169
		}
sl@0
   170
sl@0
   171
	//Tell plugin to start creating pictures.
sl@0
   172
	TRAP(iError, aDevVideoPlay.SetVideoDestScreenL(EFalse));
sl@0
   173
	if (iError != KErrNone)
sl@0
   174
		{
sl@0
   175
		ERR_PRINTF1(_L("Error - couldn't SetVideoDestScreen"));
sl@0
   176
			return EInconclusive;
sl@0
   177
		}
sl@0
   178
sl@0
   179
	// initialize CDevVideoPlay and wait for response
sl@0
   180
	// iError is set by the MdvpoInitComplete callback
sl@0
   181
	aDevVideoPlay.Initialize();
sl@0
   182
sl@0
   183
	if (iError != KErrNone)
sl@0
   184
		{
sl@0
   185
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   186
			return EInconclusive;
sl@0
   187
		}
sl@0
   188
sl@0
   189
	iDevVideoPlay = &aDevVideoPlay;
sl@0
   190
	aDevVideoPlay.Start();//Tell plugin to start creating pictures.
sl@0
   191
	// We should now get a series of NewPicture() callbacks.
sl@0
   192
sl@0
   193
	if (iError == KErrNone)
sl@0
   194
		{
sl@0
   195
		ret = EPass;
sl@0
   196
		}
sl@0
   197
	else
sl@0
   198
		{
sl@0
   199
		ERR_PRINTF2(_L("Error - picture processing failed with error %d"), iError);
sl@0
   200
		}
sl@0
   201
	
sl@0
   202
	return ret;
sl@0
   203
	}
sl@0
   204
sl@0
   205
void CTestDevVideoPlayNextPicture::MdvpoNewPictures()
sl@0
   206
	{
sl@0
   207
	TRAP(iError, DoNewPicturesL());
sl@0
   208
	}
sl@0
   209
sl@0
   210
void CTestDevVideoPlayNextPicture::CheckNewPictureInfoL(TUint aNumPictures, const TTimeIntervalMicroSeconds& aFirst, const TTimeIntervalMicroSeconds& aLast)
sl@0
   211
	{
sl@0
   212
	TUint numPictures = 0;
sl@0
   213
	TTimeIntervalMicroSeconds first(0);
sl@0
   214
	TTimeIntervalMicroSeconds last(0);
sl@0
   215
	iDevVideoPlay->GetNewPictureInfo(numPictures, first, last);
sl@0
   216
sl@0
   217
	if ((numPictures!=aNumPictures) || (first!=aFirst) || (last!=aLast))
sl@0
   218
		{
sl@0
   219
		User::Leave(KErrGeneral);
sl@0
   220
		}
sl@0
   221
	}
sl@0
   222
sl@0
   223
void CTestDevVideoPlayNextPicture::DoNewPicturesL()
sl@0
   224
	{
sl@0
   225
	User::LeaveIfError(iError);//Don't go any further if we have an error
sl@0
   226
	switch (iCurrentPictureNumber)
sl@0
   227
		{
sl@0
   228
		case 0:
sl@0
   229
			{
sl@0
   230
			iCurrentPictureNumber++;
sl@0
   231
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(0));
sl@0
   232
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   233
			CheckNewPictureInfoL(0, TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(0));
sl@0
   234
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   235
			break;
sl@0
   236
			}
sl@0
   237
		case 1:
sl@0
   238
			{
sl@0
   239
			iCurrentPictureNumber++;
sl@0
   240
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(1), TTimeIntervalMicroSeconds(1));
sl@0
   241
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   242
			CheckNewPictureInfoL(0, TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(0));
sl@0
   243
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   244
			break;
sl@0
   245
			}
sl@0
   246
		case 2:
sl@0
   247
			{
sl@0
   248
			iCurrentPictureNumber++;
sl@0
   249
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(2), TTimeIntervalMicroSeconds(2));
sl@0
   250
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   251
			CheckNewPictureInfoL(0, TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(0));
sl@0
   252
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   253
			break;
sl@0
   254
			}
sl@0
   255
		case 3:
sl@0
   256
			{
sl@0
   257
			iCurrentPictureNumber++;
sl@0
   258
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(3), TTimeIntervalMicroSeconds(3));
sl@0
   259
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   260
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   261
			break;
sl@0
   262
			}
sl@0
   263
		case 4:
sl@0
   264
			{
sl@0
   265
			iCurrentPictureNumber++;
sl@0
   266
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(4), TTimeIntervalMicroSeconds(4));
sl@0
   267
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   268
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   269
			break;
sl@0
   270
			}
sl@0
   271
		case 5:
sl@0
   272
			{
sl@0
   273
			iCurrentPictureNumber++;
sl@0
   274
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(5), TTimeIntervalMicroSeconds(5));
sl@0
   275
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   276
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   277
			break;
sl@0
   278
			}
sl@0
   279
		case 6:
sl@0
   280
			{
sl@0
   281
			iCurrentPictureNumber++;
sl@0
   282
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(6), TTimeIntervalMicroSeconds(6));
sl@0
   283
			break;
sl@0
   284
			}
sl@0
   285
		case 7:
sl@0
   286
			{
sl@0
   287
			iCurrentPictureNumber++;
sl@0
   288
			CheckNewPictureInfoL(2, TTimeIntervalMicroSeconds(6), TTimeIntervalMicroSeconds(7));
sl@0
   289
			break;
sl@0
   290
			}
sl@0
   291
		case 8:
sl@0
   292
			{
sl@0
   293
			iCurrentPictureNumber++;
sl@0
   294
			CheckNewPictureInfoL(3, TTimeIntervalMicroSeconds(6), TTimeIntervalMicroSeconds(8));
sl@0
   295
			break;
sl@0
   296
			}
sl@0
   297
		case 9:
sl@0
   298
			{
sl@0
   299
			iCurrentPictureNumber++;
sl@0
   300
			CheckNewPictureInfoL(4, TTimeIntervalMicroSeconds(6), TTimeIntervalMicroSeconds(9));
sl@0
   301
			TVideoPicture* picture = iDevVideoPlay->NextPictureL();
sl@0
   302
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   303
			CheckNewPictureInfoL(3, TTimeIntervalMicroSeconds(7), TTimeIntervalMicroSeconds(9));
sl@0
   304
			picture = iDevVideoPlay->NextPictureL();
sl@0
   305
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   306
			CheckNewPictureInfoL(2, TTimeIntervalMicroSeconds(8), TTimeIntervalMicroSeconds(9));
sl@0
   307
			picture = iDevVideoPlay->NextPictureL();
sl@0
   308
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   309
			CheckNewPictureInfoL(1, TTimeIntervalMicroSeconds(9), TTimeIntervalMicroSeconds(9));
sl@0
   310
			picture = iDevVideoPlay->NextPictureL();
sl@0
   311
			iDevVideoPlay->ReturnPicture(picture);
sl@0
   312
			CheckNewPictureInfoL(0, TTimeIntervalMicroSeconds(0), TTimeIntervalMicroSeconds(0));
sl@0
   313
			break;
sl@0
   314
			}
sl@0
   315
		default:
sl@0
   316
			User::Leave(KErrGeneral);
sl@0
   317
			break;
sl@0
   318
		};
sl@0
   319
	}
sl@0
   320
sl@0
   321
sl@0
   322
sl@0
   323
//------------------------------------------------------------------
sl@0
   324
sl@0
   325
void CTestDevVideoPlayGetSnapshot::MdvpoInitComplete(TInt aError)
sl@0
   326
	{
sl@0
   327
	INFO_PRINTF2(_L("CTestDevVideoPlayGetSnapshot::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   328
	
sl@0
   329
	iError = aError;
sl@0
   330
	}
sl@0
   331
sl@0
   332
CTestDevVideoPlayGetSnapshot::CTestDevVideoPlayGetSnapshot(const TDesC& aTestName, TTestType aTestType)
sl@0
   333
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   334
	{
sl@0
   335
	}
sl@0
   336
sl@0
   337
CTestDevVideoPlayGetSnapshot* CTestDevVideoPlayGetSnapshot::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   338
	{
sl@0
   339
	CTestDevVideoPlayGetSnapshot* self = new(ELeave) CTestDevVideoPlayGetSnapshot(aTestName, aTestType);
sl@0
   340
	return self;
sl@0
   341
	}
sl@0
   342
sl@0
   343
TVerdict CTestDevVideoPlayGetSnapshot::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   344
	{
sl@0
   345
	TVerdict ret = EFail;
sl@0
   346
	
sl@0
   347
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetSnapshot"));
sl@0
   348
	
sl@0
   349
	// expected results
sl@0
   350
	if (iTestType != ETestValid)
sl@0
   351
		{
sl@0
   352
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   353
		return EInconclusive;
sl@0
   354
		}
sl@0
   355
sl@0
   356
	TInt err = KErrNone;
sl@0
   357
sl@0
   358
//	THwDeviceId hwDecoder = 0;
sl@0
   359
//	THwDeviceId hwPostProc = 0;
sl@0
   360
sl@0
   361
	// select decoder
sl@0
   362
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   363
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
   364
	if (err != KErrNone)
sl@0
   365
		{
sl@0
   366
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   367
			return EInconclusive;
sl@0
   368
		}
sl@0
   369
sl@0
   370
	// select post-processor
sl@0
   371
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   372
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
   373
	if (err != KErrNone)
sl@0
   374
		{
sl@0
   375
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   376
			return EInconclusive;
sl@0
   377
		}
sl@0
   378
sl@0
   379
	// initialize CDevVideoPlay and wait for response
sl@0
   380
	// iError is set by the MdvpoInitComplete callback
sl@0
   381
	aDevVideoPlay.Initialize();
sl@0
   382
	
sl@0
   383
	if (iError != KErrNone)
sl@0
   384
		{
sl@0
   385
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   386
			return EInconclusive;
sl@0
   387
		}
sl@0
   388
sl@0
   389
	TBool result = EFalse;
sl@0
   390
	TPictureData pictureData;
sl@0
   391
sl@0
   392
	TUncompressedVideoFormat format;
sl@0
   393
	format.iDataFormat = EYuvRawData;
sl@0
   394
	format.iYuvFormat = KTestYuvFormat1;
sl@0
   395
sl@0
   396
	TRAP(err, result = aDevVideoPlay.GetSnapshotL(pictureData, format));
sl@0
   397
sl@0
   398
	if (err == KErrNone)
sl@0
   399
		{
sl@0
   400
		if (result)
sl@0
   401
			{
sl@0
   402
			if ((pictureData.iDataFormat == EYuvRawData) &&
sl@0
   403
				(pictureData.iDataSize == TSize(KTestPictureDataSizeX, KTestPictureDataSizeY)) && 
sl@0
   404
				(pictureData.iRawData == NULL))
sl@0
   405
				{
sl@0
   406
				ret = EPass;
sl@0
   407
				}
sl@0
   408
			}
sl@0
   409
		}
sl@0
   410
	
sl@0
   411
	return ret;
sl@0
   412
	}
sl@0
   413
//------------------------------------------------------------------
sl@0
   414
sl@0
   415
void CTestDevVideoPlayGetTimedSnapshotTimestamp::MdvpoInitComplete(TInt aError)
sl@0
   416
	{
sl@0
   417
	INFO_PRINTF2(_L("CTestDevVideoPlayGetTimedSnapshotTimestamp::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   418
	
sl@0
   419
	iError = aError;
sl@0
   420
	}
sl@0
   421
sl@0
   422
void CTestDevVideoPlayGetTimedSnapshotTimestamp::MdvpoTimedSnapshotComplete(TInt aError, 
sl@0
   423
											TPictureData* aPictureData, 
sl@0
   424
											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
sl@0
   425
											const TPictureId& /*aPictureId*/)
sl@0
   426
	{
sl@0
   427
	INFO_PRINTF2(_L("CTestDevVideoPlayGetTimedSnapshotTimestamp::MdvpoTimedSnapshotComplete():  Error = %d"), aError);
sl@0
   428
	
sl@0
   429
	iError = aError;
sl@0
   430
	iTimestamp = aPresentationTimestamp;
sl@0
   431
	iPictureData = aPictureData;
sl@0
   432
	}
sl@0
   433
sl@0
   434
CTestDevVideoPlayGetTimedSnapshotTimestamp::CTestDevVideoPlayGetTimedSnapshotTimestamp(const TDesC& aTestName, TTestType aTestType)
sl@0
   435
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   436
	{
sl@0
   437
	}
sl@0
   438
sl@0
   439
CTestDevVideoPlayGetTimedSnapshotTimestamp* CTestDevVideoPlayGetTimedSnapshotTimestamp::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   440
	{
sl@0
   441
	CTestDevVideoPlayGetTimedSnapshotTimestamp* self = new(ELeave) CTestDevVideoPlayGetTimedSnapshotTimestamp(aTestName, aTestType);
sl@0
   442
	return self;
sl@0
   443
	}
sl@0
   444
sl@0
   445
TVerdict CTestDevVideoPlayGetTimedSnapshotTimestamp::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   446
	{
sl@0
   447
	TVerdict ret = EFail;
sl@0
   448
	TInt expErr = KErrNone;
sl@0
   449
	
sl@0
   450
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetTimedSnapshotTimestamp"));
sl@0
   451
	
sl@0
   452
	// expected results
sl@0
   453
	if (iTestType != ETestValid)
sl@0
   454
		{
sl@0
   455
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   456
		return EInconclusive;
sl@0
   457
		}
sl@0
   458
sl@0
   459
	TInt err = KErrNone;
sl@0
   460
sl@0
   461
//	THwDeviceId hwDecoder = 0;
sl@0
   462
//	THwDeviceId hwPostProc = 0;
sl@0
   463
sl@0
   464
	// select decoder
sl@0
   465
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   466
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
   467
	if (err != KErrNone)
sl@0
   468
		{
sl@0
   469
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   470
			return EInconclusive;
sl@0
   471
		}
sl@0
   472
sl@0
   473
	// select post-processor
sl@0
   474
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   475
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
   476
	if (err != KErrNone)
sl@0
   477
		{
sl@0
   478
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   479
			return EInconclusive;
sl@0
   480
		}
sl@0
   481
sl@0
   482
	// initialize CDevVideoPlay and wait for response
sl@0
   483
	// iError is set by the MdvpoInitComplete callback
sl@0
   484
	aDevVideoPlay.Initialize();
sl@0
   485
	
sl@0
   486
	if (iError != KErrNone)
sl@0
   487
		{
sl@0
   488
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   489
			return EInconclusive;
sl@0
   490
		}
sl@0
   491
sl@0
   492
	TPictureData pictureData;
sl@0
   493
sl@0
   494
	TUncompressedVideoFormat format;
sl@0
   495
	format.iDataFormat = EYuvRawData;
sl@0
   496
	format.iYuvFormat = KTestYuvFormat1;
sl@0
   497
	TTimeIntervalMicroSeconds snapTime(KTestSnapshotTimestamp);
sl@0
   498
sl@0
   499
	// get a timed snapshot from the post processor
sl@0
   500
	TRAP(err, aDevVideoPlay.GetTimedSnapshotL(&pictureData, format, snapTime));
sl@0
   501
sl@0
   502
	// check picture and timestamp from callback
sl@0
   503
	if ((err == KErrNone) && (iError == KErrNone))
sl@0
   504
		{
sl@0
   505
		if ((iPictureData) && (iTimestamp == TTimeIntervalMicroSeconds(KTestSnapshotTimestamp)))
sl@0
   506
			{
sl@0
   507
			if ((iPictureData->iDataFormat == EYuvRawData) &&
sl@0
   508
				(iPictureData->iDataSize == TSize(KTestPictureDataSizeX, KTestPictureDataSizeY)) && 
sl@0
   509
				(iPictureData->iRawData == NULL))
sl@0
   510
				{
sl@0
   511
				ret = EPass;
sl@0
   512
				}
sl@0
   513
			else
sl@0
   514
				{
sl@0
   515
				ERR_PRINTF1(_L("Error - PictureData is corrupt!"));
sl@0
   516
				}
sl@0
   517
			}
sl@0
   518
		}
sl@0
   519
	else
sl@0
   520
		{
sl@0
   521
		ERR_PRINTF3(_L("GetTimedSnapshotL() gave error %d (expected %d)"),err, expErr);
sl@0
   522
		}
sl@0
   523
	
sl@0
   524
	return ret;
sl@0
   525
	}
sl@0
   526
//------------------------------------------------------------------
sl@0
   527
sl@0
   528
void CTestDevVideoPlayGetTimedSnapshotID::MdvpoInitComplete(TInt aError)
sl@0
   529
	{
sl@0
   530
	INFO_PRINTF2(_L("CTestDevVideoPlayGetTimedSnapshotID::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   531
	
sl@0
   532
	iError = aError;
sl@0
   533
	}
sl@0
   534
sl@0
   535
void CTestDevVideoPlayGetTimedSnapshotID::MdvpoTimedSnapshotComplete(TInt aError, 
sl@0
   536
											TPictureData* aPictureData, 
sl@0
   537
											const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/, 
sl@0
   538
											const TPictureId& aPictureId)
sl@0
   539
	{
sl@0
   540
	INFO_PRINTF2(_L("CTestDevVideoPlayGetTimedSnapshotID::MdvpoTimedSnapshotComplete():  Error = %d"), aError);
sl@0
   541
	
sl@0
   542
	iError = aError;
sl@0
   543
	iPictureId = aPictureId;
sl@0
   544
	iPictureData = aPictureData;
sl@0
   545
	}
sl@0
   546
sl@0
   547
CTestDevVideoPlayGetTimedSnapshotID::CTestDevVideoPlayGetTimedSnapshotID(const TDesC& aTestName, TTestType aTestType)
sl@0
   548
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   549
	{
sl@0
   550
	}
sl@0
   551
sl@0
   552
CTestDevVideoPlayGetTimedSnapshotID* CTestDevVideoPlayGetTimedSnapshotID::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   553
	{
sl@0
   554
	CTestDevVideoPlayGetTimedSnapshotID* self = new(ELeave) CTestDevVideoPlayGetTimedSnapshotID(aTestName, aTestType);
sl@0
   555
	return self;
sl@0
   556
	}
sl@0
   557
sl@0
   558
TVerdict CTestDevVideoPlayGetTimedSnapshotID::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   559
	{
sl@0
   560
	TVerdict ret = EPass;
sl@0
   561
	TInt expErr = KErrNone;
sl@0
   562
	
sl@0
   563
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetTimedSnapshotID"));
sl@0
   564
	
sl@0
   565
	// expected results
sl@0
   566
	if (iTestType != ETestValid)
sl@0
   567
		{
sl@0
   568
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   569
		return EInconclusive;
sl@0
   570
		}
sl@0
   571
sl@0
   572
	TInt err = KErrNone;
sl@0
   573
sl@0
   574
//	THwDeviceId hwDecoder = 0;
sl@0
   575
//	THwDeviceId hwPostProc = 0;
sl@0
   576
sl@0
   577
	// select decoder
sl@0
   578
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   579
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
   580
	if (err != KErrNone)
sl@0
   581
		{
sl@0
   582
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   583
			return EInconclusive;
sl@0
   584
		}
sl@0
   585
sl@0
   586
	// select post-processor
sl@0
   587
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   588
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
   589
	if (err != KErrNone)
sl@0
   590
		{
sl@0
   591
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   592
			return EInconclusive;
sl@0
   593
		}
sl@0
   594
sl@0
   595
	// initialize CDevVideoPlay and wait for response
sl@0
   596
	// iError is set by the MdvpoInitComplete callback
sl@0
   597
	aDevVideoPlay.Initialize();
sl@0
   598
	
sl@0
   599
	if (iError != KErrNone)
sl@0
   600
		{
sl@0
   601
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   602
			return EInconclusive;
sl@0
   603
		}
sl@0
   604
sl@0
   605
	TPictureData pictureData;
sl@0
   606
sl@0
   607
	TUncompressedVideoFormat format;
sl@0
   608
	format.iDataFormat = EYuvRawData;
sl@0
   609
	format.iYuvFormat = KTestYuvFormat1;
sl@0
   610
	TPictureId snapId = KTestSnapshotId;
sl@0
   611
sl@0
   612
	// get a timed snapshot from the post processor
sl@0
   613
	TRAP(err, aDevVideoPlay.GetTimedSnapshotL(&pictureData, format, snapId));
sl@0
   614
sl@0
   615
	// check picture and timestamp from callback
sl@0
   616
	if ((err == KErrNone) && (iError == KErrNone))
sl@0
   617
		{
sl@0
   618
		if ( (iPictureData) && (iPictureId.iIdType == KTestSnapshotId.iIdType) && 
sl@0
   619
			 (iPictureId.iId == KTestSnapshotId.iId) )
sl@0
   620
			{
sl@0
   621
			if ((iPictureData->iDataFormat == EYuvRawData) &&
sl@0
   622
				(iPictureData->iDataSize == TSize(KTestPictureDataSizeX, KTestPictureDataSizeY)) && 
sl@0
   623
				(iPictureData->iRawData == NULL))
sl@0
   624
				{
sl@0
   625
				ret = EPass;
sl@0
   626
				}
sl@0
   627
			else
sl@0
   628
				{
sl@0
   629
				ERR_PRINTF1(_L("Error - PictureData is corrupt!"));
sl@0
   630
				}
sl@0
   631
			}
sl@0
   632
		}
sl@0
   633
	else
sl@0
   634
		{
sl@0
   635
		ERR_PRINTF3(_L("GetTimedSnapshotL() gave error %d (expected %d)"),err, expErr);
sl@0
   636
		}
sl@0
   637
	
sl@0
   638
	return ret;
sl@0
   639
	}
sl@0
   640
//------------------------------------------------------------------
sl@0
   641
sl@0
   642
void CTestDevVideoPlayCancelTimedSnapshot::MdvpoInitComplete(TInt aError)
sl@0
   643
	{
sl@0
   644
	INFO_PRINTF2(_L("CTestDevVideoPlayCancelTimedSnapshot::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   645
	
sl@0
   646
	iError = aError;
sl@0
   647
	}
sl@0
   648
sl@0
   649
void CTestDevVideoPlayCancelTimedSnapshot::MdvpoTimedSnapshotComplete(TInt aError, 
sl@0
   650
											TPictureData* /*aPictureData*/, 
sl@0
   651
											const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/, 
sl@0
   652
											const TPictureId& /*aPictureId*/)
sl@0
   653
	{
sl@0
   654
	INFO_PRINTF2(_L("CTestDevVideoPlayCancelTimedSnapshot::MdvpoTimedSnapshotComplete():  Error = %d"), aError);
sl@0
   655
	
sl@0
   656
	iError = aError;
sl@0
   657
	}
sl@0
   658
sl@0
   659
CTestDevVideoPlayCancelTimedSnapshot::CTestDevVideoPlayCancelTimedSnapshot(const TDesC& aTestName, TTestType aTestType)
sl@0
   660
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   661
	{
sl@0
   662
	}
sl@0
   663
sl@0
   664
CTestDevVideoPlayCancelTimedSnapshot* CTestDevVideoPlayCancelTimedSnapshot::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   665
	{
sl@0
   666
	CTestDevVideoPlayCancelTimedSnapshot* self = new(ELeave) CTestDevVideoPlayCancelTimedSnapshot(aTestName, aTestType);
sl@0
   667
	return self;
sl@0
   668
	}
sl@0
   669
sl@0
   670
TVerdict CTestDevVideoPlayCancelTimedSnapshot::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   671
	{
sl@0
   672
	TVerdict ret = EFail;
sl@0
   673
	TInt expErr = KErrNone;
sl@0
   674
	
sl@0
   675
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  CancelTimedSnapshot"));
sl@0
   676
	
sl@0
   677
	// expected results
sl@0
   678
	if (iTestType != ETestValid)
sl@0
   679
		{
sl@0
   680
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   681
		return EInconclusive;
sl@0
   682
		}
sl@0
   683
sl@0
   684
	TInt err = KErrNone;
sl@0
   685
sl@0
   686
//	THwDeviceId hwDecoder = 0;
sl@0
   687
//	THwDeviceId hwPostProc = 0;
sl@0
   688
sl@0
   689
	// select decoder
sl@0
   690
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   691
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   692
	if (err != KErrNone)
sl@0
   693
		{
sl@0
   694
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   695
			return EInconclusive;
sl@0
   696
		}
sl@0
   697
sl@0
   698
	// select post-processor
sl@0
   699
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   700
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   701
	if (err != KErrNone)
sl@0
   702
		{
sl@0
   703
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   704
			return EInconclusive;
sl@0
   705
		}
sl@0
   706
sl@0
   707
	// initialize CDevVideoPlay and wait for response
sl@0
   708
	// iError is set by the MdvpoInitComplete callback
sl@0
   709
	aDevVideoPlay.Initialize();
sl@0
   710
	
sl@0
   711
	if (iError != KErrNone)
sl@0
   712
		{
sl@0
   713
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   714
			return EInconclusive;
sl@0
   715
		}
sl@0
   716
sl@0
   717
	
sl@0
   718
	TPictureData pictureData;
sl@0
   719
sl@0
   720
	TUncompressedVideoFormat format;
sl@0
   721
	format.iDataFormat = EYuvRawData;
sl@0
   722
	format.iYuvFormat = KTestYuvFormat1;
sl@0
   723
	TPictureId snapId = KTestSnapshotId;
sl@0
   724
sl@0
   725
	// get a timed snapshot from the post processor
sl@0
   726
	TRAP(err, aDevVideoPlay.GetTimedSnapshotL(&pictureData, format, snapId));
sl@0
   727
sl@0
   728
	// cancel the snapshot
sl@0
   729
	aDevVideoPlay.CancelTimedSnapshot();
sl@0
   730
sl@0
   731
	// check picture has been cancelled
sl@0
   732
	if (err == KErrNone) 
sl@0
   733
		{
sl@0
   734
		if (iError == KErrAbort)
sl@0
   735
			{
sl@0
   736
			INFO_PRINTF1(_L("Timed snapshot cancelled successfully"));
sl@0
   737
			ret = EPass;
sl@0
   738
			}
sl@0
   739
		else
sl@0
   740
			{
sl@0
   741
			ERR_PRINTF3(_L("MdvpoTimedSnapshotComplete() gave error %d (expected %d)"),iError, KErrAbort);			
sl@0
   742
			}
sl@0
   743
		}
sl@0
   744
	else
sl@0
   745
		{
sl@0
   746
		ERR_PRINTF3(_L("CancelTimedSnapshotL() gave error %d (expected %d)"),err, expErr);
sl@0
   747
		}
sl@0
   748
sl@0
   749
	return ret;
sl@0
   750
	}
sl@0
   751
//------------------------------------------------------------------
sl@0
   752
sl@0
   753
void CTestDevVideoPlayGetSupportedSnapshotFormats::MdvpoInitComplete(TInt aError)
sl@0
   754
	{
sl@0
   755
	INFO_PRINTF2(_L("CTestDevVideoPlayGetSupportedSnapshotFormats::MdvpoInitComplete():  Error = %d"), aError);
sl@0
   756
	
sl@0
   757
	iError = aError;
sl@0
   758
	}
sl@0
   759
sl@0
   760
CTestDevVideoPlayGetSupportedSnapshotFormats::CTestDevVideoPlayGetSupportedSnapshotFormats(const TDesC& aTestName, TTestType aTestType)
sl@0
   761
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
   762
	{
sl@0
   763
	}
sl@0
   764
sl@0
   765
CTestDevVideoPlayGetSupportedSnapshotFormats* CTestDevVideoPlayGetSupportedSnapshotFormats::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
   766
	{
sl@0
   767
	CTestDevVideoPlayGetSupportedSnapshotFormats* self = new(ELeave) CTestDevVideoPlayGetSupportedSnapshotFormats(aTestName, aTestType);
sl@0
   768
	return self;
sl@0
   769
	}
sl@0
   770
sl@0
   771
TVerdict CTestDevVideoPlayGetSupportedSnapshotFormats::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
   772
	{
sl@0
   773
	TVerdict ret = EFail;
sl@0
   774
	TInt expErr = KErrNone;
sl@0
   775
	
sl@0
   776
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  GetSupportedSnapshotFormats"));
sl@0
   777
	
sl@0
   778
	// expected results
sl@0
   779
	if (iTestType != ETestValid)
sl@0
   780
		{
sl@0
   781
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
   782
		return EInconclusive;
sl@0
   783
		}
sl@0
   784
sl@0
   785
	TInt err = KErrNone;
sl@0
   786
sl@0
   787
//	THwDeviceId hwDecoder = 0;
sl@0
   788
//	THwDeviceId hwPostProc = 0;
sl@0
   789
sl@0
   790
	// select decoder
sl@0
   791
//	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
   792
	TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
   793
	if (err != KErrNone)
sl@0
   794
		{
sl@0
   795
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
   796
			return EInconclusive;
sl@0
   797
		}
sl@0
   798
sl@0
   799
	// select post-processor
sl@0
   800
//	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
   801
	TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
   802
	if (err != KErrNone)
sl@0
   803
		{
sl@0
   804
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
   805
			return EInconclusive;
sl@0
   806
		}
sl@0
   807
sl@0
   808
	// initialize CDevVideoPlay and wait for response
sl@0
   809
	// iError is set by the MdvpoInitComplete callback
sl@0
   810
	aDevVideoPlay.Initialize();
sl@0
   811
	
sl@0
   812
	if (iError != KErrNone)
sl@0
   813
		{
sl@0
   814
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
   815
			return EInconclusive;
sl@0
   816
		}
sl@0
   817
sl@0
   818
	RArray<TUncompressedVideoFormat> vidFormats;
sl@0
   819
sl@0
   820
	// get a list of supported formats from the plugin
sl@0
   821
	TRAP(err, aDevVideoPlay.GetSupportedSnapshotFormatsL(vidFormats) )
sl@0
   822
sl@0
   823
	// check picture and timestamp from callback
sl@0
   824
	if (err == KErrNone)
sl@0
   825
		{
sl@0
   826
		if ( vidFormats.Count() == 3)
sl@0
   827
			{
sl@0
   828
			if ((vidFormats[0] == KTestVidFormat1) &&
sl@0
   829
				(vidFormats[1] == KTestVidFormat2) &&
sl@0
   830
				(vidFormats[2] == KTestVidFormat3) )
sl@0
   831
				{
sl@0
   832
				INFO_PRINTF1(_L("Snapshot format list checks ok"));
sl@0
   833
				ret = EPass;
sl@0
   834
				}
sl@0
   835
			else
sl@0
   836
				{
sl@0
   837
				ERR_PRINTF1(_L("Error - Snapshot format list is corrupt!"));
sl@0
   838
				}
sl@0
   839
			}
sl@0
   840
		}
sl@0
   841
	else
sl@0
   842
		{
sl@0
   843
		ERR_PRINTF3(_L("GetSupportedSnapshotFormatsL() gave error %d (expected %d)"),err, expErr);
sl@0
   844
		}
sl@0
   845
sl@0
   846
	vidFormats.Reset();
sl@0
   847
	vidFormats.Close();
sl@0
   848
sl@0
   849
	return ret;
sl@0
   850
	}
sl@0
   851
sl@0
   852
//------------------------------------------------------------------
sl@0
   853
sl@0
   854
CTestDevVideoPlayClock::CTestDevVideoPlayClock(const TDesC& aTestName)
sl@0
   855
	{
sl@0
   856
	iTestStepName = aTestName;
sl@0
   857
	}
sl@0
   858
sl@0
   859
void CTestDevVideoPlayClock::ConstructL()
sl@0
   860
	{
sl@0
   861
	}
sl@0
   862
sl@0
   863
CTestDevVideoPlayClock::~CTestDevVideoPlayClock()
sl@0
   864
	{
sl@0
   865
	}
sl@0
   866
sl@0
   867
CTestDevVideoPlayClock* CTestDevVideoPlayClock::NewL(const TDesC& aTestName)
sl@0
   868
	{
sl@0
   869
	CTestDevVideoPlayClock* self = new(ELeave) CTestDevVideoPlayClock(aTestName);
sl@0
   870
	CleanupStack::PushL(self);
sl@0
   871
	self->ConstructL();
sl@0
   872
	CleanupStack::Pop(self);
sl@0
   873
	return self;
sl@0
   874
	}
sl@0
   875
sl@0
   876
TInt CTestDevVideoPlayClock::StartThread(TAny* aAny)
sl@0
   877
	{
sl@0
   878
	CTestDevVideoPlayClock* me = static_cast<CTestDevVideoPlayClock*>(aAny);
sl@0
   879
	me->RunThread();
sl@0
   880
sl@0
   881
	return KErrNone;
sl@0
   882
	}
sl@0
   883
sl@0
   884
void CTestDevVideoPlayClock::RunThread()
sl@0
   885
	{
sl@0
   886
	TTimeIntervalMicroSeconds currentTime(0);
sl@0
   887
sl@0
   888
	while(!iShutdownSubthread)
sl@0
   889
		{
sl@0
   890
		currentTime = iClockSource->Time();
sl@0
   891
		TUint timeUint = I64LOW(currentTime.Int64());
sl@0
   892
		}
sl@0
   893
	}
sl@0
   894
sl@0
   895
void CTestDevVideoPlayClock::MmcspuoTick(const TTimeIntervalMicroSeconds& aTime)
sl@0
   896
	{
sl@0
   897
	iPeriodicUtilityIteration++;
sl@0
   898
sl@0
   899
	TUint currentTime = I64LOW(aTime.Int64());
sl@0
   900
	TUint predictedTime = iPeriodicUtilityIteration * KTestClock2Seconds;
sl@0
   901
sl@0
   902
	if (!TimeComparison(currentTime, predictedTime, KTestClockBigDeviationMS))
sl@0
   903
		{
sl@0
   904
		ERR_PRINTF3(_L("Error - Periodic Utility time comparison failed:  Got %u;  Expected %u"), currentTime, predictedTime);
sl@0
   905
		iPeriodicUtilityTestVerdict = EFail;
sl@0
   906
		iPeriodicUtility->Stop();
sl@0
   907
		CActiveScheduler::Stop();
sl@0
   908
		}
sl@0
   909
	else
sl@0
   910
		{
sl@0
   911
		INFO_PRINTF3(_L("Periodic Utility time comparison passed:  Got %u;  Expected %u"), currentTime, predictedTime);
sl@0
   912
		}
sl@0
   913
sl@0
   914
	if (iPeriodicUtilityIteration >= 5)
sl@0
   915
		{
sl@0
   916
		iPeriodicUtility->Stop();
sl@0
   917
		CActiveScheduler::Stop();
sl@0
   918
		}
sl@0
   919
	}
sl@0
   920
sl@0
   921
TVerdict CTestDevVideoPlayClock::DoTestStepL()
sl@0
   922
	{
sl@0
   923
	TVerdict ret = EPass;
sl@0
   924
	TTimeIntervalMicroSeconds testTime(0);
sl@0
   925
	TUint timeUint = 0;
sl@0
   926
sl@0
   927
	iClockSource = CSystemClockSource::NewL();
sl@0
   928
sl@0
   929
	// Construct a new thread to constantly probe the clock - to test that it'll work from multiple threads
sl@0
   930
	RThread thread;
sl@0
   931
	
sl@0
   932
	TInt error = thread.Create(_L("ClockSourceTestThread"), 
sl@0
   933
								&CTestDevVideoPlayClock::StartThread,
sl@0
   934
								KDefaultStackSize, 
sl@0
   935
								&User::Heap(),
sl@0
   936
								static_cast<TAny*>(this), 
sl@0
   937
								EOwnerThread);
sl@0
   938
sl@0
   939
	if (error)
sl@0
   940
		{
sl@0
   941
		ERR_PRINTF1(_L("Error - Couldn't create periodic utility object"));
sl@0
   942
		delete iClockSource;
sl@0
   943
		return EInconclusive;
sl@0
   944
		}
sl@0
   945
sl@0
   946
	TRequestStatus stat;
sl@0
   947
	thread.Logon(stat);
sl@0
   948
	if (stat!=KRequestPending)
sl@0
   949
		{
sl@0
   950
		delete iClockSource;
sl@0
   951
		ERR_PRINTF2(_L("Error - Couldn't logon to the thread err=%d"), stat.Int());
sl@0
   952
		thread.LogonCancel(stat);
sl@0
   953
		User::WaitForRequest(stat);
sl@0
   954
		return EInconclusive;
sl@0
   955
		}
sl@0
   956
	thread.SetPriority(EPriorityLess);
sl@0
   957
sl@0
   958
	// wait for system to calm down
sl@0
   959
	User::After(KTestClock2Seconds);
sl@0
   960
sl@0
   961
	// reset the clock
sl@0
   962
	iClockSource->Reset();
sl@0
   963
sl@0
   964
	thread.Resume();
sl@0
   965
sl@0
   966
	// wait for 2 seconds and then check the time == 2 seconds
sl@0
   967
	User::After(KTestClock2Seconds);
sl@0
   968
	testTime = iClockSource->Time();
sl@0
   969
	timeUint = I64LOW(testTime.Int64());
sl@0
   970
sl@0
   971
	if (!TimeComparison(timeUint, KTestClock2Seconds, KTestClockDeviationMS))
sl@0
   972
		{
sl@0
   973
		ERR_PRINTF3(_L("Error - time comparison failed:  Got %u;  Expected %u"), timeUint, KTestClock2Seconds);
sl@0
   974
		ret = EFail;
sl@0
   975
		}
sl@0
   976
	else 
sl@0
   977
		{
sl@0
   978
		INFO_PRINTF3(_L("Time comparison passed:  Got %u;  Expected %u"), timeUint, KTestClock2Seconds);
sl@0
   979
		}
sl@0
   980
sl@0
   981
	// reset the clock back to 2 seconds
sl@0
   982
	//testTime = KTestClock2Seconds;
sl@0
   983
	//iClockSource->Reset(testTime);
sl@0
   984
sl@0
   985
	// suspend timer for 2 seconds then resume for 2 seconds
sl@0
   986
	iClockSource->Suspend();
sl@0
   987
	User::After(KTestClock2Seconds);
sl@0
   988
	iClockSource->Resume();
sl@0
   989
	User::After(KTestClock2Seconds);
sl@0
   990
	testTime = iClockSource->Time();
sl@0
   991
	timeUint = I64LOW(testTime.Int64());
sl@0
   992
sl@0
   993
	if (!TimeComparison(timeUint, KTestClock4Seconds, KTestClockDeviationMS))
sl@0
   994
		{
sl@0
   995
		ERR_PRINTF3(_L("Error - Suspend() + Resume() time comparison failed:  Got %u;  Expected %u"), timeUint, KTestClock4Seconds);
sl@0
   996
		ret = EFail;
sl@0
   997
		}
sl@0
   998
	else
sl@0
   999
		{
sl@0
  1000
		INFO_PRINTF3(_L("Suspend() + Resume() time comparison passed:  Got %u;  Expected %u"), timeUint, KTestClock4Seconds);
sl@0
  1001
		}
sl@0
  1002
sl@0
  1003
	// reset clock to 18 seconds
sl@0
  1004
	testTime = KTestClock18Seconds;
sl@0
  1005
	iClockSource->Reset(testTime);
sl@0
  1006
sl@0
  1007
	// wait for 2 seconds and then check the time == 20 seconds
sl@0
  1008
	User::After(KTestClock2Seconds);
sl@0
  1009
	testTime = iClockSource->Time();
sl@0
  1010
	timeUint = I64LOW(testTime.Int64());
sl@0
  1011
sl@0
  1012
	if (!TimeComparison(timeUint, KTestClock20Seconds, KTestClockDeviationMS))
sl@0
  1013
		{
sl@0
  1014
		ERR_PRINTF3(_L("Error - Reset() time comparison failed:  Got %u;  Expected %u"), timeUint, KTestClock20Seconds);
sl@0
  1015
		ret = EFail;
sl@0
  1016
		}
sl@0
  1017
	else
sl@0
  1018
		{
sl@0
  1019
		INFO_PRINTF3(_L("Reset() time comparison passed:  Got %u;  Expected %u"), timeUint, KTestClock20Seconds);
sl@0
  1020
		}
sl@0
  1021
sl@0
  1022
	// suspend for 2 seconds then resume for 2 seconds
sl@0
  1023
	iClockSource->Suspend();
sl@0
  1024
	User::After(KTestClock2Seconds);
sl@0
  1025
	iClockSource->Resume();
sl@0
  1026
	User::After(KTestClock2Seconds);
sl@0
  1027
	
sl@0
  1028
	testTime = iClockSource->Time();
sl@0
  1029
	timeUint = I64LOW(testTime.Int64());
sl@0
  1030
sl@0
  1031
	if (!TimeComparison(timeUint, KTestClock22Seconds, KTestClockDeviationMS))
sl@0
  1032
		{
sl@0
  1033
		ERR_PRINTF3(_L("Error - Suspend() + Resume() time comparison failed:  Got %u;  Expected %u"), timeUint, KTestClock22Seconds);
sl@0
  1034
		ret = EFail;
sl@0
  1035
		}
sl@0
  1036
	else
sl@0
  1037
		{
sl@0
  1038
		INFO_PRINTF3(_L("Suspend() + Resume() time comparison passed:  Got %u;  Expected %u"), timeUint, KTestClock22Seconds);
sl@0
  1039
		}
sl@0
  1040
sl@0
  1041
	// Now test the periodic utility
sl@0
  1042
	TRAPD(perError, iPeriodicUtility = CMMFClockSourcePeriodicUtility::NewL(*iClockSource, *this));
sl@0
  1043
	if (perError)
sl@0
  1044
		{
sl@0
  1045
		ERR_PRINTF1(_L("Error - Couldn't create periodic utility object"));
sl@0
  1046
		ret = EInconclusive;
sl@0
  1047
		}
sl@0
  1048
	else
sl@0
  1049
		{
sl@0
  1050
		iPeriodicUtilityTestVerdict = EPass;
sl@0
  1051
		TTimeIntervalMicroSeconds32 period = KTestClock2Seconds;
sl@0
  1052
		iClockSource->Reset();
sl@0
  1053
		iPeriodicUtility->Start(period);
sl@0
  1054
		CActiveScheduler::Start();
sl@0
  1055
		ret = iPeriodicUtilityTestVerdict;
sl@0
  1056
		}
sl@0
  1057
	delete iPeriodicUtility;
sl@0
  1058
	iPeriodicUtility = NULL;
sl@0
  1059
sl@0
  1060
	// Clean up the thread
sl@0
  1061
	iShutdownSubthread = ETrue;
sl@0
  1062
	User::WaitForRequest(stat);
sl@0
  1063
	thread.Close();
sl@0
  1064
sl@0
  1065
	delete iClockSource;
sl@0
  1066
sl@0
  1067
	return ret;
sl@0
  1068
	}
sl@0
  1069
sl@0
  1070
//------------------------------------------------------------------
sl@0
  1071
sl@0
  1072
void CTestDevVideoPlayCommit::MdvpoInitComplete(TInt aError)
sl@0
  1073
	{
sl@0
  1074
	INFO_PRINTF2(_L("CTestDevVideoPlayCommit::MdvpoInitComplete():  Error = %d"), aError);
sl@0
  1075
	
sl@0
  1076
	iError = aError;
sl@0
  1077
	}
sl@0
  1078
sl@0
  1079
CTestDevVideoPlayCommit::CTestDevVideoPlayCommit(const TDesC& aTestName, TTestType aTestType)
sl@0
  1080
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
  1081
	{
sl@0
  1082
	}
sl@0
  1083
sl@0
  1084
CTestDevVideoPlayCommit* CTestDevVideoPlayCommit::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
  1085
	{
sl@0
  1086
	CTestDevVideoPlayCommit* self = new(ELeave) CTestDevVideoPlayCommit(aTestName, aTestType);
sl@0
  1087
	return self;
sl@0
  1088
	}
sl@0
  1089
sl@0
  1090
TVerdict CTestDevVideoPlayCommit::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
  1091
	{
sl@0
  1092
	TVerdict ret = EPass;
sl@0
  1093
	TInt expErr = KErrNone;
sl@0
  1094
	TBool selDec = ETrue;
sl@0
  1095
	TBool selPost = ETrue;
sl@0
  1096
sl@0
  1097
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  Commit"));
sl@0
  1098
	
sl@0
  1099
	// expected results
sl@0
  1100
	switch(iTestType)
sl@0
  1101
		{
sl@0
  1102
		case ETestValid:
sl@0
  1103
			expErr = KErrNone;
sl@0
  1104
			break;
sl@0
  1105
		case ETestDecoderOnly:
sl@0
  1106
			selPost = EFalse;
sl@0
  1107
			break;
sl@0
  1108
		case ETestPostProcOnly:
sl@0
  1109
			selDec = EFalse;
sl@0
  1110
			break;
sl@0
  1111
		default:
sl@0
  1112
			ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
  1113
			return EInconclusive;
sl@0
  1114
		}
sl@0
  1115
sl@0
  1116
	TInt err = KErrNone;
sl@0
  1117
sl@0
  1118
//	THwDeviceId hwDecoder = 0;
sl@0
  1119
//	THwDeviceId hwPostProc = 0;
sl@0
  1120
sl@0
  1121
	// select decoder
sl@0
  1122
	if (selDec)
sl@0
  1123
		{
sl@0
  1124
//		TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
  1125
		TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
  1126
		if (err != KErrNone)
sl@0
  1127
			{
sl@0
  1128
			ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
  1129
				return EInconclusive;
sl@0
  1130
			}
sl@0
  1131
		}
sl@0
  1132
sl@0
  1133
	// select post-processor
sl@0
  1134
	if (selPost)
sl@0
  1135
		{
sl@0
  1136
//		TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
  1137
		TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
  1138
		if (err != KErrNone)
sl@0
  1139
			{
sl@0
  1140
			ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
  1141
				return EInconclusive;
sl@0
  1142
			}
sl@0
  1143
		}
sl@0
  1144
sl@0
  1145
	// initialize CDevVideoPlay and wait for response
sl@0
  1146
	// iError is set by the MdvpoInitComplete callback
sl@0
  1147
	aDevVideoPlay.Initialize();
sl@0
  1148
	
sl@0
  1149
	if (iError != KErrNone)
sl@0
  1150
		{
sl@0
  1151
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
  1152
			return EInconclusive;
sl@0
  1153
		}
sl@0
  1154
sl@0
  1155
	// call CommitL on DevVideoPlay 
sl@0
  1156
	TRAP(iError, aDevVideoPlay.CommitL());
sl@0
  1157
sl@0
  1158
	if (iError != expErr)
sl@0
  1159
		{
sl@0
  1160
		ERR_PRINTF3(_L("Commit left with error %d; Expected %d!"), iError, expErr);
sl@0
  1161
		ret = EFail;
sl@0
  1162
		}
sl@0
  1163
	else
sl@0
  1164
		INFO_PRINTF1(_L("CommitL() called successfully"));
sl@0
  1165
	
sl@0
  1166
	return ret;
sl@0
  1167
	}
sl@0
  1168
sl@0
  1169
//------------------------------------------------------------------
sl@0
  1170
sl@0
  1171
void CTestDevVideoPlayRevert::MdvpoInitComplete(TInt aError)
sl@0
  1172
	{
sl@0
  1173
	INFO_PRINTF2(_L("CTestDevVideoPlayRevert::MdvpoInitComplete():  Error = %d"), aError);
sl@0
  1174
	
sl@0
  1175
	iError = aError;
sl@0
  1176
	}
sl@0
  1177
sl@0
  1178
CTestDevVideoPlayRevert::CTestDevVideoPlayRevert(const TDesC& aTestName, TTestType aTestType)
sl@0
  1179
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
  1180
	{
sl@0
  1181
	}
sl@0
  1182
sl@0
  1183
CTestDevVideoPlayRevert* CTestDevVideoPlayRevert::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
  1184
	{
sl@0
  1185
	CTestDevVideoPlayRevert* self = new(ELeave) CTestDevVideoPlayRevert(aTestName, aTestType);
sl@0
  1186
	return self;
sl@0
  1187
	}
sl@0
  1188
sl@0
  1189
TVerdict CTestDevVideoPlayRevert::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
  1190
	{
sl@0
  1191
	TVerdict ret = EPass;
sl@0
  1192
//	TInt expErr = KErrNone;
sl@0
  1193
	TBool selDec = ETrue;
sl@0
  1194
	TBool selPost = ETrue;
sl@0
  1195
sl@0
  1196
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  Revert"));
sl@0
  1197
	
sl@0
  1198
	// expected results
sl@0
  1199
	switch(iTestType)
sl@0
  1200
		{
sl@0
  1201
		case ETestValid:
sl@0
  1202
//			expErr = KErrNone;
sl@0
  1203
			break;
sl@0
  1204
		case ETestDecoderOnly:
sl@0
  1205
			selPost = EFalse;
sl@0
  1206
			break;
sl@0
  1207
		case ETestPostProcOnly:
sl@0
  1208
			selDec = EFalse;
sl@0
  1209
			break;
sl@0
  1210
		default:
sl@0
  1211
			ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
  1212
			return EInconclusive;
sl@0
  1213
		}
sl@0
  1214
sl@0
  1215
	TInt err = KErrNone;
sl@0
  1216
sl@0
  1217
//	THwDeviceId hwDecoder = 0;
sl@0
  1218
//	THwDeviceId hwPostProc = 0;
sl@0
  1219
sl@0
  1220
	// select decoder
sl@0
  1221
	if (selDec)
sl@0
  1222
		{
sl@0
  1223
//		TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
  1224
		TRAP(err, aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));	// EABI warning removal
sl@0
  1225
		if (err != KErrNone)
sl@0
  1226
			{
sl@0
  1227
			ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
  1228
				return EInconclusive;
sl@0
  1229
			}
sl@0
  1230
		}
sl@0
  1231
sl@0
  1232
	// select post-processor
sl@0
  1233
	if (selPost)
sl@0
  1234
		{
sl@0
  1235
//		TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
  1236
		TRAP(err, aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));	// EABI warning removal
sl@0
  1237
		if (err != KErrNone)
sl@0
  1238
			{
sl@0
  1239
			ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
  1240
				return EInconclusive;
sl@0
  1241
			}
sl@0
  1242
		}
sl@0
  1243
sl@0
  1244
	// initialize CDevVideoPlay and wait for response
sl@0
  1245
	// iError is set by the MdvpoInitComplete callback
sl@0
  1246
	aDevVideoPlay.Initialize();
sl@0
  1247
	
sl@0
  1248
	if (iError != KErrNone)
sl@0
  1249
		{
sl@0
  1250
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
  1251
			return EInconclusive;
sl@0
  1252
		}
sl@0
  1253
sl@0
  1254
	// call Revert on DevVideoPlay
sl@0
  1255
	aDevVideoPlay.Revert();
sl@0
  1256
sl@0
  1257
	// if no PANIC then test has passed...
sl@0
  1258
sl@0
  1259
	INFO_PRINTF1(_L("Revert() called successfully"));
sl@0
  1260
	
sl@0
  1261
	return ret;
sl@0
  1262
	}
sl@0
  1263
sl@0
  1264
sl@0
  1265
//------------------------------------------------------------------
sl@0
  1266
sl@0
  1267
CTestDevVideoPlayCustomInterface::CTestDevVideoPlayCustomInterface(const TDesC& aTestName, TTestType aTestType)
sl@0
  1268
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
  1269
	{
sl@0
  1270
	}
sl@0
  1271
sl@0
  1272
CTestDevVideoPlayCustomInterface* CTestDevVideoPlayCustomInterface::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
  1273
	{
sl@0
  1274
	CTestDevVideoPlayCustomInterface* self = new(ELeave) CTestDevVideoPlayCustomInterface(aTestName, aTestType);
sl@0
  1275
	return self;
sl@0
  1276
	}
sl@0
  1277
sl@0
  1278
TVerdict CTestDevVideoPlayCustomInterface::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
  1279
	{
sl@0
  1280
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  CustomInterface"));
sl@0
  1281
sl@0
  1282
	THwDeviceId hwDecoder = 0;
sl@0
  1283
	THwDeviceId hwPostProc = 0;
sl@0
  1284
	TInt err = KErrNone;
sl@0
  1285
sl@0
  1286
	TRAP(err, hwDecoder = aDevVideoPlay.SelectDecoderL(KUidDevVideoTestDecodeHwDevice));
sl@0
  1287
	if (err != KErrNone)
sl@0
  1288
		{
sl@0
  1289
		ERR_PRINTF1(_L("Error - couldn't initialize decoder"));
sl@0
  1290
			return EInconclusive;
sl@0
  1291
		}
sl@0
  1292
	
sl@0
  1293
	TRAP(err, hwPostProc = aDevVideoPlay.SelectPostProcessorL(KUidDevVideoTestPostProcHwDevice));
sl@0
  1294
	if (err != KErrNone)
sl@0
  1295
		{
sl@0
  1296
		ERR_PRINTF1(_L("Error - couldn't initialize post processor"));
sl@0
  1297
			return EInconclusive;
sl@0
  1298
		}
sl@0
  1299
sl@0
  1300
	// First try test uninitialized
sl@0
  1301
sl@0
  1302
	TAny* ciOne = NULL;
sl@0
  1303
	TAny* ciTwo = NULL;
sl@0
  1304
	TAny* ciThree = NULL;
sl@0
  1305
	TAny* ciFour = NULL;
sl@0
  1306
	
sl@0
  1307
	ciOne = aDevVideoPlay.CustomInterface(hwDecoder, KUidCustomInterfaceOne);
sl@0
  1308
	ciTwo = aDevVideoPlay.CustomInterface(hwDecoder, KUidCustomInterfaceTwo);
sl@0
  1309
	ciThree = aDevVideoPlay.CustomInterface(hwPostProc, KUidCustomInterfaceTwo);
sl@0
  1310
	ciFour = aDevVideoPlay.CustomInterface(hwPostProc, KUidCustomInterfaceOne);
sl@0
  1311
sl@0
  1312
	if (ciOne==NULL || ciTwo!=NULL || ciThree==NULL || ciFour!=NULL)
sl@0
  1313
		{
sl@0
  1314
		ERR_PRINTF1(_L("Test Failed - wrong interfaces returned"));
sl@0
  1315
		return EFail;
sl@0
  1316
		}
sl@0
  1317
sl@0
  1318
	// Next, re-perform test initialized.
sl@0
  1319
sl@0
  1320
	// initialize CDevVideoPlay and wait for response
sl@0
  1321
	// iError is set by the MdvpoInitComplete callback
sl@0
  1322
	aDevVideoPlay.Initialize();
sl@0
  1323
	
sl@0
  1324
	if (iError != KErrNone)
sl@0
  1325
		{
sl@0
  1326
		ERR_PRINTF1(_L("Error - couldn't initialize DevVideoPlay"));
sl@0
  1327
		return EInconclusive;
sl@0
  1328
		}
sl@0
  1329
sl@0
  1330
	ciOne = NULL;
sl@0
  1331
	ciTwo = NULL;
sl@0
  1332
	ciThree = NULL;
sl@0
  1333
	ciFour = NULL;
sl@0
  1334
	
sl@0
  1335
	ciOne = aDevVideoPlay.CustomInterface(hwDecoder, KUidCustomInterfaceOne);
sl@0
  1336
	ciTwo = aDevVideoPlay.CustomInterface(hwDecoder, KUidCustomInterfaceTwo);
sl@0
  1337
	ciThree = aDevVideoPlay.CustomInterface(hwPostProc, KUidCustomInterfaceTwo);
sl@0
  1338
	ciFour = aDevVideoPlay.CustomInterface(hwPostProc, KUidCustomInterfaceOne);
sl@0
  1339
sl@0
  1340
	if (ciOne==NULL || ciTwo!=NULL || ciThree==NULL || ciFour!=NULL)
sl@0
  1341
		{
sl@0
  1342
		ERR_PRINTF1(_L("Test Failed - wrong interfaces returned"));
sl@0
  1343
		return EFail;
sl@0
  1344
		}
sl@0
  1345
sl@0
  1346
sl@0
  1347
	return EPass;
sl@0
  1348
	}
sl@0
  1349
sl@0
  1350
sl@0
  1351
sl@0
  1352
/*
sl@0
  1353
//------------------------------------------------------------------
sl@0
  1354
sl@0
  1355
CTestDevVideoPlayXXX::CTestDevVideoPlayXXX(const TDesC& aTestName, TTestType aTestType)
sl@0
  1356
	:CTestDevVideoPlayStep(aTestName, aTestType)
sl@0
  1357
	{
sl@0
  1358
	}
sl@0
  1359
sl@0
  1360
CTestDevVideoPlayXXX* CTestDevVideoPlayXXX::NewL(const TDesC& aTestName, TTestType aTestType)
sl@0
  1361
	{
sl@0
  1362
	CTestDevVideoPlayXXX* self = new(ELeave) CTestDevVideoPlayXXX(aTestName, aTestType);
sl@0
  1363
	return self;
sl@0
  1364
	}
sl@0
  1365
sl@0
  1366
TVerdict CTestDevVideoPlayXXX::DoTestL(CMMFDevVideoPlay& aDevVideoPlay)
sl@0
  1367
	{
sl@0
  1368
	TVerdict ret = EPass;
sl@0
  1369
	TInt expErr = KErrNone;
sl@0
  1370
	
sl@0
  1371
	INFO_PRINTF1(_L("CMMFDevVideoPlay:  XXX"));
sl@0
  1372
	
sl@0
  1373
	// expected results
sl@0
  1374
	if (iTestType != ETestValid)
sl@0
  1375
		{
sl@0
  1376
		ERR_PRINTF1(_L("Error - invalid test step type"));
sl@0
  1377
		return EInconclusive;
sl@0
  1378
		}
sl@0
  1379
	
sl@0
  1380
	// XXXX
sl@0
  1381
sl@0
  1382
	TInt err = KErrNone;
sl@0
  1383
	// TRAP(err, aDevVideoPlay.API_FUNCTION_HERE() )
sl@0
  1384
sl@0
  1385
	if (err != expErr)
sl@0
  1386
		{
sl@0
  1387
		ERR_PRINTF3(_L("XXX() gave error %d (expected %d)"),iError, expErr);
sl@0
  1388
		ret = EFail;
sl@0
  1389
		}
sl@0
  1390
	else
sl@0
  1391
		INFO_PRINTF3(_L("XXX(), %d = %d"), iError, expErr);
sl@0
  1392
	
sl@0
  1393
	return ret;
sl@0
  1394
	}
sl@0
  1395
sl@0
  1396
*/
sl@0
  1397