|
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 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 * @param aManager reference to the manager |
|
58 */ |
|
59 IMPORT_C static CMceCameraSource* NewL( CMceManager& aManager ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @param aManager reference to the manager |
|
64 */ |
|
65 IMPORT_C static CMceCameraSource* NewLC( CMceManager& aManager ); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 IMPORT_C ~CMceCameraSource(); |
|
71 |
|
72 public: // From CMceMediaSource |
|
73 |
|
74 /** |
|
75 * Enables the source explicitly. |
|
76 */ |
|
77 IMPORT_C void EnableL(); |
|
78 |
|
79 /** |
|
80 * Disables the source explicitly. |
|
81 */ |
|
82 IMPORT_C void DisableL(); |
|
83 |
|
84 public: // New functions |
|
85 |
|
86 /** |
|
87 * Gets the number of cameras on the device. |
|
88 * @return number of available cameras |
|
89 */ |
|
90 IMPORT_C TInt CamerasAvailable() const; |
|
91 |
|
92 /** |
|
93 * Sets index of physical camera to be used. |
|
94 * @param aCameraIndex, index of the camera to be used; First camera has |
|
95 * index 0 and number of available cameras can be retrieved by |
|
96 * calling CMceCameraSource::CamerasAvailable |
|
97 */ |
|
98 IMPORT_C void SetCameraIndexL( TInt aCameraIndex ); |
|
99 |
|
100 /** |
|
101 * Gets information about the camera device. |
|
102 * @param aInfo on return information about the camera device |
|
103 */ |
|
104 IMPORT_C void GetCameraInfo( TCameraInfo& aInfo ) const; |
|
105 |
|
106 /** |
|
107 * Sets the zoom factor. |
|
108 * This must be in the range of TCameraInfo::iMinZoom to |
|
109 * TCameraInfo::iMaxZoom inclusive. |
|
110 * @param aZoomFactor required zoom factor |
|
111 * @leave KErrArgument if the specified zoom factor is out of range |
|
112 */ |
|
113 IMPORT_C void SetZoomFactorL( TInt aZoomFactor ); |
|
114 |
|
115 /** |
|
116 * Gets the currently set zoom factor. |
|
117 * @return current zoom factor |
|
118 */ |
|
119 IMPORT_C TInt ZoomFactorL(); |
|
120 |
|
121 /** |
|
122 * Sets the digital zoom factor. |
|
123 * This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom |
|
124 * inclusive. |
|
125 * @param aDigitalZoomFactor The required digital zoom factor |
|
126 * @leave KErrArgument if the zoom factor is out of range |
|
127 */ |
|
128 IMPORT_C void SetDigitalZoomFactorL( TInt aDigitalZoomFactor ); |
|
129 |
|
130 /** |
|
131 * Gets the currently set digital zoom factor. |
|
132 * @return current digital zoom factor |
|
133 */ |
|
134 IMPORT_C TInt DigitalZoomFactorL(); |
|
135 |
|
136 /** |
|
137 * Sets the contrast adjustment of the device. |
|
138 * @param aContrast required contrast value; This must be in the |
|
139 * range of -100 to +100 or CCamera::EContrastAuto. |
|
140 * @leave KErrNotSupported if contrast adjustment is not supported, |
|
141 * see TCameraInfo::TOptions |
|
142 * @leave KErrArgument if the specified contrast value is out of |
|
143 * range |
|
144 */ |
|
145 IMPORT_C void SetContrastL( TInt aContrast ); |
|
146 |
|
147 /** |
|
148 * Gets the current contrast value. |
|
149 * @return current contrast value |
|
150 */ |
|
151 IMPORT_C TInt ContrastL(); |
|
152 |
|
153 /** |
|
154 * Sets the brightness adjustment of the device. |
|
155 * No effect if this is not supported, see TCameraInfo::TOptions. |
|
156 * |
|
157 * @param aBrightness required brightness adjustment; This must be |
|
158 * in the range of -100 to +100 or CCamera::EBrightnessAuto |
|
159 * @leave KErrNotSupported if brightness adjustment is not supported, |
|
160 * see TCameraInfo::TOptions |
|
161 * @leave KErrArgument if the brightness adjustment is out of range |
|
162 */ |
|
163 IMPORT_C void SetBrightnessL( TInt aBrightness ); |
|
164 |
|
165 /** |
|
166 * Gets the currently set brightness adjustment value. |
|
167 * @return current brightness adjustment value |
|
168 */ |
|
169 IMPORT_C TInt BrightnessL(); |
|
170 |
|
171 /** |
|
172 * Sets the exposure adjustment of the device. |
|
173 * @param aExposure required exposure adjustment |
|
174 * @leave KErrNotSupported if the specified exposure adjustment is |
|
175 * not supported, see CameraInfo::iExposureModesSupported |
|
176 */ |
|
177 IMPORT_C void SetExposureL( CCamera::TExposure aExposure ); |
|
178 |
|
179 /** |
|
180 * Gets the currently set exposure setting value. |
|
181 * @return current exposure setting value |
|
182 */ |
|
183 IMPORT_C CCamera::TExposure ExposureL(); |
|
184 |
|
185 /** |
|
186 * Sets the white balance adjustment of the device. |
|
187 * @param aWhiteBalance required white balance adjustment |
|
188 * @leave KErrNotSupported if the specified white balance adjustment is |
|
189 * not supported, see TCameraInfo::iWhiteBalanceModesSupported |
|
190 */ |
|
191 IMPORT_C void SetWhiteBalanceL( CCamera::TWhiteBalance aWhiteBalance ); |
|
192 |
|
193 /** |
|
194 * Gets the currently set white balance adjustment value. |
|
195 * @return current white balance adjustment value |
|
196 */ |
|
197 IMPORT_C CCamera::TWhiteBalance WhiteBalanceL(); |
|
198 |
|
199 public: // internal |
|
200 |
|
201 /** |
|
202 * Initializes |
|
203 * @param aManager the manager. Ownership is NOT transferred |
|
204 */ |
|
205 void InitializeL( CMceManager* aManager ); |
|
206 |
|
207 private: |
|
208 |
|
209 /** |
|
210 * C++ constructor. |
|
211 */ |
|
212 CMceCameraSource(); |
|
213 |
|
214 /** |
|
215 * Second-phase constructor. |
|
216 */ |
|
217 void ConstructL( CMceManager* aManager ); |
|
218 |
|
219 private: // Owned data |
|
220 |
|
221 TCameraInfo iCameraInfo; |
|
222 |
|
223 private: // Not owned data |
|
224 |
|
225 //CMceManager* iManager; |
|
226 |
|
227 private: // Reserved for future use |
|
228 |
|
229 TAny* iReserved; |
|
230 |
|
231 |
|
232 public: // stub data |
|
233 |
|
234 TInt iCameraIndex; |
|
235 TInt iZoomFactor; |
|
236 TInt iDigitalZoomFactor; |
|
237 TInt iContrast; |
|
238 TInt iBrightness; |
|
239 TInt iExposure; |
|
240 TInt iWhiteBalance; |
|
241 |
|
242 }; |
|
243 |
|
244 #endif |