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