os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/extended_functionality.cpp
Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // extendedfunctionality.cpp
18 #include "extended_functionality.h"
19 #include "AdvancedSettings.h"
20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
21 #include <ecamcapturecontrolconst.h>
22 #include <ecamviewfinderdef.h>
27 //pre image capture control impl
28 CCamPreImageCaptureControl* CCamPreImageCaptureControl::NewL(CCamUnitTestPlugin& aOwner)
30 return new(ELeave) CCamPreImageCaptureControl(aOwner);
33 CCamPreImageCaptureControl::CCamPreImageCaptureControl(CCamUnitTestPlugin& aOwner): iOwner(aOwner),
34 iPreImageCaptureControlObserver(NULL)
38 CCamPreImageCaptureControl::~CCamPreImageCaptureControl()
42 void CCamPreImageCaptureControl::Release()
47 void CCamPreImageCaptureControl::SetPreImageCaptureControlObserver(MPreImageCaptureControlObserver& aPreImageCaptureControlObserver)
49 iPreImageCaptureControlObserver = &aPreImageCaptureControlObserver;
52 void CCamPreImageCaptureControl::GetDirectSnapshotSupportInfoL(TUint& aDirectSnapshotSupportInfo) const
54 aDirectSnapshotSupportInfo = CCamera::CCameraPreImageCaptureControl::EDirectSnapshotSupported;
57 void CCamPreImageCaptureControl::GetSupportedEmbeddedStillCaptureSettingsL(RArray<TUid>& aSupportedEmbeddedStillCaptureSettings) const
59 aSupportedEmbeddedStillCaptureSettings.Reset();
62 void CCamPreImageCaptureControl::GetSupportedDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aSupportedDirectSavingType) const
64 aSupportedDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed;
67 void CCamPreImageCaptureControl::SetSequentialImageFilenameL(const TDesC8& /*aFilename*/, TInt /*aStartingSequenceNumber*/)
69 User::Leave(KErrNotSupported);
72 void CCamPreImageCaptureControl::SetLowerResolutionSequentialImageFilenameL(const TDesC8& /*aLowerResolutionFilename*/, TInt /*aStartingSequenceNumber*/)
74 User::Leave(KErrNotSupported);
77 void CCamPreImageCaptureControl::GetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aDirectSavingType) const
79 aDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed;
82 void CCamPreImageCaptureControl::SetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType /*aDirectSavingType*/)
84 User::Leave(KErrNotSupported);
87 void CCamPreImageCaptureControl::GetCaptureEventSupportInfoL(TUint& aSupportedDriveModes) const
89 aSupportedDriveModes = 0;
92 void CCamPreImageCaptureControl::GetImageFormatsSupportedL(TUint& aImageFormatsSupported, const TSize& /*aSize*/) const
94 aImageFormatsSupported = CCamera::EFormatFbsBitmapColor16M;
97 void CCamPreImageCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aImageFormat*/, const TSize& /*aSize*/) const
99 aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1;
102 void CCamPreImageCaptureControl::PrepareImageCapture(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters&
103 aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver)
105 //perform any prepare operation at hardware level eg. memory allocation etc.
106 CCamera::CCameraImageCapture* cameraImageCapture = NULL;
108 TRAPD(err,CreateCaptureImageL(cameraImageCapture, aPrepareImageParameters, aCaptureImageObserver));
110 PreImageCaptureControlObserver()->PrepareImageComplete(cameraImageCapture, err);
113 void CCamPreImageCaptureControl::GetImageMaxMemorySizeSettingSupportInfoL(TBool& aIsImageMaxMemorySizeSettingSupported) const
115 aIsImageMaxMemorySizeSettingSupported = EFalse;
118 void CCamPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& /*aMemorySize*/) const
120 User::Leave(KErrNotSupported);
123 void CCamPreImageCaptureControl::GetSupportedProcessingOptionsL(TUint& /*aSupportedProcessingOptions*/) const
125 User::Leave(KErrNotSupported);
128 void CCamPreImageCaptureControl::CreateCaptureImageL(CCamera::CCameraImageCapture*& aCameraImageCapture, const CCamera::
129 CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver)
131 CCamera::CCameraImageCapture* cameraImageCapture = CCamera::CCameraImageCapture::CreateL(iOwner, aPrepareImageParameters, aCaptureImageObserver);
132 aCameraImageCapture = cameraImageCapture;
137 CCamImageCapture* CCamImageCapture::NewL(CCamUnitTestPlugin& aOwner)
139 return new(ELeave) CCamImageCapture(aOwner);
142 CCamImageCapture::CCamImageCapture(CCamUnitTestPlugin& aOwner) : iOwner(aOwner),
143 iCaptureImageObserver(NULL),
144 iSnapshotImpForImage(NULL),
145 iCamImgProcImpForImage(NULL),
146 iCameraImageCapture(NULL)
148 iArrayPostCaptureControlId.Reset();
149 iArrayPostCaptureControlHandle.Reset();
150 iArrayPostCaptureControlImpl.Reset();
153 CCamImageCapture::~CCamImageCapture()
155 iArrayPostCaptureControlId.Close();
156 iArrayPostCaptureControlHandle.Reset();
157 iArrayPostCaptureControlImpl.Reset();
158 iArrayPostCaptureControlHandle.Close();
159 iArrayPostCaptureControlImpl.Close();
162 void CCamImageCapture::Release(CCamera::CCameraImageCapture* /*aCameraImageCapture*/)
167 void CCamImageCapture::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
169 aImplFactoryPtr = CHistogramFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this));
172 void CCamImageCapture::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
174 aImplFactoryPtr = CSnapshotFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this), iSnapshotImpForImage);
177 void CCamImageCapture::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
179 aImplFactoryPtr = CImgProcFactoryForImage::NewL(const_cast<CCamImageCapture&>(*this), iCamImgProcImpForImage);
182 void CCamImageCapture::SetCaptureImageObserver(MCaptureImageObserver& aCaptureImageObserver)
184 iCaptureImageObserver = &aCaptureImageObserver;
187 void CCamImageCapture::GetPrepareImageParametersL(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) const
189 if(aPrepareImageParameters.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters) ||
190 aPrepareImageParameters.Version() != KECamPrepareImageParametersCurrentVersion)
192 User::Leave(KErrNotSupported);
195 if(aPrepareImageParameters.iDriveModeAttributes.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TDriveModeDependentAttributes) ||
196 aPrepareImageParameters.iDriveModeAttributes.Version() != KECamDriveModeDependentAttributesCurrentVersion)
198 User::Leave(KErrNotSupported);
201 aPrepareImageParameters = iPrepareImageParameters;
204 void CCamImageCapture::SetPrepareImageParameters(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters)
206 iPrepareImageParameters = aPrepareImageParameters;
209 TAny* CCamImageCapture::CreatePostImageCaptureControlImpl(TUid aInterface, TPostCaptureControlId aPostCaptureControlId)
212 if(aInterface.iUid == KECamMCameraPostImageCaptureControlUidValue)
214 if(iArrayPostCaptureControlId.Find(aPostCaptureControlId) == KErrNotFound)
216 CCamPostImageCaptureControl* camPostImageCaptureControl = NULL;
217 TRAP(err, camPostImageCaptureControl = CCamPostImageCaptureControl::NewL(const_cast<CCamImageCapture&>(*this)));
221 err = iArrayPostCaptureControlId.Append(aPostCaptureControlId);
224 err = iArrayPostCaptureControlImpl.Append(camPostImageCaptureControl);
227 iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1);
228 delete camPostImageCaptureControl;
233 return static_cast<MCameraPostImageCaptureControl*>(camPostImageCaptureControl);
238 delete camPostImageCaptureControl;
258 void CCamImageCapture::CaptureImage(CCamera::CCameraImageCapture* aCameraImageCapture)
260 TInt count = iArrayPostCaptureControlId.Count();
263 iArrayPostCaptureControlId.Remove(count-1);
264 iArrayPostCaptureControlImpl.Remove(count-1);
265 delete iArrayPostCaptureControlHandle[count-1];
266 iArrayPostCaptureControlHandle.Remove(count-1);
268 count = iArrayPostCaptureControlId.Count();
271 iCameraImageCapture = aCameraImageCapture;
273 //this will create Post Image capture control object. assume one such object is required. ( for demo purpose only)
274 CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = NULL;
276 TRAPD(err,CreatePostImageCaptureControlL(postImageCaptureControl, 1));
280 err = iArrayPostCaptureControlHandle.Append(postImageCaptureControl);
283 iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1);
284 iArrayPostCaptureControlImpl.Remove(iArrayPostCaptureControlImpl.Count()-1);
285 delete postImageCaptureControl;
289 CaptureImageObserver()->IndividualImageControlHandle(*iCameraImageCapture, 1);
293 CaptureImageObserver()->ImageCaptureComplete(*iCameraImageCapture, KErrNotSupported);
296 void CCamImageCapture::CancelCaptureImage()
301 void CCamImageCapture::GetNumImagesExposedL(TUint& /*aNumImagesExposed*/) const
303 User::Leave(KErrNotSupported);
306 void CCamImageCapture::GetNumTotalImagesL(TUint& aNumTotalImages) const
311 void CCamImageCapture::GetPostCaptureControlHandleL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle,
312 TPostCaptureControlId aPostCaptureControlId) const
314 TInt index = iArrayPostCaptureControlId.Find(aPostCaptureControlId);
315 User::LeaveIfError(index);
317 aPostCaptureControlHandle = iArrayPostCaptureControlHandle[index];
320 void CCamImageCapture::SetCaptureImagePriorityL(TECamImagePriority /*aCaptureImagePriority*/)
322 User::Leave(KErrNotSupported);
325 void CCamImageCapture::GetCaptureImagePriorityL(TECamImagePriority& /*aCaptureImagePriority*/) const
327 User::Leave(KErrNotSupported);
330 void CCamImageCapture::PauseProcessing(TUint /*aProcessingType*/)
335 void CCamImageCapture::ResumeProcessingL(TUint /*aProcessingType*/)
337 User::Leave(KErrNotSupported);
340 void CCamImageCapture::CreatePostImageCaptureControlL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle,
341 TPostCaptureControlId aPostCaptureControlId)
343 CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = CCamera::CCameraPostImageCaptureControl::
344 CreateL(iCameraImageCapture, aPostCaptureControlId);
346 aPostCaptureControlHandle = postImageCaptureControl;
350 //post image capture control impl
352 CCamPostImageCaptureControl* CCamPostImageCaptureControl::NewL(CCamImageCapture& aCamImageCaptureImpl)
354 return new(ELeave) CCamPostImageCaptureControl(aCamImageCaptureImpl);
357 CCamPostImageCaptureControl::CCamPostImageCaptureControl(CCamImageCapture& aCamImageCaptureImpl) :
358 iCamImageCaptureImpl(aCamImageCaptureImpl)
362 CCamPostImageCaptureControl::~CCamPostImageCaptureControl()
366 void CCamPostImageCaptureControl::Release(TPostCaptureControlId aPostCaptureControlId)
368 //remove this id from the CCamImageCapture arrays
369 TInt index = iCamImageCaptureImpl.iArrayPostCaptureControlId.Find(aPostCaptureControlId);
373 iCamImageCaptureImpl.iArrayPostCaptureControlId.Remove(index);
374 iCamImageCaptureImpl.iArrayPostCaptureControlImpl.Remove(index);
375 iCamImageCaptureImpl.iArrayPostCaptureControlHandle.Remove(index);
381 void CCamPostImageCaptureControl::GetImageSequenceNumberL(TUint& /*aSequenceNumber*/) const
383 User::Leave(KErrNotSupported);
386 void CCamPostImageCaptureControl::CancelImage()
391 void CCamPostImageCaptureControl::SetImagePriorityL(TECamImagePriority /*aImagePriority*/)
393 User::Leave(KErrNotSupported);
396 void CCamPostImageCaptureControl::GetImagePriorityL(TECamImagePriority& /*aImagePriority*/) const
398 User::Leave(KErrNotSupported);
401 void CCamPostImageCaptureControl::PauseProcessing(TUint /*aProcessingType*/)
406 void CCamPostImageCaptureControl::ResumeProcessingL(TUint /*aProcessingType*/)
408 User::Leave(KErrNotSupported);
411 void CCamPostImageCaptureControl::GetImageBufferL(MCameraImageBuffer& /*aCameraImageBuffer*/) const
413 User::Leave(KErrNotSupported);
416 void CCamPostImageCaptureControl::GetImageStateL(CCamera::CCameraPostImageCaptureControl::TImageState& /*aImageState*/) const
418 User::Leave(KErrNotSupported);
421 void CCamPostImageCaptureControl::GetBufferStateL(CCamera::CCameraPostImageCaptureControl::TBufferState& /*aBufferState*/) const
423 User::Leave(KErrNotSupported);
427 //video capture control impl
429 CCamVideoCaptureControl* CCamVideoCaptureControl::NewL(CCamUnitTestPlugin& aOwner)
431 CCamVideoCaptureControl* self = new(ELeave) CCamVideoCaptureControl(aOwner);
432 CleanupStack::PushL(self);
438 void CCamVideoCaptureControl::ConstructL()
440 User::LeaveIfError(RFbsSession::Connect());
442 iBitmap = new(ELeave) CFbsBitmap;
443 User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
446 CCamVideoCaptureControl::CCamVideoCaptureControl(CCamUnitTestPlugin& aOwner) :
448 iCaptureVideoObserver(NULL),
449 iSnapshotImpForVideo(NULL)
453 CCamVideoCaptureControl::~CCamVideoCaptureControl()
456 RFbsSession::Disconnect();
459 void CCamVideoCaptureControl::Release()
464 void CCamVideoCaptureControl::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
466 aImplFactoryPtr = CHistogramFactoryForVideo::NewL(const_cast<CCamVideoCaptureControl&>(*this));
469 void CCamVideoCaptureControl::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
471 aImplFactoryPtr = CSnapshotFactoryForVideo::NewL(const_cast<CCamVideoCaptureControl&>(*this), iSnapshotImpForVideo);
474 void CCamVideoCaptureControl::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
476 aImplFactoryPtr = NULL;
477 User::Leave(KErrNotSupported);
480 void CCamVideoCaptureControl::SetCaptureVideoObserver(MCaptureVideoObserver& aCaptureVideoObserver)
482 iCaptureVideoObserver = &aCaptureVideoObserver;
485 void CCamVideoCaptureControl::GetVideoFormatsSupportedL(TUint& aVideoFormatsSupported, const TSize& /*aSize*/) const
487 aVideoFormatsSupported = CCamera::EFormatFbsBitmapColor16M;
490 void CCamVideoCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aVideoFormat*/, const TSize& /*aSize*/) const
492 aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1;
495 void CCamVideoCaptureControl::GetEmbeddedStillCaptureSupportInfoL(TInt& aSupportedEmbeddedStillCaptureTypes) const
497 aSupportedEmbeddedStillCaptureTypes = CCamera::CCameraVideoCaptureControl::EEmbeddedStillCaptureNotSupported;
500 void CCamVideoCaptureControl::PrepareVideoCapture(const CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters)
502 if(((aPrepareVideoParameters.Size() != sizeof(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters)) ||
503 aPrepareVideoParameters.Version() != KECamPrepareVideoParametersCurrentVersion))
505 iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNotSupported);
508 iPrepareVideoParameters = aPrepareVideoParameters;
510 iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNone);
513 void CCamVideoCaptureControl::GetRangeAffectedSettingsL(RArray<TUid>& aRangeAffectedSettings) const
515 aRangeAffectedSettings.Reset();
518 void CCamVideoCaptureControl::GetValueAffectedSettingsL(RArray<TUid>& aValueAffectedSettings) const
520 aValueAffectedSettings.Reset();
523 void CCamVideoCaptureControl::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const
525 aDisabledSettings.Reset();
528 void CCamVideoCaptureControl::ReleaseVideoResource()
533 void CCamVideoCaptureControl::StartVideoCaptureL()
535 RCamBuffer2 videoBuffer(iBitmap);
537 if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EVideoCaptureNotSupported)
539 CaptureVideoObserver()->DirectVideoCaptureFailed(KErrNotSupported);
543 if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EClientVideoCapture)
545 CaptureVideoObserver()->VideoBufferReady(NULL, KErrNotSupported);
550 void CCamVideoCaptureControl::StopVideoCapture()
554 void CCamVideoCaptureControl::PauseVideoCapture()
559 void CCamVideoCaptureControl::ResumeVideoCaptureL()
561 User::Leave(KErrNotSupported);
564 void CCamVideoCaptureControl::GetFadingEffectStateL(CCamera::CCameraVideoCaptureControl::TFadingEffectState& /*aFadingEffectState*/) const
566 User::Leave(KErrNotSupported);
569 void CCamVideoCaptureControl::SetFadingEffectState(CCamera::CCameraVideoCaptureControl::TFadingEffectState /*aFadingEffectState*/)
571 iOwner.Notify(KUidECamEventVideoCaptureControlFadingEffect, KErrNotSupported);
574 void CCamVideoCaptureControl::GetVideoCaptureStateL(CCamera::CCameraVideoCaptureControl::TVideoCaptureState& /*aVideoCaptureState*/) const
576 User::Leave(KErrNotSupported);
579 void CCamVideoCaptureControl::GetVideoCaptureSupportInfoL(TInt& aSupportedVideoCaptureTypes) const
581 aSupportedVideoCaptureTypes = KSupportedDirectVCType;
584 void CCamVideoCaptureControl::GetPrepareVideoParametersL(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters) const
586 aPrepareVideoParameters = iPrepareVideoParameters;
591 //Direct Snapshot impl for version2 direct viewfinder
593 CCamDirectSnapshot::CCamDirectSnapshot() : iCameraV2DirectVF(NULL),
594 iDirectSnapshotState(CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled)
598 CCamDirectSnapshot* CCamDirectSnapshot::NewL()
600 return new (ELeave) CCamDirectSnapshot;
603 CCamDirectSnapshot::~CCamDirectSnapshot()
607 void CCamDirectSnapshot::Release()
612 void CCamDirectSnapshot::SetDirectViewFinder(const CCamera::CCameraV2DirectViewFinder* aDirectViewFinder)
614 iCameraV2DirectVF = aDirectViewFinder;
617 void CCamDirectSnapshot::GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const
619 aDirectViewFinder = const_cast<CCamera::CCameraV2DirectViewFinder*>(iCameraV2DirectVF);
622 void CCamDirectSnapshot::EnableDirectSnapshotL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
624 iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotEnabled;
625 iDirectSnapshotParameters = aDirectSnapshotParameters;
628 void CCamDirectSnapshot::DisableDirectSnapshot()
630 iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled;
633 void CCamDirectSnapshot::GetDirectSnapshotStateL(CCamera::CCameraDirectSnapshot::TDirectSnapshotState& aDirectSnapshotState) const
635 aDirectSnapshotState = iDirectSnapshotState;
638 void CCamDirectSnapshot::GetDirectSnapshotParametersL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) const
640 aDirectSnapshotParameters = iDirectSnapshotParameters;
643 void CCamDirectSnapshot::SetDirectSnapshotParametersL(const CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters)
645 iDirectSnapshotParameters = aDirectSnapshotParameters;
649 //V2 direct viewfinder impl
651 CCamV2DirectViewFinder* CCamV2DirectViewFinder::NewL(CCamUnitTestPlugin& aOwner)
653 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
657 globalData = new (ELeave) CDataGlobal;
658 CleanupStack::PushL(globalData);
660 globalData->iReferenceCount = 0;
661 globalData->iCamV2DirectViewFinder = new (ELeave) CCamV2DirectViewFinder(aOwner);
662 globalData->iCamV2DirectViewFinder->iRefCount = 1;
664 TInt error = Dll::SetTls(globalData);
667 delete globalData->iCamV2DirectViewFinder;
670 CleanupStack::Pop(globalData);
672 return static_cast <CCamV2DirectViewFinder*> (globalData->iCamV2DirectViewFinder);
676 CCamV2DirectViewFinder* self = globalData->iCamV2DirectViewFinder;
678 globalData->iReferenceCount++;
679 self->iRefCount = globalData->iReferenceCount + 1;
680 if (globalData->iReferenceCount == 1)
687 TInt error = Dll::SetTls(globalData);
690 delete globalData->iCamV2DirectViewFinder;
694 return static_cast <CCamV2DirectViewFinder*> (self);
698 CCamV2DirectViewFinder::CCamV2DirectViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0), iDirectSnapshot(NULL)
700 //dummy scheme or impl dependent scheme
701 //server may generate unique handle no. for each such objects
702 iOwner.GenerateVFHandle(iVFHandle);
705 CCamV2DirectViewFinder::~CCamV2DirectViewFinder()
710 void CCamV2DirectViewFinder::Release(CCamera::CCameraV2DirectViewFinder* /*aDirectViewFinderHandle*/)
719 void CCamV2DirectViewFinder::Release()
728 void CCamV2DirectViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const
730 if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) ||
731 (aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion))
733 User::Leave(KErrNotSupported);
735 User::Leave(KErrNotSupported);
738 void CCamV2DirectViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const
740 if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) ||
741 (aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion))
743 User::Leave(KErrNotSupported);
745 User::Leave(KErrNotSupported);
748 void CCamV2DirectViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/)
750 iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle);
753 void CCamV2DirectViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const
755 aVFHandle = iVFHandle;
758 void CCamV2DirectViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
760 aImplFactoryPtr = CHistogramFactoryForDirectViewFinder::NewL(const_cast<CCamV2DirectViewFinder&>(*this));
763 void CCamV2DirectViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
765 aImplFactoryPtr = NULL;
766 User::Leave(KErrNotSupported);
769 void CCamV2DirectViewFinder::SetDirectViewFinderObserver(MDirectViewFinderObserver& aDirectViewFinderObserver)
771 iDirectViewFinderObserver = &aDirectViewFinderObserver;
774 void CCamV2DirectViewFinder::SetDirectViewFinderHandle(CCamera::CCameraV2DirectViewFinder* aDirectViewFinderHandle)
776 iDirectViewFinderHandle = aDirectViewFinderHandle;
779 void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/)
781 DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
784 void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/)
786 DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
789 void CCamV2DirectViewFinder::GetDirectViewFinderPropertiesL(TInt& /*aScreenNumber*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/) const
791 User::Leave(KErrNotSupported);
794 void CCamV2DirectViewFinder::PauseViewFinderDirect()
799 void CCamV2DirectViewFinder::ResumeViewFinderDirect()
801 DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported);
804 void CCamV2DirectViewFinder::GetViewFinderStateL(CCamera::CCameraV2DirectViewFinder::TViewFinderState& /*aViewFinderState*/) const
806 User::Leave(KErrNotSupported);
809 void CCamV2DirectViewFinder::StopDirectViewFinder()
815 TAny* CCamV2DirectViewFinder::GetDirectSnapshotImpl(TUid aInterface) const
817 switch(aInterface.iUid)
819 case KECamMCameraDirectSnapshotUidValue:
821 if(iDirectSnapshot == NULL)
823 TRAPD(err,iDirectSnapshot = CCamDirectSnapshot::NewL());
829 return static_cast<MCameraDirectSnapshot*>(iDirectSnapshot);
837 //Client viewfinder impl
838 CCamClientViewFinder* CCamClientViewFinder::NewL(CCamUnitTestPlugin& aOwner)
840 CDataGlobal* globalData = static_cast <CDataGlobal*> (Dll::Tls());
844 globalData = new (ELeave) CDataGlobal;
845 CleanupStack::PushL(globalData);
847 globalData->iReferenceCount = 0;
848 globalData->iCamClientViewFinder = new (ELeave) CCamClientViewFinder(aOwner);
849 globalData->iCamClientViewFinder->iRefCount = 1;
851 TInt error = Dll::SetTls(globalData);
854 delete globalData->iCamClientViewFinder;
857 CleanupStack::Pop(globalData);
859 return static_cast <CCamClientViewFinder*> (globalData->iCamClientViewFinder);
863 CCamClientViewFinder* self = globalData->iCamClientViewFinder;
865 globalData->iReferenceCount++;
866 self->iRefCount = globalData->iReferenceCount + 1;
867 if (globalData->iReferenceCount == 1)
874 TInt error = Dll::SetTls(globalData);
877 delete globalData->iCamClientViewFinder;
881 return static_cast <CCamClientViewFinder*> (self);
885 CCamClientViewFinder::CCamClientViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0)
887 //dummy scheme or impl dependent scheme
888 //server may generate unique handle no. for each such objects
889 iOwner.GenerateVFHandle(iVFHandle);
892 CCamClientViewFinder::~CCamClientViewFinder()
897 void CCamClientViewFinder::Release(CCamera::CCameraClientViewFinder* /*aClientViewFinderHandle*/)
906 void CCamClientViewFinder::Release()
915 void CCamClientViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const
917 if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) ||
918 (aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion))
920 User::Leave(KErrNotSupported);
922 User::Leave(KErrNotSupported);
925 void CCamClientViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const
927 if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) ||
928 (aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion))
930 User::Leave(KErrNotSupported);
932 User::Leave(KErrNotSupported);
935 void CCamClientViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/)
937 iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle);
940 void CCamClientViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const
942 aVFHandle = iVFHandle;
945 void CCamClientViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
947 aImplFactoryPtr = CHistogramFactoryForClientViewFinder::NewL(const_cast<CCamClientViewFinder&>(*this));
950 void CCamClientViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
952 aImplFactoryPtr = NULL;
953 User::Leave(KErrNotSupported);
956 void CCamClientViewFinder::SetClientViewFinderObserver(MClientViewFinderObserver& aClientViewFinderObserver)
958 iClientViewFinderObserver = &aClientViewFinderObserver;
961 void CCamClientViewFinder::SetClientViewFinderHandle(CCamera::CCameraClientViewFinder* aClientViewFinderHandle)
963 iClientViewFinderHandle = aClientViewFinderHandle;
966 void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/)
968 ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported);
971 void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/)
973 ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported);
976 void CCamClientViewFinder::GetClientViewFinderStateL(TBool& /*aIsActive*/) const
978 User::Leave(KErrNotSupported);
981 void CCamClientViewFinder::GetClientViewFinderPropertiesL(TInt& /*aScreenNumber*/, CCamera::TFormat& /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/) const
983 User::Leave(KErrNotSupported);
986 void CCamClientViewFinder::StopClientViewFinder()
991 void CCamClientViewFinder::GetViewFinderBufferL(MCameraBuffer2& /*aClientViewFinderBuffer*/) const
993 User::Leave(KErrNotSupported);
997 //Snapshot impl for Image
998 CCamSnapshotForImage* CCamSnapshotForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
1000 CCamSnapshotForImage* self = new(ELeave) CCamSnapshotForImage(aOwner, aCamImageCaptureImpl);
1001 CleanupStack::PushL(self);
1003 CleanupStack::Pop();
1007 void CCamSnapshotForImage::ConstructL()
1009 User::LeaveIfError(RFbsSession::Connect());
1011 iBitmap = new(ELeave) CFbsBitmap;
1012 User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
1015 CCamSnapshotForImage::CCamSnapshotForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
1017 iCamImageCaptureImpl(aCamImageCaptureImpl),
1018 iSnapshotbuffer(iBitmap),
1023 CCamSnapshotForImage::~CCamSnapshotForImage()
1026 RFbsSession::Disconnect();
1029 TUint32 CCamSnapshotForImage::SupportedFormats()
1031 return CCamera::EFormatFbsBitmapColor16M;
1034 void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/)
1036 User::Leave(KErrNotSupported);
1039 void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/)
1041 User::Leave(KErrNotSupported);
1044 void CCamSnapshotForImage::SetBgColorL(const TRgb& /*aBgColor*/)
1046 User::Leave(KErrNotSupported);
1049 void CCamSnapshotForImage::SetPositionL(const TPoint& /*aPosition*/)
1051 User::Leave(KErrNotSupported);
1054 TBool CCamSnapshotForImage::IsSnapshotActive() const
1059 void CCamSnapshotForImage::StartSnapshot()
1064 void CCamSnapshotForImage::StopSnapshot()
1069 MCameraBuffer& CCamSnapshotForImage::SnapshotDataL(RArray<TInt>& /*aFrameIndexOrder*/)
1071 User::Leave(KErrNotSupported);
1072 return iSnapshotbuffer;
1075 void CCamSnapshotForImage::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
1077 aImplFactoryPtr = CHistogramFactoryForImageSnapshot::NewL(const_cast<CCamSnapshotForImage&>(*this));
1080 void CCamSnapshotForImage::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1082 if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) ||
1083 aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion )
1085 User::Leave(KErrNotSupported);
1087 iSnapshotParameters = aSnapshotParameters;
1090 void CCamSnapshotForImage::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1092 aSnapshotParameters = iSnapshotParameters;
1095 void CCamSnapshotForImage::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1097 iSnapshotParameters = aSnapshotParameters;
1100 void CCamSnapshotForImage::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const
1102 User::Leave(KErrNotSupported);
1105 void CCamSnapshotForImage::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/)
1107 User::Leave(KErrNotSupported);
1110 void CCamSnapshotForImage::EnableSnapshot()
1112 CamImageCaptureImpl().CaptureImageObserver()->ClientSnapshotForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
1115 void CCamSnapshotForImage::DisableSnapshot()
1121 void CCamSnapshotForImage::SetClientViewFinderId(TInt /*aClientViewFinderId*/)
1126 void CCamSnapshotForImage::Release()
1136 //Snapshot factory for Image
1137 CSnapshotFactoryForImage* CSnapshotFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage)
1139 CSnapshotFactoryForImage* self = new(ELeave) CSnapshotFactoryForImage();
1141 CleanupStack::PushL(self);
1142 self->ConstructL(aCamImageCaptureImpl, aSnapshotImpForImage);
1143 CleanupStack::Pop();
1148 void CSnapshotFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage)
1150 if(aSnapshotImpForImage == NULL)
1152 iSnapshotImpForImage = CCamSnapshotForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl);
1153 aCamImageCaptureImpl.iSnapshotImpForImage = iSnapshotImpForImage;
1157 CSnapshotFactoryForImage::CSnapshotFactoryForImage() : iSnapshotImpForImage(NULL),
1158 iIsSnapshotImpPassed(EFalse)
1162 CSnapshotFactoryForImage::~CSnapshotFactoryForImage()
1164 if(!iIsSnapshotImpPassed)
1166 delete iSnapshotImpForImage;
1168 iSnapshotImpForImage = NULL;
1171 TInt CSnapshotFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1173 switch(aIfaceUid.iUid)
1176 case KECamMCameraSnapshotUidValue:
1178 aIfPtr = static_cast<MCameraSnapshot*>(iSnapshotImpForImage);
1179 iIsSnapshotImpPassed = ETrue;
1183 case KECamMCameraSnapshot2UidValue:
1185 aIfPtr = static_cast<MCameraSnapshot2*>(iSnapshotImpForImage);
1186 iIsSnapshotImpPassed = ETrue;
1192 return KErrNotSupported;
1197 TInt CSnapshotFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1199 return KErrNotSupported;
1202 TInt CSnapshotFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1204 return KErrNotSupported;
1207 void CSnapshotFactoryForImage::Release()
1213 //Snapshot impl for Video
1214 CCamSnapshotForVideo* CCamSnapshotForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
1216 CCamSnapshotForVideo* self = new(ELeave) CCamSnapshotForVideo(aOwner, aCamVideoCaptureControlImpl);
1217 CleanupStack::PushL(self);
1219 CleanupStack::Pop();
1223 void CCamSnapshotForVideo::ConstructL()
1225 User::LeaveIfError(RFbsSession::Connect());
1227 iBitmap = new(ELeave) CFbsBitmap;
1228 User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M));
1231 CCamSnapshotForVideo::CCamSnapshotForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl) :
1233 iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl),
1234 iSnapshotbuffer(iBitmap),
1240 CCamSnapshotForVideo::~CCamSnapshotForVideo()
1243 RFbsSession::Disconnect();
1246 TUint32 CCamSnapshotForVideo::SupportedFormats()
1248 return CCamera::EFormatFbsBitmapColor16M;
1251 void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/)
1253 User::Leave(KErrNotSupported);
1256 void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/)
1258 User::Leave(KErrNotSupported);
1261 void CCamSnapshotForVideo::SetBgColorL(const TRgb& /*aBgColor*/)
1263 User::Leave(KErrNotSupported);
1266 void CCamSnapshotForVideo::SetPositionL(const TPoint& /*aPosition*/)
1268 User::Leave(KErrNotSupported);
1271 TBool CCamSnapshotForVideo::IsSnapshotActive() const
1276 void CCamSnapshotForVideo::StartSnapshot()
1281 void CCamSnapshotForVideo::StopSnapshot()
1286 MCameraBuffer& CCamSnapshotForVideo::SnapshotDataL(RArray<TInt>& /*aFrameIndexOrder*/)
1288 User::Leave(KErrNotSupported);
1289 return iSnapshotbuffer;
1292 void CCamSnapshotForVideo::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const
1294 aImplFactoryPtr = NULL;
1297 void CCamSnapshotForVideo::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1299 if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) ||
1300 aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion )
1302 User::Leave(KErrNotSupported);
1304 iSnapshotParameters = aSnapshotParameters;
1307 void CCamSnapshotForVideo::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1309 aSnapshotParameters = iSnapshotParameters;
1312 void CCamSnapshotForVideo::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters)
1314 iSnapshotParameters = aSnapshotParameters;
1317 void CCamSnapshotForVideo::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const
1319 User::Leave(KErrNotSupported);
1322 void CCamSnapshotForVideo::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/)
1324 User::Leave(KErrNotSupported);
1327 void CCamSnapshotForVideo::EnableSnapshot()
1329 CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientSnapshotReady(NULL, KErrNotSupported);
1332 void CCamSnapshotForVideo::DisableSnapshot()
1338 void CCamSnapshotForVideo::SetClientViewFinderId(TInt /*aClientViewFinderId*/)
1343 void CCamSnapshotForVideo::Release()
1353 //snapshot factory for video
1354 CSnapshotFactoryForVideo* CSnapshotFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo)
1356 CSnapshotFactoryForVideo* self = new(ELeave) CSnapshotFactoryForVideo();
1358 CleanupStack::PushL(self);
1359 self->ConstructL(aCamVideoCaptureControlImpl, aSnapshotImpForVideo);
1360 CleanupStack::Pop();
1365 void CSnapshotFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo)
1367 if(aSnapshotImpForVideo == NULL)
1369 iSnapshotImpForVideo = CCamSnapshotForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl);
1370 aCamVideoCaptureControlImpl.iSnapshotImpForVideo = iSnapshotImpForVideo;
1374 CSnapshotFactoryForVideo::CSnapshotFactoryForVideo() : iSnapshotImpForVideo(NULL),
1375 iIsSnapshotImpPassed(EFalse)
1379 CSnapshotFactoryForVideo::~CSnapshotFactoryForVideo()
1381 if(!iIsSnapshotImpPassed)
1383 delete iSnapshotImpForVideo;
1385 iSnapshotImpForVideo = NULL;
1388 TInt CSnapshotFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1390 switch(aIfaceUid.iUid)
1393 case KECamMCameraSnapshotUidValue:
1395 aIfPtr = static_cast<MCameraSnapshot*>(iSnapshotImpForVideo);
1396 iIsSnapshotImpPassed = ETrue;
1400 case KECamMCameraSnapshot2UidValue:
1402 aIfPtr = static_cast<MCameraSnapshot2*>(iSnapshotImpForVideo);
1403 iIsSnapshotImpPassed = ETrue;
1409 return KErrNotSupported;
1414 TInt CSnapshotFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1416 return KErrNotSupported;
1419 TInt CSnapshotFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1421 return KErrNotSupported;
1424 void CSnapshotFactoryForVideo::Release()
1430 // Histogram impl for video
1431 CHistogramImpForVideo* CHistogramImpForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
1433 return new(ELeave) CHistogramImpForVideo(aOwner, aCamVideoCaptureControlImpl);
1436 CHistogramImpForVideo::CHistogramImpForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl):
1437 iOwner(aOwner), iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl)
1441 CHistogramImpForVideo::~CHistogramImpForVideo()
1445 void CHistogramImpForVideo::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
1450 void CHistogramImpForVideo::SetHistogramHandle(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
1455 void CHistogramImpForVideo::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
1457 aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
1460 void CHistogramImpForVideo::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
1462 User::Leave(KErrNotSupported);
1465 void CHistogramImpForVideo::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
1467 User::Leave(KErrNotSupported);
1470 void CHistogramImpForVideo::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
1472 if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
1473 (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
1475 User::Leave(KErrNotSupported);
1477 User::Leave(KErrNotSupported);
1480 void CHistogramImpForVideo::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
1482 User::Leave(KErrNotSupported);
1485 void CHistogramImpForVideo::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
1487 User::Leave(KErrNotSupported);
1490 void CHistogramImpForVideo::StartHistogram()
1492 RCamHistogramV2Buffer camHistogramV2Buffer;
1494 CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientHistogramReady(NULL, KErrNotSupported);
1497 void CHistogramImpForVideo::StopHistogram()
1502 void CHistogramImpForVideo::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
1504 User::Leave(KErrNotSupported);
1507 //Hisotgram factory for Video
1508 CHistogramFactoryForVideo* CHistogramFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
1510 CHistogramFactoryForVideo* self = new(ELeave) CHistogramFactoryForVideo();
1512 CleanupStack::PushL(self);
1513 self->ConstructL(aCamVideoCaptureControlImpl);
1514 CleanupStack::Pop();
1519 void CHistogramFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl)
1521 iHistogramImpForVideo = CHistogramImpForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl);
1524 CHistogramFactoryForVideo::CHistogramFactoryForVideo() : iHistogramImpForVideo(NULL),
1525 iIsHistogramImpPassed(EFalse)
1529 CHistogramFactoryForVideo::~CHistogramFactoryForVideo()
1531 if(!iIsHistogramImpPassed)
1533 delete iHistogramImpForVideo;
1535 iHistogramImpForVideo = NULL;
1538 TInt CHistogramFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1540 switch(aIfaceUid.iUid)
1542 case KECamMCameraV2HistogramUidValue:
1544 aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForVideo);
1545 iIsHistogramImpPassed = ETrue;
1551 return KErrNotSupported;
1556 TInt CHistogramFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1558 return KErrNotSupported;
1561 TInt CHistogramFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1563 return KErrNotSupported;
1566 void CHistogramFactoryForVideo::Release()
1571 // Histogram impl for image
1572 CHistogramImpForImage* CHistogramImpForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl)
1574 return new(ELeave) CHistogramImpForImage(aOwner, aCamImageCaptureImpl);
1577 CHistogramImpForImage::CHistogramImpForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl):
1578 iOwner(aOwner), iCamImageCaptureImpl(aCamImageCaptureImpl)
1582 CHistogramImpForImage::~CHistogramImpForImage()
1586 void CHistogramImpForImage::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
1591 void CHistogramImpForImage::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
1593 iHistogramHandle = aHistogramHandle;
1596 void CHistogramImpForImage::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
1598 aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
1601 void CHistogramImpForImage::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
1603 User::Leave(KErrNotSupported);
1606 void CHistogramImpForImage::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
1608 User::Leave(KErrNotSupported);
1611 void CHistogramImpForImage::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
1613 if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
1614 (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
1616 User::Leave(KErrNotSupported);
1618 User::Leave(KErrNotSupported);
1621 void CHistogramImpForImage::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
1623 User::Leave(KErrNotSupported);
1626 void CHistogramImpForImage::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
1628 User::Leave(KErrNotSupported);
1631 void CHistogramImpForImage::StartHistogram()
1633 RCamHistogramV2Buffer camHistogramV2Buffer;
1634 CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
1637 void CHistogramImpForImage::StopHistogram()
1642 void CHistogramImpForImage::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
1644 User::Leave(KErrNotSupported);
1647 //Hisotgram factory for Image
1648 CHistogramFactoryForImage* CHistogramFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl)
1650 CHistogramFactoryForImage* self = new(ELeave) CHistogramFactoryForImage();
1652 CleanupStack::PushL(self);
1653 self->ConstructL(aCamImageCaptureImpl);
1654 CleanupStack::Pop();
1659 void CHistogramFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl)
1661 iHistogramImpForImage = CHistogramImpForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl);
1664 CHistogramFactoryForImage::CHistogramFactoryForImage() : iHistogramImpForImage(NULL),
1665 iIsHistogramImpPassed(EFalse)
1669 CHistogramFactoryForImage::~CHistogramFactoryForImage()
1671 if(!iIsHistogramImpPassed)
1673 delete iHistogramImpForImage;
1675 iHistogramImpForImage = NULL;
1678 TInt CHistogramFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1680 switch(aIfaceUid.iUid)
1682 case KECamMCameraV2HistogramUidValue:
1684 aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForImage);
1685 iIsHistogramImpPassed = ETrue;
1691 return KErrNotSupported;
1696 TInt CHistogramFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1698 return KErrNotSupported;
1701 TInt CHistogramFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1703 return KErrNotSupported;
1706 void CHistogramFactoryForImage::Release()
1711 // Histogram impl for direct view finder
1712 CHistogramImpForDirectViewFinder* CHistogramImpForDirectViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
1714 return new(ELeave) CHistogramImpForDirectViewFinder(aOwner, aCamV2DirectViewFinderImpl);
1717 CHistogramImpForDirectViewFinder::CHistogramImpForDirectViewFinder(CCamUnitTestPlugin& aOwner,
1718 CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl): iOwner(aOwner),
1719 iCamV2DirectViewFinderImpl(aCamV2DirectViewFinderImpl)
1723 CHistogramImpForDirectViewFinder::~CHistogramImpForDirectViewFinder()
1727 void CHistogramImpForDirectViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
1732 void CHistogramImpForDirectViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
1734 iHistogramHandle = aHistogramHandle;
1737 void CHistogramImpForDirectViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
1739 aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
1742 void CHistogramImpForDirectViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
1744 User::Leave(KErrNotSupported);
1747 void CHistogramImpForDirectViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
1749 User::Leave(KErrNotSupported);
1752 void CHistogramImpForDirectViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
1754 if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
1755 (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
1757 User::Leave(KErrNotSupported);
1759 User::Leave(KErrNotSupported);
1762 void CHistogramImpForDirectViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
1764 User::Leave(KErrNotSupported);
1767 void CHistogramImpForDirectViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
1769 User::Leave(KErrNotSupported);
1772 void CHistogramImpForDirectViewFinder::StartHistogram()
1774 RCamHistogramV2Buffer camHistogramV2Buffer;
1775 DirectViewFinderImpl().DirectViewFinderObserver()->ClientHistogramReady(DirectViewFinderImpl().DirectViewFinderHandle(), NULL, KErrNotSupported);
1778 void CHistogramImpForDirectViewFinder::StopHistogram()
1783 void CHistogramImpForDirectViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
1785 User::Leave(KErrNotSupported);
1788 //Hisotgram factory for Direct View Finder
1789 CHistogramFactoryForDirectViewFinder* CHistogramFactoryForDirectViewFinder::NewL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
1791 CHistogramFactoryForDirectViewFinder* self = new(ELeave) CHistogramFactoryForDirectViewFinder();
1793 CleanupStack::PushL(self);
1794 self->ConstructL(aCamV2DirectViewFinderImpl);
1795 CleanupStack::Pop();
1800 void CHistogramFactoryForDirectViewFinder::ConstructL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl)
1802 iHistogramImpForDirectViewFinder = CHistogramImpForDirectViewFinder::NewL(aCamV2DirectViewFinderImpl.Owner(), aCamV2DirectViewFinderImpl);
1805 CHistogramFactoryForDirectViewFinder::CHistogramFactoryForDirectViewFinder() : iHistogramImpForDirectViewFinder(NULL),
1806 iIsHistogramImpPassed(EFalse)
1810 CHistogramFactoryForDirectViewFinder::~CHistogramFactoryForDirectViewFinder()
1812 if(!iIsHistogramImpPassed)
1814 delete iHistogramImpForDirectViewFinder;
1816 iHistogramImpForDirectViewFinder = NULL;
1819 TInt CHistogramFactoryForDirectViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1821 switch(aIfaceUid.iUid)
1823 case KECamMCameraV2HistogramUidValue:
1825 aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForDirectViewFinder);
1826 iIsHistogramImpPassed = ETrue;
1832 return KErrNotSupported;
1837 TInt CHistogramFactoryForDirectViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1839 return KErrNotSupported;
1842 TInt CHistogramFactoryForDirectViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1844 return KErrNotSupported;
1847 void CHistogramFactoryForDirectViewFinder::Release()
1852 // Histogram impl for client view finder
1853 CHistogramImpForClientViewFinder* CHistogramImpForClientViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamClientViewFinder& aCamClientViewFinderImpl)
1855 return new(ELeave) CHistogramImpForClientViewFinder(aOwner, aCamClientViewFinderImpl);
1858 CHistogramImpForClientViewFinder::CHistogramImpForClientViewFinder(CCamUnitTestPlugin& aOwner,
1859 CCamClientViewFinder& aCamClientViewFinderImpl): iOwner(aOwner),
1860 iCamClientViewFinderImpl(aCamClientViewFinderImpl)
1864 CHistogramImpForClientViewFinder::~CHistogramImpForClientViewFinder()
1868 void CHistogramImpForClientViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
1873 void CHistogramImpForClientViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
1875 iHistogramHandle = aHistogramHandle;
1878 void CHistogramImpForClientViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
1880 aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
1883 void CHistogramImpForClientViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
1885 User::Leave(KErrNotSupported);
1888 void CHistogramImpForClientViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
1890 User::Leave(KErrNotSupported);
1893 void CHistogramImpForClientViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
1895 if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
1896 (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
1898 User::Leave(KErrNotSupported);
1900 User::Leave(KErrNotSupported);
1903 void CHistogramImpForClientViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
1905 User::Leave(KErrNotSupported);
1908 void CHistogramImpForClientViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
1910 User::Leave(KErrNotSupported);
1913 void CHistogramImpForClientViewFinder::StartHistogram()
1915 RCamHistogramV2Buffer camHistogramV2Buffer;
1916 ClientViewFinderImpl().ClientViewFinderObserver()->ClientHistogramReady(ClientViewFinderHandle(), NULL, KErrNotSupported);
1919 void CHistogramImpForClientViewFinder::StopHistogram()
1924 void CHistogramImpForClientViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
1926 User::Leave(KErrNotSupported);
1929 //Hisotgram factory for Client View Finder
1930 CHistogramFactoryForClientViewFinder* CHistogramFactoryForClientViewFinder::NewL(CCamClientViewFinder& aCamClientViewFinderImpl)
1932 CHistogramFactoryForClientViewFinder* self = new(ELeave) CHistogramFactoryForClientViewFinder();
1934 CleanupStack::PushL(self);
1935 self->ConstructL(aCamClientViewFinderImpl);
1936 CleanupStack::Pop();
1941 void CHistogramFactoryForClientViewFinder::ConstructL(CCamClientViewFinder& aCamClientViewFinderImpl)
1943 iHistogramImpForClientViewFinder = CHistogramImpForClientViewFinder::NewL(aCamClientViewFinderImpl.Owner(), aCamClientViewFinderImpl);
1946 CHistogramFactoryForClientViewFinder::CHistogramFactoryForClientViewFinder() : iHistogramImpForClientViewFinder(NULL),
1947 iIsHistogramImpPassed(EFalse)
1951 CHistogramFactoryForClientViewFinder::~CHistogramFactoryForClientViewFinder()
1953 if(!iIsHistogramImpPassed)
1955 delete iHistogramImpForClientViewFinder;
1958 iHistogramImpForClientViewFinder = NULL;
1961 TInt CHistogramFactoryForClientViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
1963 switch(aIfaceUid.iUid)
1965 case KECamMCameraV2HistogramUidValue:
1967 aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForClientViewFinder);
1968 iIsHistogramImpPassed = ETrue;
1974 return KErrNotSupported;
1979 TInt CHistogramFactoryForClientViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
1981 return KErrNotSupported;
1984 TInt CHistogramFactoryForClientViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
1986 return KErrNotSupported;
1989 void CHistogramFactoryForClientViewFinder::Release()
1994 // Histogram impl for image snapshot
1995 CHistogramImpForImageSnapshot* CHistogramImpForImageSnapshot::NewL(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl)
1997 return new(ELeave) CHistogramImpForImageSnapshot(aOwner, aCamSnapshotForImageImpl);
2000 CHistogramImpForImageSnapshot::CHistogramImpForImageSnapshot(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl):
2002 iCamSnapshotForImageImpl(aCamSnapshotForImageImpl)
2006 CHistogramImpForImageSnapshot::~CHistogramImpForImageSnapshot()
2010 void CHistogramImpForImageSnapshot::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/)
2015 void CHistogramImpForImageSnapshot::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)
2017 iHistogramHandle = aHistogramHandle;
2020 void CHistogramImpForImageSnapshot::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const
2022 aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone;
2025 void CHistogramImpForImageSnapshot::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const
2027 User::Leave(KErrNotSupported);
2030 void CHistogramImpForImageSnapshot::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/)
2032 User::Leave(KErrNotSupported);
2035 void CHistogramImpForImageSnapshot::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)
2037 if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) ||
2038 (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion))
2040 User::Leave(KErrNotSupported);
2042 User::Leave(KErrNotSupported);
2045 void CHistogramImpForImageSnapshot::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/)
2047 User::Leave(KErrNotSupported);
2050 void CHistogramImpForImageSnapshot::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const
2052 User::Leave(KErrNotSupported);
2055 void CHistogramImpForImageSnapshot::StartHistogram()
2057 RCamHistogramV2Buffer camHistogramV2Buffer;
2059 CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForSnapshotReady(CameraImageCapture(), 1, NULL, KErrNotSupported);
2062 void CHistogramImpForImageSnapshot::StopHistogram()
2067 void CHistogramImpForImageSnapshot::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const
2069 User::Leave(KErrNotSupported);
2072 //Hisotgram factory for Image Snapshot
2073 CHistogramFactoryForImageSnapshot* CHistogramFactoryForImageSnapshot::NewL(CCamSnapshotForImage& aCamSnapshotForImageImpl)
2075 CHistogramFactoryForImageSnapshot* self = new(ELeave) CHistogramFactoryForImageSnapshot();
2077 CleanupStack::PushL(self);
2078 self->ConstructL(aCamSnapshotForImageImpl);
2079 CleanupStack::Pop();
2084 void CHistogramFactoryForImageSnapshot::ConstructL(CCamSnapshotForImage& aCamSnapshotForImageImpl)
2086 iHistogramImpForImageSnapshot = CHistogramImpForImageSnapshot::NewL(aCamSnapshotForImageImpl.Owner(), aCamSnapshotForImageImpl);
2089 CHistogramFactoryForImageSnapshot::CHistogramFactoryForImageSnapshot() : iHistogramImpForImageSnapshot(NULL),
2090 iIsHistogramImpPassed(EFalse)
2094 CHistogramFactoryForImageSnapshot::~CHistogramFactoryForImageSnapshot()
2096 if(!iIsHistogramImpPassed)
2098 delete iHistogramImpForImageSnapshot;
2100 iHistogramImpForImageSnapshot = NULL;
2103 TInt CHistogramFactoryForImageSnapshot::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
2105 switch(aIfaceUid.iUid)
2107 case KECamMCameraV2HistogramUidValue:
2109 aIfPtr = static_cast<MCameraV2Histogram*>(iHistogramImpForImageSnapshot);
2110 iIsHistogramImpPassed = ETrue;
2116 return KErrNotSupported;
2121 TInt CHistogramFactoryForImageSnapshot::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
2123 return KErrNotSupported;
2126 TInt CHistogramFactoryForImageSnapshot::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
2128 return KErrNotSupported;
2131 void CHistogramFactoryForImageSnapshot::Release()
2137 //img proc impl for still images.
2138 CCamImgProcImpForImage* CCamImgProcImpForImage::NewL(CCamUnitTestPlugin& aOwner)
2140 return new(ELeave) CCamImgProcImpForImage(aOwner);
2143 CCamImgProcImpForImage::CCamImgProcImpForImage(CCamUnitTestPlugin& aOwner): iOwner(aOwner)
2147 CCamImgProcImpForImage::~CCamImgProcImpForImage()
2151 void CCamImgProcImpForImage::Release()
2156 void CCamImgProcImpForImage::GetSupportedTransformationsL(RArray<TUid>& aTransformations) const
2158 aTransformations.Reset();
2161 void CCamImgProcImpForImage::GetActiveTransformationsL(RArray<TUid>& aTransformations) const
2163 aTransformations.Reset();
2166 void CCamImgProcImpForImage::GetTransformationSupportedValuesL(TUid /*aTransformation*/, RArray<TInt>& aValues, TValueInfo& aInfo) const
2172 TInt CCamImgProcImpForImage::TransformationValue(TUid /*aTransformation*/) const
2174 return KErrNotSupported;
2177 TInt CCamImgProcImpForImage::GetTransformationValue(TUid /*aTransformation*/, TInt& /*aTransformationValue*/) const
2179 return KErrNotSupported;
2182 void CCamImgProcImpForImage::SetTransformationValue(TUid /*aTransformation*/, TInt /*aValue*/)
2187 void CCamImgProcImpForImage::GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const
2189 aTransformSequence.Reset();
2192 void CCamImgProcImpForImage::SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence)
2194 aTransformSequence.Reset();
2197 void CCamImgProcImpForImage::SetSourceRect(const TRect& /*aRect*/)
2202 void CCamImgProcImpForImage::GetSourceRect(TRect& /*aRect*/) const
2208 //img proc factory for still images.
2209 CImgProcFactoryForImage* CImgProcFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage)
2211 CImgProcFactoryForImage* self = new(ELeave) CImgProcFactoryForImage();
2213 CleanupStack::PushL(self);
2214 self->ConstructL(aCamImageCaptureImpl, aCamImgProcImpForImage);
2215 CleanupStack::Pop();
2220 void CImgProcFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage)
2222 if(aCamImgProcImpForImage == NULL)
2224 iCamImgProcImpForImage = CCamImgProcImpForImage::NewL(aCamImageCaptureImpl.Owner());
2225 aCamImageCaptureImpl.iCamImgProcImpForImage = iCamImgProcImpForImage;
2229 CImgProcFactoryForImage::CImgProcFactoryForImage() : iCamImgProcImpForImage(NULL),
2230 iIsImgProcImpPassed(EFalse)
2235 TECamImplFactoryParam factoryParam(ptr);
2236 TECamImplFactoryParam factoryParam1(value);
2237 TECamImplFactoryParam factoryParam2(param);
2240 CImgProcFactoryForImage::~CImgProcFactoryForImage()
2242 if(!iIsImgProcImpPassed)
2244 delete iCamImgProcImpForImage;
2246 iCamImgProcImpForImage = NULL;
2249 TInt CImgProcFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const
2251 switch(aIfaceUid.iUid)
2254 case KECamMCameraImageProcessingUidValue:
2256 aIfPtr = static_cast<MCameraImageProcessing*>(iCamImgProcImpForImage);
2257 iIsImgProcImpPassed = ETrue;
2263 return KErrNotSupported;
2268 TInt CImgProcFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const
2270 return KErrNotSupported;
2273 TInt CImgProcFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const
2275 return KErrNotSupported;
2278 void CImgProcFactoryForImage::Release()