os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/extended_functionality.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // extendedfunctionality.cpp
    15 // 
    16 //
    17 
    18 #include "extended_functionality.h"
    19 #include "AdvancedSettings.h"
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    21 #include <ecamcapturecontrolconst.h>
    22 #include <ecamviewfinderdef.h>
    23 #include "ecamdef.h"
    24 #endif
    25 
    26 //
    27 //pre image capture control impl
    28 CCamPreImageCaptureControl* CCamPreImageCaptureControl::NewL(CCamUnitTestPlugin& aOwner)
    29 	{
    30 	return new(ELeave) CCamPreImageCaptureControl(aOwner);
    31 	}
    32 
    33 CCamPreImageCaptureControl::CCamPreImageCaptureControl(CCamUnitTestPlugin& aOwner): iOwner(aOwner),
    34 																					iPreImageCaptureControlObserver(NULL)
    35 	{
    36 	}
    37 	
    38 CCamPreImageCaptureControl::~CCamPreImageCaptureControl()
    39 	{
    40 	}
    41 	
    42 void CCamPreImageCaptureControl::Release()
    43 	{	
    44 	delete this;
    45 	}
    46 	
    47 void CCamPreImageCaptureControl::SetPreImageCaptureControlObserver(MPreImageCaptureControlObserver& aPreImageCaptureControlObserver)
    48 	{
    49 	iPreImageCaptureControlObserver = &aPreImageCaptureControlObserver;
    50 	}
    51 	
    52 void CCamPreImageCaptureControl::GetDirectSnapshotSupportInfoL(TUint& aDirectSnapshotSupportInfo) const
    53 	{
    54 	aDirectSnapshotSupportInfo = CCamera::CCameraPreImageCaptureControl::EDirectSnapshotSupported;
    55 	}
    56 	
    57 void CCamPreImageCaptureControl::GetSupportedEmbeddedStillCaptureSettingsL(RArray<TUid>& aSupportedEmbeddedStillCaptureSettings) const
    58 	{
    59 	aSupportedEmbeddedStillCaptureSettings.Reset();
    60 	}
    61 	
    62 void CCamPreImageCaptureControl::GetSupportedDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aSupportedDirectSavingType) const
    63 	{
    64 	aSupportedDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed;
    65 	}
    66 	
    67 void CCamPreImageCaptureControl::SetSequentialImageFilenameL(const TDesC8& /*aFilename*/, TInt /*aStartingSequenceNumber*/)
    68 	{
    69 	User::Leave(KErrNotSupported);
    70 	}
    71 	
    72 void CCamPreImageCaptureControl::SetLowerResolutionSequentialImageFilenameL(const TDesC8& /*aLowerResolutionFilename*/, TInt /*aStartingSequenceNumber*/)
    73 	{
    74 	User::Leave(KErrNotSupported);
    75 	}
    76 	
    77 void CCamPreImageCaptureControl::GetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aDirectSavingType) const
    78 	{
    79 	aDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed;	
    80 	}
    81 	
    82 void CCamPreImageCaptureControl::SetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType /*aDirectSavingType*/)
    83 	{
    84 	User::Leave(KErrNotSupported);
    85 	}
    86 	
    87 void CCamPreImageCaptureControl::GetCaptureEventSupportInfoL(TUint& aSupportedDriveModes) const
    88 	{
    89 	aSupportedDriveModes = 0; 	
    90 	}
    91 	
    92 void CCamPreImageCaptureControl::GetImageFormatsSupportedL(TUint& aImageFormatsSupported, const TSize& /*aSize*/) const
    93 	{
    94 	aImageFormatsSupported = CCamera::EFormatFbsBitmapColor16M;
    95 	}
    96 	
    97 void CCamPreImageCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aImageFormat*/, const TSize& /*aSize*/) const
    98 	{
    99 	aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1;
   100 	}
   101 	
   102 void CCamPreImageCaptureControl::PrepareImageCapture(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& 
   103 								aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver)
   104 	{
   105 	//perform any prepare operation at hardware level eg. memory allocation etc.
   106 	CCamera::CCameraImageCapture* cameraImageCapture = NULL;
   107 	
   108 	TRAPD(err,CreateCaptureImageL(cameraImageCapture, aPrepareImageParameters, aCaptureImageObserver));
   109 	
   110 	PreImageCaptureControlObserver()->PrepareImageComplete(cameraImageCapture, err);
   111 	}
   112 	
   113 void CCamPreImageCaptureControl::GetImageMaxMemorySizeSettingSupportInfoL(TBool& aIsImageMaxMemorySizeSettingSupported) const
   114 	{
   115 	aIsImageMaxMemorySizeSettingSupported = EFalse;
   116 	}
   117 	
   118 void CCamPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& /*aMemorySize*/) const
   119 	{
   120 	User::Leave(KErrNotSupported);
   121 	}
   122 
   123 void CCamPreImageCaptureControl::GetSupportedProcessingOptionsL(TUint& /*aSupportedProcessingOptions*/) const
   124 	{
   125 	User::Leave(KErrNotSupported);
   126 	}
   127 
   128 void CCamPreImageCaptureControl::CreateCaptureImageL(CCamera::CCameraImageCapture*& aCameraImageCapture, const CCamera::
   129 		CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver)
   130 	{
   131 	CCamera::CCameraImageCapture* cameraImageCapture = CCamera::CCameraImageCapture::CreateL(iOwner, aPrepareImageParameters, aCaptureImageObserver);
   132 	aCameraImageCapture = cameraImageCapture;
   133 	}
   134 
   135 //
   136 //image capture impl
   137 CCamImageCapture* CCamImageCapture::NewL(CCamUnitTestPlugin& aOwner)
   138 	{
   139 	return new(ELeave) CCamImageCapture(aOwner);
   140 	}
   141 	
   142 CCamImageCapture::CCamImageCapture(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), 
   143 																 iCaptureImageObserver(NULL), 
   144 																 iSnapshotImpForImage(NULL),
   145 																 iCamImgProcImpForImage(NULL),
   146 																 iCameraImageCapture(NULL)
   147 	{
   148 	iArrayPostCaptureControlId.Reset();
   149 	iArrayPostCaptureControlHandle.Reset();
   150 	iArrayPostCaptureControlImpl.Reset();
   151 	}
   152 	
   153 CCamImageCapture::~CCamImageCapture()
   154 	{
   155 	iArrayPostCaptureControlId.Close();
   156 	iArrayPostCaptureControlHandle.Reset();
   157 	iArrayPostCaptureControlImpl.Reset();
   158 	iArrayPostCaptureControlHandle.Close();
   159 	iArrayPostCaptureControlImpl.Close();
   160 	}
   161 	
   162 void CCamImageCapture::Release(CCamera::CCameraImageCapture* /*aCameraImageCapture*/)
   163 	{
   164 	delete this;
   165 	}
   166 	
   167 void CCamImageCapture::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   168 	{
   169 	aImplFactoryPtr	= CHistogramFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this));
   170 	}
   171 	
   172 void CCamImageCapture::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   173 	{
   174 	aImplFactoryPtr = CSnapshotFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this), iSnapshotImpForImage);
   175 	}
   176 	
   177 void CCamImageCapture::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   178 	{
   179 	aImplFactoryPtr = CImgProcFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this), iCamImgProcImpForImage);
   180 	}
   181 	
   182 void CCamImageCapture::SetCaptureImageObserver(MCaptureImageObserver& aCaptureImageObserver)
   183 	{
   184 	iCaptureImageObserver = &aCaptureImageObserver;
   185 	}
   186 
   187 void CCamImageCapture::GetPrepareImageParametersL(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) const
   188 	{
   189 	if(aPrepareImageParameters.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters) ||
   190 		aPrepareImageParameters.Version() != KECamPrepareImageParametersCurrentVersion)
   191 		{
   192 		User::Leave(KErrNotSupported);
   193 		}
   194 
   195 	if(aPrepareImageParameters.iDriveModeAttributes.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TDriveModeDependentAttributes) ||
   196 		aPrepareImageParameters.iDriveModeAttributes.Version() != KECamDriveModeDependentAttributesCurrentVersion)
   197 		{
   198 		User::Leave(KErrNotSupported);
   199 		}
   200 
   201 	aPrepareImageParameters = iPrepareImageParameters;
   202 	}
   203 	
   204 void CCamImageCapture::SetPrepareImageParameters(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters)
   205 	{
   206 	iPrepareImageParameters = aPrepareImageParameters;
   207 	}
   208 	
   209 TAny* CCamImageCapture::CreatePostImageCaptureControlImpl(TUid aInterface, TPostCaptureControlId aPostCaptureControlId)
   210 	{
   211 	TInt err=KErrNone;
   212 	if(aInterface.iUid == KECamMCameraPostImageCaptureControlUidValue)
   213 		{
   214 		if(iArrayPostCaptureControlId.Find(aPostCaptureControlId) == KErrNotFound)
   215 			{
   216 			CCamPostImageCaptureControl* camPostImageCaptureControl = NULL;
   217 			TRAP(err, camPostImageCaptureControl = CCamPostImageCaptureControl::NewL(const_cast<CCamImageCapture&>(*this)));
   218 			
   219 			if (err == KErrNone)
   220 				{
   221 				err = iArrayPostCaptureControlId.Append(aPostCaptureControlId);
   222 				if(err == KErrNone)
   223 					{
   224 					err = iArrayPostCaptureControlImpl.Append(camPostImageCaptureControl);
   225 					if(err != KErrNone)
   226 						{
   227 						iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1);
   228 						delete camPostImageCaptureControl;
   229 						return NULL;
   230 						}
   231 					else
   232 						{
   233 						return static_cast<MCameraPostImageCaptureControl*>(camPostImageCaptureControl);	
   234 						}
   235 					}
   236 				else
   237 					{
   238 					delete camPostImageCaptureControl;
   239 					return NULL;	
   240 					}
   241 				}
   242 			else
   243 				{
   244 				return NULL;
   245 				}
   246 			}
   247 		else
   248 			{
   249 			return NULL;
   250 			}
   251 		}
   252 	else
   253 		{
   254 		return NULL;
   255 		}	
   256 	}
   257 	
   258 void CCamImageCapture::CaptureImage(CCamera::CCameraImageCapture* aCameraImageCapture)
   259 	{
   260 	TInt count = iArrayPostCaptureControlId.Count();
   261 	while(count > 0)
   262 		{
   263 		iArrayPostCaptureControlId.Remove(count-1);
   264 		iArrayPostCaptureControlImpl.Remove(count-1);
   265 		delete iArrayPostCaptureControlHandle[count-1];
   266 		iArrayPostCaptureControlHandle.Remove(count-1);
   267 				
   268 		count = iArrayPostCaptureControlId.Count();
   269 		}
   270 	
   271 	iCameraImageCapture = aCameraImageCapture;
   272 	
   273 	//this will create Post Image capture control object. assume one such object is required. ( for demo purpose only)
   274 	CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = NULL;
   275 	
   276 	TRAPD(err,CreatePostImageCaptureControlL(postImageCaptureControl, 1));
   277 	
   278 	if(err == KErrNone)
   279 		{
   280 		err = iArrayPostCaptureControlHandle.Append(postImageCaptureControl);
   281 		if(err != KErrNone)
   282 			{
   283 			iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1);
   284 			iArrayPostCaptureControlImpl.Remove(iArrayPostCaptureControlImpl.Count()-1);
   285 			delete postImageCaptureControl;
   286 			}
   287 		else
   288 			{
   289 			CaptureImageObserver()->IndividualImageControlHandle(*iCameraImageCapture, 1);
   290 			}
   291 		}
   292 	
   293 	CaptureImageObserver()->ImageCaptureComplete(*iCameraImageCapture, KErrNotSupported);
   294 	}
   295 	
   296 void CCamImageCapture::CancelCaptureImage()
   297 	{
   298 	return;
   299 	}
   300 	
   301 void CCamImageCapture::GetNumImagesExposedL(TUint& /*aNumImagesExposed*/) const
   302 	{
   303 	User::Leave(KErrNotSupported);
   304 	}
   305 	
   306 void CCamImageCapture::GetNumTotalImagesL(TUint& aNumTotalImages) const
   307 	{
   308 	aNumTotalImages = 1;	
   309 	}
   310 	
   311 void CCamImageCapture::GetPostCaptureControlHandleL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle, 
   312 									TPostCaptureControlId aPostCaptureControlId) const
   313 	{
   314 	TInt index = iArrayPostCaptureControlId.Find(aPostCaptureControlId);
   315 	User::LeaveIfError(index);
   316 	
   317 	aPostCaptureControlHandle = iArrayPostCaptureControlHandle[index];
   318 	}
   319 	
   320 void CCamImageCapture::SetCaptureImagePriorityL(TECamImagePriority /*aCaptureImagePriority*/)
   321 	{
   322 	User::Leave(KErrNotSupported);
   323 	}
   324 	
   325 void CCamImageCapture::GetCaptureImagePriorityL(TECamImagePriority& /*aCaptureImagePriority*/) const
   326 	{
   327 	User::Leave(KErrNotSupported);	
   328 	}
   329 	
   330 void CCamImageCapture::PauseProcessing(TUint /*aProcessingType*/)
   331 	{
   332 	return;
   333 	}
   334 	
   335 void CCamImageCapture::ResumeProcessingL(TUint /*aProcessingType*/)
   336 	{
   337 	User::Leave(KErrNotSupported);
   338 	}
   339 	
   340 void CCamImageCapture::CreatePostImageCaptureControlL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle, 
   341 						TPostCaptureControlId aPostCaptureControlId)
   342 	{
   343 	CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = CCamera::CCameraPostImageCaptureControl::
   344 					CreateL(iCameraImageCapture, aPostCaptureControlId);
   345 					
   346 	aPostCaptureControlHandle = postImageCaptureControl;
   347 	}
   348 	
   349 //
   350 //post image capture control impl
   351 
   352 CCamPostImageCaptureControl* CCamPostImageCaptureControl::NewL(CCamImageCapture& aCamImageCaptureImpl)
   353 	{
   354 	return new(ELeave) CCamPostImageCaptureControl(aCamImageCaptureImpl);
   355 	}
   356 	
   357 CCamPostImageCaptureControl::CCamPostImageCaptureControl(CCamImageCapture& aCamImageCaptureImpl) : 
   358 													iCamImageCaptureImpl(aCamImageCaptureImpl)
   359 	{
   360 	}
   361 	
   362 CCamPostImageCaptureControl::~CCamPostImageCaptureControl()
   363 	{
   364 	}
   365 	
   366 void CCamPostImageCaptureControl::Release(TPostCaptureControlId aPostCaptureControlId)
   367 	{
   368 	//remove this id from the CCamImageCapture arrays
   369 	TInt index = iCamImageCaptureImpl.iArrayPostCaptureControlId.Find(aPostCaptureControlId);
   370 	
   371 	if(index >=0 )
   372 		{
   373 		iCamImageCaptureImpl.iArrayPostCaptureControlId.Remove(index);
   374 		iCamImageCaptureImpl.iArrayPostCaptureControlImpl.Remove(index);
   375 		iCamImageCaptureImpl.iArrayPostCaptureControlHandle.Remove(index);
   376 		}
   377 	
   378 	delete this;
   379 	}
   380 	
   381 void CCamPostImageCaptureControl::GetImageSequenceNumberL(TUint& /*aSequenceNumber*/) const
   382 	{
   383 	User::Leave(KErrNotSupported);
   384 	}
   385 	
   386 void CCamPostImageCaptureControl::CancelImage()
   387 	{
   388 	return;
   389 	}
   390 	
   391 void CCamPostImageCaptureControl::SetImagePriorityL(TECamImagePriority /*aImagePriority*/)
   392 	{
   393 	User::Leave(KErrNotSupported);
   394 	}
   395 	
   396 void CCamPostImageCaptureControl::GetImagePriorityL(TECamImagePriority& /*aImagePriority*/) const
   397 	{
   398 	User::Leave(KErrNotSupported);	
   399 	}
   400 	
   401 void CCamPostImageCaptureControl::PauseProcessing(TUint /*aProcessingType*/)
   402 	{
   403 	return;
   404 	}
   405 	
   406 void CCamPostImageCaptureControl::ResumeProcessingL(TUint /*aProcessingType*/)
   407 	{
   408 	User::Leave(KErrNotSupported);
   409 	}
   410 	
   411 void CCamPostImageCaptureControl::GetImageBufferL(MCameraImageBuffer& /*aCameraImageBuffer*/) const
   412 	{
   413 	User::Leave(KErrNotSupported);		
   414 	}
   415 	
   416 void CCamPostImageCaptureControl::GetImageStateL(CCamera::CCameraPostImageCaptureControl::TImageState& /*aImageState*/) const
   417 	{
   418 	User::Leave(KErrNotSupported);	
   419 	}
   420 	
   421 void CCamPostImageCaptureControl::GetBufferStateL(CCamera::CCameraPostImageCaptureControl::TBufferState& /*aBufferState*/) const
   422 	{
   423 	User::Leave(KErrNotSupported);		
   424 	}
   425 	
   426 //
   427 //video capture control impl
   428 
   429 CCamVideoCaptureControl* CCamVideoCaptureControl::NewL(CCamUnitTestPlugin& aOwner)
   430 	{
   431 	CCamVideoCaptureControl* self = new(ELeave) CCamVideoCaptureControl(aOwner);
   432 	CleanupStack::PushL(self);
   433 	self->ConstructL();
   434 	CleanupStack::Pop();
   435 	return self;
   436 	}
   437 
   438 void CCamVideoCaptureControl::ConstructL()
   439 	{
   440 	User::LeaveIfError(RFbsSession::Connect());
   441 	
   442 	iBitmap = new(ELeave) CFbsBitmap;
   443 	User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
   444 	}
   445 
   446 CCamVideoCaptureControl::CCamVideoCaptureControl(CCamUnitTestPlugin& aOwner) : 
   447 																iOwner(aOwner),
   448 																iCaptureVideoObserver(NULL),
   449 																iSnapshotImpForVideo(NULL)
   450 	{
   451 	}
   452 	
   453 CCamVideoCaptureControl::~CCamVideoCaptureControl()
   454 	{
   455 	delete iBitmap;
   456 	RFbsSession::Disconnect();
   457 	}
   458 	
   459 void CCamVideoCaptureControl::Release()
   460 	{
   461 	delete this;
   462 	}
   463 	
   464 void CCamVideoCaptureControl::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   465 	{
   466 	aImplFactoryPtr	= CHistogramFactoryForVideo::NewL(const_cast<CCamVideoCaptureControl&>(*this));
   467 	}
   468 	
   469 void CCamVideoCaptureControl::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   470 	{
   471 	aImplFactoryPtr = CSnapshotFactoryForVideo::NewL(const_cast<CCamVideoCaptureControl&>(*this), iSnapshotImpForVideo);
   472 	}
   473 	
   474 void CCamVideoCaptureControl::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   475 	{
   476 	aImplFactoryPtr = NULL;
   477 	User::Leave(KErrNotSupported);	
   478 	}
   479 	
   480 void CCamVideoCaptureControl::SetCaptureVideoObserver(MCaptureVideoObserver& aCaptureVideoObserver)
   481 	{
   482 	iCaptureVideoObserver = &aCaptureVideoObserver;
   483 	}
   484 	
   485 void CCamVideoCaptureControl::GetVideoFormatsSupportedL(TUint& aVideoFormatsSupported, const TSize& /*aSize*/) const
   486 	{
   487 	aVideoFormatsSupported = CCamera::EFormatFbsBitmapColor16M;	
   488 	}
   489 	
   490 void CCamVideoCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aVideoFormat*/, const TSize& /*aSize*/) const
   491 	{
   492 	aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1;	
   493 	}
   494 	
   495 void CCamVideoCaptureControl::GetEmbeddedStillCaptureSupportInfoL(TInt& aSupportedEmbeddedStillCaptureTypes) const
   496 	{
   497 	aSupportedEmbeddedStillCaptureTypes = CCamera::CCameraVideoCaptureControl::EEmbeddedStillCaptureNotSupported;
   498 	}
   499 	
   500 void CCamVideoCaptureControl::PrepareVideoCapture(const CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters)
   501 	{
   502 	if(((aPrepareVideoParameters.Size() != sizeof(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters)) ||
   503 		aPrepareVideoParameters.Version() != KECamPrepareVideoParametersCurrentVersion))
   504 		{
   505 		iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNotSupported);
   506 		}
   507 	
   508 	iPrepareVideoParameters = aPrepareVideoParameters;
   509 	
   510 	iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNone);
   511 	}
   512 	
   513 void CCamVideoCaptureControl::GetRangeAffectedSettingsL(RArray<TUid>& aRangeAffectedSettings) const
   514 	{
   515 	aRangeAffectedSettings.Reset();	
   516 	}
   517 	
   518 void CCamVideoCaptureControl::GetValueAffectedSettingsL(RArray<TUid>& aValueAffectedSettings) const
   519 	{
   520 	aValueAffectedSettings.Reset();	
   521 	}
   522 	
   523 void CCamVideoCaptureControl::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const
   524 	{
   525 	aDisabledSettings.Reset();	
   526 	}
   527 	
   528 void CCamVideoCaptureControl::ReleaseVideoResource()
   529 	{
   530 	return;
   531 	}
   532 	
   533 void CCamVideoCaptureControl::StartVideoCaptureL()
   534 	{
   535 	RCamBuffer2 videoBuffer(iBitmap);
   536 	
   537 	if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EVideoCaptureNotSupported)
   538 		{
   539 		CaptureVideoObserver()->DirectVideoCaptureFailed(KErrNotSupported);
   540 		}
   541 	else
   542 		{
   543 		if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EClientVideoCapture)	
   544 			{
   545 			CaptureVideoObserver()->VideoBufferReady(NULL, KErrNotSupported);	
   546 			}
   547 		}
   548 	}
   549 	
   550 void CCamVideoCaptureControl::StopVideoCapture()
   551 	{
   552 	}
   553 	
   554 void CCamVideoCaptureControl::PauseVideoCapture()
   555 	{
   556 	return;
   557 	}
   558 
   559 void CCamVideoCaptureControl::ResumeVideoCaptureL()
   560 	{
   561 	User::Leave(KErrNotSupported);
   562 	}
   563 	
   564 void CCamVideoCaptureControl::GetFadingEffectStateL(CCamera::CCameraVideoCaptureControl::TFadingEffectState& /*aFadingEffectState*/) const
   565 	{
   566 	User::Leave(KErrNotSupported);	
   567 	}
   568 
   569 void CCamVideoCaptureControl::SetFadingEffectState(CCamera::CCameraVideoCaptureControl::TFadingEffectState /*aFadingEffectState*/)
   570 	{
   571 	iOwner.Notify(KUidECamEventVideoCaptureControlFadingEffect, KErrNotSupported);
   572 	}
   573 
   574 void CCamVideoCaptureControl::GetVideoCaptureStateL(CCamera::CCameraVideoCaptureControl::TVideoCaptureState& /*aVideoCaptureState*/) const
   575 	{
   576 	User::Leave(KErrNotSupported);	
   577 	}
   578 	
   579 void CCamVideoCaptureControl::GetVideoCaptureSupportInfoL(TInt& aSupportedVideoCaptureTypes) const
   580 	{
   581 	aSupportedVideoCaptureTypes = KSupportedDirectVCType;	
   582 	}
   583 	
   584 void CCamVideoCaptureControl::GetPrepareVideoParametersL(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters) const
   585 	{
   586 	aPrepareVideoParameters = iPrepareVideoParameters;
   587 	}
   588 
   589 	
   590 //
   591 //Direct Snapshot impl for version2 direct viewfinder
   592 //
   593 CCamDirectSnapshot::CCamDirectSnapshot() : iCameraV2DirectVF(NULL), 
   594 										   iDirectSnapshotState(CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled)
   595 	{
   596 	}
   597 
   598 CCamDirectSnapshot* CCamDirectSnapshot::NewL()
   599 	{
   600 	return new (ELeave) CCamDirectSnapshot;
   601 	}
   602 	
   603 CCamDirectSnapshot::~CCamDirectSnapshot()
   604 	{
   605 	}
   606 	
   607 void CCamDirectSnapshot::Release()
   608 	{
   609 	delete this;
   610 	}
   611 
   612 void CCamDirectSnapshot::SetDirectViewFinder(const CCamera::CCameraV2DirectViewFinder* aDirectViewFinder)
   613 	{
   614 	iCameraV2DirectVF = aDirectViewFinder;
   615 	}
   616 	
   617 void CCamDirectSnapshot::GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const
   618 	{
   619 	aDirectViewFinder = const_cast<CCamera::CCameraV2DirectViewFinder*>(iCameraV2DirectVF);
   620 	}
   621 	
   622 void CCamDirectSnapshot::EnableDirectSnapshotL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
   623 	{
   624 	iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotEnabled;
   625 	iDirectSnapshotParameters = aDirectSnapshotParameters;
   626 	}
   627 	
   628 void CCamDirectSnapshot::DisableDirectSnapshot()
   629 	{
   630 	iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled;
   631 	}
   632 	
   633 void CCamDirectSnapshot::GetDirectSnapshotStateL(CCamera::CCameraDirectSnapshot::TDirectSnapshotState& aDirectSnapshotState) const
   634 	{
   635 	aDirectSnapshotState = iDirectSnapshotState;
   636 	}
   637 	
   638 void CCamDirectSnapshot::GetDirectSnapshotParametersL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) const
   639 	{
   640 	aDirectSnapshotParameters = iDirectSnapshotParameters;	
   641 	}
   642 	
   643 void CCamDirectSnapshot::SetDirectSnapshotParametersL(const CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
   644 	{
   645 	iDirectSnapshotParameters = aDirectSnapshotParameters;
   646 	}
   647 		
   648 //
   649 //V2 direct viewfinder impl
   650 //
   651 CCamV2DirectViewFinder* CCamV2DirectViewFinder::NewL(CCamUnitTestPlugin& aOwner)
   652 	{
   653 	CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
   654 	
   655 	if(!globalData)
   656 		{
   657 		globalData = new (ELeave) CDataGlobal;
   658 		CleanupStack::PushL(globalData);
   659 		
   660 		globalData->iReferenceCount = 0;
   661 		globalData->iCamV2DirectViewFinder = new (ELeave) CCamV2DirectViewFinder(aOwner);
   662     	globalData->iCamV2DirectViewFinder->iRefCount = 1;
   663     	
   664     	TInt error = Dll::SetTls(globalData);
   665 		if (error)
   666 			{
   667 			delete globalData->iCamV2DirectViewFinder;
   668 			User::Leave(error);
   669 			}
   670 		CleanupStack::Pop(globalData);
   671     	
   672 		return static_cast <CCamV2DirectViewFinder*> (globalData->iCamV2DirectViewFinder);
   673 		}
   674 	else
   675 		{
   676 		CCamV2DirectViewFinder* self = globalData->iCamV2DirectViewFinder;
   677 		
   678 		globalData->iReferenceCount++;
   679 		self->iRefCount = globalData->iReferenceCount + 1;
   680 		if (globalData->iReferenceCount == 1)
   681 			{
   682 			delete globalData;
   683 			Dll::FreeTls();
   684 			}
   685 		else
   686 			{
   687 	    	TInt error = Dll::SetTls(globalData);
   688 			if (error)
   689 				{
   690 				delete globalData->iCamV2DirectViewFinder;
   691 				User::Leave(error);
   692 				}	
   693 			}
   694 		return static_cast <CCamV2DirectViewFinder*> (self);		
   695 		}
   696 	 }
   697 	
   698 CCamV2DirectViewFinder::CCamV2DirectViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0), iDirectSnapshot(NULL)
   699 	{
   700 	//dummy scheme or impl dependent scheme
   701 	//server may generate unique handle no. for each such objects
   702 	iOwner.GenerateVFHandle(iVFHandle);
   703 	}
   704 
   705 CCamV2DirectViewFinder::~CCamV2DirectViewFinder()
   706 	{
   707 	Dll::FreeTls();
   708 	}
   709 	
   710 void CCamV2DirectViewFinder::Release(CCamera::CCameraV2DirectViewFinder* /*aDirectViewFinderHandle*/)
   711 	{
   712 	iRefCount--; 
   713 	if(!iRefCount)
   714 		{
   715 		delete this;
   716 		}
   717 	}
   718 	
   719 void CCamV2DirectViewFinder::Release()
   720 	{
   721 	iRefCount--; 
   722 	if(!iRefCount)
   723 		{
   724 		delete this;
   725 		}
   726 	}
   727 	
   728 void CCamV2DirectViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const
   729 	{
   730 	if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) ||
   731 		(aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion))
   732 		{
   733 		User::Leave(KErrNotSupported);
   734 		}
   735 	User::Leave(KErrNotSupported);
   736 	}
   737 	
   738 void CCamV2DirectViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const
   739 	{
   740 	if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) ||
   741 		(aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion))
   742 		{
   743 		User::Leave(KErrNotSupported);
   744 		}
   745 	User::Leave(KErrNotSupported);	
   746 	}
   747 	
   748 void CCamV2DirectViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/)
   749 	{
   750 	iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle);
   751 	}
   752 
   753 void CCamV2DirectViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const
   754 	{
   755 	aVFHandle = iVFHandle;
   756 	}
   757 	
   758 void CCamV2DirectViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   759 	{
   760 	aImplFactoryPtr	= CHistogramFactoryForDirectViewFinder::NewL(const_cast<CCamV2DirectViewFinder&>(*this));
   761 	}
   762 	
   763 void CCamV2DirectViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   764 	{
   765 	aImplFactoryPtr = NULL;	
   766 	User::Leave(KErrNotSupported);
   767 	}
   768 
   769 void CCamV2DirectViewFinder::SetDirectViewFinderObserver(MDirectViewFinderObserver& aDirectViewFinderObserver)
   770 	{
   771 	iDirectViewFinderObserver = &aDirectViewFinderObserver;
   772 	}
   773 	
   774 void CCamV2DirectViewFinder::SetDirectViewFinderHandle(CCamera::CCameraV2DirectViewFinder* aDirectViewFinderHandle)
   775 	{
   776 	iDirectViewFinderHandle = aDirectViewFinderHandle;
   777 	}
   778 	
   779 void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/)
   780 	{
   781 	DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
   782 	}
   783 	
   784 void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/)
   785 	{
   786 	DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
   787 	}
   788 	
   789 void CCamV2DirectViewFinder::GetDirectViewFinderPropertiesL(TInt& /*aScreenNumber*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/) const
   790 	{
   791 	User::Leave(KErrNotSupported);		
   792 	}
   793 
   794 void CCamV2DirectViewFinder::PauseViewFinderDirect()
   795 	{
   796 	return;
   797 	}
   798 	
   799 void CCamV2DirectViewFinder::ResumeViewFinderDirect()
   800 	{
   801 	DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
   802 	}
   803 
   804 void CCamV2DirectViewFinder::GetViewFinderStateL(CCamera::CCameraV2DirectViewFinder::TViewFinderState& /*aViewFinderState*/) const
   805 	{
   806 	User::Leave(KErrNotSupported);		
   807 	}
   808 	
   809 void CCamV2DirectViewFinder::StopDirectViewFinder()
   810 	{
   811 	return;
   812 	}
   813 	
   814 /* Dummy test*/
   815 TAny* CCamV2DirectViewFinder::GetDirectSnapshotImpl(TUid aInterface) const
   816 	{
   817 	switch(aInterface.iUid)
   818 		{
   819 		case KECamMCameraDirectSnapshotUidValue:
   820 			{
   821 			if(iDirectSnapshot == NULL)	
   822 				{
   823 				TRAPD(err,iDirectSnapshot = CCamDirectSnapshot::NewL());
   824 				if (err != KErrNone)	
   825 					{
   826 					return NULL;
   827 					}
   828 				}
   829 			return static_cast<MCameraDirectSnapshot*>(iDirectSnapshot); 
   830 			}
   831 		default:
   832 			return NULL;
   833 		}
   834 	}
   835 	
   836 //
   837 //Client viewfinder impl	
   838 CCamClientViewFinder* CCamClientViewFinder::NewL(CCamUnitTestPlugin& aOwner)
   839 	{
   840 	CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
   841 	
   842 	if(!globalData)
   843 		{
   844 		globalData = new (ELeave) CDataGlobal;
   845 		CleanupStack::PushL(globalData);
   846 		
   847 		globalData->iReferenceCount = 0;
   848 		globalData->iCamClientViewFinder = new (ELeave) CCamClientViewFinder(aOwner);
   849     	globalData->iCamClientViewFinder->iRefCount = 1;
   850     	
   851 		TInt error = Dll::SetTls(globalData);
   852 		if (error)
   853 			{
   854 			delete globalData->iCamClientViewFinder;
   855 			User::Leave(error);
   856 			}
   857 		CleanupStack::Pop(globalData);
   858     	
   859 		return static_cast <CCamClientViewFinder*> (globalData->iCamClientViewFinder);
   860 		}
   861 	else
   862 		{
   863 		CCamClientViewFinder* self = globalData->iCamClientViewFinder;
   864 		
   865 		globalData->iReferenceCount++;
   866 		self->iRefCount = globalData->iReferenceCount + 1;
   867 		if (globalData->iReferenceCount == 1)
   868 			{
   869 			delete globalData;
   870 			Dll::FreeTls();
   871 			}
   872 		else
   873 			{
   874 			TInt error = Dll::SetTls(globalData);
   875 			if (error)
   876 				{
   877 				delete globalData->iCamClientViewFinder;
   878 				User::Leave(error);
   879 				}	
   880 			}
   881 		return static_cast <CCamClientViewFinder*> (self);		
   882 		}
   883 	}
   884 	
   885 CCamClientViewFinder::CCamClientViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0)
   886 	{
   887 	//dummy scheme or impl dependent scheme
   888 	//server may generate unique handle no. for each such objects
   889 	iOwner.GenerateVFHandle(iVFHandle);
   890 	}
   891 
   892 CCamClientViewFinder::~CCamClientViewFinder()
   893 	{
   894 	Dll::FreeTls();
   895 	}
   896 	
   897 void CCamClientViewFinder::Release(CCamera::CCameraClientViewFinder* /*aClientViewFinderHandle*/)
   898 	{
   899 	iRefCount--; 
   900 	if(!iRefCount)
   901 		{
   902 		delete this;
   903 		}
   904 	}
   905 	
   906 void CCamClientViewFinder::Release()
   907 	{
   908 	iRefCount--; 
   909 	if(!iRefCount)
   910 		{
   911 		delete this;
   912 		}
   913 	}
   914 
   915 void CCamClientViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const
   916 	{
   917 	if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) ||
   918 		(aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion))
   919 		{
   920 		User::Leave(KErrNotSupported);
   921 		}
   922 	User::Leave(KErrNotSupported);
   923 	}
   924 	
   925 void CCamClientViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const
   926 	{
   927 	if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) ||
   928 		(aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion))
   929 		{
   930 		User::Leave(KErrNotSupported);
   931 		}
   932 	User::Leave(KErrNotSupported);
   933 	}
   934 	
   935 void CCamClientViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/)
   936 	{
   937 	iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle);
   938 	}
   939 
   940 void CCamClientViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const
   941 	{
   942 	aVFHandle = iVFHandle;
   943 	}
   944 	
   945 void CCamClientViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   946 	{
   947 	aImplFactoryPtr	= CHistogramFactoryForClientViewFinder::NewL(const_cast<CCamClientViewFinder&>(*this));
   948 	}
   949 	
   950 void CCamClientViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
   951 	{
   952 	aImplFactoryPtr = NULL;
   953 	User::Leave(KErrNotSupported);
   954 	}
   955 	
   956 void CCamClientViewFinder::SetClientViewFinderObserver(MClientViewFinderObserver& aClientViewFinderObserver)
   957 	{
   958 	iClientViewFinderObserver = &aClientViewFinderObserver;
   959 	}
   960 	
   961 void CCamClientViewFinder::SetClientViewFinderHandle(CCamera::CCameraClientViewFinder* aClientViewFinderHandle)
   962 	{
   963 	iClientViewFinderHandle = aClientViewFinderHandle;
   964 	}
   965 	
   966 void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/)
   967 	{
   968 	ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported);
   969 	}
   970 	
   971 void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/)
   972 	{
   973 	ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported);
   974 	}
   975 	
   976 void CCamClientViewFinder::GetClientViewFinderStateL(TBool& /*aIsActive*/) const
   977 	{
   978 	User::Leave(KErrNotSupported);
   979 	}
   980 	
   981 void CCamClientViewFinder::GetClientViewFinderPropertiesL(TInt& /*aScreenNumber*/, CCamera::TFormat& /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/) const
   982 	{
   983 	User::Leave(KErrNotSupported);		
   984 	}
   985 	
   986 void CCamClientViewFinder::StopClientViewFinder()
   987 	{
   988 	return;
   989 	}
   990 	
   991 void CCamClientViewFinder::GetViewFinderBufferL(MCameraBuffer2& /*aClientViewFinderBuffer*/) const
   992 	{
   993 	User::Leave(KErrNotSupported);	
   994 	}
   995 	
   996 //
   997 //Snapshot impl for Image
   998 CCamSnapshotForImage* CCamSnapshotForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
   999 	{
  1000 	CCamSnapshotForImage* self = new(ELeave) CCamSnapshotForImage(aOwner, aCamImageCaptureImpl);
  1001 	CleanupStack::PushL(self);
  1002 	self->ConstructL();
  1003 	CleanupStack::Pop();
  1004 	return self;
  1005 	}
  1006 	
  1007 void CCamSnapshotForImage::ConstructL()
  1008 	{
  1009 	User::LeaveIfError(RFbsSession::Connect());
  1010 	
  1011 	iBitmap = new(ELeave) CFbsBitmap;
  1012 	User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
  1013 	}
  1014 	
  1015 CCamSnapshotForImage::CCamSnapshotForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
  1016 												: iOwner(aOwner), 
  1017 												  iCamImageCaptureImpl(aCamImageCaptureImpl),
  1018 												  iSnapshotbuffer(iBitmap),
  1019 												  iRefCount(2)
  1020 	{
  1021 	}
  1022 	
  1023 CCamSnapshotForImage::~CCamSnapshotForImage()
  1024 	{
  1025 	delete iBitmap;
  1026 	RFbsSession::Disconnect();
  1027 	}
  1028 	
  1029 TUint32 CCamSnapshotForImage::SupportedFormats()
  1030 	{
  1031 	return CCamera::EFormatFbsBitmapColor16M;
  1032 	}
  1033 	
  1034 void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/)
  1035 	{
  1036 	User::Leave(KErrNotSupported);
  1037 	}
  1038 	
  1039 void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/)
  1040 	{
  1041 	User::Leave(KErrNotSupported);	
  1042 	}
  1043     
  1044 void CCamSnapshotForImage::SetBgColorL(const TRgb& /*aBgColor*/)
  1045 	{
  1046 	User::Leave(KErrNotSupported);
  1047 	}
  1048 
  1049 void CCamSnapshotForImage::SetPositionL(const TPoint& /*aPosition*/)
  1050 	{
  1051 	User::Leave(KErrNotSupported);
  1052 	}
  1053 	
  1054 TBool CCamSnapshotForImage::IsSnapshotActive() const
  1055 	{
  1056 	return EFalse;	
  1057 	}
  1058 	
  1059 void CCamSnapshotForImage::StartSnapshot()
  1060 	{
  1061 	return;
  1062 	}
  1063 	
  1064 void CCamSnapshotForImage::StopSnapshot()
  1065 	{
  1066 	return;
  1067 	}
  1068 	
  1069 MCameraBuffer& CCamSnapshotForImage::SnapshotDataL(RArray<TInt>& /*aFrameIndexOrder*/)
  1070 	{
  1071 	User::Leave(KErrNotSupported);
  1072 	return iSnapshotbuffer;
  1073 	}
  1074 	
  1075 void CCamSnapshotForImage::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
  1076 	{
  1077 	aImplFactoryPtr	= CHistogramFactoryForImageSnapshot::NewL(const_cast<CCamSnapshotForImage&>(*this));
  1078 	}
  1079 	
  1080 void CCamSnapshotForImage::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1081 	{
  1082 	if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) ||
  1083 		aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion )
  1084 		{
  1085 		User::Leave(KErrNotSupported);	
  1086 		}
  1087 	iSnapshotParameters = aSnapshotParameters;
  1088 	}
  1089 	
  1090 void CCamSnapshotForImage::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1091 	{
  1092 	aSnapshotParameters = iSnapshotParameters;
  1093 	}
  1094 	
  1095 void CCamSnapshotForImage::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1096 	{
  1097 	iSnapshotParameters = aSnapshotParameters;
  1098 	}
  1099 	
  1100 void CCamSnapshotForImage::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const
  1101 	{
  1102 	User::Leave(KErrNotSupported);
  1103 	}
  1104 	
  1105 void CCamSnapshotForImage::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/)
  1106 	{
  1107 	User::Leave(KErrNotSupported);
  1108 	}
  1109 	
  1110 void CCamSnapshotForImage::EnableSnapshot()
  1111 	{
  1112 	CamImageCaptureImpl().CaptureImageObserver()->ClientSnapshotForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
  1113 	}
  1114 	
  1115 void CCamSnapshotForImage::DisableSnapshot()
  1116 	{
  1117 	return;
  1118 	}
  1119 
  1120 /* dummy */
  1121 void CCamSnapshotForImage::SetClientViewFinderId(TInt /*aClientViewFinderId*/)
  1122 	{
  1123 	return;
  1124 	}
  1125 	
  1126 void CCamSnapshotForImage::Release()
  1127 	{
  1128 	iRefCount--;
  1129 	if(iRefCount == 0)
  1130 		{
  1131 		delete this;	
  1132 		}
  1133 	}
  1134 
  1135 //
  1136 //Snapshot factory for Image
  1137 CSnapshotFactoryForImage* CSnapshotFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage)
  1138 	{
  1139 	CSnapshotFactoryForImage* self = new(ELeave) CSnapshotFactoryForImage();
  1140 	
  1141 	CleanupStack::PushL(self);
  1142 	self->ConstructL(aCamImageCaptureImpl, aSnapshotImpForImage);
  1143 	CleanupStack::Pop();
  1144 	
  1145 	return self;
  1146 	}
  1147 	
  1148 void CSnapshotFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage)
  1149 	{
  1150 	if(aSnapshotImpForImage == NULL)
  1151 		{
  1152 		iSnapshotImpForImage = CCamSnapshotForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl);
  1153 		aCamImageCaptureImpl.iSnapshotImpForImage = iSnapshotImpForImage;
  1154 		}
  1155 	}
  1156 
  1157 CSnapshotFactoryForImage::CSnapshotFactoryForImage() : iSnapshotImpForImage(NULL),
  1158 													   iIsSnapshotImpPassed(EFalse)
  1159 	{
  1160 	}
  1161 	
  1162 CSnapshotFactoryForImage::~CSnapshotFactoryForImage()
  1163 	{
  1164 	if(!iIsSnapshotImpPassed)
  1165 		{
  1166 		delete iSnapshotImpForImage;
  1167 		}
  1168 	iSnapshotImpForImage = NULL;
  1169 	}
  1170 	
  1171 TInt CSnapshotFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1172 	{
  1173 	switch(aIfaceUid.iUid)	
  1174 		{
  1175 		//fall through
  1176 		case KECamMCameraSnapshotUidValue:
  1177 			{
  1178 			aIfPtr = static_cast<MCameraSnapshot*>(iSnapshotImpForImage);
  1179 			iIsSnapshotImpPassed = ETrue;
  1180 			return KErrNone;	
  1181 			}
  1182 			
  1183 		case KECamMCameraSnapshot2UidValue:
  1184 			{
  1185 			aIfPtr = static_cast<MCameraSnapshot2*>(iSnapshotImpForImage);
  1186 			iIsSnapshotImpPassed = ETrue;
  1187 			return KErrNone;	
  1188 			}
  1189 		default:
  1190 			{
  1191 			aIfPtr = NULL;
  1192 			return KErrNotSupported;	
  1193 			}
  1194 		}	
  1195 	}
  1196 	
  1197 TInt CSnapshotFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1198 	{
  1199 	return KErrNotSupported;		
  1200 	}
  1201 	
  1202 TInt CSnapshotFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1203 	{
  1204 	return KErrNotSupported;	
  1205 	}
  1206 	
  1207 void CSnapshotFactoryForImage::Release()
  1208 	{
  1209 	delete this;
  1210 	}
  1211 	
  1212 //
  1213 //Snapshot impl for Video
  1214 CCamSnapshotForVideo* CCamSnapshotForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
  1215 	{
  1216 	CCamSnapshotForVideo* self = new(ELeave) CCamSnapshotForVideo(aOwner, aCamVideoCaptureControlImpl);
  1217 	CleanupStack::PushL(self);
  1218 	self->ConstructL();
  1219 	CleanupStack::Pop();
  1220 	return self;
  1221 	}
  1222 	
  1223 void CCamSnapshotForVideo::ConstructL()
  1224 	{
  1225 	User::LeaveIfError(RFbsSession::Connect());
  1226 	
  1227 	iBitmap = new(ELeave) CFbsBitmap;
  1228 	User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
  1229 	}
  1230 	
  1231 CCamSnapshotForVideo::CCamSnapshotForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl) : 
  1232 															iOwner(aOwner),
  1233 															iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl),
  1234 															iSnapshotbuffer(iBitmap),
  1235 															iRefCount(2)
  1236 															
  1237 	{
  1238 	}
  1239 	
  1240 CCamSnapshotForVideo::~CCamSnapshotForVideo()
  1241 	{
  1242 	delete iBitmap;
  1243 	RFbsSession::Disconnect();
  1244 	}
  1245 	
  1246 TUint32 CCamSnapshotForVideo::SupportedFormats()
  1247 	{
  1248 	return CCamera::EFormatFbsBitmapColor16M;
  1249 	}
  1250 	
  1251 void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/)
  1252 	{
  1253 	User::Leave(KErrNotSupported);
  1254 	}
  1255 	
  1256 void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/)
  1257 	{
  1258 	User::Leave(KErrNotSupported);	
  1259 	}
  1260     
  1261 void CCamSnapshotForVideo::SetBgColorL(const TRgb& /*aBgColor*/)
  1262 	{
  1263 	User::Leave(KErrNotSupported);
  1264 	}
  1265 
  1266 void CCamSnapshotForVideo::SetPositionL(const TPoint& /*aPosition*/)
  1267 	{
  1268 	User::Leave(KErrNotSupported);
  1269 	}
  1270 	
  1271 TBool CCamSnapshotForVideo::IsSnapshotActive() const
  1272 	{
  1273 	return EFalse;	
  1274 	}
  1275 	
  1276 void CCamSnapshotForVideo::StartSnapshot()
  1277 	{
  1278 	return;
  1279 	}
  1280 	
  1281 void CCamSnapshotForVideo::StopSnapshot()
  1282 	{
  1283 	return;
  1284 	}
  1285 	
  1286 MCameraBuffer& CCamSnapshotForVideo::SnapshotDataL(RArray<TInt>& /*aFrameIndexOrder*/)
  1287 	{
  1288 	User::Leave(KErrNotSupported);
  1289 	return iSnapshotbuffer;
  1290 	}
  1291 	
  1292 void CCamSnapshotForVideo::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
  1293 	{
  1294 	aImplFactoryPtr	= NULL;		
  1295 	}
  1296 	
  1297 void CCamSnapshotForVideo::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1298 	{
  1299 	if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) ||
  1300 		aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion )
  1301 		{
  1302 		User::Leave(KErrNotSupported);	
  1303 		}
  1304 	iSnapshotParameters = aSnapshotParameters;
  1305 	}
  1306 	
  1307 void CCamSnapshotForVideo::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1308 	{
  1309 	aSnapshotParameters = iSnapshotParameters;
  1310 	}
  1311 	
  1312 void CCamSnapshotForVideo::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
  1313 	{
  1314 	iSnapshotParameters = aSnapshotParameters;
  1315 	}
  1316 	
  1317 void CCamSnapshotForVideo::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const
  1318 	{
  1319 	User::Leave(KErrNotSupported);
  1320 	}
  1321 	
  1322 void CCamSnapshotForVideo::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/)
  1323 	{
  1324 	User::Leave(KErrNotSupported);
  1325 	}
  1326 	
  1327 void CCamSnapshotForVideo::EnableSnapshot()
  1328 	{
  1329 	CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientSnapshotReady(NULL, KErrNotSupported);
  1330 	}
  1331 	
  1332 void CCamSnapshotForVideo::DisableSnapshot()
  1333 	{
  1334 	return;
  1335 	}
  1336 	
  1337 /* dummy */
  1338 void CCamSnapshotForVideo::SetClientViewFinderId(TInt /*aClientViewFinderId*/)
  1339 	{
  1340 	return;
  1341 	}
  1342 	
  1343 void CCamSnapshotForVideo::Release()
  1344 	{
  1345 	iRefCount--;
  1346 	if(iRefCount == 0)
  1347 		{
  1348 		delete this;	
  1349 		}
  1350 	}
  1351 
  1352 //
  1353 //snapshot factory for video
  1354 CSnapshotFactoryForVideo* CSnapshotFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo)
  1355 	{
  1356 	CSnapshotFactoryForVideo* self = new(ELeave) CSnapshotFactoryForVideo();
  1357 	
  1358 	CleanupStack::PushL(self);
  1359 	self->ConstructL(aCamVideoCaptureControlImpl, aSnapshotImpForVideo);
  1360 	CleanupStack::Pop();
  1361 	
  1362 	return self;
  1363 	}
  1364 	
  1365 void CSnapshotFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo)
  1366 	{
  1367 	if(aSnapshotImpForVideo == NULL)
  1368 		{
  1369 		iSnapshotImpForVideo = CCamSnapshotForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl);
  1370 		aCamVideoCaptureControlImpl.iSnapshotImpForVideo = iSnapshotImpForVideo;
  1371 		}
  1372 	}
  1373 
  1374 CSnapshotFactoryForVideo::CSnapshotFactoryForVideo() : iSnapshotImpForVideo(NULL),
  1375 													   iIsSnapshotImpPassed(EFalse)
  1376 	{
  1377 	}
  1378 	
  1379 CSnapshotFactoryForVideo::~CSnapshotFactoryForVideo()
  1380 	{
  1381 	if(!iIsSnapshotImpPassed)
  1382 		{
  1383 		delete iSnapshotImpForVideo;
  1384 		}
  1385 	iSnapshotImpForVideo = NULL;
  1386 	}
  1387 	
  1388 TInt CSnapshotFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1389 	{
  1390 	switch(aIfaceUid.iUid)	
  1391 		{
  1392 		//fall through
  1393 		case KECamMCameraSnapshotUidValue:
  1394 			{
  1395 			aIfPtr = static_cast<MCameraSnapshot*>(iSnapshotImpForVideo);
  1396 			iIsSnapshotImpPassed = ETrue;
  1397 			return KErrNone;	
  1398 			}
  1399 			
  1400 		case KECamMCameraSnapshot2UidValue:
  1401 			{
  1402 			aIfPtr = static_cast<MCameraSnapshot2*>(iSnapshotImpForVideo);
  1403 			iIsSnapshotImpPassed = ETrue;
  1404 			return KErrNone;	
  1405 			}
  1406 		default:
  1407 			{
  1408 			aIfPtr = NULL;
  1409 			return KErrNotSupported;	
  1410 			}
  1411 		}	
  1412 	}
  1413 	
  1414 TInt CSnapshotFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1415 	{
  1416 	return KErrNotSupported;		
  1417 	}
  1418 	
  1419 TInt CSnapshotFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1420 	{
  1421 	return KErrNotSupported;	
  1422 	}
  1423 	
  1424 void CSnapshotFactoryForVideo::Release()
  1425 	{
  1426 	delete this;
  1427 	}
  1428 	
  1429 //
  1430 // Histogram impl for video
  1431 CHistogramImpForVideo* CHistogramImpForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
  1432 	{
  1433 	return new(ELeave) CHistogramImpForVideo(aOwner, aCamVideoCaptureControlImpl);
  1434 	}
  1435 
  1436 CHistogramImpForVideo::CHistogramImpForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl):
  1437 													iOwner(aOwner),	iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl)
  1438 	{
  1439 	}
  1440 
  1441 CHistogramImpForVideo::~CHistogramImpForVideo()
  1442 	{
  1443 	}
  1444 	
  1445 void CHistogramImpForVideo::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  1446 	{
  1447 	delete this;
  1448 	}
  1449 	
  1450 void CHistogramImpForVideo::SetHistogramHandle(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  1451 	{
  1452 	return;
  1453 	}
  1454 	
  1455 void CHistogramImpForVideo::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
  1456 	{
  1457 	aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
  1458 	}
  1459 
  1460 void CHistogramImpForVideo::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
  1461 	{
  1462 	User::Leave(KErrNotSupported);	
  1463 	}
  1464 	
  1465 void CHistogramImpForVideo::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
  1466 	{
  1467 	User::Leave(KErrNotSupported);
  1468 	}
  1469 
  1470 void CHistogramImpForVideo::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
  1471 	{
  1472 	if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
  1473 		(aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
  1474 		{
  1475 		User::Leave(KErrNotSupported);
  1476 		}
  1477 	User::Leave(KErrNotSupported);
  1478 	}
  1479 	
  1480 void CHistogramImpForVideo::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
  1481 	{
  1482 	User::Leave(KErrNotSupported);	
  1483 	}
  1484 	
  1485 void CHistogramImpForVideo::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
  1486 	{
  1487 	User::Leave(KErrNotSupported);	
  1488 	}
  1489 	
  1490 void CHistogramImpForVideo::StartHistogram()
  1491 	{
  1492 	RCamHistogramV2Buffer camHistogramV2Buffer;
  1493 	
  1494 	CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientHistogramReady(NULL, KErrNotSupported);
  1495 	}
  1496 	
  1497 void CHistogramImpForVideo::StopHistogram()
  1498 	{
  1499 	return;
  1500 	}
  1501 
  1502 void CHistogramImpForVideo::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
  1503 	{
  1504 	User::Leave(KErrNotSupported);		
  1505 	}
  1506 
  1507 //Hisotgram factory for Video
  1508 CHistogramFactoryForVideo* CHistogramFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
  1509 	{
  1510 	CHistogramFactoryForVideo* self = new(ELeave) CHistogramFactoryForVideo();
  1511 	
  1512 	CleanupStack::PushL(self);
  1513 	self->ConstructL(aCamVideoCaptureControlImpl);
  1514 	CleanupStack::Pop();
  1515 	
  1516 	return self;
  1517 	}
  1518 	
  1519 void CHistogramFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
  1520 	{
  1521 	iHistogramImpForVideo = CHistogramImpForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl);
  1522 	}
  1523 
  1524 CHistogramFactoryForVideo::CHistogramFactoryForVideo() : iHistogramImpForVideo(NULL),
  1525 														 iIsHistogramImpPassed(EFalse)
  1526 	{
  1527 	}
  1528 	
  1529 CHistogramFactoryForVideo::~CHistogramFactoryForVideo()
  1530 	{
  1531 	if(!iIsHistogramImpPassed)
  1532 		{
  1533 		delete iHistogramImpForVideo;
  1534 		}
  1535 	iHistogramImpForVideo = NULL;
  1536 	}
  1537 	
  1538 TInt CHistogramFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1539 	{
  1540 	switch(aIfaceUid.iUid)	
  1541 		{
  1542 		case KECamMCameraV2HistogramUidValue:
  1543 			{
  1544 			aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForVideo);
  1545 			iIsHistogramImpPassed = ETrue;
  1546 			return KErrNone;	
  1547 			}
  1548 		default:
  1549 			{
  1550 			aIfPtr = NULL;
  1551 			return KErrNotSupported;	
  1552 			}
  1553 		}	
  1554 	}
  1555 	
  1556 TInt CHistogramFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1557 	{
  1558 	return KErrNotSupported;		
  1559 	}
  1560 	
  1561 TInt CHistogramFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1562 	{
  1563 	return KErrNotSupported;	
  1564 	}
  1565 	
  1566 void CHistogramFactoryForVideo::Release()
  1567 	{
  1568 	delete this;
  1569 	}
  1570 	
  1571 // Histogram impl for image
  1572 CHistogramImpForImage* CHistogramImpForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
  1573 	{
  1574 	return new(ELeave) CHistogramImpForImage(aOwner, aCamImageCaptureImpl);
  1575 	}
  1576 
  1577 CHistogramImpForImage::CHistogramImpForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl):
  1578 													iOwner(aOwner),	iCamImageCaptureImpl(aCamImageCaptureImpl)
  1579 	{
  1580 	}
  1581 
  1582 CHistogramImpForImage::~CHistogramImpForImage()
  1583 	{
  1584 	}
  1585 	
  1586 void CHistogramImpForImage::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  1587 	{
  1588 	delete this;
  1589 	}
  1590 	
  1591 void CHistogramImpForImage::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
  1592 	{
  1593 	iHistogramHandle = aHistogramHandle;
  1594 	}
  1595 	
  1596 void CHistogramImpForImage::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
  1597 	{
  1598 	aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
  1599 	}
  1600 
  1601 void CHistogramImpForImage::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
  1602 	{
  1603 	User::Leave(KErrNotSupported);	
  1604 	}
  1605 	
  1606 void CHistogramImpForImage::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
  1607 	{
  1608 	User::Leave(KErrNotSupported);
  1609 	}
  1610 
  1611 void CHistogramImpForImage::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
  1612 	{
  1613 	if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
  1614 		(aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
  1615 		{
  1616 		User::Leave(KErrNotSupported);
  1617 		}	
  1618 	User::Leave(KErrNotSupported);
  1619 	}
  1620 	
  1621 void CHistogramImpForImage::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
  1622 	{
  1623 	User::Leave(KErrNotSupported);	
  1624 	}
  1625 	
  1626 void CHistogramImpForImage::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
  1627 	{
  1628 	User::Leave(KErrNotSupported);	
  1629 	}
  1630 	
  1631 void CHistogramImpForImage::StartHistogram()
  1632 	{
  1633 	RCamHistogramV2Buffer camHistogramV2Buffer;
  1634 	CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
  1635 	}
  1636 	
  1637 void CHistogramImpForImage::StopHistogram()
  1638 	{
  1639 	return;
  1640 	}
  1641 
  1642 void CHistogramImpForImage::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
  1643 	{
  1644 	User::Leave(KErrNotSupported);		
  1645 	}
  1646 	
  1647 //Hisotgram factory for Image
  1648 CHistogramFactoryForImage* CHistogramFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl)
  1649 	{
  1650 	CHistogramFactoryForImage* self = new(ELeave) CHistogramFactoryForImage();
  1651 	
  1652 	CleanupStack::PushL(self);
  1653 	self->ConstructL(aCamImageCaptureImpl);
  1654 	CleanupStack::Pop();
  1655 	
  1656 	return self;
  1657 	}
  1658 	
  1659 void CHistogramFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl)
  1660 	{
  1661 	iHistogramImpForImage = CHistogramImpForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl);
  1662 	}
  1663 
  1664 CHistogramFactoryForImage::CHistogramFactoryForImage() : iHistogramImpForImage(NULL),
  1665 														 iIsHistogramImpPassed(EFalse)
  1666 	{
  1667 	}
  1668 	
  1669 CHistogramFactoryForImage::~CHistogramFactoryForImage()
  1670 	{
  1671 	if(!iIsHistogramImpPassed)
  1672 		{
  1673 		delete iHistogramImpForImage;
  1674 		}
  1675 	iHistogramImpForImage = NULL;
  1676 	}
  1677 	
  1678 TInt CHistogramFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1679 	{
  1680 	switch(aIfaceUid.iUid)	
  1681 		{
  1682 		case KECamMCameraV2HistogramUidValue:
  1683 			{
  1684 			aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForImage);
  1685 			iIsHistogramImpPassed = ETrue;
  1686 			return KErrNone;	
  1687 			}
  1688 		default:
  1689 			{
  1690 			aIfPtr = NULL;
  1691 			return KErrNotSupported;	
  1692 			}
  1693 		}	
  1694 	}
  1695 	
  1696 TInt CHistogramFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1697 	{
  1698 	return KErrNotSupported;		
  1699 	}
  1700 	
  1701 TInt CHistogramFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1702 	{
  1703 	return KErrNotSupported;	
  1704 	}
  1705 	
  1706 void CHistogramFactoryForImage::Release()
  1707 	{
  1708 	delete this;
  1709 	}
  1710 	
  1711 // Histogram impl for direct view finder
  1712 CHistogramImpForDirectViewFinder* CHistogramImpForDirectViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
  1713 	{
  1714 	return new(ELeave) CHistogramImpForDirectViewFinder(aOwner, aCamV2DirectViewFinderImpl);
  1715 	}
  1716 
  1717 CHistogramImpForDirectViewFinder::CHistogramImpForDirectViewFinder(CCamUnitTestPlugin& aOwner, 
  1718 					CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl): iOwner(aOwner),	
  1719 																		 iCamV2DirectViewFinderImpl(aCamV2DirectViewFinderImpl)
  1720 	{
  1721 	}
  1722 
  1723 CHistogramImpForDirectViewFinder::~CHistogramImpForDirectViewFinder()
  1724 	{
  1725 	}
  1726 	
  1727 void CHistogramImpForDirectViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  1728 	{
  1729 	delete this;
  1730 	}
  1731 
  1732 void CHistogramImpForDirectViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
  1733 	{
  1734 	iHistogramHandle = aHistogramHandle;
  1735 	}
  1736 
  1737 void CHistogramImpForDirectViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
  1738 	{
  1739 	aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
  1740 	}
  1741 
  1742 void CHistogramImpForDirectViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
  1743 	{
  1744 	User::Leave(KErrNotSupported);	
  1745 	}
  1746 	
  1747 void CHistogramImpForDirectViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
  1748 	{
  1749 	User::Leave(KErrNotSupported);
  1750 	}
  1751 
  1752 void CHistogramImpForDirectViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
  1753 	{
  1754 	if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
  1755 		(aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
  1756 		{
  1757 		User::Leave(KErrNotSupported);
  1758 		}
  1759 	User::Leave(KErrNotSupported);	
  1760 	}
  1761 	
  1762 void CHistogramImpForDirectViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
  1763 	{
  1764 	User::Leave(KErrNotSupported);	
  1765 	}
  1766 	
  1767 void CHistogramImpForDirectViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
  1768 	{
  1769 	User::Leave(KErrNotSupported);	
  1770 	}
  1771 	
  1772 void CHistogramImpForDirectViewFinder::StartHistogram()
  1773 	{
  1774 	RCamHistogramV2Buffer camHistogramV2Buffer;
  1775 	DirectViewFinderImpl().DirectViewFinderObserver()->ClientHistogramReady(DirectViewFinderImpl().DirectViewFinderHandle(), NULL, KErrNotSupported);
  1776 	}
  1777 	
  1778 void CHistogramImpForDirectViewFinder::StopHistogram()
  1779 	{
  1780 	return;
  1781 	}
  1782 
  1783 void CHistogramImpForDirectViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
  1784 	{
  1785 	User::Leave(KErrNotSupported);		
  1786 	}
  1787 
  1788 //Hisotgram factory for Direct View Finder
  1789 CHistogramFactoryForDirectViewFinder* CHistogramFactoryForDirectViewFinder::NewL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
  1790 	{
  1791 	CHistogramFactoryForDirectViewFinder* self = new(ELeave) CHistogramFactoryForDirectViewFinder();
  1792 	
  1793 	CleanupStack::PushL(self);
  1794 	self->ConstructL(aCamV2DirectViewFinderImpl);
  1795 	CleanupStack::Pop();
  1796 	
  1797 	return self;
  1798 	}
  1799 	
  1800 void CHistogramFactoryForDirectViewFinder::ConstructL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
  1801 	{
  1802 	iHistogramImpForDirectViewFinder = CHistogramImpForDirectViewFinder::NewL(aCamV2DirectViewFinderImpl.Owner(), aCamV2DirectViewFinderImpl);
  1803 	}
  1804 
  1805 CHistogramFactoryForDirectViewFinder::CHistogramFactoryForDirectViewFinder() : iHistogramImpForDirectViewFinder(NULL),
  1806 																			   iIsHistogramImpPassed(EFalse)
  1807 	{
  1808 	}
  1809 	
  1810 CHistogramFactoryForDirectViewFinder::~CHistogramFactoryForDirectViewFinder()
  1811 	{
  1812 	if(!iIsHistogramImpPassed)
  1813 		{
  1814 		delete iHistogramImpForDirectViewFinder;
  1815 		}
  1816 	iHistogramImpForDirectViewFinder = NULL;
  1817 	}
  1818 	
  1819 TInt CHistogramFactoryForDirectViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1820 	{
  1821 	switch(aIfaceUid.iUid)	
  1822 		{
  1823 		case KECamMCameraV2HistogramUidValue:
  1824 			{
  1825 			aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForDirectViewFinder);
  1826 			iIsHistogramImpPassed = ETrue;
  1827 			return KErrNone;	
  1828 			}
  1829 		default:
  1830 			{
  1831 			aIfPtr = NULL;
  1832 			return KErrNotSupported;	
  1833 			}
  1834 		}	
  1835 	}
  1836 	
  1837 TInt CHistogramFactoryForDirectViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1838 	{
  1839 	return KErrNotSupported;		
  1840 	}
  1841 	
  1842 TInt CHistogramFactoryForDirectViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1843 	{
  1844 	return KErrNotSupported;	
  1845 	}
  1846 	
  1847 void CHistogramFactoryForDirectViewFinder::Release()
  1848 	{
  1849 	delete this;
  1850 	}	
  1851 	
  1852 // Histogram impl for client view finder
  1853 CHistogramImpForClientViewFinder* CHistogramImpForClientViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamClientViewFinder& aCamClientViewFinderImpl)
  1854 	{
  1855 	return new(ELeave) CHistogramImpForClientViewFinder(aOwner, aCamClientViewFinderImpl);
  1856 	}
  1857 
  1858 CHistogramImpForClientViewFinder::CHistogramImpForClientViewFinder(CCamUnitTestPlugin& aOwner, 
  1859 					CCamClientViewFinder& aCamClientViewFinderImpl): iOwner(aOwner), 
  1860 															  		 iCamClientViewFinderImpl(aCamClientViewFinderImpl)
  1861 	{
  1862 	}
  1863 
  1864 CHistogramImpForClientViewFinder::~CHistogramImpForClientViewFinder()
  1865 	{
  1866 	}
  1867 	
  1868 void CHistogramImpForClientViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  1869 	{
  1870 	delete this;
  1871 	}
  1872 	
  1873 void CHistogramImpForClientViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
  1874 	{
  1875 	iHistogramHandle = aHistogramHandle;
  1876 	}
  1877 	
  1878 void CHistogramImpForClientViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
  1879 	{
  1880 	aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
  1881 	}
  1882 
  1883 void CHistogramImpForClientViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
  1884 	{
  1885 	User::Leave(KErrNotSupported);	
  1886 	}
  1887 	
  1888 void CHistogramImpForClientViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
  1889 	{
  1890 	User::Leave(KErrNotSupported);
  1891 	}
  1892 
  1893 void CHistogramImpForClientViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
  1894 	{
  1895 	if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
  1896 		(aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
  1897 		{
  1898 		User::Leave(KErrNotSupported);
  1899 		}
  1900 	User::Leave(KErrNotSupported);	
  1901 	}
  1902 	
  1903 void CHistogramImpForClientViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
  1904 	{
  1905 	User::Leave(KErrNotSupported);	
  1906 	}
  1907 	
  1908 void CHistogramImpForClientViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
  1909 	{
  1910 	User::Leave(KErrNotSupported);	
  1911 	}
  1912 	
  1913 void CHistogramImpForClientViewFinder::StartHistogram()
  1914 	{
  1915 	RCamHistogramV2Buffer camHistogramV2Buffer;
  1916 	ClientViewFinderImpl().ClientViewFinderObserver()->ClientHistogramReady(ClientViewFinderHandle(), NULL, KErrNotSupported);
  1917 	}
  1918 	
  1919 void CHistogramImpForClientViewFinder::StopHistogram()
  1920 	{
  1921 	return;
  1922 	}
  1923 
  1924 void CHistogramImpForClientViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
  1925 	{
  1926 	User::Leave(KErrNotSupported);		
  1927 	}
  1928 	
  1929 //Hisotgram factory for Client View Finder
  1930 CHistogramFactoryForClientViewFinder* CHistogramFactoryForClientViewFinder::NewL(CCamClientViewFinder& aCamClientViewFinderImpl)
  1931 	{
  1932 	CHistogramFactoryForClientViewFinder* self = new(ELeave) CHistogramFactoryForClientViewFinder();
  1933 	
  1934 	CleanupStack::PushL(self);
  1935 	self->ConstructL(aCamClientViewFinderImpl);
  1936 	CleanupStack::Pop();
  1937 	
  1938 	return self;
  1939 	}
  1940 	
  1941 void CHistogramFactoryForClientViewFinder::ConstructL(CCamClientViewFinder& aCamClientViewFinderImpl)
  1942 	{
  1943 	iHistogramImpForClientViewFinder = CHistogramImpForClientViewFinder::NewL(aCamClientViewFinderImpl.Owner(), aCamClientViewFinderImpl);
  1944 	}
  1945 
  1946 CHistogramFactoryForClientViewFinder::CHistogramFactoryForClientViewFinder() : iHistogramImpForClientViewFinder(NULL),
  1947 																			   iIsHistogramImpPassed(EFalse)
  1948 	{
  1949 	}
  1950 	
  1951 CHistogramFactoryForClientViewFinder::~CHistogramFactoryForClientViewFinder()
  1952 	{
  1953 	if(!iIsHistogramImpPassed)
  1954 		{
  1955 		delete iHistogramImpForClientViewFinder;
  1956 		}
  1957 		
  1958 	iHistogramImpForClientViewFinder = NULL;
  1959 	}
  1960 	
  1961 TInt CHistogramFactoryForClientViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  1962 	{
  1963 	switch(aIfaceUid.iUid)	
  1964 		{
  1965 		case KECamMCameraV2HistogramUidValue:
  1966 			{
  1967 			aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForClientViewFinder);
  1968 			iIsHistogramImpPassed = ETrue;
  1969 			return KErrNone;	
  1970 			}
  1971 		default:
  1972 			{
  1973 			aIfPtr = NULL;
  1974 			return KErrNotSupported;	
  1975 			}
  1976 		}	
  1977 	}
  1978 	
  1979 TInt CHistogramFactoryForClientViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  1980 	{
  1981 	return KErrNotSupported;		
  1982 	}
  1983 	
  1984 TInt CHistogramFactoryForClientViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  1985 	{
  1986 	return KErrNotSupported;	
  1987 	}
  1988 	
  1989 void CHistogramFactoryForClientViewFinder::Release()
  1990 	{
  1991 	delete this;
  1992 	}
  1993 
  1994 // Histogram impl for image snapshot
  1995 CHistogramImpForImageSnapshot* CHistogramImpForImageSnapshot::NewL(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl)
  1996 	{
  1997 	return new(ELeave) CHistogramImpForImageSnapshot(aOwner, aCamSnapshotForImageImpl);
  1998 	}
  1999 
  2000 CHistogramImpForImageSnapshot::CHistogramImpForImageSnapshot(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl):
  2001 									 iOwner(aOwner), 
  2002 									 iCamSnapshotForImageImpl(aCamSnapshotForImageImpl)
  2003 	{
  2004 	}
  2005 
  2006 CHistogramImpForImageSnapshot::~CHistogramImpForImageSnapshot()
  2007 	{
  2008 	}
  2009 	
  2010 void CHistogramImpForImageSnapshot::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
  2011 	{
  2012 	delete this;
  2013 	}
  2014 	
  2015 void CHistogramImpForImageSnapshot::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
  2016 	{
  2017 	iHistogramHandle = aHistogramHandle;
  2018 	}
  2019 	
  2020 void CHistogramImpForImageSnapshot::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
  2021 	{
  2022 	aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
  2023 	}
  2024 
  2025 void CHistogramImpForImageSnapshot::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
  2026 	{
  2027 	User::Leave(KErrNotSupported);	
  2028 	}
  2029 	
  2030 void CHistogramImpForImageSnapshot::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
  2031 	{
  2032 	User::Leave(KErrNotSupported);
  2033 	}
  2034 
  2035 void CHistogramImpForImageSnapshot::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
  2036 	{
  2037 	if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
  2038 		(aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
  2039 		{
  2040 		User::Leave(KErrNotSupported);
  2041 		}	
  2042 	User::Leave(KErrNotSupported);
  2043 	}
  2044 	
  2045 void CHistogramImpForImageSnapshot::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
  2046 	{
  2047 	User::Leave(KErrNotSupported);	
  2048 	}
  2049 	
  2050 void CHistogramImpForImageSnapshot::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
  2051 	{
  2052 	User::Leave(KErrNotSupported);	
  2053 	}
  2054 	
  2055 void CHistogramImpForImageSnapshot::StartHistogram()
  2056 	{
  2057 	RCamHistogramV2Buffer camHistogramV2Buffer;
  2058 
  2059 	CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForSnapshotReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
  2060 	}
  2061 	
  2062 void CHistogramImpForImageSnapshot::StopHistogram()
  2063 	{
  2064 	return;
  2065 	}
  2066 
  2067 void CHistogramImpForImageSnapshot::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
  2068 	{
  2069 	User::Leave(KErrNotSupported);		
  2070 	}
  2071 
  2072 //Hisotgram factory for Image Snapshot
  2073 CHistogramFactoryForImageSnapshot* CHistogramFactoryForImageSnapshot::NewL(CCamSnapshotForImage& aCamSnapshotForImageImpl)
  2074 	{
  2075 	CHistogramFactoryForImageSnapshot* self = new(ELeave) CHistogramFactoryForImageSnapshot();
  2076 	
  2077 	CleanupStack::PushL(self);
  2078 	self->ConstructL(aCamSnapshotForImageImpl);
  2079 	CleanupStack::Pop();
  2080 	
  2081 	return self;
  2082 	}
  2083 	
  2084 void CHistogramFactoryForImageSnapshot::ConstructL(CCamSnapshotForImage& aCamSnapshotForImageImpl)
  2085 	{
  2086 	iHistogramImpForImageSnapshot = CHistogramImpForImageSnapshot::NewL(aCamSnapshotForImageImpl.Owner(), aCamSnapshotForImageImpl);
  2087 	}
  2088 
  2089 CHistogramFactoryForImageSnapshot::CHistogramFactoryForImageSnapshot() : iHistogramImpForImageSnapshot(NULL),
  2090 																		 iIsHistogramImpPassed(EFalse)
  2091 	{
  2092 	}
  2093 	
  2094 CHistogramFactoryForImageSnapshot::~CHistogramFactoryForImageSnapshot()
  2095 	{
  2096 	if(!iIsHistogramImpPassed)
  2097 		{
  2098 		delete iHistogramImpForImageSnapshot;
  2099 		}
  2100 	iHistogramImpForImageSnapshot = NULL;
  2101 	}
  2102 	
  2103 TInt CHistogramFactoryForImageSnapshot::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  2104 	{
  2105 	switch(aIfaceUid.iUid)	
  2106 		{
  2107 		case KECamMCameraV2HistogramUidValue:
  2108 			{
  2109 			aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForImageSnapshot);
  2110 			iIsHistogramImpPassed = ETrue;
  2111 			return KErrNone;	
  2112 			}
  2113 		default:
  2114 			{
  2115 			aIfPtr = NULL;
  2116 			return KErrNotSupported;	
  2117 			}
  2118 		}	
  2119 	}
  2120 	
  2121 TInt CHistogramFactoryForImageSnapshot::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  2122 	{
  2123 	return KErrNotSupported;		
  2124 	}
  2125 	
  2126 TInt CHistogramFactoryForImageSnapshot::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  2127 	{
  2128 	return KErrNotSupported;	
  2129 	}
  2130 	
  2131 void CHistogramFactoryForImageSnapshot::Release()
  2132 	{
  2133 	delete this;
  2134 	}
  2135 	
  2136 //	
  2137 //img proc impl for still images.
  2138 CCamImgProcImpForImage* CCamImgProcImpForImage::NewL(CCamUnitTestPlugin& aOwner)
  2139 	{
  2140 	return new(ELeave) CCamImgProcImpForImage(aOwner);
  2141 	}
  2142 	
  2143 CCamImgProcImpForImage::CCamImgProcImpForImage(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
  2144 	{
  2145 	}
  2146 	
  2147 CCamImgProcImpForImage::~CCamImgProcImpForImage()
  2148 	{
  2149 	}
  2150 	
  2151 void CCamImgProcImpForImage::Release()
  2152 	{
  2153 	delete this;
  2154 	}
  2155 	
  2156 void CCamImgProcImpForImage::GetSupportedTransformationsL(RArray<TUid>& aTransformations) const
  2157 	{
  2158 	aTransformations.Reset();
  2159 	}
  2160 	
  2161 void CCamImgProcImpForImage::GetActiveTransformationsL(RArray<TUid>& aTransformations) const
  2162 	{
  2163 	aTransformations.Reset();
  2164 	}
  2165 	
  2166 void CCamImgProcImpForImage::GetTransformationSupportedValuesL(TUid /*aTransformation*/, RArray<TInt>& aValues, TValueInfo& aInfo) const
  2167 	{
  2168 	aValues.Reset();
  2169 	aInfo = ENotActive;
  2170 	}
  2171 	
  2172 TInt CCamImgProcImpForImage::TransformationValue(TUid /*aTransformation*/) const
  2173 	{
  2174 	return KErrNotSupported;	
  2175 	}
  2176 	
  2177 TInt CCamImgProcImpForImage::GetTransformationValue(TUid /*aTransformation*/, TInt& /*aTransformationValue*/) const
  2178 	{
  2179 	return KErrNotSupported;	
  2180 	}
  2181 	
  2182 void CCamImgProcImpForImage::SetTransformationValue(TUid /*aTransformation*/, TInt /*aValue*/)
  2183 	{
  2184 	return;
  2185 	}
  2186 	
  2187 void CCamImgProcImpForImage::GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const
  2188 	{
  2189 	aTransformSequence.Reset();
  2190 	}
  2191 	
  2192 void CCamImgProcImpForImage::SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence)
  2193 	{
  2194 	aTransformSequence.Reset();	
  2195 	}
  2196 	
  2197 void CCamImgProcImpForImage::SetSourceRect(const TRect& /*aRect*/)
  2198 	{
  2199 	return;
  2200 	}
  2201 
  2202 void CCamImgProcImpForImage::GetSourceRect(TRect& /*aRect*/) const
  2203 	{
  2204 	return;		
  2205 	}
  2206 
  2207 //	
  2208 //img proc factory for still images.
  2209 CImgProcFactoryForImage* CImgProcFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage)
  2210 	{
  2211 	CImgProcFactoryForImage* self = new(ELeave) CImgProcFactoryForImage();
  2212 	
  2213 	CleanupStack::PushL(self);
  2214 	self->ConstructL(aCamImageCaptureImpl, aCamImgProcImpForImage);
  2215 	CleanupStack::Pop();
  2216 	
  2217 	return self;
  2218 	}
  2219 	
  2220 void CImgProcFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage)
  2221 	{
  2222 	if(aCamImgProcImpForImage == NULL)
  2223 		{
  2224 		iCamImgProcImpForImage = CCamImgProcImpForImage::NewL(aCamImageCaptureImpl.Owner());
  2225 		aCamImageCaptureImpl.iCamImgProcImpForImage = iCamImgProcImpForImage;
  2226 		}
  2227 	}
  2228 
  2229 CImgProcFactoryForImage::CImgProcFactoryForImage() : iCamImgProcImpForImage(NULL),
  2230 													 iIsImgProcImpPassed(EFalse)
  2231 	{
  2232 	TAny* ptr = NULL;
  2233 	TUint value = 0;
  2234 	TInt param = -4;
  2235 	TECamImplFactoryParam factoryParam(ptr);
  2236 	TECamImplFactoryParam factoryParam1(value);
  2237 	TECamImplFactoryParam factoryParam2(param);
  2238 	}
  2239 	
  2240 CImgProcFactoryForImage::~CImgProcFactoryForImage()
  2241 	{
  2242 	if(!iIsImgProcImpPassed)
  2243 		{
  2244 		delete iCamImgProcImpForImage;
  2245 		}
  2246 	iCamImgProcImpForImage = NULL;
  2247 	}
  2248 	
  2249 TInt CImgProcFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
  2250 	{
  2251 	switch(aIfaceUid.iUid)	
  2252 		{
  2253 		//fall through
  2254 		case KECamMCameraImageProcessingUidValue:
  2255 			{
  2256 			aIfPtr = static_cast<MCameraImageProcessing*>(iCamImgProcImpForImage);
  2257 			iIsImgProcImpPassed = ETrue;
  2258 			return KErrNone;	
  2259 			}
  2260 		default:
  2261 			{
  2262 			aIfPtr = NULL;
  2263 			return KErrNotSupported;	
  2264 			}
  2265 		}	
  2266 	}
  2267 	
  2268 TInt CImgProcFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
  2269 	{
  2270 	return KErrNotSupported;		
  2271 	}
  2272 	
  2273 TInt CImgProcFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
  2274 	{
  2275 	return KErrNotSupported;	
  2276 	}
  2277 	
  2278 void CImgProcFactoryForImage::Release()
  2279 	{
  2280 	delete this;
  2281 	}