os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/extended_functionality.h
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.h
18 #ifndef EXTENDEDFUNCTIONALITY_H
19 #define EXTENDEDFUNCTIONALITY_H
21 #include <ecam/ecamplugin.h>
22 #include <ecam/ecaminfoplugin.h>
24 #include "ECamUnitTestPlugin.h"
27 #include <ecam/mcamerahistogram.h>
28 #include <ecam/mcamerasnapshot.h>
29 #include <ecam/ecamcapturecontrolintf.h>
30 #include <ecam/ecamimageprocessingintf.h>
31 #include <ecam/ecamviewfinderintf.h>
32 #include <ecam/implementationfactoryintf.h>
34 class CCamUnitTestPlugin;
36 const TInt KSupportedDirectVCType = 0;
37 const TInt KSupportedClientVCType = 1;
41 class RCamBuffer2 : public MCameraBuffer2
44 RCamBuffer2(CFbsBitmap*& aFrame): iAvailable(ETrue), iFrame(aFrame) {}
45 virtual TInt NumFrames() {return 0;}
46 virtual TDesC8* DataL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return NULL; }
47 virtual CFbsBitmap& BitmapL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return *iFrame;}
48 virtual RChunk& ChunkL() { return iChunk;}
49 virtual TInt ChunkOffsetL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0;}
50 virtual TInt FrameSize(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0; }
51 virtual void Release() {iAvailable = ETrue;}
53 virtual TInt GetInterfaceUids(RArray<TUid>& aInterfaceUids) {aInterfaceUids.Reset(); return KErrNotSupported;}
54 virtual TInt CustomInterface(TUid /*aInterface*/, TAny*& aPtrInterface) {aPtrInterface = NULL; return KErrNotSupported;}
63 //pre image capture control impl
64 class CCamPreImageCaptureControl: public CBase, public MCameraPreImageCaptureControl
67 static CCamPreImageCaptureControl* NewL(CCamUnitTestPlugin& aOwner);
68 ~CCamPreImageCaptureControl();
71 void SetPreImageCaptureControlObserver(MPreImageCaptureControlObserver& aPreImageCaptureControlObserver);
72 void GetDirectSnapshotSupportInfoL(TUint& aDirectSnapshotSupportInfo) const;
73 void GetSupportedEmbeddedStillCaptureSettingsL(RArray<TUid>& aSupportedEmbeddedStillCaptureSettings) const;
74 void GetSupportedDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aSupportedDirectSavingType) const;
75 void SetSequentialImageFilenameL(const TDesC8& aFilename, TInt aStartingSequenceNumber);
76 void SetLowerResolutionSequentialImageFilenameL(const TDesC8& aLowerResolutionFilename, TInt aStartingSequenceNumber);
77 void GetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType& aDirectSavingType) const;
78 void SetDirectSavingTypeL(CCamera::CCameraPreImageCaptureControl::TDirectSavingType aDirectSavingType);
79 void GetCaptureEventSupportInfoL(TUint& aSupportedDriveModes) const;
80 void GetImageFormatsSupportedL(TUint& aImageFormatsSupported, const TSize& aSize) const;
81 void GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat aImageFormat, const TSize& aSize) const;
82 void PrepareImageCapture(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters&
83 aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver);
84 void GetImageMaxMemorySizeSettingSupportInfoL(TBool& aIsImageMaxMemorySizeSettingSupported) const;
85 void GetImageMaxMemorySizeL(TUint& aMemorySize) const;
86 void GetSupportedProcessingOptionsL(TUint& aSupportedProcessingOptions) const;
88 inline MPreImageCaptureControlObserver* PreImageCaptureControlObserver() {return iPreImageCaptureControlObserver;}
91 CCamPreImageCaptureControl(CCamUnitTestPlugin& aOwner);
93 void CreateCaptureImageL(CCamera::CCameraImageCapture*& aCameraImageCapture, const CCamera::CCameraPreImageCaptureControl::
94 TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver);
97 CCamUnitTestPlugin& iOwner;
98 MPreImageCaptureControlObserver* iPreImageCaptureControlObserver;
103 class CCamSnapshotForImage;
104 class CCamImgProcImpForImage;
105 class CCamPostImageCaptureControl;
107 class CCamImageCapture: public CBase, public MCameraImageCapture
109 friend class CSnapshotFactoryForImage;
110 friend class CImgProcFactoryForImage;
111 friend class CCamPostImageCaptureControl;
114 static CCamImageCapture* NewL(CCamUnitTestPlugin& aOwner);
117 void Release(CCamera::CCameraImageCapture* aCameraImageCapture);
118 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
119 void GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
120 void GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
121 void SetCaptureImageObserver(MCaptureImageObserver& aCaptureImageObserver);
122 void GetPrepareImageParametersL(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) const;
123 void SetPrepareImageParameters(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters);
124 TAny* CreatePostImageCaptureControlImpl(TUid aInterface, TPostCaptureControlId aPostCaptureControlId);
125 void CaptureImage(CCamera::CCameraImageCapture* aCameraImageCapture);
126 void CancelCaptureImage();
127 void GetNumImagesExposedL(TUint& aNumImagesExposed) const;
128 void GetNumTotalImagesL(TUint& aNumTotalImages) const;
129 void GetPostCaptureControlHandleL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle,
130 TPostCaptureControlId aPostCaptureControlId) const;
131 void SetCaptureImagePriorityL(TECamImagePriority aCaptureImagePriority);
132 void GetCaptureImagePriorityL(TECamImagePriority& aCaptureImagePriority) const;
133 void PauseProcessing(TUint aProcessingType);
134 void ResumeProcessingL(TUint aProcessingType);
136 inline MCaptureImageObserver* CaptureImageObserver() {return iCaptureImageObserver;}
137 inline CCamera::CCameraImageCapture* CameraImageCapture() {return iCameraImageCapture;}
138 inline CCamUnitTestPlugin& Owner() {return iOwner;}
141 CCamImageCapture(CCamUnitTestPlugin& aOwner);
142 void CreatePostImageCaptureControlL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle,
143 TPostCaptureControlId aPostCaptureControlId);
146 CCamUnitTestPlugin& iOwner;
147 MCaptureImageObserver* iCaptureImageObserver;
148 CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters iPrepareImageParameters;
150 mutable CCamSnapshotForImage* iSnapshotImpForImage;
151 CCamImgProcImpForImage* iCamImgProcImpForImage;
152 RArray<TInt> iArrayPostCaptureControlId;
153 RArray<CCamPostImageCaptureControl*> iArrayPostCaptureControlImpl;
154 RArray<CCamera::CCameraPostImageCaptureControl*> iArrayPostCaptureControlHandle;
156 CCamera::CCameraImageCapture* iCameraImageCapture;
160 //post image capture control impl
161 class CCamPostImageCaptureControl: public CBase, public MCameraPostImageCaptureControl
164 static CCamPostImageCaptureControl* NewL(CCamImageCapture& aCamImageCaptureImpl);
165 ~CCamPostImageCaptureControl();
167 void Release(TPostCaptureControlId aPostCaptureControlId);
168 void GetImageSequenceNumberL(TUint& aSequenceNumber) const;
170 void SetImagePriorityL(TECamImagePriority aImagePriority);
171 void GetImagePriorityL(TECamImagePriority& aImagePriority) const;
172 void PauseProcessing(TUint aProcessingType);
173 void ResumeProcessingL(TUint aProcessingType);
174 void GetImageBufferL(MCameraImageBuffer& aCameraImageBuffer) const;
175 void GetImageStateL(CCamera::CCameraPostImageCaptureControl::TImageState& aImageState) const;
176 void GetBufferStateL(CCamera::CCameraPostImageCaptureControl::TBufferState& aBufferState) const;
178 inline CCamImageCapture& CamImageCaptureImpl() {return iCamImageCaptureImpl;}
181 CCamPostImageCaptureControl(CCamImageCapture& aCamImageCaptureImpl);
184 CCamImageCapture& iCamImageCaptureImpl;
188 //video capture control impl
189 class CCamSnapshotForVideo;
190 class CCamVideoCaptureControl : public CBase, public MCameraVideoCaptureControl
192 friend class CSnapshotFactoryForVideo;
195 static CCamVideoCaptureControl* NewL(CCamUnitTestPlugin& aOwner);
196 ~CCamVideoCaptureControl();
199 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
200 void GetSnapshotImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
201 void GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
202 void SetCaptureVideoObserver(MCaptureVideoObserver& aCaptureVideoObserver);
203 void GetVideoFormatsSupportedL(TUint& aVideoFormatsSupported, const TSize& aSize) const;
204 void GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat aVideoFormat, const TSize& aSize) const;
205 void GetEmbeddedStillCaptureSupportInfoL(TInt& aSupportedEmbeddedStillCaptureTypes) const;
206 void PrepareVideoCapture(const CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters);
207 void GetRangeAffectedSettingsL(RArray<TUid>& aRangeAffectedSettings) const;
208 void GetValueAffectedSettingsL(RArray<TUid>& aValueAffectedSettings) const;
209 void GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const;
210 void ReleaseVideoResource();
211 void StartVideoCaptureL();
212 void StopVideoCapture();
213 void PauseVideoCapture();
214 void ResumeVideoCaptureL();
215 void GetFadingEffectStateL(CCamera::CCameraVideoCaptureControl::TFadingEffectState& aFadingEffectState) const;
216 void SetFadingEffectState(CCamera::CCameraVideoCaptureControl::TFadingEffectState aFadingEffectState);
217 void GetVideoCaptureStateL(CCamera::CCameraVideoCaptureControl::TVideoCaptureState& aVideoCaptureState) const;
218 void GetVideoCaptureSupportInfoL(TInt& aSupportedVideoCaptureTypes) const;
219 void GetPrepareVideoParametersL(CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters& aPrepareVideoParameters) const;
221 inline MCaptureVideoObserver* CaptureVideoObserver() {return iCaptureVideoObserver;}
222 inline CCamUnitTestPlugin& Owner() {return iOwner;}
225 CCamVideoCaptureControl(CCamUnitTestPlugin& aOwner);
229 CCamUnitTestPlugin& iOwner;
230 MCaptureVideoObserver* iCaptureVideoObserver;
231 CCamSnapshotForVideo* iSnapshotImpForVideo;
232 CCamera::CCameraVideoCaptureControl::TPrepareVideoParameters iPrepareVideoParameters;
237 //direct snapshot implementation to be used by version2 direct viewfinder.
238 class CCamDirectSnapshot : public CBase, public MCameraDirectSnapshot
242 static CCamDirectSnapshot* NewL();
243 ~CCamDirectSnapshot();
246 void SetDirectViewFinder(const CCamera::CCameraV2DirectViewFinder* aDirectViewFinder);
247 void GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const;
248 void EnableDirectSnapshotL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters);
249 void DisableDirectSnapshot();
250 void GetDirectSnapshotStateL(CCamera::CCameraDirectSnapshot::TDirectSnapshotState& aDirectSnapshotState) const;
251 void GetDirectSnapshotParametersL(CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters) const;
252 void SetDirectSnapshotParametersL(const CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters& aDirectSnapshotParameters);
255 CCamDirectSnapshot();
258 const CCamera::CCameraV2DirectViewFinder* iCameraV2DirectVF;
259 CCamera::CCameraDirectSnapshot::TDirectSnapshotParameters iDirectSnapshotParameters;
260 CCamera::CCameraDirectSnapshot::TDirectSnapshotState iDirectSnapshotState;
264 //V2 direct viewfinder impl
265 class CCamV2DirectViewFinder: public CBase, public MCameraViewFinder, public MCameraV2DirectViewFinder
268 static CCamV2DirectViewFinder* NewL(CCamUnitTestPlugin& aOwner);
269 ~CCamV2DirectViewFinder();
271 void Release(CCamera::CCameraV2DirectViewFinder* aDirectViewFinderHandle);
273 void GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const;
274 void GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const;
275 void SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& aVFFadingEffect);
276 void GetViewFinderHandleL(TInt& aVFHandle) const;
278 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
279 void GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
280 void SetDirectViewFinderObserver(MDirectViewFinderObserver& aDirectViewFinderObserver);
281 void SetDirectViewFinderHandle(CCamera::CCameraV2DirectViewFinder* aDirectViewFinderHandle);
282 void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aScreenRect);
283 void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aScreenRect, TRect& aClipRect);
284 void GetDirectViewFinderPropertiesL(TInt& aScreenNumber, TRect& aScreenRect, TRect& aClipRect) const;
285 void PauseViewFinderDirect();
286 void ResumeViewFinderDirect();
287 void GetViewFinderStateL(CCamera::CCameraV2DirectViewFinder::TViewFinderState& aViewFinderState) const;
288 void StopDirectViewFinder();
289 TAny* GetDirectSnapshotImpl(TUid aInterface) const;
291 inline MDirectViewFinderObserver* DirectViewFinderObserver() {return iDirectViewFinderObserver;}
292 inline CCamera::CCameraV2DirectViewFinder& DirectViewFinderHandle() {return *iDirectViewFinderHandle;}
293 inline CCamUnitTestPlugin& Owner() {return iOwner;}
296 CCamV2DirectViewFinder(CCamUnitTestPlugin& aOwner);
302 CCamUnitTestPlugin& iOwner;
303 MDirectViewFinderObserver* iDirectViewFinderObserver;
304 CCamera::CCameraV2DirectViewFinder* iDirectViewFinderHandle;
306 mutable CCamDirectSnapshot* iDirectSnapshot;
310 //client viewfinder impl
311 class CCamClientViewFinder: public CBase, public MCameraViewFinder, public MCameraClientViewFinder
314 static CCamClientViewFinder* NewL(CCamUnitTestPlugin& aOwner);
315 ~CCamClientViewFinder();
317 void Release(CCamera::CCameraClientViewFinder* aClientViewFinderHandle);
319 void GetViewFinderFadingCapabilitiesL(CCameraViewFinder::TViewFinderFadingCapabilities& aVFFadingCapabilities) const;
320 void GetViewFinderFadingEffectL(CCameraViewFinder::TViewFinderFadingEffect& aCurrentVFFadingEffect) const;
321 void SetViewFinderFadingEffect(const CCameraViewFinder::TViewFinderFadingEffect& aVFFadingEffect);
322 void GetViewFinderHandleL(TInt& aVFHandle) const;
324 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
325 void GetImageProcessingImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
326 void SetClientViewFinderObserver(MClientViewFinderObserver& aClientViewFinderObserver);
327 void SetClientViewFinderHandle(CCamera::CCameraClientViewFinder* aClientViewFinderHandle);
329 void StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize);
330 void StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize, TRect& aClipRect);
331 void GetClientViewFinderStateL(TBool& aIsActive) const;
332 void GetClientViewFinderPropertiesL(TInt& aScreenNumber, CCamera::TFormat& aImageFormat, TSize& aSize, TRect& aClipRect) const;
333 void StopClientViewFinder();
334 void GetViewFinderBufferL(MCameraBuffer2& aClientViewFinderBuffer) const;
336 inline MClientViewFinderObserver* ClientViewFinderObserver() {return iClientViewFinderObserver;}
337 inline CCamera::CCameraClientViewFinder& ClientViewFinderHandle() {return *iClientViewFinderHandle;}
338 inline CCamUnitTestPlugin& Owner() {return iOwner;}
341 CCamClientViewFinder(CCamUnitTestPlugin& aOwner);
347 CCamUnitTestPlugin& iOwner;
348 MClientViewFinderObserver* iClientViewFinderObserver;
349 CCamera::CCameraClientViewFinder* iClientViewFinderHandle;
354 //snapshot impl for image
355 class CCamSnapshotForImage : public CBase, public MCameraSnapshot, public MCameraSnapshot2
357 friend class CHistogramImpForImageSnapshot;
360 static CCamSnapshotForImage* NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl);
361 ~CCamSnapshotForImage();
363 TUint32 SupportedFormats();
364 void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
365 void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
367 void SetBgColorL(const TRgb& aBgColor);
368 void SetPositionL(const TPoint& aPosition);
370 TBool IsSnapshotActive() const;
371 void StartSnapshot();
373 MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
375 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
376 void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
377 void GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
378 void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
379 void GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& aSnapshotState) const;
380 void SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames aSnapshotVideoFrames);
381 void EnableSnapshot();
382 void DisableSnapshot();
383 void SetClientViewFinderId(TInt aClientViewFinderId);
387 inline CCamImageCapture& CamImageCaptureImpl() {return iCamImageCaptureImpl;}
388 inline CCamera::CCameraImageCapture& CameraImageCapture() {return *(CamImageCaptureImpl().CameraImageCapture());}
389 inline CCamUnitTestPlugin& Owner() {return iOwner;}
391 CCamSnapshotForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl);
395 CCamUnitTestPlugin& iOwner;
396 CCamImageCapture& iCamImageCaptureImpl;
398 RCamBuffer2 iSnapshotbuffer;
399 CCamera::CCameraSnapshot::TSnapshotParameters iSnapshotParameters;
405 //snapshot factory for image
406 class CSnapshotFactoryForImage : public CBase, public MImplementationFactory
409 static CSnapshotFactoryForImage* NewL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage);
410 ~CSnapshotFactoryForImage();
412 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
413 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
414 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
418 CSnapshotFactoryForImage();
419 void ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamSnapshotForImage* aSnapshotImpForImage);
422 CCamSnapshotForImage* iSnapshotImpForImage;
423 mutable TBool iIsSnapshotImpPassed;
427 //snapshot impl for video
428 class CCamSnapshotForVideo : public CBase, public MCameraSnapshot, public MCameraSnapshot2
431 static CCamSnapshotForVideo* NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
432 ~CCamSnapshotForVideo();
434 TUint32 SupportedFormats();
435 void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
436 void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
438 void SetBgColorL(const TRgb& aBgColor);
439 void SetPositionL(const TPoint& aPosition);
441 TBool IsSnapshotActive() const;
442 void StartSnapshot();
444 MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
446 void CreateHistogramImplFactoryL(MImplementationFactory*& aImplFactoryPtr) const;
447 void PrepareSnapshotL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
448 void GetSnapshotParametersL(CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
449 void SetSnapshotParametersL(const CCamera::CCameraSnapshot::TSnapshotParameters& aSnapshotParameters);
450 void GetSnapshotStatusL(CCamera::CCameraSnapshot::TSnapshotState& aSnapshotState) const;
451 void SelectSnapshotVideoFramesL(CCamera::CCameraSnapshot::TSnapshotVideoFrames aSnapshotVideoFrames);
452 void EnableSnapshot();
453 void DisableSnapshot();
454 void SetClientViewFinderId(TInt aClientViewFinderId);
458 inline CCamVideoCaptureControl& CamVideoCaptureControlImpl() {return iCamVideoCaptureControlImpl;}
461 CCamSnapshotForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
465 CCamUnitTestPlugin& iOwner;
466 CCamVideoCaptureControl& iCamVideoCaptureControlImpl;
468 RCamBuffer2 iSnapshotbuffer;
469 CCamera::CCameraSnapshot::TSnapshotParameters iSnapshotParameters;
475 //snapshot factory for video
476 class CSnapshotFactoryForVideo : public CBase, public MImplementationFactory
479 static CSnapshotFactoryForVideo* NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo);
480 ~CSnapshotFactoryForVideo();
482 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
483 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
484 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
488 CSnapshotFactoryForVideo();
489 void ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl, CCamSnapshotForVideo* aSnapshotImpForVideo);
492 CCamSnapshotForVideo* iSnapshotImpForVideo;
493 mutable TBool iIsSnapshotImpPassed;
497 // V2 buffer for histogram: MHistogramV2Buffer
498 class RCamHistogramV2Buffer : public MHistogramV2Buffer
502 RCamHistogramV2Buffer(): iAvailable(ETrue) {}
503 CCamera::CCameraV2Histogram::THistogramType Type() {return CCamera::CCameraV2Histogram::EHistNone;}
504 TInt ElementSize() {return -5;}
505 TInt NumOfElements() {return -5;}
506 TDesC8* DataL() {User::Leave(KErrNotSupported); return NULL;}
507 RChunk& ChunkL() {User::Leave(KErrNotSupported); return iChunk;}
508 TInt ChunkOffsetL() {User::Leave(KErrNotSupported); return -5;}
509 void Release() {iAvailable = EFalse;}
518 //histogram impl for video
519 class CHistogramImpForVideo : public CBase, public MCameraV2Histogram
523 static CHistogramImpForVideo* NewL(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
524 ~CHistogramImpForVideo();
526 void Release(CCamera::CCameraV2Histogram* aHistogramHandle);
527 void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle);
528 void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const;
529 void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const;
530 void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType);
531 void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
532 void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
533 void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const;
534 void StartHistogram();
535 void StopHistogram();
536 void GetHistogramStateL(TBool& aIsHistogramActive) const;
538 inline CCamVideoCaptureControl& CamVideoCaptureControlImpl() {return iCamVideoCaptureControlImpl;}
541 CHistogramImpForVideo(CCamUnitTestPlugin& aOwner, CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
544 CCamUnitTestPlugin& iOwner;
545 CCamVideoCaptureControl& iCamVideoCaptureControlImpl;
549 //histogram factory for video
550 class CHistogramFactoryForVideo : public CBase, public MImplementationFactory
553 static CHistogramFactoryForVideo* NewL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
554 ~CHistogramFactoryForVideo();
556 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
557 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
558 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
562 CHistogramFactoryForVideo();
563 void ConstructL(CCamVideoCaptureControl& aCamVideoCaptureControlImpl);
566 CHistogramImpForVideo* iHistogramImpForVideo;
567 mutable TBool iIsHistogramImpPassed;
571 //histogram impl for image
572 class CHistogramImpForImage : public CBase, public MCameraV2Histogram
576 static CHistogramImpForImage* NewL(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl);
577 ~CHistogramImpForImage();
579 void Release(CCamera::CCameraV2Histogram* aHistogramHandle);
580 void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle);
581 void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const;
582 void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const;
583 void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType);
584 void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
585 void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
586 void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const;
587 void StartHistogram();
588 void StopHistogram();
589 void GetHistogramStateL(TBool& aIsHistogramActive) const;
591 inline CCamImageCapture& CamImageCaptureImpl() {return iCamImageCaptureImpl;}
592 inline CCamera::CCameraImageCapture& CameraImageCapture() {return *(CamImageCaptureImpl().CameraImageCapture());}
595 CHistogramImpForImage(CCamUnitTestPlugin& aOwner, CCamImageCapture& aCamImageCaptureImpl);
598 CCamUnitTestPlugin& iOwner;
599 CCamImageCapture& iCamImageCaptureImpl;
600 CCamera::CCameraV2Histogram* iHistogramHandle;
604 //histogram factory for image
605 class CHistogramFactoryForImage : public CBase, public MImplementationFactory
608 static CHistogramFactoryForImage* NewL(CCamImageCapture& aCamImageCaptureImpl);
609 ~CHistogramFactoryForImage();
611 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
612 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
613 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
617 CHistogramFactoryForImage();
618 void ConstructL(CCamImageCapture& aCamImageCaptureImpl);
621 CHistogramImpForImage* iHistogramImpForImage;
622 mutable TBool iIsHistogramImpPassed;
626 //histogram impl for DirectViewFinder
627 class CHistogramImpForDirectViewFinder : public CBase, public MCameraV2Histogram
631 static CHistogramImpForDirectViewFinder* NewL(CCamUnitTestPlugin& aOwner, CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl);
632 ~CHistogramImpForDirectViewFinder();
634 void Release(CCamera::CCameraV2Histogram* aHistogramHandle);
635 void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle);
636 void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const;
637 void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const;
638 void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType);
639 void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
640 void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
641 void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const;
642 void StartHistogram();
643 void StopHistogram();
644 void GetHistogramStateL(TBool& aIsHistogramActive) const;
646 inline CCamV2DirectViewFinder& DirectViewFinderImpl() {return iCamV2DirectViewFinderImpl;}
649 CHistogramImpForDirectViewFinder(CCamUnitTestPlugin& aOwner, CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl);
652 CCamUnitTestPlugin& iOwner;
653 CCamV2DirectViewFinder& iCamV2DirectViewFinderImpl;
654 CCamera::CCameraV2Histogram* iHistogramHandle;
658 //histogram factory for DirectViewFinder
659 class CHistogramFactoryForDirectViewFinder : public CBase, public MImplementationFactory
662 static CHistogramFactoryForDirectViewFinder* NewL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl);
663 ~CHistogramFactoryForDirectViewFinder();
665 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
666 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
667 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
671 CHistogramFactoryForDirectViewFinder();
672 void ConstructL(CCamV2DirectViewFinder& aCamV2DirectViewFinderImpl);
675 CHistogramImpForDirectViewFinder* iHistogramImpForDirectViewFinder;
676 mutable TBool iIsHistogramImpPassed;
680 //histogram impl for ClientViewFinder
681 class CHistogramImpForClientViewFinder : public CBase, public MCameraV2Histogram
685 static CHistogramImpForClientViewFinder* NewL(CCamUnitTestPlugin& aOwner, CCamClientViewFinder& aCamClientViewFinderImpl);
686 ~CHistogramImpForClientViewFinder();
688 void Release(CCamera::CCameraV2Histogram* aHistogramHandle);
689 void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle);
690 void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const;
691 void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const;
692 void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType);
693 void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
694 void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
695 void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const;
696 void StartHistogram();
697 void StopHistogram();
698 void GetHistogramStateL(TBool& aIsHistogramActive) const;
700 inline CCamClientViewFinder& ClientViewFinderImpl() {return iCamClientViewFinderImpl;}
701 inline CCamera::CCameraClientViewFinder& ClientViewFinderHandle() {return ClientViewFinderImpl().ClientViewFinderHandle();}
704 CHistogramImpForClientViewFinder(CCamUnitTestPlugin& aOwner, CCamClientViewFinder& aCamClientViewFinderImpl);
707 CCamUnitTestPlugin& iOwner;
708 CCamClientViewFinder& iCamClientViewFinderImpl;
709 CCamera::CCameraV2Histogram* iHistogramHandle;
713 //histogram factory for ClientViewFinder
714 class CHistogramFactoryForClientViewFinder : public CBase, public MImplementationFactory
717 static CHistogramFactoryForClientViewFinder* NewL(CCamClientViewFinder& aCamClientViewFinderImpl);
718 ~CHistogramFactoryForClientViewFinder();
720 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
721 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
722 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
726 CHistogramFactoryForClientViewFinder();
727 void ConstructL(CCamClientViewFinder& aCamClientViewFinderImpl);
730 CHistogramImpForClientViewFinder* iHistogramImpForClientViewFinder;
731 mutable TBool iIsHistogramImpPassed;
735 //histogram impl for image snapshot
736 class CHistogramImpForImageSnapshot : public CBase, public MCameraV2Histogram
740 static CHistogramImpForImageSnapshot* NewL(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl);
741 ~CHistogramImpForImageSnapshot();
743 void Release(CCamera::CCameraV2Histogram* aHistogramHandle);
744 void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle);
745 void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const;
746 void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const;
747 void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType);
748 void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
749 void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters);
750 void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const;
751 void StartHistogram();
752 void StopHistogram();
753 void GetHistogramStateL(TBool& aIsHistogramActive) const;
755 inline CCamSnapshotForImage& CamSnapshotForImageImpl() {return iCamSnapshotForImageImpl;}
756 inline CCamera::CCameraV2Histogram* HistogramHandle() {return iHistogramHandle;}
757 inline CCamImageCapture& CamImageCaptureImpl() {return CamSnapshotForImageImpl().CamImageCaptureImpl();}
758 inline CCamera::CCameraImageCapture& CameraImageCapture() {return *(CamImageCaptureImpl().CameraImageCapture());}
761 CHistogramImpForImageSnapshot(CCamUnitTestPlugin& aOwner, CCamSnapshotForImage& aCamSnapshotForImageImpl);
764 CCamUnitTestPlugin& iOwner;
765 CCamSnapshotForImage& iCamSnapshotForImageImpl;
766 CCamera::CCameraV2Histogram* iHistogramHandle;
770 //histogram factory for image snapshot
771 class CHistogramFactoryForImageSnapshot : public CBase, public MImplementationFactory
774 static CHistogramFactoryForImageSnapshot* NewL(CCamSnapshotForImage& aCamSnapshotForImageImpl);
775 ~CHistogramFactoryForImageSnapshot();
777 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
778 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
779 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
783 CHistogramFactoryForImageSnapshot();
784 void ConstructL(CCamSnapshotForImage& aCamSnapshotForImageImpl);
787 CHistogramImpForImageSnapshot* iHistogramImpForImageSnapshot;
788 mutable TBool iIsHistogramImpPassed;
792 //img proc impl for still images.
793 class CCamImgProcImpForImage : public CBase, public MCameraImageProcessing
796 static CCamImgProcImpForImage* NewL(CCamUnitTestPlugin& aOwner);
797 ~CCamImgProcImpForImage();
800 void GetSupportedTransformationsL(RArray<TUid>& aTransformations) const;
801 void GetActiveTransformationsL(RArray<TUid>& aTransformations) const;
802 void GetTransformationSupportedValuesL(TUid aTransformation, RArray<TInt>& aValues, TValueInfo& aInfo) const;
803 TInt TransformationValue(TUid aTransformation) const;
804 TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const;
805 void SetTransformationValue(TUid aTransformation, TInt aValue);
806 void GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const;
807 void SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence);
808 void SetSourceRect(const TRect& aRect);
809 void GetSourceRect(TRect& aRect) const;
812 CCamImgProcImpForImage(CCamUnitTestPlugin& aOwner);
815 CCamUnitTestPlugin& iOwner;
819 //img proc factory for still images.
820 class CImgProcFactoryForImage : public CBase, public MImplementationFactory
823 static CImgProcFactoryForImage* NewL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage);
824 ~CImgProcFactoryForImage();
826 TInt GetImpl(TAny*& aIfPtr, TUid aIfaceUid) const;
827 TInt GetImpl1(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1) const;
828 TInt GetImpl2(TAny*& aIfPtr, TUid aIfaceUid, TECamImplFactoryParam aParam1, TECamImplFactoryParam aParam2) const;
832 CImgProcFactoryForImage();
833 void ConstructL(CCamImageCapture& aCamImageCaptureImpl, CCamImgProcImpForImage* aCamImgProcImpForImage);
836 CCamImgProcImpForImage* iCamImgProcImpForImage;
837 mutable TBool iIsImgProcImpPassed;
840 #endif // EXTENDEDFUNCTIONALITY_H