sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // extendedfunctionality.cpp sl@0: // sl@0: // sl@0: sl@0: #include "extended_functionality.h" sl@0: #include "AdvancedSettings.h" sl@0: #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #include sl@0: #include "ecamdef.h" sl@0: #endif sl@0: sl@0: // sl@0: //pre image capture control impl sl@0: CCamPreImageCaptureControl* CCamPreImageCaptureControl::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: return new(ELeave) CCamPreImageCaptureControl(aOwner); sl@0: } sl@0: sl@0: CCamPreImageCaptureControl::CCamPreImageCaptureControl(CCamUnitTestPlugin& aOwner): iOwner(aOwner), sl@0: iPreImageCaptureControlObserver(NULL) sl@0: { sl@0: } sl@0: sl@0: CCamPreImageCaptureControl::~CCamPreImageCaptureControl() sl@0: { sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::SetPreImageCaptureControlObserver(MPreImageCaptureControlObserver& aPreImageCaptureControlObserver) sl@0: { sl@0: iPreImageCaptureControlObserver = &aPreImageCaptureControlObserver; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetDirectSnapshotSupportInfoL(TUint& aDirectSnapshotSupportInfo) const sl@0: { sl@0: aDirectSnapshotSupportInfo = CCamera::CCameraPreImageCaptureControl::EDirectSnapshotSupported; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetSupportedEmbeddedStillCaptureSettingsL(RArray& aSupportedEmbeddedStillCaptureSettings) const sl@0: { sl@0: aSupportedEmbeddedStillCaptureSettings.Reset(); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetSupportedDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aSupportedDirectSavingType) const sl@0: { sl@0: aSupportedDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::SetSequentialImageFilenameL(const TDesC8& /*aFilename*/, TInt /*aStartingSequenceNumber*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::SetLowerResolutionSequentialImageFilenameL(const TDesC8& /*aLowerResolutionFilename*/, TInt /*aStartingSequenceNumber*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aDirectSavingType) const sl@0: { sl@0: aDirectSavingType = CCamera::CCameraPreImageCaptureControl::EDirectSavingNotUsed; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::SetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType /*aDirectSavingType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetCaptureEventSupportInfoL(TUint& aSupportedDriveModes) const sl@0: { sl@0: aSupportedDriveModes = 0; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetImageFormatsSupportedL(TUint& aImageFormatsSupported, const TSize& /*aSize*/) const sl@0: { sl@0: aImageFormatsSupported = CCamera::EFormatFbsBitmapColor16M; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aImageFormat*/, const TSize& /*aSize*/) const sl@0: { sl@0: aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::PrepareImageCapture(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& sl@0: aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver) sl@0: { sl@0: //perform any prepare operation at hardware level eg. memory allocation etc. sl@0: CCamera::CCameraImageCapture* cameraImageCapture = NULL; sl@0: sl@0: TRAPD(err,CreateCaptureImageL(cameraImageCapture, aPrepareImageParameters, aCaptureImageObserver)); sl@0: sl@0: PreImageCaptureControlObserver()->PrepareImageComplete(cameraImageCapture, err); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetImageMaxMemorySizeSettingSupportInfoL(TBool& aIsImageMaxMemorySizeSettingSupported) const sl@0: { sl@0: aIsImageMaxMemorySizeSettingSupported = EFalse; sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& /*aMemorySize*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::GetSupportedProcessingOptionsL(TUint& /*aSupportedProcessingOptions*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPreImageCaptureControl::CreateCaptureImageL(CCamera::CCameraImageCapture*& aCameraImageCapture, const CCamera:: sl@0: CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver) sl@0: { sl@0: CCamera::CCameraImageCapture* cameraImageCapture = CCamera::CCameraImageCapture::CreateL(iOwner, aPrepareImageParameters, aCaptureImageObserver); sl@0: aCameraImageCapture = cameraImageCapture; sl@0: } sl@0: sl@0: // sl@0: //image capture impl sl@0: CCamImageCapture* CCamImageCapture::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: return new(ELeave) CCamImageCapture(aOwner); sl@0: } sl@0: sl@0: CCamImageCapture::CCamImageCapture(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), sl@0: iCaptureImageObserver(NULL), sl@0: iSnapshotImpForImage(NULL), sl@0: iCamImgProcImpForImage(NULL), sl@0: iCameraImageCapture(NULL) sl@0: { sl@0: iArrayPostCaptureControlId.Reset(); sl@0: iArrayPostCaptureControlHandle.Reset(); sl@0: iArrayPostCaptureControlImpl.Reset(); sl@0: } sl@0: sl@0: CCamImageCapture::~CCamImageCapture() sl@0: { sl@0: iArrayPostCaptureControlId.Close(); sl@0: iArrayPostCaptureControlHandle.Reset(); sl@0: iArrayPostCaptureControlImpl.Reset(); sl@0: iArrayPostCaptureControlHandle.Close(); sl@0: iArrayPostCaptureControlImpl.Close(); sl@0: } sl@0: sl@0: void CCamImageCapture::Release(CCamera::CCameraImageCapture* /*aCameraImageCapture*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CCamImageCapture::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CHistogramFactoryForImage::NewL(const_cast(*this)); sl@0: } sl@0: sl@0: void CCamImageCapture::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CSnapshotFactoryForImage::NewL(const_cast(*this), iSnapshotImpForImage); sl@0: } sl@0: sl@0: void CCamImageCapture::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CImgProcFactoryForImage::NewL(const_cast(*this), iCamImgProcImpForImage); sl@0: } sl@0: sl@0: void CCamImageCapture::SetCaptureImageObserver(MCaptureImageObserver& aCaptureImageObserver) sl@0: { sl@0: iCaptureImageObserver = &aCaptureImageObserver; sl@0: } sl@0: sl@0: void CCamImageCapture::GetPrepareImageParametersL(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) const sl@0: { sl@0: if(aPrepareImageParameters.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters) || sl@0: aPrepareImageParameters.Version() != KECamPrepareImageParametersCurrentVersion) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: if(aPrepareImageParameters.iDriveModeAttributes.Size() != sizeof(CCamera::CCameraPreImageCaptureControl::TDriveModeDependentAttributes) || sl@0: aPrepareImageParameters.iDriveModeAttributes.Version() != KECamDriveModeDependentAttributesCurrentVersion) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: aPrepareImageParameters = iPrepareImageParameters; sl@0: } sl@0: sl@0: void CCamImageCapture::SetPrepareImageParameters(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) sl@0: { sl@0: iPrepareImageParameters = aPrepareImageParameters; sl@0: } sl@0: sl@0: TAny* CCamImageCapture::CreatePostImageCaptureControlImpl(TUid aInterface, TPostCaptureControlId aPostCaptureControlId) sl@0: { sl@0: TInt err=KErrNone; sl@0: if(aInterface.iUid == KECamMCameraPostImageCaptureControlUidValue) sl@0: { sl@0: if(iArrayPostCaptureControlId.Find(aPostCaptureControlId) == KErrNotFound) sl@0: { sl@0: CCamPostImageCaptureControl* camPostImageCaptureControl = NULL; sl@0: TRAP(err, camPostImageCaptureControl = CCamPostImageCaptureControl::NewL(const_cast(*this))); sl@0: sl@0: if (err == KErrNone) sl@0: { sl@0: err = iArrayPostCaptureControlId.Append(aPostCaptureControlId); sl@0: if(err == KErrNone) sl@0: { sl@0: err = iArrayPostCaptureControlImpl.Append(camPostImageCaptureControl); sl@0: if(err != KErrNone) sl@0: { sl@0: iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1); sl@0: delete camPostImageCaptureControl; sl@0: return NULL; sl@0: } sl@0: else sl@0: { sl@0: return static_cast(camPostImageCaptureControl); sl@0: } sl@0: } sl@0: else sl@0: { sl@0: delete camPostImageCaptureControl; sl@0: return NULL; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: return NULL; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: return NULL; sl@0: } sl@0: } sl@0: else sl@0: { sl@0: return NULL; sl@0: } sl@0: } sl@0: sl@0: void CCamImageCapture::CaptureImage(CCamera::CCameraImageCapture* aCameraImageCapture) sl@0: { sl@0: TInt count = iArrayPostCaptureControlId.Count(); sl@0: while(count > 0) sl@0: { sl@0: iArrayPostCaptureControlId.Remove(count-1); sl@0: iArrayPostCaptureControlImpl.Remove(count-1); sl@0: delete iArrayPostCaptureControlHandle[count-1]; sl@0: iArrayPostCaptureControlHandle.Remove(count-1); sl@0: sl@0: count = iArrayPostCaptureControlId.Count(); sl@0: } sl@0: sl@0: iCameraImageCapture = aCameraImageCapture; sl@0: sl@0: //this will create Post Image capture control object. assume one such object is required. ( for demo purpose only) sl@0: CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = NULL; sl@0: sl@0: TRAPD(err,CreatePostImageCaptureControlL(postImageCaptureControl, 1)); sl@0: sl@0: if(err == KErrNone) sl@0: { sl@0: err = iArrayPostCaptureControlHandle.Append(postImageCaptureControl); sl@0: if(err != KErrNone) sl@0: { sl@0: iArrayPostCaptureControlId.Remove(iArrayPostCaptureControlId.Count()-1); sl@0: iArrayPostCaptureControlImpl.Remove(iArrayPostCaptureControlImpl.Count()-1); sl@0: delete postImageCaptureControl; sl@0: } sl@0: else sl@0: { sl@0: CaptureImageObserver()->IndividualImageControlHandle(*iCameraImageCapture, 1); sl@0: } sl@0: } sl@0: sl@0: CaptureImageObserver()->ImageCaptureComplete(*iCameraImageCapture, KErrNotSupported); sl@0: } sl@0: sl@0: void CCamImageCapture::CancelCaptureImage() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamImageCapture::GetNumImagesExposedL(TUint& /*aNumImagesExposed*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamImageCapture::GetNumTotalImagesL(TUint& aNumTotalImages) const sl@0: { sl@0: aNumTotalImages = 1; sl@0: } sl@0: sl@0: void CCamImageCapture::GetPostCaptureControlHandleL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle, sl@0: TPostCaptureControlId aPostCaptureControlId) const sl@0: { sl@0: TInt index = iArrayPostCaptureControlId.Find(aPostCaptureControlId); sl@0: User::LeaveIfError(index); sl@0: sl@0: aPostCaptureControlHandle = iArrayPostCaptureControlHandle[index]; sl@0: } sl@0: sl@0: void CCamImageCapture::SetCaptureImagePriorityL(TECamImagePriority /*aCaptureImagePriority*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamImageCapture::GetCaptureImagePriorityL(TECamImagePriority& /*aCaptureImagePriority*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamImageCapture::PauseProcessing(TUint /*aProcessingType*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamImageCapture::ResumeProcessingL(TUint /*aProcessingType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamImageCapture::CreatePostImageCaptureControlL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle, sl@0: TPostCaptureControlId aPostCaptureControlId) sl@0: { sl@0: CCamera::CCameraPostImageCaptureControl* postImageCaptureControl = CCamera::CCameraPostImageCaptureControl:: sl@0: CreateL(iCameraImageCapture, aPostCaptureControlId); sl@0: sl@0: aPostCaptureControlHandle = postImageCaptureControl; sl@0: } sl@0: sl@0: // sl@0: //post image capture control impl sl@0: sl@0: CCamPostImageCaptureControl* CCamPostImageCaptureControl::NewL(CCamImageCapture& aCamImageCaptureImpl) sl@0: { sl@0: return new(ELeave) CCamPostImageCaptureControl(aCamImageCaptureImpl); sl@0: } sl@0: sl@0: CCamPostImageCaptureControl::CCamPostImageCaptureControl(CCamImageCapture& aCamImageCaptureImpl) : sl@0: iCamImageCaptureImpl(aCamImageCaptureImpl) sl@0: { sl@0: } sl@0: sl@0: CCamPostImageCaptureControl::~CCamPostImageCaptureControl() sl@0: { sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::Release(TPostCaptureControlId aPostCaptureControlId) sl@0: { sl@0: //remove this id from the CCamImageCapture arrays sl@0: TInt index = iCamImageCaptureImpl.iArrayPostCaptureControlId.Find(aPostCaptureControlId); sl@0: sl@0: if(index >=0 ) sl@0: { sl@0: iCamImageCaptureImpl.iArrayPostCaptureControlId.Remove(index); sl@0: iCamImageCaptureImpl.iArrayPostCaptureControlImpl.Remove(index); sl@0: iCamImageCaptureImpl.iArrayPostCaptureControlHandle.Remove(index); sl@0: } sl@0: sl@0: delete this; sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::GetImageSequenceNumberL(TUint& /*aSequenceNumber*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::CancelImage() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::SetImagePriorityL(TECamImagePriority /*aImagePriority*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::GetImagePriorityL(TECamImagePriority& /*aImagePriority*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::PauseProcessing(TUint /*aProcessingType*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::ResumeProcessingL(TUint /*aProcessingType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::GetImageBufferL(MCameraImageBuffer& /*aCameraImageBuffer*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::GetImageStateL(CCamera::CCameraPostImageCaptureControl::TImageState& /*aImageState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamPostImageCaptureControl::GetBufferStateL(CCamera::CCameraPostImageCaptureControl::TBufferState& /*aBufferState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: // sl@0: //video capture control impl sl@0: sl@0: CCamVideoCaptureControl* CCamVideoCaptureControl::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: CCamVideoCaptureControl* self = new(ELeave) CCamVideoCaptureControl(aOwner); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::ConstructL() sl@0: { sl@0: User::LeaveIfError(RFbsSession::Connect()); sl@0: sl@0: iBitmap = new(ELeave) CFbsBitmap; sl@0: User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M)); sl@0: } sl@0: sl@0: CCamVideoCaptureControl::CCamVideoCaptureControl(CCamUnitTestPlugin& aOwner) : sl@0: iOwner(aOwner), sl@0: iCaptureVideoObserver(NULL), sl@0: iSnapshotImpForVideo(NULL) sl@0: { sl@0: } sl@0: sl@0: CCamVideoCaptureControl::~CCamVideoCaptureControl() sl@0: { sl@0: delete iBitmap; sl@0: RFbsSession::Disconnect(); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CHistogramFactoryForVideo::NewL(const_cast(*this)); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CSnapshotFactoryForVideo::NewL(const_cast(*this), iSnapshotImpForVideo); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = NULL; sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::SetCaptureVideoObserver(MCaptureVideoObserver& aCaptureVideoObserver) sl@0: { sl@0: iCaptureVideoObserver = &aCaptureVideoObserver; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetVideoFormatsSupportedL(TUint& aVideoFormatsSupported, const TSize& /*aSize*/) const sl@0: { sl@0: aVideoFormatsSupported = CCamera::EFormatFbsBitmapColor16M; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat /*aVideoFormat*/, const TSize& /*aSize*/) const sl@0: { sl@0: aPixelAspectsSupported = CCamera::CCameraAdvancedSettings::EPixelAspect1To1; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetEmbeddedStillCaptureSupportInfoL(TInt& aSupportedEmbeddedStillCaptureTypes) const sl@0: { sl@0: aSupportedEmbeddedStillCaptureTypes = CCamera::CCameraVideoCaptureControl::EEmbeddedStillCaptureNotSupported; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::PrepareVideoCapture(const CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters) sl@0: { sl@0: if(((aPrepareVideoParameters.Size() != sizeof(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters)) || sl@0: aPrepareVideoParameters.Version() != KECamPrepareVideoParametersCurrentVersion)) sl@0: { sl@0: iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNotSupported); sl@0: } sl@0: sl@0: iPrepareVideoParameters = aPrepareVideoParameters; sl@0: sl@0: iOwner.Notify(KUidECamEventVideoCaptureControlPrepareComplete, KErrNone); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetRangeAffectedSettingsL(RArray& aRangeAffectedSettings) const sl@0: { sl@0: aRangeAffectedSettings.Reset(); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetValueAffectedSettingsL(RArray& aValueAffectedSettings) const sl@0: { sl@0: aValueAffectedSettings.Reset(); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetDisabledSettingsL(RArray& aDisabledSettings) const sl@0: { sl@0: aDisabledSettings.Reset(); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::ReleaseVideoResource() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::StartVideoCaptureL() sl@0: { sl@0: RCamBuffer2 videoBuffer(iBitmap); sl@0: sl@0: if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EVideoCaptureNotSupported) sl@0: { sl@0: CaptureVideoObserver()->DirectVideoCaptureFailed(KErrNotSupported); sl@0: } sl@0: else sl@0: { sl@0: if(iPrepareVideoParameters.VideoCaptureType() != CCamera::CCameraVideoCaptureControl::EClientVideoCapture) sl@0: { sl@0: CaptureVideoObserver()->VideoBufferReady(NULL, KErrNotSupported); sl@0: } sl@0: } sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::StopVideoCapture() sl@0: { sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::PauseVideoCapture() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::ResumeVideoCaptureL() sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetFadingEffectStateL(CCamera::CCameraVideoCaptureControl::TFadingEffectState& /*aFadingEffectState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::SetFadingEffectState(CCamera::CCameraVideoCaptureControl::TFadingEffectState /*aFadingEffectState*/) sl@0: { sl@0: iOwner.Notify(KUidECamEventVideoCaptureControlFadingEffect, KErrNotSupported); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetVideoCaptureStateL(CCamera::CCameraVideoCaptureControl::TVideoCaptureState& /*aVideoCaptureState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetVideoCaptureSupportInfoL(TInt& aSupportedVideoCaptureTypes) const sl@0: { sl@0: aSupportedVideoCaptureTypes = KSupportedDirectVCType; sl@0: } sl@0: sl@0: void CCamVideoCaptureControl::GetPrepareVideoParametersL(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters) const sl@0: { sl@0: aPrepareVideoParameters = iPrepareVideoParameters; sl@0: } sl@0: sl@0: sl@0: // sl@0: //Direct Snapshot impl for version2 direct viewfinder sl@0: // sl@0: CCamDirectSnapshot::CCamDirectSnapshot() : iCameraV2DirectVF(NULL), sl@0: iDirectSnapshotState(CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled) sl@0: { sl@0: } sl@0: sl@0: CCamDirectSnapshot* CCamDirectSnapshot::NewL() sl@0: { sl@0: return new (ELeave) CCamDirectSnapshot; sl@0: } sl@0: sl@0: CCamDirectSnapshot::~CCamDirectSnapshot() sl@0: { sl@0: } sl@0: sl@0: void CCamDirectSnapshot::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::SetDirectViewFinder(const CCamera::CCameraV2DirectViewFinder* aDirectViewFinder) sl@0: { sl@0: iCameraV2DirectVF = aDirectViewFinder; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const sl@0: { sl@0: aDirectViewFinder = const_cast(iCameraV2DirectVF); sl@0: } sl@0: sl@0: void CCamDirectSnapshot::EnableDirectSnapshotL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) sl@0: { sl@0: iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotEnabled; sl@0: iDirectSnapshotParameters = aDirectSnapshotParameters; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::DisableDirectSnapshot() sl@0: { sl@0: iDirectSnapshotState = CCamera::CCameraDirectSnapshot::EDirectSnapshotDisabled; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::GetDirectSnapshotStateL(CCamera::CCameraDirectSnapshot::TDirectSnapshotState& aDirectSnapshotState) const sl@0: { sl@0: aDirectSnapshotState = iDirectSnapshotState; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::GetDirectSnapshotParametersL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) const sl@0: { sl@0: aDirectSnapshotParameters = iDirectSnapshotParameters; sl@0: } sl@0: sl@0: void CCamDirectSnapshot::SetDirectSnapshotParametersL(const CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) sl@0: { sl@0: iDirectSnapshotParameters = aDirectSnapshotParameters; sl@0: } sl@0: sl@0: // sl@0: //V2 direct viewfinder impl sl@0: // sl@0: CCamV2DirectViewFinder* CCamV2DirectViewFinder::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: CDataGlobal* globalData = static_cast (Dll::Tls()); sl@0: sl@0: if(!globalData) sl@0: { sl@0: globalData = new (ELeave) CDataGlobal; sl@0: CleanupStack::PushL(globalData); sl@0: sl@0: globalData->iReferenceCount = 0; sl@0: globalData->iCamV2DirectViewFinder = new (ELeave) CCamV2DirectViewFinder(aOwner); sl@0: globalData->iCamV2DirectViewFinder->iRefCount = 1; sl@0: sl@0: TInt error = Dll::SetTls(globalData); sl@0: if (error) sl@0: { sl@0: delete globalData->iCamV2DirectViewFinder; sl@0: User::Leave(error); sl@0: } sl@0: CleanupStack::Pop(globalData); sl@0: sl@0: return static_cast (globalData->iCamV2DirectViewFinder); sl@0: } sl@0: else sl@0: { sl@0: CCamV2DirectViewFinder* self = globalData->iCamV2DirectViewFinder; sl@0: sl@0: globalData->iReferenceCount++; sl@0: self->iRefCount = globalData->iReferenceCount + 1; sl@0: if (globalData->iReferenceCount == 1) sl@0: { sl@0: delete globalData; sl@0: Dll::FreeTls(); sl@0: } sl@0: else sl@0: { sl@0: TInt error = Dll::SetTls(globalData); sl@0: if (error) sl@0: { sl@0: delete globalData->iCamV2DirectViewFinder; sl@0: User::Leave(error); sl@0: } sl@0: } sl@0: return static_cast (self); sl@0: } sl@0: } sl@0: sl@0: CCamV2DirectViewFinder::CCamV2DirectViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0), iDirectSnapshot(NULL) sl@0: { sl@0: //dummy scheme or impl dependent scheme sl@0: //server may generate unique handle no. for each such objects sl@0: iOwner.GenerateVFHandle(iVFHandle); sl@0: } sl@0: sl@0: CCamV2DirectViewFinder::~CCamV2DirectViewFinder() sl@0: { sl@0: Dll::FreeTls(); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::Release(CCamera::CCameraV2DirectViewFinder* /*aDirectViewFinderHandle*/) sl@0: { sl@0: iRefCount--; sl@0: if(!iRefCount) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::Release() sl@0: { sl@0: iRefCount--; sl@0: if(!iRefCount) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const sl@0: { sl@0: if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) || sl@0: (aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const sl@0: { sl@0: if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) || sl@0: (aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/) sl@0: { sl@0: iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const sl@0: { sl@0: aVFHandle = iVFHandle; sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CHistogramFactoryForDirectViewFinder::NewL(const_cast(*this)); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = NULL; sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::SetDirectViewFinderObserver(MDirectViewFinderObserver& aDirectViewFinderObserver) sl@0: { sl@0: iDirectViewFinderObserver = &aDirectViewFinderObserver; sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::SetDirectViewFinderHandle(CCamera::CCameraV2DirectViewFinder* aDirectViewFinderHandle) sl@0: { sl@0: iDirectViewFinderHandle = aDirectViewFinderHandle; sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/) sl@0: { sl@0: DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::StartViewFinderDirectL(RWsSession& /*aWs*/, CWsScreenDevice& /*aScreenDevice*/, RWindowBase& /*aWindow*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/) sl@0: { sl@0: DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetDirectViewFinderPropertiesL(TInt& /*aScreenNumber*/, TRect& /*aScreenRect*/, TRect& /*aClipRect*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::PauseViewFinderDirect() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::ResumeViewFinderDirect() sl@0: { sl@0: DirectViewFinderObserver()->DirectViewFinderFirstFrameDisplayed(DirectViewFinderHandle(), KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::GetViewFinderStateL(CCamera::CCameraV2DirectViewFinder::TViewFinderState& /*aViewFinderState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamV2DirectViewFinder::StopDirectViewFinder() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: /* Dummy test*/ sl@0: TAny* CCamV2DirectViewFinder::GetDirectSnapshotImpl(TUid aInterface) const sl@0: { sl@0: switch(aInterface.iUid) sl@0: { sl@0: case KECamMCameraDirectSnapshotUidValue: sl@0: { sl@0: if(iDirectSnapshot == NULL) sl@0: { sl@0: TRAPD(err,iDirectSnapshot = CCamDirectSnapshot::NewL()); sl@0: if (err != KErrNone) sl@0: { sl@0: return NULL; sl@0: } sl@0: } sl@0: return static_cast(iDirectSnapshot); sl@0: } sl@0: default: sl@0: return NULL; sl@0: } sl@0: } sl@0: sl@0: // sl@0: //Client viewfinder impl sl@0: CCamClientViewFinder* CCamClientViewFinder::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: CDataGlobal* globalData = static_cast (Dll::Tls()); sl@0: sl@0: if(!globalData) sl@0: { sl@0: globalData = new (ELeave) CDataGlobal; sl@0: CleanupStack::PushL(globalData); sl@0: sl@0: globalData->iReferenceCount = 0; sl@0: globalData->iCamClientViewFinder = new (ELeave) CCamClientViewFinder(aOwner); sl@0: globalData->iCamClientViewFinder->iRefCount = 1; sl@0: sl@0: TInt error = Dll::SetTls(globalData); sl@0: if (error) sl@0: { sl@0: delete globalData->iCamClientViewFinder; sl@0: User::Leave(error); sl@0: } sl@0: CleanupStack::Pop(globalData); sl@0: sl@0: return static_cast (globalData->iCamClientViewFinder); sl@0: } sl@0: else sl@0: { sl@0: CCamClientViewFinder* self = globalData->iCamClientViewFinder; sl@0: sl@0: globalData->iReferenceCount++; sl@0: self->iRefCount = globalData->iReferenceCount + 1; sl@0: if (globalData->iReferenceCount == 1) sl@0: { sl@0: delete globalData; sl@0: Dll::FreeTls(); sl@0: } sl@0: else sl@0: { sl@0: TInt error = Dll::SetTls(globalData); sl@0: if (error) sl@0: { sl@0: delete globalData->iCamClientViewFinder; sl@0: User::Leave(error); sl@0: } sl@0: } sl@0: return static_cast (self); sl@0: } sl@0: } sl@0: sl@0: CCamClientViewFinder::CCamClientViewFinder(CCamUnitTestPlugin& aOwner) : iOwner(aOwner), iVFHandle(0) sl@0: { sl@0: //dummy scheme or impl dependent scheme sl@0: //server may generate unique handle no. for each such objects sl@0: iOwner.GenerateVFHandle(iVFHandle); sl@0: } sl@0: sl@0: CCamClientViewFinder::~CCamClientViewFinder() sl@0: { sl@0: Dll::FreeTls(); sl@0: } sl@0: sl@0: void CCamClientViewFinder::Release(CCamera::CCameraClientViewFinder* /*aClientViewFinderHandle*/) sl@0: { sl@0: iRefCount--; sl@0: if(!iRefCount) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: void CCamClientViewFinder::Release() sl@0: { sl@0: iRefCount--; sl@0: if(!iRefCount) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const sl@0: { sl@0: if((aVFFadingCapabilities.Size() != sizeof(CCameraViewFinder::TViewFinderFadingCapabilities)) || sl@0: (aVFFadingCapabilities.Version() != KECamViewFinderFadingCapabilitiesCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const sl@0: { sl@0: if((aCurrentVFFadingEffect.Size() != sizeof(CCameraViewFinder::TViewFinderFadingEffect)) || sl@0: (aCurrentVFFadingEffect.Version() != KECamViewFinderFadingEffectCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& /*aVFFadingEffect*/) sl@0: { sl@0: iOwner.Notify2(KUidECamEvent2ViewFinderFadingEffect, KErrNotSupported, iVFHandle); sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetViewFinderHandleL(TInt& aVFHandle) const sl@0: { sl@0: aVFHandle = iVFHandle; sl@0: } sl@0: sl@0: void CCamClientViewFinder::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CHistogramFactoryForClientViewFinder::NewL(const_cast(*this)); sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = NULL; sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::SetClientViewFinderObserver(MClientViewFinderObserver& aClientViewFinderObserver) sl@0: { sl@0: iClientViewFinderObserver = &aClientViewFinderObserver; sl@0: } sl@0: sl@0: void CCamClientViewFinder::SetClientViewFinderHandle(CCamera::CCameraClientViewFinder* aClientViewFinderHandle) sl@0: { sl@0: iClientViewFinderHandle = aClientViewFinderHandle; sl@0: } sl@0: sl@0: void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/) sl@0: { sl@0: ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::StartClientViewFinderL(TInt /*aScreenNumber*/, CCamera::TFormat /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/) sl@0: { sl@0: ClientViewFinderObserver()->ViewFinderBufferReady(ClientViewFinderHandle(), KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetClientViewFinderStateL(TBool& /*aIsActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetClientViewFinderPropertiesL(TInt& /*aScreenNumber*/, CCamera::TFormat& /*aImageFormat*/, TSize& /*aSize*/, TRect& /*aClipRect*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamClientViewFinder::StopClientViewFinder() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamClientViewFinder::GetViewFinderBufferL(MCameraBuffer2& /*aClientViewFinderBuffer*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: // sl@0: //Snapshot impl for Image sl@0: CCamSnapshotForImage* CCamSnapshotForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl) sl@0: { sl@0: CCamSnapshotForImage* self = new(ELeave) CCamSnapshotForImage(aOwner, aCamImageCaptureImpl); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::ConstructL() sl@0: { sl@0: User::LeaveIfError(RFbsSession::Connect()); sl@0: sl@0: iBitmap = new(ELeave) CFbsBitmap; sl@0: User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M)); sl@0: } sl@0: sl@0: CCamSnapshotForImage::CCamSnapshotForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl) sl@0: : iOwner(aOwner), sl@0: iCamImageCaptureImpl(aCamImageCaptureImpl), sl@0: iSnapshotbuffer(iBitmap), sl@0: iRefCount(2) sl@0: { sl@0: } sl@0: sl@0: CCamSnapshotForImage::~CCamSnapshotForImage() sl@0: { sl@0: delete iBitmap; sl@0: RFbsSession::Disconnect(); sl@0: } sl@0: sl@0: TUint32 CCamSnapshotForImage::SupportedFormats() sl@0: { sl@0: return CCamera::EFormatFbsBitmapColor16M; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::SetBgColorL(const TRgb& /*aBgColor*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::SetPositionL(const TPoint& /*aPosition*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TBool CCamSnapshotForImage::IsSnapshotActive() const sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::StartSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::StopSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: MCameraBuffer& CCamSnapshotForImage::SnapshotDataL(RArray& /*aFrameIndexOrder*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: return iSnapshotbuffer; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = CHistogramFactoryForImageSnapshot::NewL(const_cast(*this)); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) || sl@0: aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion ) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: iSnapshotParameters = aSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: aSnapshotParameters = iSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: iSnapshotParameters = aSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::EnableSnapshot() sl@0: { sl@0: CamImageCaptureImpl().CaptureImageObserver()->ClientSnapshotForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForImage::DisableSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: /* dummy */ sl@0: void CCamSnapshotForImage::SetClientViewFinderId(TInt /*aClientViewFinderId*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamSnapshotForImage::Release() sl@0: { sl@0: iRefCount--; sl@0: if(iRefCount == 0) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: // sl@0: //Snapshot factory for Image sl@0: CSnapshotFactoryForImage* CSnapshotFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage) sl@0: { sl@0: CSnapshotFactoryForImage* self = new(ELeave) CSnapshotFactoryForImage(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamImageCaptureImpl, aSnapshotImpForImage); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CSnapshotFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage) sl@0: { sl@0: if(aSnapshotImpForImage == NULL) sl@0: { sl@0: iSnapshotImpForImage = CCamSnapshotForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl); sl@0: aCamImageCaptureImpl.iSnapshotImpForImage = iSnapshotImpForImage; sl@0: } sl@0: } sl@0: sl@0: CSnapshotFactoryForImage::CSnapshotFactoryForImage() : iSnapshotImpForImage(NULL), sl@0: iIsSnapshotImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CSnapshotFactoryForImage::~CSnapshotFactoryForImage() sl@0: { sl@0: if(!iIsSnapshotImpPassed) sl@0: { sl@0: delete iSnapshotImpForImage; sl@0: } sl@0: iSnapshotImpForImage = NULL; sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: //fall through sl@0: case KECamMCameraSnapshotUidValue: sl@0: { sl@0: aIfPtr = static_cast(iSnapshotImpForImage); sl@0: iIsSnapshotImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: sl@0: case KECamMCameraSnapshot2UidValue: sl@0: { sl@0: aIfPtr = static_cast(iSnapshotImpForImage); sl@0: iIsSnapshotImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CSnapshotFactoryForImage::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // sl@0: //Snapshot impl for Video sl@0: CCamSnapshotForVideo* CCamSnapshotForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl) sl@0: { sl@0: CCamSnapshotForVideo* self = new(ELeave) CCamSnapshotForVideo(aOwner, aCamVideoCaptureControlImpl); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::ConstructL() sl@0: { sl@0: User::LeaveIfError(RFbsSession::Connect()); sl@0: sl@0: iBitmap = new(ELeave) CFbsBitmap; sl@0: User::LeaveIfError(iBitmap->Create(TSize(320,240), EColor16M)); sl@0: } sl@0: sl@0: CCamSnapshotForVideo::CCamSnapshotForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl) : sl@0: iOwner(aOwner), sl@0: iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl), sl@0: iSnapshotbuffer(iBitmap), sl@0: iRefCount(2) sl@0: sl@0: { sl@0: } sl@0: sl@0: CCamSnapshotForVideo::~CCamSnapshotForVideo() sl@0: { sl@0: delete iBitmap; sl@0: RFbsSession::Disconnect(); sl@0: } sl@0: sl@0: TUint32 CCamSnapshotForVideo::SupportedFormats() sl@0: { sl@0: return CCamera::EFormatFbsBitmapColor16M; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TPoint& /*aPosition*/, const TSize& /*aSize*/, const TRgb& /*aBgColor*/, TBool /*aMaintainAspectRatio*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::PrepareSnapshotL(CCamera::TFormat /*aFormat*/, const TSize& /*aSize*/, TBool /*aMaintainAspectRatio*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::SetBgColorL(const TRgb& /*aBgColor*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::SetPositionL(const TPoint& /*aPosition*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: TBool CCamSnapshotForVideo::IsSnapshotActive() const sl@0: { sl@0: return EFalse; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::StartSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::StopSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: MCameraBuffer& CCamSnapshotForVideo::SnapshotDataL(RArray& /*aFrameIndexOrder*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: return iSnapshotbuffer; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const sl@0: { sl@0: aImplFactoryPtr = NULL; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: if( aSnapshotParameters.Size() != sizeof(CCamera::CCameraSnapshot::TSnapshotParameters) || sl@0: aSnapshotParameters.Version() != KECamSnapshotParametersCurrentVersion ) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: iSnapshotParameters = aSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: aSnapshotParameters = iSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters) sl@0: { sl@0: iSnapshotParameters = aSnapshotParameters; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& /*aSnapshotState*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames /*aSnapshotVideoFrames*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::EnableSnapshot() sl@0: { sl@0: CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientSnapshotReady(NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::DisableSnapshot() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: /* dummy */ sl@0: void CCamSnapshotForVideo::SetClientViewFinderId(TInt /*aClientViewFinderId*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamSnapshotForVideo::Release() sl@0: { sl@0: iRefCount--; sl@0: if(iRefCount == 0) sl@0: { sl@0: delete this; sl@0: } sl@0: } sl@0: sl@0: // sl@0: //snapshot factory for video sl@0: CSnapshotFactoryForVideo* CSnapshotFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo) sl@0: { sl@0: CSnapshotFactoryForVideo* self = new(ELeave) CSnapshotFactoryForVideo(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamVideoCaptureControlImpl, aSnapshotImpForVideo); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CSnapshotFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo) sl@0: { sl@0: if(aSnapshotImpForVideo == NULL) sl@0: { sl@0: iSnapshotImpForVideo = CCamSnapshotForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl); sl@0: aCamVideoCaptureControlImpl.iSnapshotImpForVideo = iSnapshotImpForVideo; sl@0: } sl@0: } sl@0: sl@0: CSnapshotFactoryForVideo::CSnapshotFactoryForVideo() : iSnapshotImpForVideo(NULL), sl@0: iIsSnapshotImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CSnapshotFactoryForVideo::~CSnapshotFactoryForVideo() sl@0: { sl@0: if(!iIsSnapshotImpPassed) sl@0: { sl@0: delete iSnapshotImpForVideo; sl@0: } sl@0: iSnapshotImpForVideo = NULL; sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: //fall through sl@0: case KECamMCameraSnapshotUidValue: sl@0: { sl@0: aIfPtr = static_cast(iSnapshotImpForVideo); sl@0: iIsSnapshotImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: sl@0: case KECamMCameraSnapshot2UidValue: sl@0: { sl@0: aIfPtr = static_cast(iSnapshotImpForVideo); sl@0: iIsSnapshotImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CSnapshotFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CSnapshotFactoryForVideo::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // sl@0: // Histogram impl for video sl@0: CHistogramImpForVideo* CHistogramImpForVideo::NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl) sl@0: { sl@0: return new(ELeave) CHistogramImpForVideo(aOwner, aCamVideoCaptureControlImpl); sl@0: } sl@0: sl@0: CHistogramImpForVideo::CHistogramImpForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl): sl@0: iOwner(aOwner), iCamVideoCaptureControlImpl(aCamVideoCaptureControlImpl) sl@0: { sl@0: } sl@0: sl@0: CHistogramImpForVideo::~CHistogramImpForVideo() sl@0: { sl@0: } sl@0: sl@0: void CHistogramImpForVideo::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CHistogramImpForVideo::SetHistogramHandle(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForVideo::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const sl@0: { sl@0: aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone; sl@0: } sl@0: sl@0: void CHistogramImpForVideo::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) sl@0: { sl@0: if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) || sl@0: (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::StartHistogram() sl@0: { sl@0: RCamHistogramV2Buffer camHistogramV2Buffer; sl@0: sl@0: CamVideoCaptureControlImpl().CaptureVideoObserver()->ClientHistogramReady(NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForVideo::StopHistogram() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForVideo::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: //Hisotgram factory for Video sl@0: CHistogramFactoryForVideo* CHistogramFactoryForVideo::NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl) sl@0: { sl@0: CHistogramFactoryForVideo* self = new(ELeave) CHistogramFactoryForVideo(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamVideoCaptureControlImpl); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CHistogramFactoryForVideo::ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl) sl@0: { sl@0: iHistogramImpForVideo = CHistogramImpForVideo::NewL(aCamVideoCaptureControlImpl.Owner(), aCamVideoCaptureControlImpl); sl@0: } sl@0: sl@0: CHistogramFactoryForVideo::CHistogramFactoryForVideo() : iHistogramImpForVideo(NULL), sl@0: iIsHistogramImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CHistogramFactoryForVideo::~CHistogramFactoryForVideo() sl@0: { sl@0: if(!iIsHistogramImpPassed) sl@0: { sl@0: delete iHistogramImpForVideo; sl@0: } sl@0: iHistogramImpForVideo = NULL; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForVideo::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: case KECamMCameraV2HistogramUidValue: sl@0: { sl@0: aIfPtr = static_cast(iHistogramImpForVideo); sl@0: iIsHistogramImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CHistogramFactoryForVideo::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForVideo::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CHistogramFactoryForVideo::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // Histogram impl for image sl@0: CHistogramImpForImage* CHistogramImpForImage::NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl) sl@0: { sl@0: return new(ELeave) CHistogramImpForImage(aOwner, aCamImageCaptureImpl); sl@0: } sl@0: sl@0: CHistogramImpForImage::CHistogramImpForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl): sl@0: iOwner(aOwner), iCamImageCaptureImpl(aCamImageCaptureImpl) sl@0: { sl@0: } sl@0: sl@0: CHistogramImpForImage::~CHistogramImpForImage() sl@0: { sl@0: } sl@0: sl@0: void CHistogramImpForImage::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CHistogramImpForImage::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle) sl@0: { sl@0: iHistogramHandle = aHistogramHandle; sl@0: } sl@0: sl@0: void CHistogramImpForImage::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const sl@0: { sl@0: aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone; sl@0: } sl@0: sl@0: void CHistogramImpForImage::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) sl@0: { sl@0: if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) || sl@0: (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::StartHistogram() sl@0: { sl@0: RCamHistogramV2Buffer camHistogramV2Buffer; sl@0: CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForImageReady(CameraImageCapture(), 1, NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImage::StopHistogram() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForImage::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: //Hisotgram factory for Image sl@0: CHistogramFactoryForImage* CHistogramFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl) sl@0: { sl@0: CHistogramFactoryForImage* self = new(ELeave) CHistogramFactoryForImage(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamImageCaptureImpl); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CHistogramFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl) sl@0: { sl@0: iHistogramImpForImage = CHistogramImpForImage::NewL(aCamImageCaptureImpl.Owner(), aCamImageCaptureImpl); sl@0: } sl@0: sl@0: CHistogramFactoryForImage::CHistogramFactoryForImage() : iHistogramImpForImage(NULL), sl@0: iIsHistogramImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CHistogramFactoryForImage::~CHistogramFactoryForImage() sl@0: { sl@0: if(!iIsHistogramImpPassed) sl@0: { sl@0: delete iHistogramImpForImage; sl@0: } sl@0: iHistogramImpForImage = NULL; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: case KECamMCameraV2HistogramUidValue: sl@0: { sl@0: aIfPtr = static_cast(iHistogramImpForImage); sl@0: iIsHistogramImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CHistogramFactoryForImage::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // Histogram impl for direct view finder sl@0: CHistogramImpForDirectViewFinder* CHistogramImpForDirectViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl) sl@0: { sl@0: return new(ELeave) CHistogramImpForDirectViewFinder(aOwner, aCamV2DirectViewFinderImpl); sl@0: } sl@0: sl@0: CHistogramImpForDirectViewFinder::CHistogramImpForDirectViewFinder(CCamUnitTestPlugin& aOwner, sl@0: CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl): iOwner(aOwner), sl@0: iCamV2DirectViewFinderImpl(aCamV2DirectViewFinderImpl) sl@0: { sl@0: } sl@0: sl@0: CHistogramImpForDirectViewFinder::~CHistogramImpForDirectViewFinder() sl@0: { sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle) sl@0: { sl@0: iHistogramHandle = aHistogramHandle; sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const sl@0: { sl@0: aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone; sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) sl@0: { sl@0: if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) || sl@0: (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::StartHistogram() sl@0: { sl@0: RCamHistogramV2Buffer camHistogramV2Buffer; sl@0: DirectViewFinderImpl().DirectViewFinderObserver()->ClientHistogramReady(DirectViewFinderImpl().DirectViewFinderHandle(), NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::StopHistogram() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForDirectViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: //Hisotgram factory for Direct View Finder sl@0: CHistogramFactoryForDirectViewFinder* CHistogramFactoryForDirectViewFinder::NewL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl) sl@0: { sl@0: CHistogramFactoryForDirectViewFinder* self = new(ELeave) CHistogramFactoryForDirectViewFinder(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamV2DirectViewFinderImpl); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CHistogramFactoryForDirectViewFinder::ConstructL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl) sl@0: { sl@0: iHistogramImpForDirectViewFinder = CHistogramImpForDirectViewFinder::NewL(aCamV2DirectViewFinderImpl.Owner(), aCamV2DirectViewFinderImpl); sl@0: } sl@0: sl@0: CHistogramFactoryForDirectViewFinder::CHistogramFactoryForDirectViewFinder() : iHistogramImpForDirectViewFinder(NULL), sl@0: iIsHistogramImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CHistogramFactoryForDirectViewFinder::~CHistogramFactoryForDirectViewFinder() sl@0: { sl@0: if(!iIsHistogramImpPassed) sl@0: { sl@0: delete iHistogramImpForDirectViewFinder; sl@0: } sl@0: iHistogramImpForDirectViewFinder = NULL; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForDirectViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: case KECamMCameraV2HistogramUidValue: sl@0: { sl@0: aIfPtr = static_cast(iHistogramImpForDirectViewFinder); sl@0: iIsHistogramImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CHistogramFactoryForDirectViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForDirectViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CHistogramFactoryForDirectViewFinder::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // Histogram impl for client view finder sl@0: CHistogramImpForClientViewFinder* CHistogramImpForClientViewFinder::NewL(CCamUnitTestPlugin& aOwner, CCamClientViewFinder& aCamClientViewFinderImpl) sl@0: { sl@0: return new(ELeave) CHistogramImpForClientViewFinder(aOwner, aCamClientViewFinderImpl); sl@0: } sl@0: sl@0: CHistogramImpForClientViewFinder::CHistogramImpForClientViewFinder(CCamUnitTestPlugin& aOwner, sl@0: CCamClientViewFinder& aCamClientViewFinderImpl): iOwner(aOwner), sl@0: iCamClientViewFinderImpl(aCamClientViewFinderImpl) sl@0: { sl@0: } sl@0: sl@0: CHistogramImpForClientViewFinder::~CHistogramImpForClientViewFinder() sl@0: { sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle) sl@0: { sl@0: iHistogramHandle = aHistogramHandle; sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const sl@0: { sl@0: aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone; sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) sl@0: { sl@0: if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) || sl@0: (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::StartHistogram() sl@0: { sl@0: RCamHistogramV2Buffer camHistogramV2Buffer; sl@0: ClientViewFinderImpl().ClientViewFinderObserver()->ClientHistogramReady(ClientViewFinderHandle(), NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::StopHistogram() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForClientViewFinder::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: //Hisotgram factory for Client View Finder sl@0: CHistogramFactoryForClientViewFinder* CHistogramFactoryForClientViewFinder::NewL(CCamClientViewFinder& aCamClientViewFinderImpl) sl@0: { sl@0: CHistogramFactoryForClientViewFinder* self = new(ELeave) CHistogramFactoryForClientViewFinder(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamClientViewFinderImpl); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CHistogramFactoryForClientViewFinder::ConstructL(CCamClientViewFinder& aCamClientViewFinderImpl) sl@0: { sl@0: iHistogramImpForClientViewFinder = CHistogramImpForClientViewFinder::NewL(aCamClientViewFinderImpl.Owner(), aCamClientViewFinderImpl); sl@0: } sl@0: sl@0: CHistogramFactoryForClientViewFinder::CHistogramFactoryForClientViewFinder() : iHistogramImpForClientViewFinder(NULL), sl@0: iIsHistogramImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CHistogramFactoryForClientViewFinder::~CHistogramFactoryForClientViewFinder() sl@0: { sl@0: if(!iIsHistogramImpPassed) sl@0: { sl@0: delete iHistogramImpForClientViewFinder; sl@0: } sl@0: sl@0: iHistogramImpForClientViewFinder = NULL; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForClientViewFinder::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: case KECamMCameraV2HistogramUidValue: sl@0: { sl@0: aIfPtr = static_cast(iHistogramImpForClientViewFinder); sl@0: iIsHistogramImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CHistogramFactoryForClientViewFinder::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForClientViewFinder::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CHistogramFactoryForClientViewFinder::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // Histogram impl for image snapshot sl@0: CHistogramImpForImageSnapshot* CHistogramImpForImageSnapshot::NewL(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl) sl@0: { sl@0: return new(ELeave) CHistogramImpForImageSnapshot(aOwner, aCamSnapshotForImageImpl); sl@0: } sl@0: sl@0: CHistogramImpForImageSnapshot::CHistogramImpForImageSnapshot(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl): sl@0: iOwner(aOwner), sl@0: iCamSnapshotForImageImpl(aCamSnapshotForImageImpl) sl@0: { sl@0: } sl@0: sl@0: CHistogramImpForImageSnapshot::~CHistogramImpForImageSnapshot() sl@0: { sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::Release(CCamera::CCameraV2Histogram* /*aHistogramHandle*/) sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle) sl@0: { sl@0: iHistogramHandle = aHistogramHandle; sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::GetSupportedHistogramsL(TUint& aSupportedHistogramType) const sl@0: { sl@0: aSupportedHistogramType = CCamera::CCameraV2Histogram::EHistNone; sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::GetDirectHistogramSupportInfoL(TBool& /*aIsDirectHistogramSupported*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType /*aType*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) sl@0: { sl@0: if((aDirectHistogramParameters.Size() != sizeof(CCamera::CCameraV2Histogram::TDirectHistogramParameters)) || sl@0: (aDirectHistogramParameters.Version() != KECamDirectHistogramParametersCurrentVersion)) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& /*aDirectHistogramParameters*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::StartHistogram() sl@0: { sl@0: RCamHistogramV2Buffer camHistogramV2Buffer; sl@0: sl@0: CamImageCaptureImpl().CaptureImageObserver()->ClientHistogramForSnapshotReady(CameraImageCapture(), 1, NULL, KErrNotSupported); sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::StopHistogram() sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CHistogramImpForImageSnapshot::GetHistogramStateL(TBool& /*aIsHistogramActive*/) const sl@0: { sl@0: User::Leave(KErrNotSupported); sl@0: } sl@0: sl@0: //Hisotgram factory for Image Snapshot sl@0: CHistogramFactoryForImageSnapshot* CHistogramFactoryForImageSnapshot::NewL(CCamSnapshotForImage& aCamSnapshotForImageImpl) sl@0: { sl@0: CHistogramFactoryForImageSnapshot* self = new(ELeave) CHistogramFactoryForImageSnapshot(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamSnapshotForImageImpl); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CHistogramFactoryForImageSnapshot::ConstructL(CCamSnapshotForImage& aCamSnapshotForImageImpl) sl@0: { sl@0: iHistogramImpForImageSnapshot = CHistogramImpForImageSnapshot::NewL(aCamSnapshotForImageImpl.Owner(), aCamSnapshotForImageImpl); sl@0: } sl@0: sl@0: CHistogramFactoryForImageSnapshot::CHistogramFactoryForImageSnapshot() : iHistogramImpForImageSnapshot(NULL), sl@0: iIsHistogramImpPassed(EFalse) sl@0: { sl@0: } sl@0: sl@0: CHistogramFactoryForImageSnapshot::~CHistogramFactoryForImageSnapshot() sl@0: { sl@0: if(!iIsHistogramImpPassed) sl@0: { sl@0: delete iHistogramImpForImageSnapshot; sl@0: } sl@0: iHistogramImpForImageSnapshot = NULL; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImageSnapshot::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: case KECamMCameraV2HistogramUidValue: sl@0: { sl@0: aIfPtr = static_cast(iHistogramImpForImageSnapshot); sl@0: iIsHistogramImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImageSnapshot::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CHistogramFactoryForImageSnapshot::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CHistogramFactoryForImageSnapshot::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: // sl@0: //img proc impl for still images. sl@0: CCamImgProcImpForImage* CCamImgProcImpForImage::NewL(CCamUnitTestPlugin& aOwner) sl@0: { sl@0: return new(ELeave) CCamImgProcImpForImage(aOwner); sl@0: } sl@0: sl@0: CCamImgProcImpForImage::CCamImgProcImpForImage(CCamUnitTestPlugin& aOwner): iOwner(aOwner) sl@0: { sl@0: } sl@0: sl@0: CCamImgProcImpForImage::~CCamImgProcImpForImage() sl@0: { sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::Release() sl@0: { sl@0: delete this; sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::GetSupportedTransformationsL(RArray& aTransformations) const sl@0: { sl@0: aTransformations.Reset(); sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::GetActiveTransformationsL(RArray& aTransformations) const sl@0: { sl@0: aTransformations.Reset(); sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::GetTransformationSupportedValuesL(TUid /*aTransformation*/, RArray& aValues, TValueInfo& aInfo) const sl@0: { sl@0: aValues.Reset(); sl@0: aInfo = ENotActive; sl@0: } sl@0: sl@0: TInt CCamImgProcImpForImage::TransformationValue(TUid /*aTransformation*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CCamImgProcImpForImage::GetTransformationValue(TUid /*aTransformation*/, TInt& /*aTransformationValue*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::SetTransformationValue(TUid /*aTransformation*/, TInt /*aValue*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::GetActiveTransformSequenceL(RArray& aTransformSequence) const sl@0: { sl@0: aTransformSequence.Reset(); sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::SetActiveTransformSequenceL(RArray& aTransformSequence) sl@0: { sl@0: aTransformSequence.Reset(); sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::SetSourceRect(const TRect& /*aRect*/) sl@0: { sl@0: return; sl@0: } sl@0: sl@0: void CCamImgProcImpForImage::GetSourceRect(TRect& /*aRect*/) const sl@0: { sl@0: return; sl@0: } sl@0: sl@0: // sl@0: //img proc factory for still images. sl@0: CImgProcFactoryForImage* CImgProcFactoryForImage::NewL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage) sl@0: { sl@0: CImgProcFactoryForImage* self = new(ELeave) CImgProcFactoryForImage(); sl@0: sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aCamImageCaptureImpl, aCamImgProcImpForImage); sl@0: CleanupStack::Pop(); sl@0: sl@0: return self; sl@0: } sl@0: sl@0: void CImgProcFactoryForImage::ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage) sl@0: { sl@0: if(aCamImgProcImpForImage == NULL) sl@0: { sl@0: iCamImgProcImpForImage = CCamImgProcImpForImage::NewL(aCamImageCaptureImpl.Owner()); sl@0: aCamImageCaptureImpl.iCamImgProcImpForImage = iCamImgProcImpForImage; sl@0: } sl@0: } sl@0: sl@0: CImgProcFactoryForImage::CImgProcFactoryForImage() : iCamImgProcImpForImage(NULL), sl@0: iIsImgProcImpPassed(EFalse) sl@0: { sl@0: TAny* ptr = NULL; sl@0: TUint value = 0; sl@0: TInt param = -4; sl@0: TECamImplFactoryParam factoryParam(ptr); sl@0: TECamImplFactoryParam factoryParam1(value); sl@0: TECamImplFactoryParam factoryParam2(param); sl@0: } sl@0: sl@0: CImgProcFactoryForImage::~CImgProcFactoryForImage() sl@0: { sl@0: if(!iIsImgProcImpPassed) sl@0: { sl@0: delete iCamImgProcImpForImage; sl@0: } sl@0: iCamImgProcImpForImage = NULL; sl@0: } sl@0: sl@0: TInt CImgProcFactoryForImage::GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const sl@0: { sl@0: switch(aIfaceUid.iUid) sl@0: { sl@0: //fall through sl@0: case KECamMCameraImageProcessingUidValue: sl@0: { sl@0: aIfPtr = static_cast(iCamImgProcImpForImage); sl@0: iIsImgProcImpPassed = ETrue; sl@0: return KErrNone; sl@0: } sl@0: default: sl@0: { sl@0: aIfPtr = NULL; sl@0: return KErrNotSupported; sl@0: } sl@0: } sl@0: } sl@0: sl@0: TInt CImgProcFactoryForImage::GetImpl1(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: TInt CImgProcFactoryForImage::GetImpl2(TAny*& /*aIfPtr*/, TUid /*aIfaceUid*/, TECamImplFactoryParam /*aParam1*/, TECamImplFactoryParam /*aParam2*/) const sl@0: { sl@0: return KErrNotSupported; sl@0: } sl@0: sl@0: void CImgProcFactoryForImage::Release() sl@0: { sl@0: delete this; sl@0: }