|
1 /* |
|
2 * Copyright (c) 2006 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 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef MCECAMERASOURCE_H |
|
22 #define MCECAMERASOURCE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <ecam.h> |
|
27 #include <mcemediasource.h> |
|
28 |
|
29 // CONSTANTS |
|
30 const TMceSourceType KMceCameraSource = 3; |
|
31 |
|
32 //FORWARD DECLARATIONS |
|
33 class CMceManager; |
|
34 class CMceItcSender; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Class representing camera in MCE. |
|
41 * |
|
42 * CMceCameraSource can be used to record video from camera. |
|
43 * |
|
44 * Enable (continue) and Disable (pause) operations to it are considered |
|
45 * to be local, so they are not signalled to remote terminal. |
|
46 * |
|
47 * In common situation camera source is combined with display sink which acts |
|
48 * as a viewfinder for the camera. |
|
49 * |
|
50 * @lib mceclient.lib |
|
51 */ |
|
52 class CMceCameraSource : public CMceMediaSource |
|
53 { |
|
54 |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 * @param aManager reference to the manager |
|
60 */ |
|
61 IMPORT_C static CMceCameraSource* NewL( CMceManager& aManager ); |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * @param aManager reference to the manager |
|
66 */ |
|
67 IMPORT_C static CMceCameraSource* NewLC( CMceManager& aManager ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 IMPORT_C ~CMceCameraSource(); |
|
73 |
|
74 public: // From CMceMediaSource |
|
75 |
|
76 /** |
|
77 * Enables the source explicitly. |
|
78 */ |
|
79 IMPORT_C void EnableL(); |
|
80 |
|
81 /** |
|
82 * Disables the source explicitly. |
|
83 */ |
|
84 IMPORT_C void DisableL(); |
|
85 |
|
86 public: // New functions |
|
87 |
|
88 /** |
|
89 * Gets the number of cameras on the device. |
|
90 * @return number of available cameras |
|
91 */ |
|
92 IMPORT_C TInt CamerasAvailable() const; |
|
93 |
|
94 /** |
|
95 * Sets index of physical camera to be used. |
|
96 * @param aCameraIndex Index of the camera to be used; First camera has |
|
97 * index 0 and number of available cameras can be retrieved by |
|
98 * calling CMceCameraSource::CamerasAvailable |
|
99 */ |
|
100 IMPORT_C void SetCameraIndexL( TInt aCameraIndex ); |
|
101 |
|
102 /** |
|
103 * Gets information about the camera device. |
|
104 * @param aInfo on return information about the camera device |
|
105 */ |
|
106 IMPORT_C void GetCameraInfo( TCameraInfo& aInfo ) const; |
|
107 |
|
108 /** |
|
109 * Sets the zoom factor. |
|
110 * This must be in the range of TCameraInfo::iMinZoom to |
|
111 * TCameraInfo::iMaxZoom inclusive. |
|
112 * @param aZoomFactor required zoom factor |
|
113 * @leave KErrArgument if the specified zoom factor is out of range |
|
114 */ |
|
115 IMPORT_C void SetZoomFactorL( TInt aZoomFactor ); |
|
116 |
|
117 /** |
|
118 * Gets the currently set zoom factor. |
|
119 * @return current zoom factor |
|
120 */ |
|
121 IMPORT_C TInt ZoomFactorL(); |
|
122 |
|
123 /** |
|
124 * Sets the digital zoom factor. |
|
125 * This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom |
|
126 * inclusive. |
|
127 * @param aDigitalZoomFactor The required digital zoom factor |
|
128 * @leave KErrArgument if the zoom factor is out of range |
|
129 */ |
|
130 IMPORT_C void SetDigitalZoomFactorL( TInt aDigitalZoomFactor ); |
|
131 |
|
132 /** |
|
133 * Gets the currently set digital zoom factor. |
|
134 * @return current digital zoom factor |
|
135 */ |
|
136 IMPORT_C TInt DigitalZoomFactorL(); |
|
137 |
|
138 /** |
|
139 * Sets the contrast adjustment of the device. |
|
140 * @param aContrast required contrast value; This must be in the |
|
141 * range of -100 to +100 or CCamera::EContrastAuto. |
|
142 * @leave KErrNotSupported if contrast adjustment is not supported, |
|
143 * see TCameraInfo::TOptions |
|
144 * @leave KErrArgument if the specified contrast value is out of |
|
145 * range |
|
146 */ |
|
147 IMPORT_C void SetContrastL( TInt aContrast ); |
|
148 |
|
149 /** |
|
150 * Gets the current contrast value. |
|
151 * @return current contrast value |
|
152 */ |
|
153 IMPORT_C TInt ContrastL(); |
|
154 |
|
155 /** |
|
156 * Sets the brightness adjustment of the device. |
|
157 * No effect if this is not supported, see TCameraInfo::TOptions. |
|
158 * |
|
159 * @param aBrightness required brightness adjustment; This must be |
|
160 * in the range of -100 to +100 or CCamera::EBrightnessAuto |
|
161 * @leave KErrNotSupported if brightness adjustment is not supported, |
|
162 * see TCameraInfo::TOptions |
|
163 * @leave KErrArgument if the brightness adjustment is out of range |
|
164 */ |
|
165 IMPORT_C void SetBrightnessL( TInt aBrightness ); |
|
166 |
|
167 /** |
|
168 * Gets the currently set brightness adjustment value. |
|
169 * @return current brightness adjustment value |
|
170 */ |
|
171 IMPORT_C TInt BrightnessL(); |
|
172 |
|
173 /** |
|
174 * Sets the exposure adjustment of the device. |
|
175 * @param aExposure required exposure adjustment |
|
176 * @leave KErrNotSupported if the specified exposure adjustment is |
|
177 * not supported, see CameraInfo::iExposureModesSupported |
|
178 */ |
|
179 IMPORT_C void SetExposureL( CCamera::TExposure aExposure ); |
|
180 |
|
181 /** |
|
182 * Gets the currently set exposure setting value. |
|
183 * @return current exposure setting value |
|
184 */ |
|
185 IMPORT_C CCamera::TExposure ExposureL(); |
|
186 |
|
187 /** |
|
188 * Sets the white balance adjustment of the device. |
|
189 * @param aWhiteBalance required white balance adjustment |
|
190 * @leave KErrNotSupported if the specified white balance adjustment is |
|
191 * not supported, see TCameraInfo::iWhiteBalanceModesSupported |
|
192 */ |
|
193 IMPORT_C void SetWhiteBalanceL( CCamera::TWhiteBalance aWhiteBalance ); |
|
194 |
|
195 /** |
|
196 * Gets the currently set white balance adjustment value. |
|
197 * @return current white balance adjustment value |
|
198 */ |
|
199 IMPORT_C CCamera::TWhiteBalance WhiteBalanceL(); |
|
200 |
|
201 public: // internal |
|
202 |
|
203 /** |
|
204 * Initializes |
|
205 * @param aManager the manager. Ownership is NOT transferred |
|
206 */ |
|
207 void InitializeL( CMceManager* aManager ); |
|
208 |
|
209 |
|
210 public: |
|
211 |
|
212 /** |
|
213 * Two-phased constructor. |
|
214 */ |
|
215 static CMceCameraSource* NewL(); |
|
216 |
|
217 /** |
|
218 * Two-phased constructor. |
|
219 */ |
|
220 static CMceCameraSource* NewLC(); |
|
221 |
|
222 private: |
|
223 |
|
224 /** |
|
225 * Handles ITC |
|
226 */ |
|
227 TInt GetITCValueL( TUint8 aITCFunction ); |
|
228 |
|
229 /** |
|
230 * Handles ITC |
|
231 */ |
|
232 TInt SetITCValueL( TUint8 aITCFunction, |
|
233 TInt aValue ); |
|
234 |
|
235 /** |
|
236 * Gets camera info |
|
237 */ |
|
238 void GetITCCameraInfoL( CMceManager& aManager, |
|
239 TCameraInfo& aInfo ) const; |
|
240 |
|
241 TCameraInfo SetITCCameraIndexL( TInt aCameraIndex ) const; |
|
242 |
|
243 |
|
244 private: |
|
245 |
|
246 /** |
|
247 * C++ constructor. |
|
248 */ |
|
249 CMceCameraSource(); |
|
250 |
|
251 /** |
|
252 * Second-phase constructor. |
|
253 * @param aManager Pointer to the manager |
|
254 */ |
|
255 void ConstructL( CMceManager* aManager ); |
|
256 |
|
257 private: // Owned data |
|
258 |
|
259 private: // Not owned data |
|
260 |
|
261 //CMceManager* iManager; |
|
262 |
|
263 private: // Reserved for future use |
|
264 |
|
265 TAny* iReserved; |
|
266 |
|
267 //for testing |
|
268 |
|
269 MCE_UNIT_TEST_DEFS |
|
270 |
|
271 }; |
|
272 |
|
273 #endif |