|
1 |
|
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 |
|
17 #ifndef ECAMUNITTESTPlUGIN_H |
|
18 #define ECAMUNITTESTPlUGIN_H |
|
19 |
|
20 #include <ecam/ecamplugin.h> |
|
21 #include <ecam/ecaminfoplugin.h> |
|
22 #include <ecamadvsettings.h> |
|
23 #include <f32file.h> |
|
24 |
|
25 _LIT(KECamUnitTestPluginName, "C:\\102070CF.txt"); |
|
26 _LIT(KTestCameraPluginName, "C:\102070cc.txt"); |
|
27 |
|
28 #ifdef SYMBIAN_MULTIMEDIA_THREEPLANEARCH |
|
29 _LIT(KMMCameraPluginName, "C:\\mmcameraclientplugin.txt"); |
|
30 #endif //SYMBIAN_MULTIMEDIA_THREEPLANEARCH |
|
31 |
|
32 const TInt KECamSetAvailableCameras = 3; |
|
33 |
|
34 // Implementations of the ECam plugin classes |
|
35 class CCamUnitTestPlugin : public CCameraPlugin |
|
36 { |
|
37 friend class CCamPresets; |
|
38 friend class CCamAdvSet; |
|
39 friend class CCamImgProc; |
|
40 friend class CCamManagement; |
|
41 |
|
42 public: |
|
43 static CCamUnitTestPlugin* NewL(); |
|
44 ~CCamUnitTestPlugin(); |
|
45 |
|
46 protected: |
|
47 // from CCameraPlugin |
|
48 void Construct2L(MCameraObserver& aObserver,TInt aCameraIndex); |
|
49 void Construct2DupL(MCameraObserver& aObserver,TInt aCameraHandle); |
|
50 |
|
51 void Construct2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); |
|
52 void Construct2DupL(MCameraObserver2& aObserver,TInt aCameraHandle); |
|
53 |
|
54 // from CCamera itself |
|
55 void CameraInfo(TCameraInfo& aInfo) const; |
|
56 void Reserve(); |
|
57 void Release(); |
|
58 void PowerOn(); |
|
59 void PowerOff(); |
|
60 TInt Handle(); |
|
61 void SetZoomFactorL(TInt aZoomFactor = 0); |
|
62 TInt ZoomFactor() const; |
|
63 void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0); |
|
64 TInt DigitalZoomFactor() const; |
|
65 void SetContrastL(TInt aContrast); |
|
66 TInt Contrast() const; |
|
67 void SetBrightnessL(TInt aBrightness); |
|
68 TInt Brightness() const; |
|
69 void SetFlashL(TFlash aFlash = EFlashNone); |
|
70 TFlash Flash() const; |
|
71 void SetExposureL(TExposure aExposure = EExposureAuto); |
|
72 TExposure Exposure() const; |
|
73 void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto); |
|
74 TWhiteBalance WhiteBalance() const; |
|
75 void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect); |
|
76 void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect); |
|
77 void StartViewFinderBitmapsL(TSize& aSize); |
|
78 void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect); |
|
79 |
|
80 void StartViewFinderL(TFormat aImageFormat,TSize& aSize); |
|
81 void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect); |
|
82 |
|
83 void StopViewFinder(); |
|
84 TBool ViewFinderActive() const; |
|
85 void SetViewFinderMirrorL(TBool aMirror); |
|
86 TBool ViewFinderMirror() const; |
|
87 void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex); |
|
88 void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect); |
|
89 void CaptureImage(); |
|
90 void CancelCaptureImage(); |
|
91 void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const; |
|
92 void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer); |
|
93 void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect); |
|
94 void StartVideoCapture(); |
|
95 void StopVideoCapture(); |
|
96 TBool VideoCaptureActive() const; |
|
97 void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const; |
|
98 void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const; |
|
99 void GetFrameSize(TSize& aSize) const; |
|
100 TReal32 FrameRate() const; |
|
101 TInt BuffersInUse() const; |
|
102 TInt FramesPerBuffer() const; |
|
103 void SetJpegQuality(TInt aQuality); |
|
104 TInt JpegQuality() const; |
|
105 TAny* CustomInterface(TUid aInterface); |
|
106 |
|
107 public: |
|
108 void Notify(TUid aMessageId, TInt aError); |
|
109 void Notify2(TUid aMessageId, TInt aError, TInt aParam); |
|
110 |
|
111 void GenerateVFHandle(TInt& aVFHandle); |
|
112 // set presets |
|
113 //void InitPresetsL(RArray<TUid>& aPresets); |
|
114 private: |
|
115 CCamUnitTestPlugin(); |
|
116 |
|
117 private: |
|
118 MCameraObserver* iObserver; // not owned |
|
119 MCameraObserver2* iObserver2; // not owned |
|
120 |
|
121 TInt iCameraIndex; |
|
122 TInt iCameraHandle; |
|
123 TInt iPriority; |
|
124 |
|
125 RArray<TInt> iSupportedISORates; |
|
126 TInt iIsoRate; |
|
127 TInt iVFHandleGenerater; |
|
128 |
|
129 public: |
|
130 // additional info |
|
131 RArray<TUid> iPresets; |
|
132 TBool iCameras[KECamSetAvailableCameras]; |
|
133 CCamera::CCameraAdvancedSettings::TCameraType iCameraTypes[KECamSetAvailableCameras]; |
|
134 }; |
|
135 |
|
136 class CCamUnitTestPluginInfo : public CCameraInfoPlugin |
|
137 { |
|
138 public: |
|
139 static CCamUnitTestPluginInfo* NewL(); |
|
140 |
|
141 ~CCamUnitTestPluginInfo(); |
|
142 |
|
143 // from CCameraInfoPlugin |
|
144 TInt CamerasAvailable(); |
|
145 private: |
|
146 CCamUnitTestPluginInfo(); |
|
147 }; |
|
148 |
|
149 class CCamUnitTestPluginSecureId : public MSecureIdPlugin |
|
150 { |
|
151 public: |
|
152 static CCamUnitTestPluginSecureId* NewL(); |
|
153 |
|
154 ~CCamUnitTestPluginSecureId(); |
|
155 |
|
156 // from CCameraInfoPlugin |
|
157 void Release(); |
|
158 void GetSecureIdL(TInt& aSecureId) const; |
|
159 |
|
160 private: |
|
161 CCamUnitTestPluginSecureId(); |
|
162 }; |
|
163 |
|
164 enum TSetPanicReasons |
|
165 { |
|
166 EPanicUnimplemented=1 |
|
167 }; |
|
168 |
|
169 class FileDependencyUtil |
|
170 { |
|
171 public: |
|
172 static void CheckFileDependencyL(); |
|
173 }; |
|
174 |
|
175 #endif // ECAMUNITTESTPlUGIN_H |