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