os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/ciu/testdevvideociuplay.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmfunittest/DevVideo/src/ciu/testdevvideociuplay.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,3528 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifdef SYMBIAN_BUILD_GCE
    1.20 +#include <mmf/common/mmfvideosurfacecustomcommands.h>
    1.21 +#include <mmf/devvideo/devvideoclientbuffersupport.h>
    1.22 +#include "videoframebuffer.h"
    1.23 +#endif // SYMBIAN_BUILD_GCE
    1.24 +
    1.25 +#include "testdevvideociuplay.h"
    1.26 +#include "testdevvideociuplugins/ciudecoder.h"
    1.27 +#include "testdevvideociuplugins/ciupostproc.h"
    1.28 +#include "testdevvideociuplugins/ciudevvideotestinterface.h"
    1.29 +
    1.30 +// DevVideoCiu base class
    1.31 +
    1.32 +CTestDevVideoCiuPlayStep::CTestDevVideoCiuPlayStep(const TDesC& aTestName)
    1.33 +	{
    1.34 +	// store the name of this test case
    1.35 +	// this is the name that is used by the script file
    1.36 +	// Each test step initialises it's own name
    1.37 +	iTestStepName = aTestName;
    1.38 +	}
    1.39 +	
    1.40 +CTestDevVideoCiuPlayStep::~CTestDevVideoCiuPlayStep() 
    1.41 +	{
    1.42 +	}
    1.43 +
    1.44 +TVerdict CTestDevVideoCiuPlayStep::DoTestStepPreambleL()
    1.45 +	{
    1.46 +	TVerdict ret = CTestDevVideoCiuStep::DoTestStepPreambleL();
    1.47 +
    1.48 +	__UHEAP_MARK;
    1.49 +	TRAPD(err, iDevVideoPlay = CMMFDevVideoPlay::NewL( *this ));
    1.50 +	if (err != KErrNone)
    1.51 +		{
    1.52 +		ERR_PRINTF1(_L("Could not create a CMMFDevVideoPlay!"));
    1.53 +		ret = EInconclusive;
    1.54 +		}
    1.55 +	return ret;
    1.56 +	}
    1.57 +
    1.58 +TVerdict CTestDevVideoCiuPlayStep::DoTestStepPostambleL()
    1.59 +	{
    1.60 +	delete iDevVideoPlay;	
    1.61 +	__MM_HEAP_MARKEND;
    1.62 +	
    1.63 +	return EPass;
    1.64 +	}
    1.65 +
    1.66 +TVerdict CTestDevVideoCiuPlayStep::DoTestStepL()
    1.67 +	{
    1.68 +	TVerdict ret = EFail;
    1.69 +
    1.70 +	iDevVideoPlay->Initialize();
    1.71 +
    1.72 +	if (iError == KErrNone)
    1.73 +		{
    1.74 +		INFO_PRINTF1(_L("DevVideo Play initialisation was successful."));
    1.75 +		
    1.76 +		// call the test step
    1.77 +		ret = DoTestL();
    1.78 +		}
    1.79 +	else
    1.80 +		{
    1.81 +		ret = EInconclusive;
    1.82 +		ERR_PRINTF1(_L("Failed to initialise the DevVideo Play"));
    1.83 +		}
    1.84 +		
    1.85 +	return ret;
    1.86 +	}
    1.87 +
    1.88 +// MMMFDevVideoCiuObserver
    1.89 +void CTestDevVideoCiuPlayStep::MdvpoNewBuffers()
    1.90 +	{
    1.91 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoNewBuffers()"));
    1.92 +	}
    1.93 +
    1.94 +void CTestDevVideoCiuPlayStep::MdvpoReturnPicture(TVideoPicture* /*aPicture*/)
    1.95 +	{
    1.96 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoReturnPicture()"));
    1.97 +	}
    1.98 +
    1.99 +void CTestDevVideoCiuPlayStep::MdvpoSupplementalInformation(const TDesC8& /*aData*/, 
   1.100 +								  const TTimeIntervalMicroSeconds& /*aTimestamp*/, 
   1.101 +								  const TPictureId& /*aPictureId*/)
   1.102 +	{
   1.103 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoSupplementalInformation()"));
   1.104 +	}
   1.105 +
   1.106 +void CTestDevVideoCiuPlayStep::MdvpoPictureLoss()
   1.107 +	{
   1.108 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoPictureLoss()"));
   1.109 +	}
   1.110 +
   1.111 +void CTestDevVideoCiuPlayStep::MdvpoPictureLoss(const TArray<TPictureId>& /*aPictures*/)
   1.112 +	{
   1.113 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoPictureLoss(TArray)"));
   1.114 +	}
   1.115 +
   1.116 +void CTestDevVideoCiuPlayStep::MdvpoSliceLoss(TUint /*aFirstMacroblock*/, TUint /*aNumMacroblocks*/, const TPictureId& /*aPicture*/)
   1.117 +	{
   1.118 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoSliceLoss()"));
   1.119 +	}
   1.120 +
   1.121 +void CTestDevVideoCiuPlayStep::MdvpoReferencePictureSelection(const TDesC8& /*aSelectionData*/)
   1.122 +	{
   1.123 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoReferencePictureSelection()"));
   1.124 +	}
   1.125 +
   1.126 +void CTestDevVideoCiuPlayStep::MdvpoTimedSnapshotComplete(TInt /*aError*/, 
   1.127 +								TPictureData* /*aPictureData*/, 
   1.128 +								const TTimeIntervalMicroSeconds& /*aPresentationTimestamp*/, 
   1.129 +								const TPictureId& /*aPictureId*/)
   1.130 +	{
   1.131 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoTimedSnapshotComplete()"));
   1.132 +	}
   1.133 +
   1.134 +void CTestDevVideoCiuPlayStep::MdvpoNewPictures()
   1.135 +	{
   1.136 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoNewPictures()"));
   1.137 +	}
   1.138 +
   1.139 +void CTestDevVideoCiuPlayStep::MdvpoFatalError(TInt aError)
   1.140 +	{
   1.141 +	iError = aError;
   1.142 +	INFO_PRINTF2(_L("CTestDevVideoCiuPlayStep::MdvpoFatalError():  Error = %d"), aError);
   1.143 +	}
   1.144 +
   1.145 +void CTestDevVideoCiuPlayStep::MdvpoInitComplete(TInt aError)
   1.146 +	{
   1.147 +	iError = aError;
   1.148 +	INFO_PRINTF2(_L("CTestDevVideoCiuPlayStep::MdvpoInitComplete():  Error = %d"), aError);
   1.149 +	}
   1.150 +
   1.151 +void CTestDevVideoCiuPlayStep::MdvpoStreamEnd()
   1.152 +	{
   1.153 +	INFO_PRINTF1(_L("CTestDevVideoCiuPlayStep::MdvpoStreamEnd()"));
   1.154 +	}
   1.155 +
   1.156 +//
   1.157 +//	Video Window Control Tests
   1.158 +//
   1.159 +CTestDevVideoCiuPlayGetAndSetLogicalWindow::CTestDevVideoCiuPlayGetAndSetLogicalWindow(const TDesC& aTestName)
   1.160 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.161 +	{
   1.162 +	}
   1.163 +
   1.164 +CTestDevVideoCiuPlayGetAndSetLogicalWindow* CTestDevVideoCiuPlayGetAndSetLogicalWindow::NewL(const TDesC& aTestName)
   1.165 +	{
   1.166 +	CTestDevVideoCiuPlayGetAndSetLogicalWindow* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetLogicalWindow(aTestName);
   1.167 +	return self;
   1.168 +	}
   1.169 +
   1.170 +TVerdict CTestDevVideoCiuPlayGetAndSetLogicalWindow::DoTestStepPreambleL()
   1.171 +	{
   1.172 +	// Call the base class first
   1.173 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.174 +	if (ret == EPass)
   1.175 +		{
   1.176 +		// select decoder
   1.177 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.178 +		
   1.179 +		if (err != KErrNone)
   1.180 +			{
   1.181 +			ret = EInconclusive;
   1.182 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.183 +			}
   1.184 +		}
   1.185 +	return ret;
   1.186 +	}
   1.187 +
   1.188 +TVerdict CTestDevVideoCiuPlayGetAndSetLogicalWindow::DoTestL()
   1.189 +	{
   1.190 +	TVerdict ret = EFail;
   1.191 +	
   1.192 +	INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
   1.193 +	
   1.194 +	// Fetch the CI
   1.195 +	MMmfVideoWindowControl* interface = NULL;
   1.196 +		
   1.197 +	interface = static_cast<MMmfVideoWindowControl*>
   1.198 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.199 +																	KUidMmfVideoWindowControl));
   1.200 +	if (!interface)
   1.201 +		{
   1.202 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.203 +		ret = EFail;
   1.204 +		}
   1.205 +	else
   1.206 +		{
   1.207 +		INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
   1.208 +		
   1.209 +		TRect logicalWindow(TPoint(0,0), TPoint(300,300));
   1.210 +	
   1.211 +		interface->MmvwcSetLogicalVideoWindow(logicalWindow);
   1.212 +		
   1.213 +		MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
   1.214 +
   1.215 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
   1.216 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
   1.217 +		if (testInterface)
   1.218 +			{
   1.219 +			TRect logicalWindowResult = testInterface->MmvwcLogicalVideoWindow();
   1.220 +			if (logicalWindow == logicalWindowResult)
   1.221 +				{
   1.222 +				ret = EPass;
   1.223 +				INFO_PRINTF1(_L("Set Logical Window method call performed as expected"));
   1.224 +				}
   1.225 +			else
   1.226 +				{
   1.227 +				ret = EFail;					
   1.228 +				ERR_PRINTF1(_L("Set Logical Window method call failed to set the value correctly"));
   1.229 +				}
   1.230 +			}
   1.231 +		else
   1.232 +			{
   1.233 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
   1.234 +			ret = EInconclusive;
   1.235 +			}
   1.236 +		}
   1.237 +	return ret;
   1.238 +	}
   1.239 +
   1.240 +//------------------------------------------------------------------
   1.241 +
   1.242 +CTestDevVideoCiuPlayGetAndSetContentOffset::CTestDevVideoCiuPlayGetAndSetContentOffset(const TDesC& aTestName)
   1.243 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.244 +	{
   1.245 +	}
   1.246 +
   1.247 +CTestDevVideoCiuPlayGetAndSetContentOffset* CTestDevVideoCiuPlayGetAndSetContentOffset::NewL(const TDesC& aTestName)
   1.248 +	{
   1.249 +	CTestDevVideoCiuPlayGetAndSetContentOffset* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetContentOffset(aTestName);
   1.250 +	return self;
   1.251 +	}
   1.252 +
   1.253 +TVerdict CTestDevVideoCiuPlayGetAndSetContentOffset::DoTestStepPreambleL()
   1.254 +	{
   1.255 +	// Call the base class first
   1.256 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.257 +	if (ret == EPass)
   1.258 +		{
   1.259 +		// select decoder
   1.260 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.261 +		
   1.262 +		if (err != KErrNone)
   1.263 +			{
   1.264 +			ret = EInconclusive;
   1.265 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.266 +			}
   1.267 +		}
   1.268 +	return ret;
   1.269 +	}
   1.270 +
   1.271 +TVerdict CTestDevVideoCiuPlayGetAndSetContentOffset::DoTestL()
   1.272 +	{
   1.273 +	TVerdict ret = EFail;
   1.274 +	
   1.275 +	INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
   1.276 +	
   1.277 +	// Fetch the CI
   1.278 +	MMmfVideoWindowControl* interface = NULL;
   1.279 +		
   1.280 +	interface = static_cast<MMmfVideoWindowControl*>
   1.281 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.282 +																	KUidMmfVideoWindowControl));
   1.283 +	if (!interface)
   1.284 +		{
   1.285 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.286 +		ret = EFail;
   1.287 +		}
   1.288 +	else
   1.289 +		{
   1.290 +		INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
   1.291 +		
   1.292 +		TPoint contentOffsetInput(100, 100);
   1.293 +	
   1.294 +		interface->MmvwcSetContentOffsetL(contentOffsetInput);
   1.295 +		
   1.296 +		MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
   1.297 +
   1.298 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
   1.299 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
   1.300 +		if (testInterface)
   1.301 +			{
   1.302 +			TPoint contentOffsetOutput = testInterface->MmvwcContentOffset();
   1.303 +			if (contentOffsetInput == contentOffsetOutput)
   1.304 +				{
   1.305 +				ret = EPass;
   1.306 +				INFO_PRINTF1(_L("Set Content Offset method call performed as expected"));
   1.307 +				}
   1.308 +			else
   1.309 +				{
   1.310 +				ret = EFail;					
   1.311 +				ERR_PRINTF1(_L("Set Content Offset method call failed to set the value correctly"));
   1.312 +				}
   1.313 +			}
   1.314 +		else
   1.315 +			{
   1.316 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
   1.317 +			ret = EInconclusive;
   1.318 +			}
   1.319 +		}
   1.320 +	return ret;
   1.321 +	}
   1.322 +
   1.323 +//------------------------------------------------------------------
   1.324 +
   1.325 +CTestDevVideoCiuPlayGetAndSetContentAlignment::CTestDevVideoCiuPlayGetAndSetContentAlignment(const TDesC& aTestName)
   1.326 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.327 +	{
   1.328 +	}
   1.329 +
   1.330 +CTestDevVideoCiuPlayGetAndSetContentAlignment* CTestDevVideoCiuPlayGetAndSetContentAlignment::NewL(const TDesC& aTestName)
   1.331 +	{
   1.332 +	CTestDevVideoCiuPlayGetAndSetContentAlignment* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetContentAlignment(aTestName);
   1.333 +	return self;
   1.334 +	}
   1.335 +
   1.336 +TVerdict CTestDevVideoCiuPlayGetAndSetContentAlignment::DoTestStepPreambleL()
   1.337 +	{
   1.338 +	// Call the base class first
   1.339 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.340 +	if (ret == EPass)
   1.341 +		{
   1.342 +		// select decoder
   1.343 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.344 +		
   1.345 +		if (err != KErrNone)
   1.346 +			{
   1.347 +			ret = EInconclusive;
   1.348 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.349 +			}
   1.350 +		}
   1.351 +	return ret;
   1.352 +	}
   1.353 +
   1.354 +TVerdict CTestDevVideoCiuPlayGetAndSetContentAlignment::DoTestL()
   1.355 +	{
   1.356 +	TVerdict ret = EFail;
   1.357 +	
   1.358 +	INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Initialisation"));
   1.359 +	
   1.360 +	// Fetch the CI
   1.361 +	MMmfVideoWindowControl* interface = NULL;
   1.362 +		
   1.363 +	interface = static_cast<MMmfVideoWindowControl*>
   1.364 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.365 +																	KUidMmfVideoWindowControl));
   1.366 +	if (!interface)
   1.367 +		{
   1.368 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.369 +		ret = EFail;
   1.370 +		}
   1.371 +	else
   1.372 +		{
   1.373 +		INFO_PRINTF1(_L("DevVideo CIU Window Control Interface Instantiated"));
   1.374 +		
   1.375 +		MDevVideoCiuTestInterfaceVideoWindowControl::TAlignment alignmentInput = {MMmfVideoWindowControl::EHorizAlignCenter, MMmfVideoWindowControl::EVertAlignTop};
   1.376 +	
   1.377 +		interface->MmvwcSetContentAlignment(alignmentInput.iHorizAlign,alignmentInput.iVertAlign);
   1.378 +		
   1.379 +		MDevVideoCiuTestInterfaceVideoWindowControl* testInterface = NULL;
   1.380 +
   1.381 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoWindowControl*>
   1.382 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceVideoWindowControl));
   1.383 +		if (testInterface)
   1.384 +			{
   1.385 +			MDevVideoCiuTestInterfaceVideoWindowControl::TAlignment alignmentOutput = testInterface->MmvwcContentAlignment();
   1.386 +			if ((alignmentInput.iHorizAlign == alignmentOutput.iHorizAlign) && (alignmentInput.iVertAlign == alignmentOutput.iVertAlign) )
   1.387 +				{
   1.388 +				ret = EPass;
   1.389 +				INFO_PRINTF1(_L("Set Content Alignment method call performed as expected"));
   1.390 +				}
   1.391 +			else
   1.392 +				{
   1.393 +				ret = EFail;					
   1.394 +				ERR_PRINTF1(_L("Set Content Alignment method call failed to set the value correctly"));
   1.395 +				}
   1.396 +			}
   1.397 +		else
   1.398 +			{
   1.399 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
   1.400 +			ret = EInconclusive;
   1.401 +			}
   1.402 +		}
   1.403 +	return ret;
   1.404 +	}
   1.405 +
   1.406 +//------------------------------------------------------------------
   1.407 +
   1.408 +//
   1.409 +//	Video Resource Management Tests
   1.410 +//
   1.411 +
   1.412 +CTestDevVideoCiuPlayGetAndSetResourceObserver::CTestDevVideoCiuPlayGetAndSetResourceObserver(const TDesC& aTestName)
   1.413 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.414 +	{
   1.415 +	}
   1.416 +
   1.417 +CTestDevVideoCiuPlayGetAndSetResourceObserver* CTestDevVideoCiuPlayGetAndSetResourceObserver::NewL(const TDesC& aTestName)
   1.418 +	{
   1.419 +	CTestDevVideoCiuPlayGetAndSetResourceObserver* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetResourceObserver(aTestName);
   1.420 +	return self;
   1.421 +	}
   1.422 +
   1.423 +TVerdict CTestDevVideoCiuPlayGetAndSetResourceObserver::DoTestStepPreambleL()
   1.424 +	{
   1.425 +	// Call the base class first
   1.426 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.427 +	if (ret == EPass)
   1.428 +		{
   1.429 +		// select decoder
   1.430 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.431 +		
   1.432 +		if (err != KErrNone)
   1.433 +			{
   1.434 +			ret = EInconclusive;
   1.435 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.436 +			}
   1.437 +		}
   1.438 +	return ret;
   1.439 +	}
   1.440 +
   1.441 +TVerdict CTestDevVideoCiuPlayGetAndSetResourceObserver::DoTestL()
   1.442 +	{
   1.443 +	TVerdict ret = EFail;
   1.444 +	
   1.445 +	INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
   1.446 +	
   1.447 +	// Fetch the CI
   1.448 +	MMmfVideoResourceHandler* interface = NULL;
   1.449 +		
   1.450 +	interface = static_cast<MMmfVideoResourceHandler*>
   1.451 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.452 +																	KUidMmfVideoResourceManagement));
   1.453 +	if (!interface)
   1.454 +		{
   1.455 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.456 +		ret = EFail;
   1.457 +		}
   1.458 +	else
   1.459 +		{
   1.460 +		INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
   1.461 +	
   1.462 +		MMmfVideoResourceObserver* obs = this;
   1.463 +		interface->MmvrhSetObserver(obs);
   1.464 +		INFO_PRINTF1(_L("SetObserver called"));
   1.465 +		
   1.466 +		// Verify that the observer was set
   1.467 +		MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
   1.468 +		testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.469 +																												 KUidDevVideoCiuTestInterfaceResourceManagement));
   1.470 +		if (!testInterface)
   1.471 +			{
   1.472 +			ERR_PRINTF1(_L("Failed to create the test interface."));
   1.473 +			ret = EFail;
   1.474 +			}
   1.475 +		else
   1.476 +			{
   1.477 +			if (obs != testInterface->MdvrmObserver())
   1.478 +				{
   1.479 +				ERR_PRINTF1(_L("Failed to set the observer."));
   1.480 +				ret = EFail;
   1.481 +				}
   1.482 +			else
   1.483 +				{			
   1.484 +				INFO_PRINTF1(_L("SetObserver successfully called"));
   1.485 +				ret = EPass;
   1.486 +				}
   1.487 +			}		
   1.488 +		}
   1.489 +	return ret;
   1.490 +	}
   1.491 +
   1.492 +//from MMmfVideoResourceObserver
   1.493 +void CTestDevVideoCiuPlayGetAndSetResourceObserver::MmvroResourcesLost(TUid /*aMediaDevice*/)
   1.494 +	{}
   1.495 +		
   1.496 +void CTestDevVideoCiuPlayGetAndSetResourceObserver::MmvroResourcesRestored(TUid /*aMediaDevice*/)
   1.497 +	{}
   1.498 +
   1.499 +//------------------------------------------------------------------
   1.500 +
   1.501 +CTestDevVideoCiuPlayResourceLost::CTestDevVideoCiuPlayResourceLost(const TDesC& aTestName)
   1.502 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
   1.503 +	{
   1.504 +	}
   1.505 +
   1.506 +CTestDevVideoCiuPlayResourceLost* CTestDevVideoCiuPlayResourceLost::NewL(const TDesC& aTestName)
   1.507 +	{
   1.508 +	CTestDevVideoCiuPlayResourceLost* self = new(ELeave) CTestDevVideoCiuPlayResourceLost(aTestName);
   1.509 +	return self;
   1.510 +	}
   1.511 +
   1.512 +TVerdict CTestDevVideoCiuPlayResourceLost::DoTestStepPreambleL()
   1.513 +	{
   1.514 +	// Call the base class first
   1.515 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.516 +	if (ret == EPass)
   1.517 +		{
   1.518 +		// select decoder
   1.519 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.520 +		
   1.521 +		if (err != KErrNone)
   1.522 +			{
   1.523 +			ret = EInconclusive;
   1.524 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.525 +			}
   1.526 +		}
   1.527 +	return ret;
   1.528 +	}
   1.529 +
   1.530 +TVerdict CTestDevVideoCiuPlayResourceLost::DoTestL()
   1.531 +	{
   1.532 +	TVerdict ret = EFail;
   1.533 +	
   1.534 +	INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
   1.535 +	
   1.536 +	// Fetch the CI
   1.537 +	MMmfVideoResourceHandler* interface = NULL;
   1.538 +		
   1.539 +	interface = static_cast<MMmfVideoResourceHandler*>
   1.540 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.541 +																	KUidMmfVideoResourceManagement));
   1.542 +	if (!interface)
   1.543 +		{
   1.544 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.545 +		ret = EFail;
   1.546 +		}
   1.547 +	else
   1.548 +		{
   1.549 +		INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
   1.550 +
   1.551 +		MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
   1.552 +		testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->
   1.553 +																				CustomInterface(iHwDeviceId,
   1.554 +																								KUidDevVideoCiuTestInterfaceResourceManagement));
   1.555 +		if (!testInterface)
   1.556 +			{
   1.557 +			ERR_PRINTF1(_L("Failed to create the test interface."));
   1.558 +			ret = EFail;
   1.559 +			}
   1.560 +		else
   1.561 +			{
   1.562 +			// Set the observer to callback!
   1.563 +			MMmfVideoResourceObserver* obs = this;
   1.564 +			interface->MmvrhSetObserver(obs);
   1.565 +
   1.566 +			INFO_PRINTF1(_L("Requesting the Resource Lost Callback..."));
   1.567 +			testInterface->MdvrmRequestResourceLostCallback();
   1.568 +
   1.569 +			if ((iError != KErrNone) || (!iCallbackReceived))
   1.570 +				{	
   1.571 +				ERR_PRINTF1(_L("Error receiving the Resource Lost Callback."));
   1.572 +				ret = EFail;
   1.573 +				}
   1.574 +			else
   1.575 +				{
   1.576 +				INFO_PRINTF1(_L("Successfully retrieved the Resource Lost Callback"));
   1.577 +				ret = EPass;
   1.578 +				}
   1.579 +			}
   1.580 +		}
   1.581 +	return ret;
   1.582 +	}
   1.583 +
   1.584 +//from MMmfVideoResourceObserver
   1.585 +void CTestDevVideoCiuPlayResourceLost::MmvroResourcesLost(TUid /*aMediaDevice*/)
   1.586 +	{
   1.587 +	INFO_PRINTF1(_L("Resource Lost callback received."));
   1.588 +	iCallbackReceived = ETrue;
   1.589 +	iError = KErrNone;
   1.590 +	}
   1.591 +		
   1.592 +void CTestDevVideoCiuPlayResourceLost::MmvroResourcesRestored(TUid /*aMediaDevice*/)
   1.593 +	{
   1.594 +	iError = KErrNotSupported;
   1.595 +	}
   1.596 +
   1.597 +//------------------------------------------------------------------
   1.598 +
   1.599 +CTestDevVideoCiuPlayResourceRestored::CTestDevVideoCiuPlayResourceRestored(const TDesC& aTestName)
   1.600 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
   1.601 +	{
   1.602 +	}
   1.603 +
   1.604 +CTestDevVideoCiuPlayResourceRestored* CTestDevVideoCiuPlayResourceRestored::NewL(const TDesC& aTestName)
   1.605 +	{
   1.606 +	CTestDevVideoCiuPlayResourceRestored* self = new(ELeave) CTestDevVideoCiuPlayResourceRestored(aTestName);
   1.607 +	return self;
   1.608 +	}
   1.609 +
   1.610 +TVerdict CTestDevVideoCiuPlayResourceRestored::DoTestStepPreambleL()
   1.611 +	{
   1.612 +	// Call the base class first
   1.613 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.614 +	if (ret == EPass)
   1.615 +		{
   1.616 +		// select decoder
   1.617 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.618 +		
   1.619 +		if (err != KErrNone)
   1.620 +			{
   1.621 +			ret = EInconclusive;
   1.622 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.623 +			}
   1.624 +		}
   1.625 +	return ret;
   1.626 +	}
   1.627 +
   1.628 +TVerdict CTestDevVideoCiuPlayResourceRestored::DoTestL()
   1.629 +	{
   1.630 +	TVerdict ret = EFail;
   1.631 +	
   1.632 +	INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Initialisation"));
   1.633 +	
   1.634 +	// Fetch the CI
   1.635 +	MMmfVideoResourceHandler* interface = NULL;
   1.636 +		
   1.637 +	interface = static_cast<MMmfVideoResourceHandler*>
   1.638 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.639 +																	KUidMmfVideoResourceManagement));
   1.640 +	if (!interface)
   1.641 +		{
   1.642 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.643 +		ret = EFail;
   1.644 +		}
   1.645 +	else
   1.646 +		{
   1.647 +		INFO_PRINTF1(_L("DevVideo CIU Resource Management Interface Instantiated"));
   1.648 +
   1.649 +		MDevVideoCiuTestInterfaceResourceManagement* testInterface = NULL;
   1.650 +		testInterface = static_cast<MDevVideoCiuTestInterfaceResourceManagement*>(iDevVideoPlay->
   1.651 +																				CustomInterface(iHwDeviceId,
   1.652 +																								KUidDevVideoCiuTestInterfaceResourceManagement));
   1.653 +		if (!testInterface)
   1.654 +			{
   1.655 +			ERR_PRINTF1(_L("Failed to create the test interface."));
   1.656 +			ret = EFail;
   1.657 +			}
   1.658 +		else
   1.659 +			{
   1.660 +			// Set the observer to callback!
   1.661 +			MMmfVideoResourceObserver* obs = this;
   1.662 +			interface->MmvrhSetObserver(obs);
   1.663 +
   1.664 +			INFO_PRINTF1(_L("Requesting the Resource Restored Callback..."));
   1.665 +			testInterface->MdvrmRequestResourceRestoredCallback();
   1.666 +
   1.667 +			if ((iError != KErrNone) || (!iCallbackReceived))
   1.668 +				{	
   1.669 +				ERR_PRINTF1(_L("Error receiving the Resource Restored Callback."));
   1.670 +				ret = EFail;
   1.671 +				}
   1.672 +			else
   1.673 +				{
   1.674 +				INFO_PRINTF1(_L("Successfully retrieved the Resource Restored Callback"));
   1.675 +				ret = EPass;
   1.676 +				}
   1.677 +			}
   1.678 +		}
   1.679 +	return ret;
   1.680 +	}
   1.681 +
   1.682 +//from MMmfVideoResourceObserver
   1.683 +void CTestDevVideoCiuPlayResourceRestored::MmvroResourcesLost(TUid /*aMediaDevice*/)
   1.684 +	{
   1.685 +	iError = KErrNotSupported;
   1.686 +	}
   1.687 +		
   1.688 +void CTestDevVideoCiuPlayResourceRestored::MmvroResourcesRestored(TUid /*aMediaDevice*/)
   1.689 +	{
   1.690 +	INFO_PRINTF1(_L("Resource Restored callback received."));
   1.691 +	iCallbackReceived = ETrue;
   1.692 +	iError = KErrNone;
   1.693 +	}
   1.694 +
   1.695 +//------------------------------------------------------------------
   1.696 +
   1.697 +CTestDevVideoCiuPlayGetAndSetResourcePriority::CTestDevVideoCiuPlayGetAndSetResourcePriority(const TDesC& aTestName)
   1.698 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.699 +	{
   1.700 +	}
   1.701 +
   1.702 +CTestDevVideoCiuPlayGetAndSetResourcePriority* CTestDevVideoCiuPlayGetAndSetResourcePriority::NewL(const TDesC& aTestName)
   1.703 +	{
   1.704 +	CTestDevVideoCiuPlayGetAndSetResourcePriority* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetResourcePriority(aTestName);
   1.705 +	return self;
   1.706 +	}
   1.707 +
   1.708 +TVerdict CTestDevVideoCiuPlayGetAndSetResourcePriority::DoTestStepPreambleL()
   1.709 +	{
   1.710 +	// Call the base class first
   1.711 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.712 +	if (ret == EPass)
   1.713 +		{
   1.714 +		// select decoder
   1.715 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.716 +		
   1.717 +		if (err != KErrNone)
   1.718 +			{
   1.719 +			ret = EInconclusive;
   1.720 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.721 +			}
   1.722 +		}
   1.723 +	return ret;
   1.724 +	}
   1.725 +
   1.726 +TVerdict CTestDevVideoCiuPlayGetAndSetResourcePriority::DoTestL()
   1.727 +	{
   1.728 +	TVerdict ret = EFail;
   1.729 +	
   1.730 +	INFO_PRINTF1(_L("DevVideo CIU Resource Priority Interface Initialisation"));
   1.731 +	
   1.732 +	// Fetch the CI
   1.733 +	MMmfVideoResourcePriority* interface = NULL;
   1.734 +		
   1.735 +	interface = static_cast<MMmfVideoResourcePriority*>
   1.736 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.737 +																	KUidMmfVideoResourcePriority));
   1.738 +	if (!interface)
   1.739 +		{
   1.740 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.741 +		ret = EFail;
   1.742 +		}
   1.743 +	else
   1.744 +		{
   1.745 +		INFO_PRINTF1(_L("DevVideo CIU Resource Priority Interface Instantiated"));
   1.746 +		
   1.747 +		TInt inputPriority = 100;
   1.748 +			
   1.749 +		interface->MmvpSetResourcePriority(inputPriority);
   1.750 +		
   1.751 +		MDevVideoCiuTestInterfaceResourcePriority* testInterface = NULL;
   1.752 +
   1.753 +		testInterface = static_cast<MDevVideoCiuTestInterfaceResourcePriority*>
   1.754 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceResourcePriority));
   1.755 +		if (testInterface)
   1.756 +			{
   1.757 +			TInt outputPriority = testInterface->MdvrpResourcePriority();
   1.758 +			if (inputPriority == outputPriority)
   1.759 +				{
   1.760 +				ret = EPass;
   1.761 +				INFO_PRINTF1(_L("Set Resource Priority method call performed as expected"));
   1.762 +				}
   1.763 +			else
   1.764 +				{
   1.765 +				ret = EFail;					
   1.766 +				ERR_PRINTF1(_L("Set Resource Priority method call failed to set the value correctly"));
   1.767 +				}
   1.768 +			}
   1.769 +		else
   1.770 +			{
   1.771 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
   1.772 +			ret = EInconclusive;
   1.773 +			}
   1.774 +		}
   1.775 +	return ret;
   1.776 +	}
   1.777 +
   1.778 +
   1.779 +//
   1.780 +//	Video Properties Management Tests
   1.781 +//
   1.782 +
   1.783 +CTestDevVideoCiuPlaySetAndGetPropertiesObserver::CTestDevVideoCiuPlaySetAndGetPropertiesObserver(const TDesC& aTestName)
   1.784 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.785 +	{
   1.786 +	}
   1.787 +
   1.788 +CTestDevVideoCiuPlaySetAndGetPropertiesObserver* CTestDevVideoCiuPlaySetAndGetPropertiesObserver::NewL(const TDesC& aTestName)
   1.789 +	{
   1.790 +	CTestDevVideoCiuPlaySetAndGetPropertiesObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPropertiesObserver(aTestName);
   1.791 +	return self;
   1.792 +	}
   1.793 +
   1.794 +TVerdict CTestDevVideoCiuPlaySetAndGetPropertiesObserver::DoTestStepPreambleL()
   1.795 +	{
   1.796 +	// Call the base class first
   1.797 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.798 +	if (ret == EPass)
   1.799 +		{
   1.800 +		// select decoder
   1.801 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.802 +		
   1.803 +		if (err != KErrNone)
   1.804 +			{
   1.805 +			ret = EInconclusive;
   1.806 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.807 +			}
   1.808 +		}
   1.809 +	return ret;
   1.810 +	}
   1.811 +
   1.812 +TVerdict CTestDevVideoCiuPlaySetAndGetPropertiesObserver::DoTestL()
   1.813 +	{
   1.814 +	TVerdict ret = EFail;
   1.815 +	
   1.816 +	INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Initialisation"));
   1.817 +	
   1.818 +	// Fetch the CI
   1.819 +	MMmfVideoPropertiesNotifier* interface = NULL;
   1.820 +		
   1.821 +	interface = static_cast<MMmfVideoPropertiesNotifier*>
   1.822 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.823 +																	KUidMmfVideoPropertiesManagement));
   1.824 +	if (!interface)
   1.825 +		{
   1.826 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.827 +		ret = EFail;
   1.828 +		}
   1.829 +	else
   1.830 +		{
   1.831 +		INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Instantiated"));
   1.832 +	
   1.833 +		MMmfVideoPropertiesObserver* obs = this;
   1.834 +		interface->MmvpnSetObserver(obs);
   1.835 +		INFO_PRINTF1(_L("SetObserver called"));
   1.836 +		
   1.837 +		// Verify that the observer was set
   1.838 +		MDevVideoCiuTestInterfacePropertiesManagement* testInterface = NULL;
   1.839 +		testInterface = static_cast<MDevVideoCiuTestInterfacePropertiesManagement*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.840 +																												 KUidDevVideoCiuTestInterfacePropertiesManagement));
   1.841 +		if (!testInterface)
   1.842 +			{
   1.843 +			ERR_PRINTF1(_L("Failed to create the test interface."));
   1.844 +			ret = EFail;
   1.845 +			}
   1.846 +		else
   1.847 +			{
   1.848 +			if (obs != testInterface->MmvpoObserver())
   1.849 +				{
   1.850 +				ERR_PRINTF1(_L("Failed to set the observer."));
   1.851 +				ret = EFail;
   1.852 +				}
   1.853 +			else
   1.854 +				{			
   1.855 +				INFO_PRINTF1(_L("SetObserver successfully called."));
   1.856 +				ret = EPass;
   1.857 +				}
   1.858 +			}		
   1.859 +		}
   1.860 +	return ret;
   1.861 +	}
   1.862 +
   1.863 +//from MMmfVideoPropertiesObserver
   1.864 +void CTestDevVideoCiuPlaySetAndGetPropertiesObserver::MmvpoUpdateVideoProperties(const TYuvFormat& /*aYuvFormat*/, const TSize& /*aPictureSize*/)
   1.865 +	{}
   1.866 +
   1.867 +//------------------------------------------------------------------
   1.868 +CTestDevVideoCiuPlayUpdateProperties::CTestDevVideoCiuPlayUpdateProperties(const TDesC& aTestName)
   1.869 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
   1.870 +	{
   1.871 +	}
   1.872 +
   1.873 +CTestDevVideoCiuPlayUpdateProperties* CTestDevVideoCiuPlayUpdateProperties::NewL(const TDesC& aTestName)
   1.874 +	{
   1.875 +	CTestDevVideoCiuPlayUpdateProperties* self = new(ELeave) CTestDevVideoCiuPlayUpdateProperties(aTestName);
   1.876 +	return self;
   1.877 +	}
   1.878 +
   1.879 +TVerdict CTestDevVideoCiuPlayUpdateProperties::DoTestStepPreambleL()
   1.880 +	{
   1.881 +	// Call the base class first
   1.882 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.883 +	if (ret == EPass)
   1.884 +		{
   1.885 +		// select decoder
   1.886 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
   1.887 +		
   1.888 +		if (err != KErrNone)
   1.889 +			{
   1.890 +			ret = EInconclusive;
   1.891 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
   1.892 +			}
   1.893 +		}
   1.894 +	return ret;
   1.895 +	}
   1.896 +
   1.897 +TVerdict CTestDevVideoCiuPlayUpdateProperties::DoTestL()
   1.898 +	{
   1.899 +	TVerdict ret = EFail;
   1.900 +	
   1.901 +	INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Initialisation"));
   1.902 +	
   1.903 +	// Fetch the CI
   1.904 +	MMmfVideoPropertiesNotifier* interface = NULL;
   1.905 +		
   1.906 +	interface = static_cast<MMmfVideoPropertiesNotifier*>
   1.907 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
   1.908 +																	KUidMmfVideoPropertiesManagement));
   1.909 +	if (!interface)
   1.910 +		{
   1.911 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
   1.912 +		ret = EFail;
   1.913 +		}
   1.914 +	else
   1.915 +		{
   1.916 +		INFO_PRINTF1(_L("DevVideo CIU Properties Management Interface Instantiated"));
   1.917 +
   1.918 +		MDevVideoCiuTestInterfacePropertiesManagement* testInterface = NULL;
   1.919 +		testInterface = static_cast<MDevVideoCiuTestInterfacePropertiesManagement*>(iDevVideoPlay->
   1.920 +																				CustomInterface(iHwDeviceId,
   1.921 +																								KUidDevVideoCiuTestInterfacePropertiesManagement));
   1.922 +		if (!testInterface)
   1.923 +			{
   1.924 +			ERR_PRINTF1(_L("Failed to create the test interface."));
   1.925 +			ret = EFail;
   1.926 +			}
   1.927 +		else
   1.928 +			{
   1.929 +			// Set the observer to callback!
   1.930 +			MMmfVideoPropertiesObserver* obs = this;
   1.931 +			interface->MmvpnSetObserver(obs);
   1.932 +
   1.933 +			INFO_PRINTF1(_L("Notifying the Properties Update Callback..."));
   1.934 +			testInterface->MmvpoUpdateVideoPropertiesCallback();
   1.935 +
   1.936 +			if ((iError != KErrNone) || (!iCallbackReceived))
   1.937 +				{	
   1.938 +				ERR_PRINTF1(_L("Error receiving the RProperties Update Callback."));
   1.939 +				ret = EFail;
   1.940 +				}
   1.941 +			else
   1.942 +				{
   1.943 +				INFO_PRINTF1(_L("Successfully retrieved the Properties Update Callback"));
   1.944 +				ret = EPass;
   1.945 +				}
   1.946 +			}
   1.947 +		}
   1.948 +	return ret;
   1.949 +	}
   1.950 +
   1.951 +//from MMmfVideoPropertiesObserver
   1.952 +void CTestDevVideoCiuPlayUpdateProperties::MmvpoUpdateVideoProperties(const TYuvFormat& /*aYuvFormat*/, const TSize& /*aPictureSize*/)
   1.953 +	{	
   1.954 +	INFO_PRINTF1(_L("Properties Update Callback received."));
   1.955 +	iCallbackReceived = ETrue;
   1.956 +	iError = KErrNone;
   1.957 +	}
   1.958 +	
   1.959 +//------------------------------------------------------------------
   1.960 +
   1.961 +CTestDevVideoCiuPlayCreateVideoMediaProtected::CTestDevVideoCiuPlayCreateVideoMediaProtected(const TDesC& aTestName)
   1.962 +	:CTestDevVideoCiuPlayStep(aTestName)
   1.963 +	{
   1.964 +	}
   1.965 +
   1.966 +CTestDevVideoCiuPlayCreateVideoMediaProtected* CTestDevVideoCiuPlayCreateVideoMediaProtected::NewL(const TDesC& aTestName)
   1.967 +	{
   1.968 +	CTestDevVideoCiuPlayCreateVideoMediaProtected* self = new(ELeave) CTestDevVideoCiuPlayCreateVideoMediaProtected(aTestName);
   1.969 +	return self;
   1.970 +	}
   1.971 +
   1.972 +TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtected::DoTestStepPreambleL()
   1.973 +	{
   1.974 +	// Call the base class first
   1.975 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
   1.976 +
   1.977 +	if (ret == EPass)
   1.978 +		{
   1.979 +		// select post-processor
   1.980 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
   1.981 +		
   1.982 +		if (err != KErrNone)
   1.983 +			{
   1.984 +			ret = EInconclusive;
   1.985 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
   1.986 +			}		
   1.987 +		}
   1.988 +
   1.989 +	return ret;
   1.990 +	}
   1.991 +	
   1.992 +TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtected::DoTestL()
   1.993 +	{
   1.994 +	TVerdict ret = EPass;
   1.995 +	
   1.996 +	INFO_PRINTF1(_L("DevVideo CIU Video Media Protected Initialisation"));
   1.997 +
   1.998 +	// Try to fetch the CI...
   1.999 +	MMmfVideoMediaProtected* interface = NULL;
  1.1000 +		
  1.1001 +	interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1002 +																					KUidMmfVideoMediaProtected));
  1.1003 +	if (!interface)
  1.1004 +		{
  1.1005 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1006 +		ret = EFail;
  1.1007 +		}
  1.1008 +	else
  1.1009 +		{
  1.1010 +		INFO_PRINTF1(_L("DevVideo CIU Video Media Protected instantiated"));
  1.1011 +		}
  1.1012 +
  1.1013 +	return ret;
  1.1014 +	}
  1.1015 +//------------------------------------------------------------------
  1.1016 +
  1.1017 +//------------------------------------------------------------------
  1.1018 +
  1.1019 +CTestDevVideoCiuPlaySetVideoMediaProtected::CTestDevVideoCiuPlaySetVideoMediaProtected(const TDesC& aTestName)
  1.1020 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1021 +	{
  1.1022 +	}
  1.1023 +
  1.1024 +CTestDevVideoCiuPlaySetVideoMediaProtected* CTestDevVideoCiuPlaySetVideoMediaProtected::NewL(const TDesC& aTestName)
  1.1025 +	{
  1.1026 +	CTestDevVideoCiuPlaySetVideoMediaProtected* self = new(ELeave) CTestDevVideoCiuPlaySetVideoMediaProtected(aTestName);
  1.1027 +	return self;
  1.1028 +	}
  1.1029 +
  1.1030 +TVerdict CTestDevVideoCiuPlaySetVideoMediaProtected::DoTestStepPreambleL()
  1.1031 +	{
  1.1032 +	// Call the base class first
  1.1033 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1034 +
  1.1035 +	if (ret == EPass)
  1.1036 +		{
  1.1037 +		// select post-processor
  1.1038 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
  1.1039 +		
  1.1040 +		if (err != KErrNone)
  1.1041 +			{
  1.1042 +			ret = EInconclusive;
  1.1043 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
  1.1044 +			}
  1.1045 +		}
  1.1046 +
  1.1047 +	return ret;
  1.1048 +	}
  1.1049 +
  1.1050 +// alternate implementation that uses the test interface to check
  1.1051 +// that the value has been set
  1.1052 +TVerdict CTestDevVideoCiuPlaySetVideoMediaProtected::DoTestL()
  1.1053 +	{
  1.1054 +	TVerdict ret = EFail;
  1.1055 +
  1.1056 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1057 +	// Try to fetch the CI...
  1.1058 +	MMmfVideoMediaProtected* interface = NULL;
  1.1059 +		
  1.1060 +	interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1061 +																					KUidMmfVideoMediaProtected));
  1.1062 +	if (!interface)
  1.1063 +		{
  1.1064 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1065 +		ret = EInconclusive;
  1.1066 +		}
  1.1067 +	else
  1.1068 +		{
  1.1069 +		// Try to call a method on the interface
  1.1070 +		TRAPD(err, interface->MmvsoMediaIsProtectedL(ETrue));
  1.1071 +		// Method should have left as not supported
  1.1072 +		if (err != KErrNotSupported)
  1.1073 +			{
  1.1074 +			ERR_PRINTF2(_L("Error - wrong leave code from method call"), err);
  1.1075 +			}
  1.1076 +		else
  1.1077 +			{
  1.1078 +			// Now set up the test interface...
  1.1079 +			MDevVideoCiuTestInterfaceMediaProtected* testInterface = NULL;
  1.1080 +			testInterface = static_cast<MDevVideoCiuTestInterfaceMediaProtected*>
  1.1081 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceMediaProtected));
  1.1082 +			if (testInterface)
  1.1083 +				{
  1.1084 +				if (testInterface->MmvsoMediaIsProtected())
  1.1085 +					{
  1.1086 +					ret = EPass;
  1.1087 +					INFO_PRINTF1(_L("Media protected method call performed as expected"));
  1.1088 +					}
  1.1089 +				else
  1.1090 +					{					
  1.1091 +					ERR_PRINTF1(_L("Media protected method call failed to set the value correctly"));
  1.1092 +					}
  1.1093 +				}
  1.1094 +			else
  1.1095 +				{
  1.1096 +				ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1097 +				ret = EInconclusive;
  1.1098 +				}
  1.1099 +			}
  1.1100 +		}
  1.1101 +
  1.1102 +	return ret;
  1.1103 +	}
  1.1104 +//------------------------------------------------------------------
  1.1105 +
  1.1106 +
  1.1107 +//------------------------------------------------------------------
  1.1108 +
  1.1109 +CTestDevVideoCiuPlayCreateColourSpace::CTestDevVideoCiuPlayCreateColourSpace(const TDesC& aTestName)
  1.1110 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1111 +	{
  1.1112 +	}
  1.1113 +
  1.1114 +CTestDevVideoCiuPlayCreateColourSpace* CTestDevVideoCiuPlayCreateColourSpace::NewL(const TDesC& aTestName)
  1.1115 +	{
  1.1116 +	CTestDevVideoCiuPlayCreateColourSpace* self = new(ELeave) CTestDevVideoCiuPlayCreateColourSpace(aTestName);
  1.1117 +	return self;
  1.1118 +	}
  1.1119 +
  1.1120 +TVerdict CTestDevVideoCiuPlayCreateColourSpace::DoTestStepPreambleL()
  1.1121 +	{
  1.1122 +	// Call the base class first
  1.1123 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1124 +
  1.1125 +	if (ret == EPass)
  1.1126 +		{
  1.1127 +		// select post-processor
  1.1128 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
  1.1129 +
  1.1130 +		if (err != KErrNone)
  1.1131 +			{
  1.1132 +			ret = EInconclusive;
  1.1133 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
  1.1134 +			}
  1.1135 +		}
  1.1136 +	
  1.1137 +	return ret;
  1.1138 +	}
  1.1139 +
  1.1140 +TVerdict CTestDevVideoCiuPlayCreateColourSpace::DoTestL()
  1.1141 +	{
  1.1142 +	TVerdict ret = EPass;
  1.1143 +	
  1.1144 +	INFO_PRINTF1(_L("DevVideo CIU Colour Space Header Interface Initialisation"));
  1.1145 +
  1.1146 +	// Try to fetch the CI...
  1.1147 +	MMmfVideoPlayHWDeviceColourInfoCustomHeader* interface = NULL;
  1.1148 +		
  1.1149 +	interface = static_cast<MMmfVideoPlayHWDeviceColourInfoCustomHeader*>
  1.1150 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1151 +																	KUidMmfVideoPlayHWDeviceColourInfoCustomHeader));
  1.1152 +	if (!interface)
  1.1153 +		{
  1.1154 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1155 +		ret = EFail;
  1.1156 +		}
  1.1157 +	else
  1.1158 +		{
  1.1159 +		INFO_PRINTF1(_L("DevVideo CIU Colour Space Header Interface Instantiated"));
  1.1160 +		}
  1.1161 +				
  1.1162 +	return ret;
  1.1163 +	}
  1.1164 +//------------------------------------------------------------------
  1.1165 +
  1.1166 +//------------------------------------------------------------------
  1.1167 +CTestDevVideoCiuPlayGetColourSpace::CTestDevVideoCiuPlayGetColourSpace(const TDesC& aTestName)
  1.1168 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1169 +	{
  1.1170 +	}
  1.1171 +
  1.1172 +CTestDevVideoCiuPlayGetColourSpace* CTestDevVideoCiuPlayGetColourSpace::NewL(const TDesC& aTestName)
  1.1173 +	{
  1.1174 +	CTestDevVideoCiuPlayGetColourSpace* self = new(ELeave) CTestDevVideoCiuPlayGetColourSpace(aTestName);
  1.1175 +	return self;
  1.1176 +	}
  1.1177 +
  1.1178 +TVerdict CTestDevVideoCiuPlayGetColourSpace::DoTestStepPreambleL()
  1.1179 +	{
  1.1180 +	// Call the base class first
  1.1181 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1182 +
  1.1183 +	if (ret == EPass)
  1.1184 +		{
  1.1185 +		// select post-processor
  1.1186 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectPostProcessorL(KUidDevVideoCiuTestPostProcHwDevice));
  1.1187 +
  1.1188 +		if (err != KErrNone)
  1.1189 +			{
  1.1190 +			ret = EInconclusive;
  1.1191 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the post processor."));
  1.1192 +			}
  1.1193 +		}
  1.1194 +		
  1.1195 +	return ret;
  1.1196 +	}
  1.1197 +
  1.1198 +// Implementation that uses the test interface to set data that can be checked
  1.1199 +// in the call to the interface's "get" method.
  1.1200 +TVerdict CTestDevVideoCiuPlayGetColourSpace::DoTestL()
  1.1201 +	{
  1.1202 +	TVerdict ret = EFail;
  1.1203 +
  1.1204 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1205 +	// Try to fetch the CI...
  1.1206 +	MMmfVideoPlayHWDeviceColourInfoCustomHeader* interface = NULL;
  1.1207 +		
  1.1208 +	interface = static_cast<MMmfVideoPlayHWDeviceColourInfoCustomHeader*>
  1.1209 +						(iDevVideoPlay->CustomInterface(iHwDeviceId, 
  1.1210 +														KUidMmfVideoPlayHWDeviceColourInfoCustomHeader));
  1.1211 +	if (!interface)
  1.1212 +		{
  1.1213 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1214 +		ret = EInconclusive;
  1.1215 +		}
  1.1216 +	else
  1.1217 +		{
  1.1218 +		// Setup some test values...
  1.1219 +		TVideoDataUnitType dataUnitType = EDuArbitraryStreamSection;
  1.1220 +		TVideoDataUnitEncapsulation dataUnitEncapsulation = EDuRtpPayload;
  1.1221 +		TYuvFormat yuvFormat;
  1.1222 +		yuvFormat.iCoefficients = ECustomYuvMatrix;
  1.1223 +		yuvFormat.iPattern = EYuv422Chroma2;
  1.1224 +		yuvFormat.iDataLayout = EYuvDataSemiPlanar;
  1.1225 +		yuvFormat.iYuv2RgbMatrix = NULL;
  1.1226 +		yuvFormat.iRgb2YuvMatrix = NULL;
  1.1227 +		yuvFormat.iAspectRatioNum = 666;
  1.1228 +		yuvFormat.iAspectRatioDenom = 999;
  1.1229 +		TVideoInputBuffer* dataUnit = new TVideoInputBuffer();
  1.1230 +
  1.1231 +		if (!dataUnit)
  1.1232 +			{
  1.1233 +			ERR_PRINTF2(_L("Failed to allocate test data."), KErrNoMemory);
  1.1234 +			}
  1.1235 +		else
  1.1236 +			{
  1.1237 +			// just set one member
  1.1238 +			dataUnit->iOptions = 444;
  1.1239 +			// Now set up the test interface...
  1.1240 +			MDevVideoCiuTestInterfaceColourSpace* testInterface = NULL;
  1.1241 +			testInterface = static_cast<MDevVideoCiuTestInterfaceColourSpace*>
  1.1242 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, KUidDevVideoCiuTestInterfaceColourSpace));
  1.1243 +			if (testInterface)
  1.1244 +				{
  1.1245 +				testInterface->MmvpciSetColourSpaceHeaderInfoL(dataUnitType,
  1.1246 +																dataUnitEncapsulation,
  1.1247 +																dataUnit,
  1.1248 +																yuvFormat);
  1.1249 +				INFO_PRINTF1(_L("Set the colour space header info."));
  1.1250 +				
  1.1251 +				TVideoDataUnitType testDataUnitType = TVideoDataUnitType(0);
  1.1252 +				TVideoDataUnitEncapsulation testDataUnitEncapsulation = TVideoDataUnitEncapsulation(0);
  1.1253 +				TVideoInputBuffer* testDataUnit = new TVideoInputBuffer();
  1.1254 +				TYuvFormat testYuvFormat;
  1.1255 +				if (!testDataUnit)
  1.1256 +					{
  1.1257 +					ERR_PRINTF2(_L("Failed to allocate test data."), KErrNoMemory);
  1.1258 +					}
  1.1259 +				else
  1.1260 +					{				
  1.1261 +					// Call the interface's method
  1.1262 +					TRAPD(err, interface->MmvpciGetColourSpaceHeaderInfoL(	testDataUnitType,
  1.1263 +																			testDataUnitEncapsulation,
  1.1264 +																			testDataUnit,
  1.1265 +																			testYuvFormat));
  1.1266 +					if ((err == KErrNone) &&
  1.1267 +						(dataUnitType == testDataUnitType) &&
  1.1268 +						(dataUnitEncapsulation == testDataUnitEncapsulation) &&
  1.1269 +						(dataUnit->iOptions == testDataUnit->iOptions) &&
  1.1270 +						(yuvFormat == testYuvFormat))
  1.1271 +						{
  1.1272 +						INFO_PRINTF1(_L("Succesfully retrieved the colour space header info."));
  1.1273 +						ret = EPass;
  1.1274 +						}
  1.1275 +					else
  1.1276 +						{
  1.1277 +						ERR_PRINTF1(_L("Failed to retrieve the colour space header info."));
  1.1278 +						}
  1.1279 +					}
  1.1280 +				delete testDataUnit;
  1.1281 +				}
  1.1282 +			else
  1.1283 +				{
  1.1284 +				ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1285 +				ret = EInconclusive;
  1.1286 +				}
  1.1287 +			}
  1.1288 +		delete dataUnit;
  1.1289 +		}
  1.1290 +
  1.1291 +	return ret;
  1.1292 +	}
  1.1293 +
  1.1294 +//------------------------------------------------------------------
  1.1295 +// Resource control tests implementation
  1.1296 +CTestDevVideoCiuPlayCreatePolicyExtension::CTestDevVideoCiuPlayCreatePolicyExtension(const TDesC& aTestName)
  1.1297 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1298 +	{
  1.1299 +	}
  1.1300 +
  1.1301 +CTestDevVideoCiuPlayCreatePolicyExtension* CTestDevVideoCiuPlayCreatePolicyExtension::NewL(const TDesC& aTestName)
  1.1302 +	{
  1.1303 +	CTestDevVideoCiuPlayCreatePolicyExtension* self = new(ELeave) CTestDevVideoCiuPlayCreatePolicyExtension(aTestName);
  1.1304 +	return self;
  1.1305 +	}
  1.1306 +
  1.1307 +TVerdict CTestDevVideoCiuPlayCreatePolicyExtension::DoTestStepPreambleL()
  1.1308 +	{
  1.1309 +	// Call the base class first
  1.1310 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1311 +	if (ret == EPass)
  1.1312 +		{
  1.1313 +		// select decoder
  1.1314 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1315 +		
  1.1316 +		if (err != KErrNone)
  1.1317 +			{
  1.1318 +			ret = EInconclusive;
  1.1319 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1320 +			}
  1.1321 +		}
  1.1322 +	return ret;
  1.1323 +	}
  1.1324 +	
  1.1325 +TVerdict CTestDevVideoCiuPlayCreatePolicyExtension::DoTestL()
  1.1326 +	{
  1.1327 +	TVerdict ret = EPass;
  1.1328 +	
  1.1329 +	INFO_PRINTF1(_L("DevVideo CIU Policy Extension Interface Initialisation"));
  1.1330 +	
  1.1331 +	// Try to fetch the CI...
  1.1332 +	MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
  1.1333 +		
  1.1334 +	interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>
  1.1335 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1336 +																	KUidMmfVideoHwDevVideoPolicyExtension));
  1.1337 +	if (!interface)
  1.1338 +		{
  1.1339 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1340 +		ret = EFail;
  1.1341 +		}
  1.1342 +	else
  1.1343 +		{
  1.1344 +		INFO_PRINTF1(_L("DevVideo CIU Policy Extension Interface Instantiated"));
  1.1345 +		}
  1.1346 +		
  1.1347 +	return ret;
  1.1348 +	}
  1.1349 +
  1.1350 +//-------------------------------------------------------------------------
  1.1351 +CTestDevVideoCiuPlaySetClientPolicyExtension::CTestDevVideoCiuPlaySetClientPolicyExtension(const TDesC& aTestName)
  1.1352 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1353 +	{
  1.1354 +	}
  1.1355 +
  1.1356 +CTestDevVideoCiuPlaySetClientPolicyExtension* CTestDevVideoCiuPlaySetClientPolicyExtension::NewL(const TDesC& aTestName)
  1.1357 +	{
  1.1358 +	CTestDevVideoCiuPlaySetClientPolicyExtension* self = new(ELeave) CTestDevVideoCiuPlaySetClientPolicyExtension(aTestName);
  1.1359 +	return self;
  1.1360 +	}
  1.1361 +
  1.1362 +TVerdict CTestDevVideoCiuPlaySetClientPolicyExtension::DoTestStepPreambleL()
  1.1363 +	{
  1.1364 +	// Call the base class first
  1.1365 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1366 +
  1.1367 +	if (ret == EPass)
  1.1368 +		{
  1.1369 +		// select decoder
  1.1370 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1371 +
  1.1372 +		if (err != KErrNone)
  1.1373 +			{
  1.1374 +			ret = EInconclusive;
  1.1375 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1376 +			}
  1.1377 +		}
  1.1378 +
  1.1379 +	return ret;
  1.1380 +	}
  1.1381 +
  1.1382 +// Implementation that uses the test interface to set data that can be checked
  1.1383 +// in the call to the interface's "get" method.
  1.1384 +TVerdict CTestDevVideoCiuPlaySetClientPolicyExtension::DoTestL()
  1.1385 +	{
  1.1386 +	TVerdict ret = EFail;
  1.1387 +
  1.1388 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1389 +	// Try to fetch the CI...
  1.1390 +	MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
  1.1391 +		
  1.1392 +	interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
  1.1393 +																		iHwDeviceId, 
  1.1394 +																		KUidMmfVideoHwDevVideoPolicyExtension));
  1.1395 +	if (!interface)
  1.1396 +		{
  1.1397 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1398 +		ret = EInconclusive;
  1.1399 +		}
  1.1400 +	else
  1.1401 +		{
  1.1402 +		MMmfVideoHwDevClientNotifier* clientNotifier = this;
  1.1403 +		// call the interface's method
  1.1404 +		interface->MmvhvpeSetVideoClient(clientNotifier);
  1.1405 +		
  1.1406 +		// Now set up the test interface...
  1.1407 +		MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
  1.1408 +		testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
  1.1409 +									(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.1410 +																	KUidDevVideoCiuTestInterfaceClientResourceNotifier));
  1.1411 +		if (testInterface)
  1.1412 +			{
  1.1413 +			if (testInterface->McrnVideoClient() == clientNotifier)
  1.1414 +				{
  1.1415 +				INFO_PRINTF1(_L("Succesfully set the client notifier."));
  1.1416 +				ret = EPass;
  1.1417 +				}
  1.1418 +			else
  1.1419 +				{
  1.1420 +				ERR_PRINTF1(_L("Failed to set the client notifier."));
  1.1421 +				}
  1.1422 +			}
  1.1423 +		else
  1.1424 +			{
  1.1425 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1426 +			ret = EInconclusive;
  1.1427 +			}
  1.1428 +		}
  1.1429 +
  1.1430 +	return ret;
  1.1431 +	}
  1.1432 +
  1.1433 +// from MMmfVideoHwDevClientNotifier
  1.1434 +void CTestDevVideoCiuPlaySetClientPolicyExtension::MmvhcnVideoAccessRevoked()
  1.1435 +	{
  1.1436 +	}
  1.1437 +// from MMmfVideoHwDevClientNotifier	
  1.1438 +void CTestDevVideoCiuPlaySetClientPolicyExtension::MmvhcnReleaseVideoResource()
  1.1439 +	{
  1.1440 +	}
  1.1441 +//----------------------------------------------------------------------------
  1.1442 +CTestDevVideoCiuPlaySetPriorityPolicyExtension::CTestDevVideoCiuPlaySetPriorityPolicyExtension(const TDesC& aTestName)
  1.1443 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1444 +	{
  1.1445 +	}
  1.1446 +
  1.1447 +CTestDevVideoCiuPlaySetPriorityPolicyExtension* CTestDevVideoCiuPlaySetPriorityPolicyExtension::NewL(const TDesC& aTestName)
  1.1448 +	{
  1.1449 +	CTestDevVideoCiuPlaySetPriorityPolicyExtension* self = new(ELeave) CTestDevVideoCiuPlaySetPriorityPolicyExtension(aTestName);
  1.1450 +	return self;
  1.1451 +	}
  1.1452 +
  1.1453 +TVerdict CTestDevVideoCiuPlaySetPriorityPolicyExtension::DoTestStepPreambleL()
  1.1454 +	{
  1.1455 +	// Call the base class first
  1.1456 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1457 +
  1.1458 +	if (ret == EPass)
  1.1459 +		{
  1.1460 +		// select decoder
  1.1461 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1462 +		
  1.1463 +		if (err != KErrNone)
  1.1464 +			{
  1.1465 +			ret = EInconclusive;
  1.1466 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1467 +			}
  1.1468 +		}
  1.1469 +	
  1.1470 +	return ret;
  1.1471 +	}
  1.1472 +
  1.1473 +TVerdict CTestDevVideoCiuPlaySetPriorityPolicyExtension::DoTestL()
  1.1474 +	{
  1.1475 +	TVerdict ret = EFail;
  1.1476 +	
  1.1477 +	INFO_PRINTF1(_L("DevVideo CIU Policy Extension Set Priority"));
  1.1478 +
  1.1479 +	// Try to fetch the CI...
  1.1480 +	MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
  1.1481 +		
  1.1482 +	interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>
  1.1483 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1484 +																	KUidMmfVideoHwDevVideoPolicyExtension));
  1.1485 +	if (!interface)
  1.1486 +		{
  1.1487 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1488 +		}
  1.1489 +	else
  1.1490 +		{
  1.1491 +		TInt priority = 666;
  1.1492 +		interface->MmvhvpeSetVideoPriority(priority);
  1.1493 +		
  1.1494 +		// Now set up the test interface...
  1.1495 +		MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
  1.1496 +		testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
  1.1497 +									(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.1498 +																	KUidDevVideoCiuTestInterfaceClientResourceNotifier));
  1.1499 +		if (testInterface)
  1.1500 +			{
  1.1501 +			if (testInterface->McrnVideoPriority() == priority)
  1.1502 +				{
  1.1503 +				INFO_PRINTF1(_L("Succesfully retrieved the video priority."));
  1.1504 +				ret = EPass;
  1.1505 +				}
  1.1506 +			else
  1.1507 +				{
  1.1508 +				ERR_PRINTF1(_L("Failed to retrieve the video priority."));
  1.1509 +				}
  1.1510 +			}
  1.1511 +		else
  1.1512 +			{
  1.1513 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1514 +			ret = EInconclusive;
  1.1515 +			}		
  1.1516 +		}
  1.1517 +	return ret;
  1.1518 +	}
  1.1519 +
  1.1520 +//-------------------------------------------------------------------------
  1.1521 +CTestDevVideoCiuPlayClientNotifierRevoked::CTestDevVideoCiuPlayClientNotifierRevoked(const TDesC& aTestName)
  1.1522 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1523 +	{
  1.1524 +	}
  1.1525 +
  1.1526 +CTestDevVideoCiuPlayClientNotifierRevoked* CTestDevVideoCiuPlayClientNotifierRevoked::NewL(const TDesC& aTestName)
  1.1527 +	{
  1.1528 +	CTestDevVideoCiuPlayClientNotifierRevoked* self = new(ELeave) CTestDevVideoCiuPlayClientNotifierRevoked(aTestName);
  1.1529 +	return self;
  1.1530 +	}
  1.1531 +
  1.1532 +TVerdict CTestDevVideoCiuPlayClientNotifierRevoked::DoTestStepPreambleL()
  1.1533 +	{
  1.1534 +	// Call the base class first
  1.1535 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1536 +
  1.1537 +	if (ret == EPass)
  1.1538 +		{
  1.1539 +		// select decoder
  1.1540 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1541 +
  1.1542 +		if (err != KErrNone)
  1.1543 +			{
  1.1544 +			ret = EInconclusive;
  1.1545 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1546 +			}
  1.1547 +		}
  1.1548 +	return ret;
  1.1549 +	}
  1.1550 +
  1.1551 +// Implementation that uses the test interface to set data that can be checked
  1.1552 +// in the call to the interface's "get" method.
  1.1553 +TVerdict CTestDevVideoCiuPlayClientNotifierRevoked::DoTestL()
  1.1554 +	{
  1.1555 +	TVerdict ret = EFail;
  1.1556 +
  1.1557 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1558 +	// Try to fetch the CI...
  1.1559 +	MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
  1.1560 +		
  1.1561 +	interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
  1.1562 +																		iHwDeviceId, 
  1.1563 +																		KUidMmfVideoHwDevVideoPolicyExtension));
  1.1564 +	if (!interface)
  1.1565 +		{
  1.1566 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1567 +		ret = EInconclusive;
  1.1568 +		}
  1.1569 +	else
  1.1570 +		{
  1.1571 +		MMmfVideoHwDevClientNotifier* clientNotifier = this;
  1.1572 +		// call the interface's method
  1.1573 +		interface->MmvhvpeSetVideoClient(clientNotifier);
  1.1574 +		
  1.1575 +		// Now set up the test interface...
  1.1576 +		MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
  1.1577 +		testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
  1.1578 +									(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.1579 +																	KUidDevVideoCiuTestInterfaceClientResourceNotifier));
  1.1580 +		if (testInterface)
  1.1581 +			{
  1.1582 +			INFO_PRINTF1(_L("Requesting the revoke callback."));
  1.1583 +			testInterface->McrnRequestRevokeCallback();
  1.1584 +			
  1.1585 +			if (iCallback)
  1.1586 +				{
  1.1587 +				ret = EPass;
  1.1588 +				}
  1.1589 +			else
  1.1590 +				{
  1.1591 +				ERR_PRINTF1(_L("Didn't receive the revoke callback."));
  1.1592 +				}
  1.1593 +			}
  1.1594 +		else
  1.1595 +			{
  1.1596 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1597 +			ret = EInconclusive;
  1.1598 +			}
  1.1599 +		}
  1.1600 +
  1.1601 +	return ret;
  1.1602 +	}
  1.1603 +
  1.1604 +// from MMmfVideoHwDevClientNotifier
  1.1605 +void CTestDevVideoCiuPlayClientNotifierRevoked::MmvhcnVideoAccessRevoked()
  1.1606 +	{
  1.1607 +	INFO_PRINTF1(_L("Access revoked callback received."));
  1.1608 +	iCallback = ETrue;
  1.1609 +	}
  1.1610 +	
  1.1611 +// from MMmfVideoHwDevClientNotifier	
  1.1612 +void CTestDevVideoCiuPlayClientNotifierRevoked::MmvhcnReleaseVideoResource()
  1.1613 +	{
  1.1614 +	}
  1.1615 +
  1.1616 +//----------------------------------------------------------------------------------------
  1.1617 +
  1.1618 +CTestDevVideoCiuPlayClientNotifierResource::CTestDevVideoCiuPlayClientNotifierResource(const TDesC& aTestName)
  1.1619 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.1620 +	{
  1.1621 +	}
  1.1622 +
  1.1623 +CTestDevVideoCiuPlayClientNotifierResource* CTestDevVideoCiuPlayClientNotifierResource::NewL(const TDesC& aTestName)
  1.1624 +	{
  1.1625 +	CTestDevVideoCiuPlayClientNotifierResource* self = new(ELeave) CTestDevVideoCiuPlayClientNotifierResource(aTestName);
  1.1626 +	return self;
  1.1627 +	}
  1.1628 +
  1.1629 +TVerdict CTestDevVideoCiuPlayClientNotifierResource::DoTestStepPreambleL()
  1.1630 +	{
  1.1631 +	// Call the base class first
  1.1632 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1633 +
  1.1634 +	if (ret == EPass)
  1.1635 +		{
  1.1636 +		// select decoder
  1.1637 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1638 +
  1.1639 +		if (err != KErrNone)
  1.1640 +			{
  1.1641 +			ret = EInconclusive;
  1.1642 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1643 +			}
  1.1644 +		}
  1.1645 +
  1.1646 +	return ret;
  1.1647 +	}
  1.1648 +
  1.1649 +// Implementation that uses the test interface to set data that can be checked
  1.1650 +// in the call to the interface's "get" method.
  1.1651 +TVerdict CTestDevVideoCiuPlayClientNotifierResource::DoTestL()
  1.1652 +	{
  1.1653 +	TVerdict ret = EFail;
  1.1654 +
  1.1655 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1656 +	// Try to fetch the CI...
  1.1657 +	MMmfVideoHwDeviceVideoPolicyExtension* interface = NULL;
  1.1658 +		
  1.1659 +	interface = static_cast<MMmfVideoHwDeviceVideoPolicyExtension*>(iDevVideoPlay->CustomInterface(
  1.1660 +																		iHwDeviceId, 
  1.1661 +																		KUidMmfVideoHwDevVideoPolicyExtension));
  1.1662 +	if (!interface)
  1.1663 +		{
  1.1664 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1665 +		ret = EInconclusive;
  1.1666 +		}
  1.1667 +	else
  1.1668 +		{
  1.1669 +		MMmfVideoHwDevClientNotifier* clientNotifier = this;
  1.1670 +		// call the interface's method
  1.1671 +		interface->MmvhvpeSetVideoClient(clientNotifier);
  1.1672 +		
  1.1673 +		// Now set up the test interface...
  1.1674 +		MDevVideoCiuTestInterfaceClientResourceNotifier* testInterface = NULL;
  1.1675 +		testInterface = static_cast<MDevVideoCiuTestInterfaceClientResourceNotifier*>
  1.1676 +									(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.1677 +																	KUidDevVideoCiuTestInterfaceClientResourceNotifier));
  1.1678 +		if (testInterface)
  1.1679 +			{
  1.1680 +			INFO_PRINTF1(_L("Requesting the resource callback."));
  1.1681 +			testInterface->McrnRequestResourceCallback();
  1.1682 +			
  1.1683 +			if (iCallback)
  1.1684 +				{
  1.1685 +				ret = EPass;
  1.1686 +				}
  1.1687 +			else
  1.1688 +				{
  1.1689 +				ERR_PRINTF1(_L("Didn't receive the resource callback."));
  1.1690 +				}
  1.1691 +			}
  1.1692 +		else
  1.1693 +			{
  1.1694 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1695 +			ret = EInconclusive;
  1.1696 +			}
  1.1697 +		}
  1.1698 +
  1.1699 +	return ret;
  1.1700 +	}
  1.1701 +
  1.1702 +// from MMmfVideoHwDevClientNotifier
  1.1703 +void CTestDevVideoCiuPlayClientNotifierResource::MmvhcnVideoAccessRevoked()
  1.1704 +	{
  1.1705 +	}
  1.1706 +
  1.1707 +// from MMmfVideoHwDevClientNotifier	
  1.1708 +void CTestDevVideoCiuPlayClientNotifierResource::MmvhcnReleaseVideoResource()
  1.1709 +	{
  1.1710 +	INFO_PRINTF1(_L("Release video resource callback received."));
  1.1711 +	iCallback = ETrue;
  1.1712 +	}
  1.1713 +//----------------------------------------------------------------------------------------
  1.1714 +
  1.1715 +//------------------------------------------------------------------
  1.1716 +//			Negative Tests
  1.1717 +//------------------------------------------------------------------
  1.1718 +
  1.1719 +CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder
  1.1720 +	::CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder(const TDesC& aTestName)
  1.1721 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1722 +	{
  1.1723 +	}
  1.1724 +
  1.1725 +CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder* 
  1.1726 +CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::NewL(const TDesC& aTestName)
  1.1727 +	{
  1.1728 +	CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder* self = 
  1.1729 +									new(ELeave) CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder(aTestName);
  1.1730 +	return self;
  1.1731 +	}
  1.1732 +
  1.1733 +TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::DoTestStepPreambleL()
  1.1734 +	{
  1.1735 +	// Call the base class first
  1.1736 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1737 +
  1.1738 +	if (ret == EPass)
  1.1739 +		{
  1.1740 +		// select the decoder
  1.1741 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1742 +		
  1.1743 +		if (err != KErrNone)
  1.1744 +			{
  1.1745 +			ret = EInconclusive;
  1.1746 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the Decoder."));
  1.1747 +			}
  1.1748 +		}
  1.1749 +	return ret;
  1.1750 +	}
  1.1751 +
  1.1752 +TVerdict CTestDevVideoCiuPlayCreateVideoMediaProtectedDecoder::DoTestL()
  1.1753 +	{
  1.1754 +	TVerdict ret = EPass;
  1.1755 +
  1.1756 +	INFO_PRINTF1(_L("DevVideo CIU Video Media Protected Creation Failure from Decoder"));
  1.1757 +
  1.1758 +	// Got this far so must have successfully initialised DevVideoPlay
  1.1759 +	// Try to fetch the CI...
  1.1760 +	MMmfVideoMediaProtected* interface = NULL;
  1.1761 +	interface = static_cast<MMmfVideoMediaProtected*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1762 +																					KUidMmfVideoMediaProtected));
  1.1763 +	if (!interface)
  1.1764 +		{
  1.1765 +		INFO_PRINTF1(_L("No interface retrieved"));
  1.1766 +		}
  1.1767 +	else
  1.1768 +		{
  1.1769 +		ERR_PRINTF1(_L("Error! An interface was retrieved"));
  1.1770 +		ret = EFail;
  1.1771 +		}
  1.1772 +
  1.1773 +	return ret;
  1.1774 +	}
  1.1775 +//------------------------------------------------------------------
  1.1776 +
  1.1777 +
  1.1778 +#ifdef SYMBIAN_BUILD_GCE
  1.1779 +
  1.1780 +//
  1.1781 +//	Video Surface Support Management Tests
  1.1782 +//
  1.1783 +CTestDevVideoCiuPlayGetAndSetUseSurface::CTestDevVideoCiuPlayGetAndSetUseSurface(const TDesC& aTestName)
  1.1784 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1785 +	{
  1.1786 +	}
  1.1787 +
  1.1788 +CTestDevVideoCiuPlayGetAndSetUseSurface* CTestDevVideoCiuPlayGetAndSetUseSurface::NewL(const TDesC& aTestName)
  1.1789 +	{
  1.1790 +	CTestDevVideoCiuPlayGetAndSetUseSurface* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetUseSurface(aTestName);
  1.1791 +	return self;
  1.1792 +	}
  1.1793 +
  1.1794 +TVerdict CTestDevVideoCiuPlayGetAndSetUseSurface::DoTestStepPreambleL()
  1.1795 +	{
  1.1796 +	// Call the base class first
  1.1797 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1798 +	if (ret == EPass)
  1.1799 +		{
  1.1800 +		// select decoder
  1.1801 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1802 +		
  1.1803 +		if (err != KErrNone)
  1.1804 +			{
  1.1805 +			ret = EInconclusive;
  1.1806 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1807 +			}
  1.1808 +		}
  1.1809 +	return ret;
  1.1810 +	}
  1.1811 +
  1.1812 +TVerdict CTestDevVideoCiuPlayGetAndSetUseSurface::DoTestL()
  1.1813 +	{
  1.1814 +	TVerdict ret = EFail;
  1.1815 +	
  1.1816 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.1817 +	
  1.1818 +	// Fetch the CI
  1.1819 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.1820 +		
  1.1821 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.1822 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1823 +											KUidMMFVideoSurfaceSupport));
  1.1824 +	if (!interface)
  1.1825 +		{
  1.1826 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1827 +		ret = EFail;
  1.1828 +		}
  1.1829 +	else
  1.1830 +		{
  1.1831 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.1832 +		
  1.1833 +		TBool useSurface = ETrue; 
  1.1834 +		interface->MmvssUseSurfaces();
  1.1835 +		
  1.1836 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.1837 +
  1.1838 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
  1.1839 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, 
  1.1840 +											KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.1841 +		if (testInterface)
  1.1842 +			{
  1.1843 +			TBool useSurfaceResult = testInterface->MdvssUseSurface();
  1.1844 +			if (useSurface == useSurfaceResult)
  1.1845 +				{
  1.1846 +				ret = EPass;
  1.1847 +				INFO_PRINTF1(_L("Use Surface call performed as expected"));
  1.1848 +				}
  1.1849 +			else
  1.1850 +				{
  1.1851 +				ret = EFail;					
  1.1852 +				ERR_PRINTF2(_L("Use Surface call failed. Expected: %d"),useSurface);
  1.1853 +				ERR_PRINTF2(_L("Result: %d"),useSurfaceResult);
  1.1854 +				}
  1.1855 +			}
  1.1856 +		else
  1.1857 +			{
  1.1858 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1859 +			ret = EInconclusive;
  1.1860 +			}
  1.1861 +		}
  1.1862 +	return ret;
  1.1863 +	}
  1.1864 +	
  1.1865 +//-----------------------------------------------------------//
  1.1866 +CTestDevVideoCiuPlayGetAndSetSurfaceParameters::CTestDevVideoCiuPlayGetAndSetSurfaceParameters(const TDesC& aTestName)
  1.1867 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1868 +	{
  1.1869 +	}
  1.1870 +
  1.1871 +CTestDevVideoCiuPlayGetAndSetSurfaceParameters* CTestDevVideoCiuPlayGetAndSetSurfaceParameters::NewL(const TDesC& aTestName)
  1.1872 +	{
  1.1873 +	CTestDevVideoCiuPlayGetAndSetSurfaceParameters* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetSurfaceParameters(aTestName);
  1.1874 +	return self;
  1.1875 +	}
  1.1876 +
  1.1877 +TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceParameters::DoTestStepPreambleL()
  1.1878 +	{
  1.1879 +	// Call the base class first
  1.1880 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1881 +	if (ret == EPass)
  1.1882 +		{
  1.1883 +		// select decoder
  1.1884 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1885 +		
  1.1886 +		if (err != KErrNone)
  1.1887 +			{
  1.1888 +			ret = EInconclusive;
  1.1889 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1890 +			}
  1.1891 +		}
  1.1892 +	return ret;
  1.1893 +	}
  1.1894 +
  1.1895 +TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceParameters::DoTestL()
  1.1896 +	{
  1.1897 +	TVerdict ret = EFail;
  1.1898 +	
  1.1899 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.1900 +	
  1.1901 +	// Fetch the CI
  1.1902 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.1903 +		
  1.1904 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.1905 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.1906 +											KUidMMFVideoSurfaceSupport));
  1.1907 +	if (!interface)
  1.1908 +		{
  1.1909 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.1910 +		ret = EFail;
  1.1911 +		}
  1.1912 +	else
  1.1913 +		{
  1.1914 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.1915 +		
  1.1916 +		TSurfaceId surfaceId;
  1.1917 +		TRect getRect;
  1.1918 +		TVideoAspectRatio par;
  1.1919 +		interface->MmvssGetSurfaceParametersL(surfaceId, getRect, par);
  1.1920 +						
  1.1921 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.1922 +
  1.1923 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
  1.1924 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, 
  1.1925 +											KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.1926 +		if (testInterface)
  1.1927 +			{
  1.1928 +			TMMFVideoSurfaceConfig vsconfResult = testInterface->MdvssSurfaceParameters();
  1.1929 +			
  1.1930 +			if (vsconfResult.iSurfaceId == surfaceId && vsconfResult.iCropRectangle.iTl.iX == getRect.iTl.iX &&
  1.1931 +			vsconfResult.iCropRectangle.iTl.iY == getRect.iTl.iY && vsconfResult.iCropRectangle.iBr.iX == getRect.iBr.iX && 
  1.1932 +			vsconfResult.iCropRectangle.iBr.iY == getRect.iBr.iY &&
  1.1933 +			vsconfResult.iPixelAspectRatio.iNumerator == par.iNumerator && 
  1.1934 +			vsconfResult.iPixelAspectRatio.iDenominator == par.iDenominator)
  1.1935 +				{
  1.1936 +				ret = EPass;
  1.1937 +				INFO_PRINTF1(_L("Get Surface Parameters method call performed as expected"));
  1.1938 +				}
  1.1939 +			else
  1.1940 +				{
  1.1941 +				ret = EFail;					
  1.1942 +				ERR_PRINTF1(_L("Get Surface Parameters method call failed"));
  1.1943 +				INFO_PRINTF5(_L("Expected surfaceId %d %d %d %d"),
  1.1944 +								vsconfResult.iSurfaceId.iInternal[0], vsconfResult.iSurfaceId.iInternal[1],
  1.1945 +								vsconfResult.iSurfaceId.iInternal[2], vsconfResult.iSurfaceId.iInternal[3]);
  1.1946 +				INFO_PRINTF5(_L("surfaceId Available %d %d %d %d"),
  1.1947 +								surfaceId.iInternal[0], surfaceId.iInternal[1], 
  1.1948 +								surfaceId.iInternal[2], surfaceId.iInternal[3]);
  1.1949 +				INFO_PRINTF2(_L("Expected Rect first %d"),vsconfResult.iCropRectangle.iTl.iX);
  1.1950 +				INFO_PRINTF2(_L("Rect first Available %d"),getRect.iTl.iX);
  1.1951 +				INFO_PRINTF2(_L("Expected Rect second %d"),vsconfResult.iCropRectangle.iTl.iY);
  1.1952 +				INFO_PRINTF2(_L("Rect second Available %d"),getRect.iTl.iY);
  1.1953 +				INFO_PRINTF2(_L("Expected Rect third %d"),vsconfResult.iCropRectangle.iBr.iX);
  1.1954 +	
  1.1955 +				INFO_PRINTF2(_L("Rect third Available %d"),getRect.iBr.iX);
  1.1956 +				INFO_PRINTF2(_L("Expected Rect fourth %d"),vsconfResult.iCropRectangle.iBr.iY);
  1.1957 +				INFO_PRINTF2(_L("Rect fourth Available %d"),getRect.iBr.iY);
  1.1958 +				INFO_PRINTF2(_L("Expected TVideoAspectRatio iNumerator %d"),vsconfResult.iPixelAspectRatio.iNumerator);
  1.1959 +				INFO_PRINTF2(_L("TVideoAspectRatio iNumerator Available %d"),par.iNumerator);
  1.1960 +				INFO_PRINTF2(_L("Expected TVideoAspectRatio iDenominator %d"),vsconfResult.iPixelAspectRatio.iDenominator);
  1.1961 +				INFO_PRINTF2(_L("TVideoAspectRatio iDenominator Available %d"),par.iDenominator);
  1.1962 +
  1.1963 +				}
  1.1964 +			}
  1.1965 +		else
  1.1966 +			{
  1.1967 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.1968 +			ret = EInconclusive;
  1.1969 +			}
  1.1970 +		}
  1.1971 +	return ret;
  1.1972 +	}
  1.1973 +	
  1.1974 +//-----------------------------------------------------------//
  1.1975 +CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::CTestDevVideoCiuPlayGetAndSetSurfaceRemoved(const TDesC& aTestName)
  1.1976 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.1977 +	{
  1.1978 +	}
  1.1979 +
  1.1980 +CTestDevVideoCiuPlayGetAndSetSurfaceRemoved* CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::NewL(const TDesC& aTestName)
  1.1981 +	{
  1.1982 +	CTestDevVideoCiuPlayGetAndSetSurfaceRemoved* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetSurfaceRemoved(aTestName);
  1.1983 +	return self;
  1.1984 +	}
  1.1985 +
  1.1986 +TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::DoTestStepPreambleL()
  1.1987 +	{
  1.1988 +	// Call the base class first
  1.1989 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.1990 +	if (ret == EPass)
  1.1991 +		{
  1.1992 +		// select decoder
  1.1993 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.1994 +		
  1.1995 +		if (err != KErrNone)
  1.1996 +			{
  1.1997 +			ret = EInconclusive;
  1.1998 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.1999 +			}
  1.2000 +		}
  1.2001 +	return ret;
  1.2002 +	}
  1.2003 +
  1.2004 +TVerdict CTestDevVideoCiuPlayGetAndSetSurfaceRemoved::DoTestL()
  1.2005 +	{
  1.2006 +	TVerdict ret = EFail;
  1.2007 +	
  1.2008 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.2009 +	
  1.2010 +	// Fetch the CI
  1.2011 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.2012 +		
  1.2013 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.2014 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2015 +											KUidMMFVideoSurfaceSupport));
  1.2016 +	if (!interface)
  1.2017 +		{
  1.2018 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2019 +		ret = EFail;
  1.2020 +		}
  1.2021 +	else
  1.2022 +		{
  1.2023 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.2024 +		
  1.2025 +		// these values can be anything
  1.2026 +		TSurfaceId surfaceId;
  1.2027 +		surfaceId.iInternal[0] = 37;
  1.2028 +		surfaceId.iInternal[1] = 104;
  1.2029 +		surfaceId.iInternal[2] = 118;
  1.2030 +		surfaceId.iInternal[3] = 1045;
  1.2031 +		
  1.2032 +		interface->MmvssSurfaceRemovedL(surfaceId);
  1.2033 +		
  1.2034 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.2035 +
  1.2036 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>
  1.2037 +										(iDevVideoPlay->CustomInterface(iHwDeviceId, 
  1.2038 +											KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.2039 +		if (testInterface)
  1.2040 +			{
  1.2041 +			TSurfaceId surfaceIdResult = testInterface->MdvssSurfaceRemoved();
  1.2042 +			if (surfaceId == surfaceIdResult)
  1.2043 +				{
  1.2044 +				ret = EPass;
  1.2045 +				INFO_PRINTF1(_L("Surface Removed method call performed as expected"));
  1.2046 +				}
  1.2047 +			else
  1.2048 +				{
  1.2049 +				ret = EFail;					
  1.2050 +				ERR_PRINTF1(_L("Surface Removed method call failed."));
  1.2051 +				INFO_PRINTF5(_L("Expected surfaceId %d %d %d %d"),
  1.2052 +							surfaceId.iInternal[0], surfaceId.iInternal[1],
  1.2053 +							surfaceId.iInternal[2], surfaceId.iInternal[3]);
  1.2054 +				INFO_PRINTF5(_L("surfaceId Available %d %d %d %d"),
  1.2055 +							surfaceIdResult.iInternal[0], surfaceIdResult.iInternal[1], 
  1.2056 +							surfaceIdResult.iInternal[2], surfaceIdResult.iInternal[3]);
  1.2057 +				}
  1.2058 +			}
  1.2059 +		else
  1.2060 +			{
  1.2061 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.2062 +			ret = EInconclusive;
  1.2063 +			}
  1.2064 +		}
  1.2065 +	return ret;
  1.2066 +	}
  1.2067 +	
  1.2068 +//-----------------------------------------------------------//
  1.2069 +CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver(const TDesC& aTestName)
  1.2070 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.2071 +	{
  1.2072 +	}
  1.2073 +
  1.2074 +CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver* CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::NewL(const TDesC& aTestName)
  1.2075 +	{
  1.2076 +	CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver(aTestName);
  1.2077 +	return self;
  1.2078 +	}
  1.2079 +
  1.2080 +TVerdict CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::DoTestStepPreambleL()
  1.2081 +	{
  1.2082 +	// Call the base class first
  1.2083 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2084 +	if (ret == EPass)
  1.2085 +		{
  1.2086 +		// select decoder
  1.2087 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2088 +		
  1.2089 +		if (err != KErrNone)
  1.2090 +			{
  1.2091 +			ret = EInconclusive;
  1.2092 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2093 +			}
  1.2094 +		}
  1.2095 +	return ret;
  1.2096 +	}
  1.2097 +
  1.2098 +TVerdict CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::DoTestL()
  1.2099 +	{
  1.2100 +	TVerdict ret = EFail;
  1.2101 +	
  1.2102 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.2103 +	
  1.2104 +	// Fetch the CI
  1.2105 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.2106 +		
  1.2107 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.2108 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2109 +																	KUidMMFVideoSurfaceSupport));
  1.2110 +	if (!interface)
  1.2111 +		{
  1.2112 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2113 +		ret = EFail;
  1.2114 +		}
  1.2115 +	else
  1.2116 +		{
  1.2117 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.2118 +	
  1.2119 +		MMMFVideoSurfaceObserver* obs = this;
  1.2120 +		interface->MmvssSetObserver(*obs);
  1.2121 +		INFO_PRINTF1(_L("MmvssSetObserver called"));
  1.2122 +		
  1.2123 +		// Verify that the observer was set
  1.2124 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.2125 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2126 +															KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.2127 +		if (!testInterface)
  1.2128 +			{
  1.2129 +			ERR_PRINTF1(_L("Failed to create the test interface."));
  1.2130 +			ret = EFail;
  1.2131 +			}
  1.2132 +		else
  1.2133 +			{
  1.2134 +			if (obs != testInterface->MvsoObserver())
  1.2135 +				{
  1.2136 +				ERR_PRINTF1(_L("Failed to set the observer."));
  1.2137 +				ret = EFail;
  1.2138 +				}
  1.2139 +			else
  1.2140 +				{			
  1.2141 +				INFO_PRINTF1(_L("SetObserver successfully called"));
  1.2142 +				ret = EPass;
  1.2143 +				}
  1.2144 +			}		
  1.2145 +		}
  1.2146 +	return ret;
  1.2147 +	}
  1.2148 +
  1.2149 +//from MMMFVideoSurfaceObserver
  1.2150 +void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoSurfaceCreated()
  1.2151 +	{}
  1.2152 +		
  1.2153 +void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoSurfaceParametersChanged()
  1.2154 +	{}
  1.2155 +
  1.2156 +void CTestDevVideoCiuPlaySetAndGetSurfaceSupportObserver::MmvsoRemoveSurface()
  1.2157 +	{}
  1.2158 +	
  1.2159 +//------------------------------------------------------------------
  1.2160 +
  1.2161 +CTestDevVideoCiuPlaySurfaceCreated::CTestDevVideoCiuPlaySurfaceCreated(const TDesC& aTestName)
  1.2162 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
  1.2163 +	{
  1.2164 +	}
  1.2165 +
  1.2166 +CTestDevVideoCiuPlaySurfaceCreated* CTestDevVideoCiuPlaySurfaceCreated::NewL(const TDesC& aTestName)
  1.2167 +	{
  1.2168 +	CTestDevVideoCiuPlaySurfaceCreated* self = new(ELeave) CTestDevVideoCiuPlaySurfaceCreated(aTestName);
  1.2169 +	return self;
  1.2170 +	}
  1.2171 +
  1.2172 +TVerdict CTestDevVideoCiuPlaySurfaceCreated::DoTestStepPreambleL()
  1.2173 +	{
  1.2174 +	// Call the base class first
  1.2175 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2176 +	if (ret == EPass)
  1.2177 +		{
  1.2178 +		// select decoder
  1.2179 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2180 +		
  1.2181 +		if (err != KErrNone)
  1.2182 +			{
  1.2183 +			ret = EInconclusive;
  1.2184 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2185 +			}
  1.2186 +		}
  1.2187 +	return ret;
  1.2188 +	}
  1.2189 +
  1.2190 +TVerdict CTestDevVideoCiuPlaySurfaceCreated::DoTestL()
  1.2191 +	{
  1.2192 +	TVerdict ret = EFail;
  1.2193 +	
  1.2194 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.2195 +	
  1.2196 +	// Fetch the CI
  1.2197 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.2198 +		
  1.2199 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.2200 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2201 +																	KUidMMFVideoSurfaceSupport));
  1.2202 +	if (!interface)
  1.2203 +		{
  1.2204 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2205 +		ret = EFail;
  1.2206 +		}
  1.2207 +	else
  1.2208 +		{
  1.2209 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.2210 +	
  1.2211 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.2212 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2213 +															KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.2214 +		if (!testInterface)
  1.2215 +			{
  1.2216 +			ERR_PRINTF1(_L("Failed to create the test interface."));
  1.2217 +			ret = EFail;
  1.2218 +			}
  1.2219 +		else
  1.2220 +			{
  1.2221 +			// Set the observer to callback!
  1.2222 +			MMMFVideoSurfaceObserver* obs = this;
  1.2223 +			interface->MmvssSetObserver(*obs);
  1.2224 +		
  1.2225 +			INFO_PRINTF1(_L("Requesting the surface created Callback..."));
  1.2226 +			testInterface->MmvsoSurfaceCreatedCallback();
  1.2227 +
  1.2228 +			if ((iError != KErrNone) || (!iCallbackReceived))
  1.2229 +				{	
  1.2230 +				ERR_PRINTF1(_L("Error receiving the Surface Created Callback."));
  1.2231 +				ret = EFail;
  1.2232 +				}
  1.2233 +			else
  1.2234 +				{
  1.2235 +				INFO_PRINTF1(_L("Successfully retrieved the Surface Support Callback"));
  1.2236 +				ret = EPass;
  1.2237 +				}
  1.2238 +			}
  1.2239 +		}
  1.2240 +	return ret;
  1.2241 +	}
  1.2242 +
  1.2243 +//from MMMFVideoSurfaceObserver
  1.2244 +void CTestDevVideoCiuPlaySurfaceCreated::MmvsoSurfaceCreated()
  1.2245 +	{
  1.2246 +	INFO_PRINTF1(_L("Surface Support callback received."));
  1.2247 +	iCallbackReceived = ETrue;
  1.2248 +	iError = KErrNone;
  1.2249 +	}
  1.2250 +		
  1.2251 +void CTestDevVideoCiuPlaySurfaceCreated::MmvsoSurfaceParametersChanged()
  1.2252 +	{
  1.2253 +	iError = KErrNotSupported;
  1.2254 +	}
  1.2255 +void CTestDevVideoCiuPlaySurfaceCreated::MmvsoRemoveSurface()
  1.2256 +	{
  1.2257 +	iError = KErrNotSupported;
  1.2258 +	}
  1.2259 +
  1.2260 +//------------------------------------------------------------------
  1.2261 +
  1.2262 +CTestDevVideoCiuPlaySurfaceParametersChanged::CTestDevVideoCiuPlaySurfaceParametersChanged(const TDesC& aTestName)
  1.2263 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
  1.2264 +	{
  1.2265 +	}
  1.2266 +
  1.2267 +CTestDevVideoCiuPlaySurfaceParametersChanged* CTestDevVideoCiuPlaySurfaceParametersChanged::NewL(const TDesC& aTestName)
  1.2268 +	{
  1.2269 +	CTestDevVideoCiuPlaySurfaceParametersChanged* self = new(ELeave) CTestDevVideoCiuPlaySurfaceParametersChanged(aTestName);
  1.2270 +	return self;
  1.2271 +	}
  1.2272 +
  1.2273 +TVerdict CTestDevVideoCiuPlaySurfaceParametersChanged::DoTestStepPreambleL()
  1.2274 +	{
  1.2275 +	// Call the base class first
  1.2276 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2277 +	if (ret == EPass)
  1.2278 +		{
  1.2279 +		// select decoder
  1.2280 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2281 +		
  1.2282 +		if (err != KErrNone)
  1.2283 +			{
  1.2284 +			ret = EInconclusive;
  1.2285 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2286 +			}
  1.2287 +		}
  1.2288 +	return ret;
  1.2289 +	}
  1.2290 +
  1.2291 +TVerdict CTestDevVideoCiuPlaySurfaceParametersChanged::DoTestL()
  1.2292 +	{
  1.2293 +	TVerdict ret = EFail;
  1.2294 +	
  1.2295 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.2296 +	
  1.2297 +	// Fetch the CI
  1.2298 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.2299 +		
  1.2300 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.2301 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2302 +																	KUidMMFVideoSurfaceSupport));
  1.2303 +	if (!interface)
  1.2304 +		{
  1.2305 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2306 +		ret = EFail;
  1.2307 +		}
  1.2308 +	else
  1.2309 +		{
  1.2310 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.2311 +	
  1.2312 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.2313 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2314 +															KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.2315 +		if (!testInterface)
  1.2316 +			{
  1.2317 +			ERR_PRINTF1(_L("Failed to create the test interface."));
  1.2318 +			ret = EFail;
  1.2319 +			}
  1.2320 +		else
  1.2321 +			{
  1.2322 +			// Set the observer to callback!
  1.2323 +			MMMFVideoSurfaceObserver* obs = this;
  1.2324 +			interface->MmvssSetObserver(*obs);
  1.2325 +		
  1.2326 +			INFO_PRINTF1(_L("Requesting the Surface Parameters Changed Callback..."));
  1.2327 +			testInterface->MmvsoSurfaceParametersChangedCallback();
  1.2328 +
  1.2329 +			if ((iError != KErrNone) || (!iCallbackReceived))
  1.2330 +				{	
  1.2331 +				ERR_PRINTF1(_L("Error receiving Surface Parameters Changed Callback."));
  1.2332 +				ret = EFail;
  1.2333 +				}
  1.2334 +			else
  1.2335 +				{
  1.2336 +				INFO_PRINTF1(_L("Successfully retrieved Surface Parameters Changed Callback"));
  1.2337 +				ret = EPass;
  1.2338 +				}
  1.2339 +			}
  1.2340 +		}
  1.2341 +	return ret;
  1.2342 +	}
  1.2343 +
  1.2344 +//from MMMFVideoSurfaceObserver
  1.2345 +void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoSurfaceCreated()
  1.2346 +	{
  1.2347 +	iError = KErrNotSupported;
  1.2348 +	}
  1.2349 +		
  1.2350 +void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoSurfaceParametersChanged()
  1.2351 +	{
  1.2352 +	INFO_PRINTF1(_L("Surface Parameters Changed callback received."));
  1.2353 +	iCallbackReceived = ETrue;
  1.2354 +	iError = KErrNone;
  1.2355 +	}
  1.2356 +	
  1.2357 +void CTestDevVideoCiuPlaySurfaceParametersChanged::MmvsoRemoveSurface()
  1.2358 +	{
  1.2359 +	iError = KErrNotSupported;
  1.2360 +	}
  1.2361 +
  1.2362 +//------------------------------------------------------------------
  1.2363 +
  1.2364 +CTestDevVideoCiuRemoveSurface::CTestDevVideoCiuRemoveSurface(const TDesC& aTestName)
  1.2365 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
  1.2366 +	{
  1.2367 +	}
  1.2368 +
  1.2369 +CTestDevVideoCiuRemoveSurface* CTestDevVideoCiuRemoveSurface::NewL(const TDesC& aTestName)
  1.2370 +	{
  1.2371 +	CTestDevVideoCiuRemoveSurface* self = new(ELeave) CTestDevVideoCiuRemoveSurface(aTestName);
  1.2372 +	return self;
  1.2373 +	}
  1.2374 +
  1.2375 +TVerdict CTestDevVideoCiuRemoveSurface::DoTestStepPreambleL()
  1.2376 +	{
  1.2377 +	// Call the base class first
  1.2378 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2379 +	if (ret == EPass)
  1.2380 +		{
  1.2381 +		// select decoder
  1.2382 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2383 +		
  1.2384 +		if (err != KErrNone)
  1.2385 +			{
  1.2386 +			ret = EInconclusive;
  1.2387 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2388 +			}
  1.2389 +		}
  1.2390 +	return ret;
  1.2391 +	}
  1.2392 +
  1.2393 +TVerdict CTestDevVideoCiuRemoveSurface::DoTestL()
  1.2394 +	{
  1.2395 +	TVerdict ret = EFail;
  1.2396 +	
  1.2397 +	INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Initialisation"));
  1.2398 +	
  1.2399 +	// Fetch the CI
  1.2400 +	MMMFVideoSurfaceSupport* interface = NULL;
  1.2401 +		
  1.2402 +	interface = static_cast<MMMFVideoSurfaceSupport*>
  1.2403 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2404 +																	KUidMMFVideoSurfaceSupport));
  1.2405 +	if (!interface)
  1.2406 +		{
  1.2407 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2408 +		ret = EFail;
  1.2409 +		}
  1.2410 +	else
  1.2411 +		{
  1.2412 +		INFO_PRINTF1(_L("DevVideo CIU Surface Support Interface Instantiated"));
  1.2413 +	
  1.2414 +		MDevVideoCiuTestInterfaceVideoSurfaceSupport* testInterface = NULL;
  1.2415 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoSurfaceSupport*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2416 +															KUidDevVideoCiuTestInterfaceVideoSurfaceSupport));
  1.2417 +		if (!testInterface)
  1.2418 +			{
  1.2419 +			ERR_PRINTF1(_L("Failed to create the test interface."));
  1.2420 +			ret = EFail;
  1.2421 +			}
  1.2422 +		else
  1.2423 +			{
  1.2424 +			// Set the observer to callback!
  1.2425 +			MMMFVideoSurfaceObserver* obs = this;
  1.2426 +			interface->MmvssSetObserver(*obs);
  1.2427 +		
  1.2428 +			INFO_PRINTF1(_L("Requesting Remove Surface Callback..."));
  1.2429 +			testInterface->MmvsoRemoveSurfaceCallback();
  1.2430 +
  1.2431 +			if ((iError != KErrNone) || (!iCallbackReceived))
  1.2432 +				{	
  1.2433 +				ERR_PRINTF1(_L("Error receiving Remove Surface Callback."));
  1.2434 +				ret = EFail;
  1.2435 +				}
  1.2436 +			else
  1.2437 +				{
  1.2438 +				INFO_PRINTF1(_L("Successfully retrieved Remove Surface Callback"));
  1.2439 +				ret = EPass;
  1.2440 +				}
  1.2441 +			}
  1.2442 +		}
  1.2443 +	return ret;
  1.2444 +	}
  1.2445 +
  1.2446 +//from MMMFVideoSurfaceObserver
  1.2447 +void CTestDevVideoCiuRemoveSurface::MmvsoSurfaceCreated()
  1.2448 +	{
  1.2449 +	iError = KErrNotSupported;
  1.2450 +	}
  1.2451 +		
  1.2452 +void CTestDevVideoCiuRemoveSurface::MmvsoSurfaceParametersChanged()
  1.2453 +	{
  1.2454 +	iError = KErrNotSupported;
  1.2455 +	}
  1.2456 +	
  1.2457 +void CTestDevVideoCiuRemoveSurface::MmvsoRemoveSurface()
  1.2458 +	{
  1.2459 +	INFO_PRINTF1(_L("Remove Surface callback received."));
  1.2460 +	iCallbackReceived = ETrue;
  1.2461 +	iError = KErrNone;
  1.2462 +	}
  1.2463 +
  1.2464 +//----------------------------------------------------------------------------
  1.2465 +CTestDevVideoCiuPlayUseClientBuffers::CTestDevVideoCiuPlayUseClientBuffers(const TDesC& aTestName)
  1.2466 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.2467 +	{
  1.2468 +	}
  1.2469 +
  1.2470 +CTestDevVideoCiuPlayUseClientBuffers* CTestDevVideoCiuPlayUseClientBuffers::NewL(const TDesC& aTestName)
  1.2471 +	{
  1.2472 +	CTestDevVideoCiuPlayUseClientBuffers* self = new(ELeave) CTestDevVideoCiuPlayUseClientBuffers(aTestName);
  1.2473 +	return self;
  1.2474 +	}
  1.2475 +
  1.2476 +TVerdict CTestDevVideoCiuPlayUseClientBuffers::DoTestStepPreambleL()
  1.2477 +	{
  1.2478 +	// Call the base class first
  1.2479 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2480 +
  1.2481 +	if (ret == EPass)
  1.2482 +		{
  1.2483 +		// select decoder
  1.2484 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2485 +		
  1.2486 +		if (err != KErrNone)
  1.2487 +			{
  1.2488 +			ret = EInconclusive;
  1.2489 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2490 +			}
  1.2491 +		}
  1.2492 +	
  1.2493 +	return ret;
  1.2494 +	}
  1.2495 +
  1.2496 +TVerdict CTestDevVideoCiuPlayUseClientBuffers::DoTestL()
  1.2497 +	{
  1.2498 +	TVerdict ret = EFail;
  1.2499 +	
  1.2500 +	INFO_PRINTF1(_L("DevVideo CIU use client buffer mode test"));
  1.2501 +
  1.2502 +	// Try to fetch the CI...
  1.2503 +	MMMFVideoClientBufferSupport* interface = NULL;
  1.2504 +		
  1.2505 +	interface = static_cast<MMMFVideoClientBufferSupport*>
  1.2506 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2507 +																	KUidMMFVideoClientBufferSupport));
  1.2508 +	if (!interface)
  1.2509 +		{
  1.2510 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2511 +		}
  1.2512 +	else
  1.2513 +		{
  1.2514 +		TBool clientBuffers = ETrue;
  1.2515 +		interface->MvcbsUseClientBuffers(clientBuffers);
  1.2516 +		
  1.2517 +		// Now set up the test interface...
  1.2518 +		MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
  1.2519 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
  1.2520 +							(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.2521 +									KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
  1.2522 +		if (testInterface)
  1.2523 +			{
  1.2524 +			if (testInterface->MdvcbsClientBuffers())
  1.2525 +				{
  1.2526 +				INFO_PRINTF1(_L("Succesfully retrieved the video client buffer mode"));
  1.2527 +				ret = EPass;
  1.2528 +				}
  1.2529 +			else
  1.2530 +				{
  1.2531 +				ERR_PRINTF1(_L("Failed to retrieve the video client buffer mode."));
  1.2532 +				}
  1.2533 +			}
  1.2534 +		else
  1.2535 +			{
  1.2536 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.2537 +			ret = EInconclusive;
  1.2538 +			}		
  1.2539 +		}
  1.2540 +	return ret;
  1.2541 +	}
  1.2542 +
  1.2543 +//----------------------------------------------------------------------------
  1.2544 +CTestDevVideoCiuPlaySupplyBuffer::CTestDevVideoCiuPlaySupplyBuffer(const TDesC& aTestName)
  1.2545 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.2546 +	{
  1.2547 +	}
  1.2548 +
  1.2549 +CTestDevVideoCiuPlaySupplyBuffer* CTestDevVideoCiuPlaySupplyBuffer::NewL(const TDesC& aTestName)
  1.2550 +	{
  1.2551 +	CTestDevVideoCiuPlaySupplyBuffer* self = new(ELeave) CTestDevVideoCiuPlaySupplyBuffer(aTestName);
  1.2552 +	return self;
  1.2553 +	}
  1.2554 +
  1.2555 +TVerdict CTestDevVideoCiuPlaySupplyBuffer::DoTestStepPreambleL()
  1.2556 +	{
  1.2557 +	// Call the base class first
  1.2558 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2559 +
  1.2560 +	if (ret == EPass)
  1.2561 +		{
  1.2562 +		// select decoder
  1.2563 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2564 +		
  1.2565 +		if (err != KErrNone)
  1.2566 +			{
  1.2567 +			ret = EInconclusive;
  1.2568 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2569 +			}
  1.2570 +		}
  1.2571 +	
  1.2572 +	return ret;
  1.2573 +	}
  1.2574 +
  1.2575 +TVerdict CTestDevVideoCiuPlaySupplyBuffer::DoTestL()
  1.2576 +	{
  1.2577 +	TVerdict ret = EFail;
  1.2578 +	
  1.2579 +	INFO_PRINTF1(_L("DevVideo CIU supply buffer test"));
  1.2580 +
  1.2581 +	// Try to fetch the CI...
  1.2582 +	MMMFVideoClientBufferSupport* interface = NULL;
  1.2583 +		
  1.2584 +	interface = static_cast<MMMFVideoClientBufferSupport*>
  1.2585 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2586 +																	KUidMMFVideoClientBufferSupport));
  1.2587 +	if (!interface)
  1.2588 +		{
  1.2589 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2590 +		}
  1.2591 +	else
  1.2592 +		{
  1.2593 +		TUncompressedVideoFormat format;
  1.2594 +		format.iDataFormat = ERgbRawData;
  1.2595 +		format.iRgbFormat = ERgb32bit888;		
  1.2596 +		RChunk aChunk;
  1.2597 +
  1.2598 +		// Create a dummy object for testing only
  1.2599 +		TVideoFrameBuffer buffer(format, 1, 1, aChunk, 0);
  1.2600 +		interface->MvcbsSupplyBuffer(buffer);
  1.2601 +		
  1.2602 +		// Now set up the test interface...
  1.2603 +		MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
  1.2604 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
  1.2605 +							(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.2606 +									KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
  1.2607 +		if (testInterface)
  1.2608 +			{
  1.2609 +			if (testInterface->MdvcbsSupplyBuffer() == &buffer)
  1.2610 +				{
  1.2611 +				INFO_PRINTF1(_L("Succesfully retrieved the video supplied buffer"));
  1.2612 +				ret = EPass;
  1.2613 +				}
  1.2614 +			else
  1.2615 +				{
  1.2616 +				ERR_PRINTF1(_L("Failed to retrieve the video supplied buffer."));
  1.2617 +				}
  1.2618 +			}
  1.2619 +		else
  1.2620 +			{
  1.2621 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.2622 +			ret = EInconclusive;
  1.2623 +			}		
  1.2624 +		}
  1.2625 +	return ret;
  1.2626 +	}
  1.2627 +	
  1.2628 +//----------------------------------------------------------------------------
  1.2629 +CTestDevVideoCiuPlayReleaseBuffers::CTestDevVideoCiuPlayReleaseBuffers(const TDesC& aTestName)
  1.2630 +	: CTestDevVideoCiuPlayStep(aTestName)
  1.2631 +	{
  1.2632 +	}
  1.2633 +
  1.2634 +CTestDevVideoCiuPlayReleaseBuffers* CTestDevVideoCiuPlayReleaseBuffers::NewL(const TDesC& aTestName)
  1.2635 +	{
  1.2636 +	CTestDevVideoCiuPlayReleaseBuffers* self = new(ELeave) CTestDevVideoCiuPlayReleaseBuffers(aTestName);
  1.2637 +	return self;
  1.2638 +	}
  1.2639 +
  1.2640 +TVerdict CTestDevVideoCiuPlayReleaseBuffers::DoTestStepPreambleL()
  1.2641 +	{
  1.2642 +	// Call the base class first
  1.2643 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2644 +
  1.2645 +	if (ret == EPass)
  1.2646 +		{
  1.2647 +		// select decoder
  1.2648 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2649 +		
  1.2650 +		if (err != KErrNone)
  1.2651 +			{
  1.2652 +			ret = EInconclusive;
  1.2653 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2654 +			}
  1.2655 +		}
  1.2656 +	
  1.2657 +	return ret;
  1.2658 +	}
  1.2659 +
  1.2660 +TVerdict CTestDevVideoCiuPlayReleaseBuffers::DoTestL()
  1.2661 +	{
  1.2662 +	TVerdict ret = EFail;
  1.2663 +	
  1.2664 +	INFO_PRINTF1(_L("DevVideo CIU release buffer test"));
  1.2665 +
  1.2666 +	// Try to fetch the CI...
  1.2667 +	MMMFVideoClientBufferSupport* interface = NULL;
  1.2668 +		
  1.2669 +	interface = static_cast<MMMFVideoClientBufferSupport*>
  1.2670 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2671 +																	KUidMMFVideoClientBufferSupport));
  1.2672 +	if (!interface)
  1.2673 +		{
  1.2674 +		ERR_PRINTF1(_L("Error - no interface retrieved"));
  1.2675 +		}
  1.2676 +	else
  1.2677 +		{
  1.2678 +		interface->MvcbsReleaseBuffers();
  1.2679 +		
  1.2680 +		// Now set up the test interface...
  1.2681 +		MDevVideoCiuTestInterfaceVideoClientBufferSupport* testInterface = NULL;
  1.2682 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoClientBufferSupport*>
  1.2683 +							(iDevVideoPlay->CustomInterface( iHwDeviceId,
  1.2684 +									KUidDevVideoCiuTestInterfaceVideoClientBufferSupport));
  1.2685 +		if (testInterface)
  1.2686 +			{
  1.2687 +			// In the test decoder, we set true when we call release buffer. Here just check it will return true.
  1.2688 +			if (testInterface->MdvcbsReleaseBuffers())
  1.2689 +				{
  1.2690 +				INFO_PRINTF1(_L("Succesfully release buffer."));
  1.2691 +				ret = EPass;
  1.2692 +				}
  1.2693 +			else
  1.2694 +				{
  1.2695 +				ERR_PRINTF1(_L("Failed to release buffer."));
  1.2696 +				}
  1.2697 +			}
  1.2698 +		else
  1.2699 +			{
  1.2700 +			ERR_PRINTF1(_L("Error - no test interface retrieved"));
  1.2701 +			ret = EInconclusive;
  1.2702 +			}		
  1.2703 +		}
  1.2704 +	return ret;
  1.2705 +	}
  1.2706 +
  1.2707 +//------------------------------------------------------------------
  1.2708 +
  1.2709 +CTestDevVideoCiuPlaySurfaceHandleControl::CTestDevVideoCiuPlaySurfaceHandleControl(const TDesC& aTestName)
  1.2710 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.2711 +	{
  1.2712 +	}
  1.2713 +
  1.2714 +CTestDevVideoCiuPlaySurfaceHandleControl* CTestDevVideoCiuPlaySurfaceHandleControl::NewL(const TDesC& aTestName)
  1.2715 +	{
  1.2716 +	CTestDevVideoCiuPlaySurfaceHandleControl* self = new(ELeave) CTestDevVideoCiuPlaySurfaceHandleControl(aTestName);
  1.2717 +	return self;
  1.2718 +	}
  1.2719 +
  1.2720 +TVerdict CTestDevVideoCiuPlaySurfaceHandleControl::DoTestStepPreambleL()
  1.2721 +	{
  1.2722 +	// Call the base class first
  1.2723 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2724 +	if (ret == EPass)
  1.2725 +		{
  1.2726 +		// select decoder
  1.2727 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2728 +		
  1.2729 +		if (err != KErrNone)
  1.2730 +			{
  1.2731 +			ret = EInconclusive;
  1.2732 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2733 +			}
  1.2734 +		}
  1.2735 +	return ret;
  1.2736 +	}
  1.2737 +
  1.2738 +TVerdict CTestDevVideoCiuPlaySurfaceHandleControl::DoTestL()
  1.2739 +	{
  1.2740 +	TVerdict ret = EFail;
  1.2741 +	
  1.2742 +	INFO_PRINTF1(_L("DevVideo CIU Surface Handle Interface Initialisation"));
  1.2743 +	
  1.2744 +	// Fetch the CI
  1.2745 +	MMmfVideoSurfaceHandleControl* interface = NULL;
  1.2746 +	
  1.2747 +	interface = static_cast<MMmfVideoSurfaceHandleControl*>
  1.2748 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2749 +											KUidMMFVideoSurfaceHandleControl));
  1.2750 +	if (!interface)
  1.2751 +		{
  1.2752 +		ERR_PRINTF1(_L("Error - no interface retrieved for SurfaceHandleControl"));
  1.2753 +		ret = EFail;
  1.2754 +		}
  1.2755 +	else
  1.2756 +		{
  1.2757 +		INFO_PRINTF1(_L("DevVideo CIU SurfaceHandle Control Interface Instantiated"));
  1.2758 +		TSurfaceId nullId = TSurfaceId::CreateNullId();
  1.2759 +		INFO_PRINTF1(_L("DevVideo CIU SurfaceHandle Control testing both surfacehandle functions"));
  1.2760 +		interface->MmvshcSetSurfaceHandle(nullId);
  1.2761 +
  1.2762 +		// Fetch test interface
  1.2763 +		MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl* testInterface = NULL;
  1.2764 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2765 +												KUidDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl));
  1.2766 +		if (!testInterface)
  1.2767 +			{
  1.2768 +			ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.2769 +			ret = EFail;
  1.2770 +			}
  1.2771 +		else
  1.2772 +			{
  1.2773 +			TSurfaceId surfaceId = testInterface->MdvshcGetPlaySurfaceHandle();
  1.2774 +			
  1.2775 +			if (surfaceId == nullId) 
  1.2776 +				{
  1.2777 +				ret = EPass;
  1.2778 +				INFO_PRINTF1(_L("Get play surface handle method call performed as expected"));
  1.2779 +				}
  1.2780 +			else
  1.2781 +				{
  1.2782 +				ret = EFail;					
  1.2783 +				ERR_PRINTF1(_L("Get Play surface handle method call failed"));
  1.2784 +				}
  1.2785 +		  	}
  1.2786 +		}
  1.2787 +	return ret;
  1.2788 +	}
  1.2789 +
  1.2790 +//------------------------------------------------------------------
  1.2791 +
  1.2792 +CTestDevVideoCiuPlaySurfaceRedrawBuffer::CTestDevVideoCiuPlaySurfaceRedrawBuffer(const TDesC& aTestName)
  1.2793 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.2794 +	{
  1.2795 +	}
  1.2796 +
  1.2797 +CTestDevVideoCiuPlaySurfaceRedrawBuffer* CTestDevVideoCiuPlaySurfaceRedrawBuffer::NewL(const TDesC& aTestName)
  1.2798 +	{
  1.2799 +	CTestDevVideoCiuPlaySurfaceRedrawBuffer* self = new(ELeave) CTestDevVideoCiuPlaySurfaceRedrawBuffer(aTestName);
  1.2800 +	return self;
  1.2801 +	}
  1.2802 +
  1.2803 +TVerdict CTestDevVideoCiuPlaySurfaceRedrawBuffer::DoTestStepPreambleL()
  1.2804 +	{
  1.2805 +	// Call the base class first
  1.2806 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2807 +	if (ret == EPass)
  1.2808 +		{
  1.2809 +		// select decoder
  1.2810 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2811 +		
  1.2812 +		if (err != KErrNone)
  1.2813 +			{
  1.2814 +			ret = EInconclusive;
  1.2815 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2816 +			}
  1.2817 +		}
  1.2818 +	return ret;
  1.2819 +	}
  1.2820 +
  1.2821 +TVerdict CTestDevVideoCiuPlaySurfaceRedrawBuffer::DoTestL()
  1.2822 +	{
  1.2823 +	TVerdict ret = EFail;
  1.2824 +	
  1.2825 +	INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Start"));
  1.2826 +	
  1.2827 +	// Fetch the CI
  1.2828 +	MMmfVideoSurfaceHandleControl* interface = NULL;
  1.2829 +	
  1.2830 +	interface = static_cast<MMmfVideoSurfaceHandleControl*>
  1.2831 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2832 +											KUidMMFVideoSurfaceHandleControl));
  1.2833 +	if (!interface)
  1.2834 +		{
  1.2835 +		ERR_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - No interface"));
  1.2836 +		ret = EFail;
  1.2837 +		}
  1.2838 +	else
  1.2839 +		{
  1.2840 +		INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Interface Instantiated"));
  1.2841 +		HBufC8* redrawBuffer = HBufC8::NewLC(10);
  1.2842 +		_LIT8(KTestString, "TestString");
  1.2843 +		*redrawBuffer = KTestString();
  1.2844 +		TPtrC8 bufPtr(*redrawBuffer);
  1.2845 +		
  1.2846 +		INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Setting redraw buffer"));
  1.2847 +		interface->MmvshcRedrawBufferToSurface(bufPtr);
  1.2848 +		CleanupStack::PopAndDestroy(redrawBuffer);
  1.2849 +		redrawBuffer = NULL;
  1.2850 +
  1.2851 +		// Fetch test interface
  1.2852 +		MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl* testInterface = NULL;
  1.2853 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2854 +												KUidDevVideoCiuTestInterfaceVideoPlaySurfaceHandleControl));
  1.2855 +		if (!testInterface)
  1.2856 +			{
  1.2857 +			ERR_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Failed to create test interface"));
  1.2858 +			ret = EFail;
  1.2859 +			}
  1.2860 +		else
  1.2861 +			{
  1.2862 +			TDesC8& retrievedBuffer = testInterface->MdvshcGetRedrawBuffer();
  1.2863 +			
  1.2864 +			if (retrievedBuffer.Compare(KTestString()) == 0)
  1.2865 +				{
  1.2866 +				INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Retrieved correct string"));
  1.2867 +				ret = EPass;
  1.2868 +				}
  1.2869 +			else
  1.2870 +				{
  1.2871 +				INFO_PRINTF1(_L("DevVideo CIU Surface Redraw Buffer - Retrieved incorrect string"));
  1.2872 +				ret = EFail;					
  1.2873 +				}
  1.2874 +			}
  1.2875 +		}
  1.2876 +	return ret;
  1.2877 +	}
  1.2878 +	
  1.2879 +#endif // SYMBIAN_BUILD_GCE
  1.2880 +
  1.2881 +//
  1.2882 +//	Video Play Rate Control Tests
  1.2883 +//
  1.2884 +
  1.2885 +CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities(const TDesC& aTestName)
  1.2886 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.2887 +	{
  1.2888 +	}
  1.2889 +
  1.2890 +CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities* CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::NewL(const TDesC& aTestName)
  1.2891 +	{
  1.2892 +	CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities(aTestName);
  1.2893 +	return self;
  1.2894 +	}
  1.2895 +
  1.2896 +TVerdict CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::DoTestStepPreambleL()
  1.2897 +	{
  1.2898 +	// Call the base class first
  1.2899 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2900 +	if (ret == EPass)
  1.2901 +		{
  1.2902 +		// select decoder
  1.2903 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.2904 +		
  1.2905 +		if (err != KErrNone)
  1.2906 +			{
  1.2907 +			ret = EInconclusive;
  1.2908 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.2909 +			}
  1.2910 +		}
  1.2911 +	return ret;
  1.2912 +	}
  1.2913 +
  1.2914 +TVerdict CTestDevVideoCiuPlayGetAndSetPlayRateCapabilities::DoTestL()
  1.2915 +	{
  1.2916 +	TVerdict ret = EFail;
  1.2917 +	
  1.2918 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
  1.2919 +	
  1.2920 +	// Fetch the CI
  1.2921 +	MMmfVideoPlayRateControl* interface = NULL;
  1.2922 +	
  1.2923 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.2924 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2925 +											KUidMmfVideoPlayRateControl));
  1.2926 +	if (!interface)
  1.2927 +		{
  1.2928 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.2929 +		ret = EFail;
  1.2930 +		}
  1.2931 +	else
  1.2932 +		{
  1.2933 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.2934 +		
  1.2935 +		TVideoPlayRateCapabilities videoPlayRateCapabilities;
  1.2936 +		TRAPD(err, interface->MmvprcGetPlayRateCapabilitiesL(videoPlayRateCapabilities));
  1.2937 +		
  1.2938 +		if (err == KErrNone)
  1.2939 +			{
  1.2940 +			// Fetch test interface
  1.2941 +			MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
  1.2942 +			testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.2943 +												KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
  1.2944 +			if (!testInterface)
  1.2945 +				{
  1.2946 +				ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.2947 +				ret = EFail;
  1.2948 +				}
  1.2949 +			else
  1.2950 +				{
  1.2951 +				TVideoPlayRateCapabilities playRateCapResult = testInterface->MdvproGetPlayRateCapabilities();
  1.2952 +				
  1.2953 +				if (playRateCapResult.iPlayBackward == videoPlayRateCapabilities.iPlayBackward &&
  1.2954 +						playRateCapResult.iPlayForward == videoPlayRateCapabilities.iPlayForward &&
  1.2955 +						playRateCapResult.iStepBackward == videoPlayRateCapabilities.iStepBackward &&
  1.2956 +						playRateCapResult.iStepForward == videoPlayRateCapabilities.iStepForward)
  1.2957 +					{
  1.2958 +					ret = EPass;
  1.2959 +					INFO_PRINTF1(_L("Get Play Rate Capabilities method call performed as expected"));
  1.2960 +					}
  1.2961 +				else
  1.2962 +					{
  1.2963 +					ret = EFail;					
  1.2964 +					ERR_PRINTF1(_L("Get Play Rate Capabilities method call failed"));
  1.2965 +					INFO_PRINTF5(_L("Expected PlayBackward: %d, PlayForward: %d, StepBackward: %d, StepForward: %d"),
  1.2966 +							playRateCapResult.iPlayBackward, playRateCapResult.iPlayForward,
  1.2967 +							playRateCapResult.iStepBackward, playRateCapResult.iStepForward);
  1.2968 +					}
  1.2969 +				}	
  1.2970 +			}
  1.2971 +		else 
  1.2972 +			{
  1.2973 +			ERR_PRINTF2(_L("Failed to get the play rate capabilities: %d."),err);
  1.2974 +			}
  1.2975 +		
  1.2976 +		}
  1.2977 +	return ret;
  1.2978 +	}
  1.2979 +
  1.2980 +//-----------------------------------------------------------//
  1.2981 +CTestDevVideoCiuPlaySetAndGetPlayRate::CTestDevVideoCiuPlaySetAndGetPlayRate(const TDesC& aTestName)
  1.2982 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.2983 +	{
  1.2984 +	}
  1.2985 +
  1.2986 +CTestDevVideoCiuPlaySetAndGetPlayRate* CTestDevVideoCiuPlaySetAndGetPlayRate::NewL(const TDesC& aTestName)
  1.2987 +	{
  1.2988 +	CTestDevVideoCiuPlaySetAndGetPlayRate* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPlayRate(aTestName);
  1.2989 +	return self;
  1.2990 +	}
  1.2991 +
  1.2992 +TVerdict CTestDevVideoCiuPlaySetAndGetPlayRate::DoTestStepPreambleL()
  1.2993 +	{
  1.2994 +	// Call the base class first
  1.2995 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.2996 +	if (ret == EPass)
  1.2997 +		{
  1.2998 +		// select decoder
  1.2999 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3000 +		
  1.3001 +		if (err != KErrNone)
  1.3002 +			{
  1.3003 +			ret = EInconclusive;
  1.3004 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3005 +			}
  1.3006 +		}
  1.3007 +	return ret;
  1.3008 +	}
  1.3009 +
  1.3010 +TVerdict CTestDevVideoCiuPlaySetAndGetPlayRate::DoTestL()
  1.3011 +	{
  1.3012 +	TVerdict ret = EFail;
  1.3013 +	
  1.3014 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
  1.3015 +	
  1.3016 +	// Fetch the CI
  1.3017 +	MMmfVideoPlayRateControl* interface = NULL;
  1.3018 +	
  1.3019 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.3020 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3021 +											KUidMmfVideoPlayRateControl));
  1.3022 +	if (!interface)
  1.3023 +		{
  1.3024 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.3025 +		ret = EFail;
  1.3026 +		}
  1.3027 +	else
  1.3028 +		{
  1.3029 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.3030 +		
  1.3031 +		TInt playRate = 99; // The hardcoded value is for test purpose only
  1.3032 +		TRAPD(err, interface->MmvprcSetPlayRateL(playRate));
  1.3033 +		
  1.3034 +		if (err == KErrNone)
  1.3035 +			{
  1.3036 +			TInt playRateResult = 0;
  1.3037 +			TRAP(err, playRateResult = interface->MmvprcPlayRateL());
  1.3038 +			
  1.3039 +			if (err == KErrNone)
  1.3040 +				{
  1.3041 +				if (playRate == playRateResult)
  1.3042 +					{
  1.3043 +					ret = EPass;
  1.3044 +					INFO_PRINTF1(_L("Set and get Play Rate method calls performed as expected"));
  1.3045 +					}
  1.3046 +				else
  1.3047 +					{
  1.3048 +					ret = EFail;					
  1.3049 +					ERR_PRINTF3(_L("Set and get Play Rate methods call failed. Expected playRate: %d, return is: %d"), playRate, playRateResult);
  1.3050 +					}
  1.3051 +				}
  1.3052 +			else
  1.3053 +				{
  1.3054 +				ERR_PRINTF2(_L("Failed to get the play rate: %d."), err);
  1.3055 +				}
  1.3056 +			}
  1.3057 +		else
  1.3058 +			{
  1.3059 +			ERR_PRINTF2(_L("Failed to set the play rate: %d."), err);
  1.3060 +			}
  1.3061 +		}
  1.3062 +	return ret;
  1.3063 +	}
  1.3064 +
  1.3065 +//-----------------------------------------------------------//
  1.3066 +CTestDevVideoCiuPlayGetAndSetStepFrame::CTestDevVideoCiuPlayGetAndSetStepFrame(const TDesC& aTestName)
  1.3067 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.3068 +	{
  1.3069 +	}
  1.3070 +
  1.3071 +CTestDevVideoCiuPlayGetAndSetStepFrame* CTestDevVideoCiuPlayGetAndSetStepFrame::NewL(const TDesC& aTestName)
  1.3072 +	{
  1.3073 +	CTestDevVideoCiuPlayGetAndSetStepFrame* self = new(ELeave) CTestDevVideoCiuPlayGetAndSetStepFrame(aTestName);
  1.3074 +	return self;
  1.3075 +	}
  1.3076 +
  1.3077 +TVerdict CTestDevVideoCiuPlayGetAndSetStepFrame::DoTestStepPreambleL()
  1.3078 +	{
  1.3079 +	// Call the base class first
  1.3080 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.3081 +	if (ret == EPass)
  1.3082 +		{
  1.3083 +		// select decoder
  1.3084 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3085 +		
  1.3086 +		if (err != KErrNone)
  1.3087 +			{
  1.3088 +			ret = EInconclusive;
  1.3089 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3090 +			}
  1.3091 +		}
  1.3092 +	return ret;
  1.3093 +	}
  1.3094 +
  1.3095 +TVerdict CTestDevVideoCiuPlayGetAndSetStepFrame::DoTestL()
  1.3096 +	{
  1.3097 +	TVerdict ret = EFail;
  1.3098 +	
  1.3099 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
  1.3100 +	
  1.3101 +	// Fetch the CI
  1.3102 +	MMmfVideoPlayRateControl* interface = NULL;
  1.3103 +	
  1.3104 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.3105 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3106 +											KUidMmfVideoPlayRateControl));
  1.3107 +	if (!interface)
  1.3108 +		{
  1.3109 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.3110 +		ret = EFail;
  1.3111 +		}
  1.3112 +	else
  1.3113 +		{
  1.3114 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.3115 +		
  1.3116 +		TInt stepFrame = 99; // The hardcoded value is for test purpose only
  1.3117 +		TRAPD(err, interface->MmvprcStepFrameL(stepFrame));
  1.3118 +		
  1.3119 +		if (err == KErrNone)
  1.3120 +			{
  1.3121 +			// Fetch test interface
  1.3122 +			MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
  1.3123 +			testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3124 +												KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
  1.3125 +			if (!testInterface)
  1.3126 +				{
  1.3127 +				ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.3128 +				ret = EFail;
  1.3129 +				}
  1.3130 +			else
  1.3131 +				{
  1.3132 +				if (stepFrame == testInterface->MdvproStepFrame())
  1.3133 +					{
  1.3134 +					ret = EPass;
  1.3135 +					INFO_PRINTF1(_L("Step frame method call performed as expected"));
  1.3136 +					}
  1.3137 +				else
  1.3138 +					{
  1.3139 +					ret = EFail;					
  1.3140 +					ERR_PRINTF2(_L("Step frame method call failed. Expected stepFrame: %d."), stepFrame);
  1.3141 +					}
  1.3142 +				}	
  1.3143 +			}
  1.3144 +		else
  1.3145 +			{
  1.3146 +			ERR_PRINTF2(_L("Failed to set the step frame: %d."), err);
  1.3147 +			}		
  1.3148 +		}
  1.3149 +	return ret;
  1.3150 +	}
  1.3151 +	
  1.3152 +//------------------------------------------------------------------
  1.3153 +
  1.3154 +CTestDevVideoCiuPlaySetAndGetPlayRateObserver::CTestDevVideoCiuPlaySetAndGetPlayRateObserver(const TDesC& aTestName)
  1.3155 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.3156 +	{
  1.3157 +	}
  1.3158 +
  1.3159 +CTestDevVideoCiuPlaySetAndGetPlayRateObserver* CTestDevVideoCiuPlaySetAndGetPlayRateObserver::NewL(const TDesC& aTestName)
  1.3160 +	{
  1.3161 +	CTestDevVideoCiuPlaySetAndGetPlayRateObserver* self = new(ELeave) CTestDevVideoCiuPlaySetAndGetPlayRateObserver(aTestName);
  1.3162 +	return self;
  1.3163 +	}
  1.3164 +
  1.3165 +TVerdict CTestDevVideoCiuPlaySetAndGetPlayRateObserver::DoTestStepPreambleL()
  1.3166 +	{
  1.3167 +	// Call the base class first
  1.3168 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.3169 +	if (ret == EPass)
  1.3170 +		{
  1.3171 +		// select decoder
  1.3172 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3173 +		
  1.3174 +		if (err != KErrNone)
  1.3175 +			{
  1.3176 +			ret = EInconclusive;
  1.3177 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3178 +			}
  1.3179 +		}
  1.3180 +	return ret;
  1.3181 +	}
  1.3182 +
  1.3183 +TVerdict CTestDevVideoCiuPlaySetAndGetPlayRateObserver::DoTestL()
  1.3184 +	{
  1.3185 +	TVerdict ret = EFail;
  1.3186 +	
  1.3187 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Initialisation"));
  1.3188 +	
  1.3189 +	// Fetch the CI
  1.3190 +	MMmfVideoPlayRateControl* interface = NULL;
  1.3191 +		
  1.3192 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.3193 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3194 +											KUidMmfVideoPlayRateControl));
  1.3195 +	if (!interface)
  1.3196 +		{
  1.3197 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.3198 +		ret = EFail;
  1.3199 +		}
  1.3200 +	else
  1.3201 +		{
  1.3202 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.3203 +	
  1.3204 +		// Set the observer
  1.3205 +		MMmfVideoPlayRateObserver* obs = this;
  1.3206 +		interface->MmvprcSetObserver(*obs);
  1.3207 +		INFO_PRINTF1(_L("MmvprcSetObserver called"));
  1.3208 +		
  1.3209 +		// Verify that the observer was set
  1.3210 +		MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
  1.3211 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3212 +											KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
  1.3213 +		if (!testInterface)
  1.3214 +			{
  1.3215 +			ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.3216 +			ret = EFail;
  1.3217 +			}
  1.3218 +		else
  1.3219 +			{
  1.3220 +			if (obs != testInterface->MdvproObserver())
  1.3221 +				{
  1.3222 +				ERR_PRINTF1(_L("Failed to set the observer."));
  1.3223 +				ret = EFail;
  1.3224 +				}
  1.3225 +			else
  1.3226 +				{			
  1.3227 +				INFO_PRINTF1(_L("SetObserver successfully called"));
  1.3228 +				ret = EPass;
  1.3229 +				}
  1.3230 +			}		
  1.3231 +		}
  1.3232 +	return ret;
  1.3233 +	}
  1.3234 +
  1.3235 +//from MMmfVideoPlayRateObserver
  1.3236 +void CTestDevVideoCiuPlaySetAndGetPlayRateObserver::MmvproStepFrameComplete(TTimeIntervalMicroSeconds /*aTimestamp*/)
  1.3237 +	{}
  1.3238 +		
  1.3239 +void CTestDevVideoCiuPlaySetAndGetPlayRateObserver::MmvproKeyFrameModeRequest()
  1.3240 +	{}
  1.3241 +	
  1.3242 +//------------------------------------------------------------------
  1.3243 +
  1.3244 +CTestDevVideoCiuPlayStepFrameComplete::CTestDevVideoCiuPlayStepFrameComplete(const TDesC& aTestName)
  1.3245 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
  1.3246 +	{
  1.3247 +	}
  1.3248 +
  1.3249 +CTestDevVideoCiuPlayStepFrameComplete* CTestDevVideoCiuPlayStepFrameComplete::NewL(const TDesC& aTestName)
  1.3250 +	{
  1.3251 +	CTestDevVideoCiuPlayStepFrameComplete* self = new(ELeave) CTestDevVideoCiuPlayStepFrameComplete(aTestName);
  1.3252 +	return self;
  1.3253 +	}
  1.3254 +
  1.3255 +TVerdict CTestDevVideoCiuPlayStepFrameComplete::DoTestStepPreambleL()
  1.3256 +	{
  1.3257 +	// Call the base class first
  1.3258 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.3259 +	if (ret == EPass)
  1.3260 +		{
  1.3261 +		// select decoder
  1.3262 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3263 +		
  1.3264 +		if (err != KErrNone)
  1.3265 +			{
  1.3266 +			ret = EInconclusive;
  1.3267 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3268 +			}
  1.3269 +		}
  1.3270 +	return ret;
  1.3271 +	}
  1.3272 +
  1.3273 +TVerdict CTestDevVideoCiuPlayStepFrameComplete::DoTestL()
  1.3274 +	{
  1.3275 +	TVerdict ret = EFail;
  1.3276 +	
  1.3277 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
  1.3278 +	
  1.3279 +	// Fetch the CI
  1.3280 +	MMmfVideoPlayRateControl* interface = NULL;
  1.3281 +	
  1.3282 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.3283 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3284 +									KUidMmfVideoPlayRateControl));
  1.3285 +	if (!interface)
  1.3286 +		{
  1.3287 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.3288 +		ret = EFail;
  1.3289 +		}
  1.3290 +	else
  1.3291 +		{
  1.3292 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.3293 +	
  1.3294 +		// Fetch test interface
  1.3295 +		MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
  1.3296 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>
  1.3297 +											(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3298 +											KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
  1.3299 +		if (!testInterface)
  1.3300 +			{
  1.3301 +			ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.3302 +			ret = EFail;
  1.3303 +			}
  1.3304 +		else
  1.3305 +			{
  1.3306 +			// Set the observer to callback!
  1.3307 +			MMmfVideoPlayRateObserver* obs = this;
  1.3308 +			interface->MmvprcSetObserver(*obs);
  1.3309 +		
  1.3310 +			INFO_PRINTF1(_L("Requesting the step frame complete Callback..."));
  1.3311 +			testInterface->MdvproStepFrameCompleteCallback();
  1.3312 +
  1.3313 +			if ((iError != KErrNone) && (!iCallbackReceived))
  1.3314 +				{	
  1.3315 +				ERR_PRINTF1(_L("Error receiving the step frame complete Callback."));
  1.3316 +				ret = EFail;
  1.3317 +				}
  1.3318 +			else
  1.3319 +				{
  1.3320 +				INFO_PRINTF1(_L("Successfully retrieved the step frame complete Callback"));
  1.3321 +				ret = EPass;
  1.3322 +				}
  1.3323 +			}
  1.3324 +		}
  1.3325 +	return ret;
  1.3326 +	}
  1.3327 +
  1.3328 +//from MMmfVideoPlayRateObserver
  1.3329 +void CTestDevVideoCiuPlayStepFrameComplete::MmvproStepFrameComplete(TTimeIntervalMicroSeconds aTimestamp)
  1.3330 +	{
  1.3331 +	INFO_PRINTF1(_L("Step frame complete callback received. "));
  1.3332 +	// Test h/w sets the time stamp to 10000
  1.3333 +	if (aTimestamp == 10000)
  1.3334 +		{
  1.3335 +		iCallbackReceived = ETrue;
  1.3336 +		iError = KErrNone;
  1.3337 +		}
  1.3338 +	else
  1.3339 +		{
  1.3340 +		iCallbackReceived = ETrue;
  1.3341 +		iError = KErrGeneral;
  1.3342 +		}
  1.3343 +	}
  1.3344 +		
  1.3345 +void CTestDevVideoCiuPlayStepFrameComplete::MmvproKeyFrameModeRequest()
  1.3346 +	{
  1.3347 +	iError = KErrNotSupported;
  1.3348 +	}
  1.3349 +
  1.3350 +//------------------------------------------------------------------
  1.3351 +
  1.3352 +CTestDevVideoCiuPlayKeyFrameModeRequest::CTestDevVideoCiuPlayKeyFrameModeRequest(const TDesC& aTestName)
  1.3353 +	:CTestDevVideoCiuPlayStep(aTestName), iCallbackReceived(EFalse)
  1.3354 +	{
  1.3355 +	}
  1.3356 +
  1.3357 +CTestDevVideoCiuPlayKeyFrameModeRequest* CTestDevVideoCiuPlayKeyFrameModeRequest::NewL(const TDesC& aTestName)
  1.3358 +	{
  1.3359 +	CTestDevVideoCiuPlayKeyFrameModeRequest* self = new(ELeave) CTestDevVideoCiuPlayKeyFrameModeRequest(aTestName);
  1.3360 +	return self;
  1.3361 +	}
  1.3362 +
  1.3363 +TVerdict CTestDevVideoCiuPlayKeyFrameModeRequest::DoTestStepPreambleL()
  1.3364 +	{
  1.3365 +	// Call the base class first
  1.3366 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.3367 +	if (ret == EPass)
  1.3368 +		{
  1.3369 +		// select decoder
  1.3370 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3371 +		
  1.3372 +		if (err != KErrNone)
  1.3373 +			{
  1.3374 +			ret = EInconclusive;
  1.3375 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3376 +			}
  1.3377 +		}
  1.3378 +	return ret;
  1.3379 +	}
  1.3380 +
  1.3381 +TVerdict CTestDevVideoCiuPlayKeyFrameModeRequest::DoTestL()
  1.3382 +	{
  1.3383 +	TVerdict ret = EFail;
  1.3384 +	
  1.3385 +	INFO_PRINTF1(_L("DevVideo CIU Play Rate Control Interface Initialisation"));
  1.3386 +	
  1.3387 +	// Fetch the CI
  1.3388 +	MMmfVideoPlayRateControl* interface = NULL;
  1.3389 +	
  1.3390 +	interface = static_cast<MMmfVideoPlayRateControl*>
  1.3391 +									(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3392 +									KUidMmfVideoPlayRateControl));
  1.3393 +	if (!interface)
  1.3394 +		{
  1.3395 +		ERR_PRINTF1(_L("Error - no interface retrieved for Play Rate"));
  1.3396 +		ret = EFail;
  1.3397 +		}
  1.3398 +	else
  1.3399 +		{
  1.3400 +		INFO_PRINTF1(_L("DevVideo CIU Play Rate Interface Instantiated"));
  1.3401 +	
  1.3402 +		// Fetch test interface
  1.3403 +		MDevVideoCiuTestInterfaceVideoPlayRateControl* testInterface = NULL;
  1.3404 +		testInterface = static_cast<MDevVideoCiuTestInterfaceVideoPlayRateControl*>
  1.3405 +											(iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3406 +											KUidDevVideoCiuTestInterfaceVideoPlayRateControl));
  1.3407 +		if (!testInterface)
  1.3408 +			{
  1.3409 +			ERR_PRINTF1(_L("Failed to create the test interface for Play rate control."));
  1.3410 +			ret = EFail;
  1.3411 +			}
  1.3412 +		else
  1.3413 +			{
  1.3414 +			// Set the observer to callback!
  1.3415 +			MMmfVideoPlayRateObserver* obs = this;
  1.3416 +			interface->MmvprcSetObserver(*obs);
  1.3417 +		
  1.3418 +			INFO_PRINTF1(_L("Requesting the key frame mode request Callback..."));
  1.3419 +			testInterface->MdvproKeyFrameModeRequestCallback();
  1.3420 +
  1.3421 +			if ((iError != KErrNone) && (!iCallbackReceived))
  1.3422 +				{	
  1.3423 +				ERR_PRINTF1(_L("Error receiving the key frame mode request Callback."));
  1.3424 +				ret = EFail;
  1.3425 +				}
  1.3426 +			else
  1.3427 +				{
  1.3428 +				INFO_PRINTF1(_L("Successfully retrieved the key frame mode request Callback"));
  1.3429 +				ret = EPass;
  1.3430 +				}
  1.3431 +			}
  1.3432 +		}
  1.3433 +	return ret;
  1.3434 +	}
  1.3435 +
  1.3436 +//from MMmfVideoPlayRateObserver
  1.3437 +void CTestDevVideoCiuPlayKeyFrameModeRequest::MmvproStepFrameComplete(TTimeIntervalMicroSeconds /*aTimestamp*/)
  1.3438 +	{
  1.3439 +	iError = KErrNotSupported;
  1.3440 +	}
  1.3441 +		
  1.3442 +void CTestDevVideoCiuPlayKeyFrameModeRequest::MmvproKeyFrameModeRequest()
  1.3443 +	{
  1.3444 +	INFO_PRINTF1(_L("Key frame mode request callback received."));
  1.3445 +	iCallbackReceived = ETrue;
  1.3446 +	iError = KErrNone;
  1.3447 +	}
  1.3448 +
  1.3449 +
  1.3450 +//------------------------------------------------------------------
  1.3451 +
  1.3452 +CTestDevVideoCiuHwDeviceTunnel* CTestDevVideoCiuHwDeviceTunnel::NewL(const TDesC& aTestName)
  1.3453 +	{
  1.3454 +	CTestDevVideoCiuHwDeviceTunnel* self = new(ELeave) CTestDevVideoCiuHwDeviceTunnel(aTestName);
  1.3455 +	return self;
  1.3456 +	}
  1.3457 +
  1.3458 +CTestDevVideoCiuHwDeviceTunnel::CTestDevVideoCiuHwDeviceTunnel(const TDesC& aTestName)
  1.3459 +	:CTestDevVideoCiuPlayStep(aTestName)
  1.3460 +	{
  1.3461 +	}
  1.3462 +
  1.3463 +TVerdict CTestDevVideoCiuHwDeviceTunnel::DoTestStepPreambleL()
  1.3464 +	{
  1.3465 +	// Call the base class first
  1.3466 +	TVerdict ret = CTestDevVideoCiuPlayStep::DoTestStepPreambleL();
  1.3467 +	if (ret == EPass)
  1.3468 +		{
  1.3469 +		// select decoder
  1.3470 +		TRAPD(err, iHwDeviceId = iDevVideoPlay->SelectDecoderL(KUidDevVideoCiuTestDecodeHwDevice));
  1.3471 +
  1.3472 +		if (err != KErrNone)
  1.3473 +			{
  1.3474 +			ret = EInconclusive;
  1.3475 +			ERR_PRINTF1(_L("DevVideo Play Failed to select the decoder."));
  1.3476 +			}
  1.3477 +		}
  1.3478 +	return ret;
  1.3479 +	}
  1.3480 +
  1.3481 +TVerdict CTestDevVideoCiuHwDeviceTunnel::DoTestL()
  1.3482 +	{
  1.3483 +	INFO_PRINTF1(_L("DevVideo CIU HwDeviceTunnel Initialisation"));
  1.3484 +
  1.3485 +	// Fetch the CI
  1.3486 +	MMmfVideoHwDeviceTunnel* interface = static_cast<MMmfVideoHwDeviceTunnel*>
  1.3487 +	  (iDevVideoPlay->CustomInterface(iHwDeviceId, KUidMmfVideoHwDeviceTunnel));
  1.3488 +
  1.3489 +	if (!interface)
  1.3490 +		{
  1.3491 +		ERR_PRINTF1(_L("Failed to create interface for HwDevice Tunnel"));
  1.3492 +		return EFail;
  1.3493 +		}
  1.3494 +
  1.3495 +	INFO_PRINTF1(_L("Created interface for HwDevice Tunnel"));
  1.3496 +
  1.3497 +	// Fetch test interface
  1.3498 +	MDevVideoCiuTestInterfaceHwDeviceTunnel* testInterface =
  1.3499 +	  static_cast<MDevVideoCiuTestInterfaceHwDeviceTunnel*>
  1.3500 +	    (iDevVideoPlay->CustomInterface(iHwDeviceId,
  1.3501 +	                                    KUidDevVideoCiuTestInterfaceHwDeviceTunnel));
  1.3502 +	if (!testInterface)
  1.3503 +		{
  1.3504 +		ERR_PRINTF1(_L("Failed to create test interface for HwDevice Tunnel"));
  1.3505 +		return EFail;
  1.3506 +		}
  1.3507 +
  1.3508 +	INFO_PRINTF1(_L("Created test interface for HwDevice Tunnel"));
  1.3509 +
  1.3510 +	CMMFVideoHwDevice* hwDevice = interface->MmvhdtHwDevice();
  1.3511 +	if (hwDevice != reinterpret_cast<CMMFVideoHwDevice*>(0x11111111))
  1.3512 +		{
  1.3513 +		INFO_PRINTF1(_L("MmvhdtHwDevice() failed"));
  1.3514 +		return EFail;
  1.3515 +		}
  1.3516 +
  1.3517 +	INFO_PRINTF1(_L("MmvhdtHwDevice() succeeded"));
  1.3518 +
  1.3519 +	interface->MmvhdtSetupTunnelL(reinterpret_cast<CMMFVideoHwDevice*>(0x22222222));
  1.3520 +
  1.3521 +	hwDevice = testInterface->MhdtHwDevice();
  1.3522 +	if (hwDevice != reinterpret_cast<CMMFVideoHwDevice*>(0x22222222))
  1.3523 +		{
  1.3524 +		INFO_PRINTF1(_L("MmvhdtSetupTunnelL() failed"));
  1.3525 +		return EFail;
  1.3526 +		}
  1.3527 +
  1.3528 +	INFO_PRINTF1(_L("MmvhdtSetupTunnelL() succeeded"));
  1.3529 +
  1.3530 +	return EPass;
  1.3531 +	}