|
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 // INCLUDE FILES |
|
22 #include <e32svr.h> |
|
23 |
|
24 #include "mcccamerahandler.h" |
|
25 #include "mccscreen.h" |
|
26 #include "mcccontrollerlogs.h" |
|
27 |
|
28 #include "mmccinterfacedef.h" |
|
29 |
|
30 // EXTERNAL DATA STRUCTURES |
|
31 |
|
32 // EXTERNAL FUNCTION PROTOTYPES |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // MACROS |
|
37 |
|
38 // LOCAL CONSTANTS AND MACROS |
|
39 |
|
40 // MODULE DATA STRUCTURES |
|
41 |
|
42 // LOCAL FUNCTION PROTOTYPES |
|
43 |
|
44 // FORWARD DECLARATIONS |
|
45 |
|
46 // ============================= LOCAL FUNCTIONS =============================== |
|
47 |
|
48 |
|
49 // ============================ MEMBER FUNCTIONS =============================== |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CMccCameraHandler::CMccCameraHandler |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CMccCameraHandler::CMccCameraHandler( |
|
56 MMccResources& aResources, TInt aCameraIndex, TInt aPriority ): |
|
57 iResources( aResources ), |
|
58 iState( EInit ), |
|
59 iPriority( aPriority ), |
|
60 iCameraIndex( aCameraIndex ) |
|
61 { |
|
62 } |
|
63 |
|
64 // ----------------------------------------------------------------------------- |
|
65 // CMccCameraHandler::~CMccCameraHandler |
|
66 // ----------------------------------------------------------------------------- |
|
67 // |
|
68 CMccCameraHandler::~CMccCameraHandler() |
|
69 { |
|
70 __CONTROLLER( "CMccCameraHandler::~CMccCameraHandler" ) |
|
71 |
|
72 iObservers.Reset(); |
|
73 iObservers.Close(); |
|
74 |
|
75 if( iScreen ) |
|
76 { |
|
77 iScreen->Stop(); |
|
78 } |
|
79 |
|
80 delete iScreen; |
|
81 |
|
82 __CONTROLLER( "CMccCameraHandler::~CMccCameraHandler, exit" ) |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CMccCameraHandler::NewL |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 CMccCameraHandler* CMccCameraHandler::NewL( |
|
90 MMccResources& aResources, TInt aCameraIndex, TInt aPriority ) |
|
91 { |
|
92 CMccCameraHandler* self = |
|
93 new ( ELeave ) CMccCameraHandler( aResources, aCameraIndex, aPriority ); |
|
94 CleanupStack::PushL( self ); |
|
95 self->ConstructL(); |
|
96 CleanupStack::Pop( self ); |
|
97 return self; |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CMccCameraHandler::ConstructL |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 void CMccCameraHandler::ConstructL() |
|
105 { |
|
106 __CONTROLLER( "CMccCameraHandler::ConstructL" ) |
|
107 |
|
108 __CONTROLLER( "CMccCameraHandler::ConstructL, exit" ) |
|
109 } |
|
110 |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CMccCameraHandler::EnableViewFinderL |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 void CMccCameraHandler::EnableViewFinderL( TMccVideoSinkSetting& aSetting ) |
|
116 { |
|
117 __CONTROLLER( "CMccCameraHandler::EnableViewFinderL" ) |
|
118 |
|
119 iViewFinderSettings = aSetting; |
|
120 |
|
121 iViewFinderEnabled = ETrue; |
|
122 |
|
123 __CONTROLLER( "CMccCameraHandler::EnableViewFinderL, exit" ) |
|
124 } |
|
125 |
|
126 // ----------------------------------------------------------------------------- |
|
127 // CMccCameraHandler::DisableViewFinderL |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 void CMccCameraHandler::DisableViewFinderL() |
|
131 { |
|
132 __CONTROLLER( "CMccCameraHandler::DisableViewFinderL" ) |
|
133 |
|
134 iViewFinderEnabled = EFalse; |
|
135 |
|
136 __CONTROLLER( "CMccCameraHandler::DisableViewFinderL, exit" ) |
|
137 } |
|
138 |
|
139 // ----------------------------------------------------------------------------- |
|
140 // CMccCameraHandler::IsViewFinderEnabled |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 TBool CMccCameraHandler::IsViewFinderEnabled() const |
|
144 { |
|
145 return iViewFinderEnabled; |
|
146 } |
|
147 |
|
148 |
|
149 // ----------------------------------------------------------------------------- |
|
150 // CMccCameraHandler::GetViewFinderSettingsL |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 void CMccCameraHandler::GetViewFinderSettingsL( TMccVideoSinkSetting& aSetting ) |
|
154 { |
|
155 __CONTROLLER( "CMccCameraHandler::GetViewFinderSettingsL" ) |
|
156 |
|
157 aSetting = iViewFinderSettings; |
|
158 |
|
159 __CONTROLLER( "CMccCameraHandler::GetViewFinderSettingsL, exit" ) |
|
160 } |
|
161 |
|
162 // ----------------------------------------------------------------------------- |
|
163 // CMccCameraHandler::GetCamInfoL |
|
164 // ----------------------------------------------------------------------------- |
|
165 // |
|
166 void CMccCameraHandler::GetCamInfoL( TCameraInfo& aInfo, TBool /*aForceCameraCreation*/ ) |
|
167 { |
|
168 __CONTROLLER( "CMccCameraHandler::GetCamInfoL" ) |
|
169 |
|
170 aInfo.iMinZoom = -100; |
|
171 aInfo.iMaxZoom = 100; |
|
172 aInfo.iMaxDigitalZoom = 100; |
|
173 aInfo.iOptionsSupported = 2147483647; //4294967295; |
|
174 __CONTROLLER( "CMccCameraHandler::GetCamInfoL, exit" ) |
|
175 } |
|
176 |
|
177 // ----------------------------------------------------------------------------- |
|
178 // CMccCameraHandler::GetNumOfCamerasL |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 TInt CMccCameraHandler::GetNumOfCamerasL() |
|
182 { |
|
183 __CONTROLLER( "CMccCameraHandler::GetNumOfCamerasL" ) |
|
184 |
|
185 __CONTROLLER( "CMccCameraHandler::GetNumOfCamerasL, exit" ) |
|
186 return 1; |
|
187 } |
|
188 // ----------------------------------------------------------------------------- |
|
189 // CMccCameraHandler::GetValue |
|
190 // ----------------------------------------------------------------------------- |
|
191 // |
|
192 void CMccCameraHandler::GetValueL( TUint32 aParam, TInt& aVal ) |
|
193 { |
|
194 __CONTROLLER( "CMccCameraHandler::GetValue" ) |
|
195 RDebug::Print(_L("CMccCameraHandler::GetValue, aParam=%d"), aParam ); |
|
196 aVal = 5; |
|
197 __CONTROLLER( "CMccCameraHandler::GetValue, exit" ) |
|
198 } |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CMccCameraHandler::SetValue |
|
202 // ----------------------------------------------------------------------------- |
|
203 // |
|
204 void CMccCameraHandler::SetValueL( TUint32 aParam, TInt aVal ) |
|
205 { |
|
206 __CONTROLLER( "CMccCameraHandler::SetValue" ) |
|
207 RDebug::Print(_L("CMccCameraHandler::GetValue, aParam=%d, aVal=%d"), aParam, aVal ); |
|
208 |
|
209 __CONTROLLER( "CMccCameraHandler::SetValue, exit" ) |
|
210 } |
|
211 |
|
212 // ----------------------------------------------------------------------------- |
|
213 // CMccCameraHandler::GetValue |
|
214 // ----------------------------------------------------------------------------- |
|
215 // |
|
216 void CMccCameraHandler::GetValueL( TUint32 /*aParam*/, TReal& /*aVal*/ ) |
|
217 { |
|
218 User::Leave( KErrNotSupported ); |
|
219 } |
|
220 |
|
221 // ----------------------------------------------------------------------------- |
|
222 // CMccCameraHandler::SetValue |
|
223 // ----------------------------------------------------------------------------- |
|
224 // |
|
225 void CMccCameraHandler::SetValueL( TUint32 /*aParam*/, TReal /*aVal*/ ) |
|
226 { |
|
227 User::Leave( KErrNotSupported ); |
|
228 } |
|
229 |
|
230 // ----------------------------------------------------------------------------- |
|
231 // CMccCameraHandler::ReserveResourcesL |
|
232 // ----------------------------------------------------------------------------- |
|
233 // |
|
234 void CMccCameraHandler::ReserveResourcesL( |
|
235 TInt aCameraIndex, TBool /*aForceCameraCreation*/ ) |
|
236 { |
|
237 __CONTROLLER_INT1( "CMccCameraHandler::ReserveResourcesL, camera index", aCameraIndex ) |
|
238 |
|
239 iCameraIndex = aCameraIndex; |
|
240 } |
|
241 |
|
242 // ----------------------------------------------------------------------------- |
|
243 // CMccCameraHandler::ReleaseResources |
|
244 // ----------------------------------------------------------------------------- |
|
245 // |
|
246 void CMccCameraHandler::ReleaseResources() |
|
247 { |
|
248 __CONTROLLER( "CMccCameraHandler::ReleaseResources" ) |
|
249 } |
|
250 |
|
251 // ----------------------------------------------------------------------------- |
|
252 // CMccCameraHandler::Handle |
|
253 // ----------------------------------------------------------------------------- |
|
254 // |
|
255 TUint32 CMccCameraHandler::Handle() |
|
256 { |
|
257 return 0; |
|
258 } |
|
259 |
|
260 // ----------------------------------------------------------------------------- |
|
261 // CMccCameraHandler::IsCameraReady |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 TBool CMccCameraHandler::IsCameraReady() |
|
265 { |
|
266 return ETrue; |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // CMccCameraHandler::MonitorCameraReservation |
|
271 // ----------------------------------------------------------------------------- |
|
272 // |
|
273 TInt CMccCameraHandler::MonitorCameraReservation( |
|
274 MMccCameraHandlerObserver& /*aObserver*/, |
|
275 TBool /*aForceCameraReserve*/ ) |
|
276 { |
|
277 __CONTROLLER( "CMccCameraHandler::MonitorCameraReservation" ) |
|
278 |
|
279 return KErrNone; |
|
280 } |
|
281 |
|
282 // ----------------------------------------------------------------------------- |
|
283 // CMccCameraHandler::StopCameraMonitoring |
|
284 // ----------------------------------------------------------------------------- |
|
285 // |
|
286 TInt CMccCameraHandler::StopCameraMonitoring( |
|
287 MMccCameraHandlerObserver& /*aObserver*/, |
|
288 TBool /*aForceCameraRelease*/ ) |
|
289 { |
|
290 return KErrNone; |
|
291 } |
|
292 |
|
293 // ----------------------------------------------------------------------------- |
|
294 // CMccCameraHandler::NotifyObservers |
|
295 // ----------------------------------------------------------------------------- |
|
296 // |
|
297 void CMccCameraHandler::NotifyObservers( TInt /*aError*/ ) |
|
298 { |
|
299 } |
|
300 |
|
301 // ----------------------------------------------------------------------------- |
|
302 // CMccCameraHandler::ReserveComplete |
|
303 // ----------------------------------------------------------------------------- |
|
304 // |
|
305 void CMccCameraHandler::ReserveComplete( TInt /*aError*/ ) |
|
306 { |
|
307 __CONTROLLER( "CMccCameraHandler::ReserveComplete" ) |
|
308 } |
|
309 |
|
310 // ----------------------------------------------------------------------------- |
|
311 // CMccCameraHandler::PowerOnComplete |
|
312 // ----------------------------------------------------------------------------- |
|
313 // |
|
314 void CMccCameraHandler::PowerOnComplete( TInt /*aError*/ ) |
|
315 { |
|
316 __CONTROLLER( "CMccCameraHandler::PowerOnComplete" ) |
|
317 } |
|
318 |
|
319 // ----------------------------------------------------------------------------- |
|
320 // CMccCameraHandler::ViewFinderFrameReady |
|
321 // ----------------------------------------------------------------------------- |
|
322 // |
|
323 void CMccCameraHandler::ViewFinderFrameReady( CFbsBitmap& aFrame ) |
|
324 { |
|
325 if ( iScreen ) |
|
326 { |
|
327 iScreen->Draw( aFrame ); |
|
328 } |
|
329 } |
|
330 |
|
331 // ----------------------------------------------------------------------------- |
|
332 // CMccCameraHandler::ImageReady |
|
333 // ----------------------------------------------------------------------------- |
|
334 // |
|
335 void CMccCameraHandler::ImageReady( CFbsBitmap* /*aBitmap*/, HBufC8* /*aData*/, TInt /*aError*/ ) |
|
336 { |
|
337 } |
|
338 |
|
339 // ----------------------------------------------------------------------------- |
|
340 // CMccCameraHandler::FrameBufferReady |
|
341 // ----------------------------------------------------------------------------- |
|
342 // |
|
343 void CMccCameraHandler::FrameBufferReady( MFrameBuffer* /*aFrameBuffer*/, TInt /*aError*/ ) |
|
344 { |
|
345 } |
|
346 |
|
347 // ----------------------------------------------------------------------------- |
|
348 // CMccCameraHandler::HandleEvent |
|
349 // ----------------------------------------------------------------------------- |
|
350 // |
|
351 void CMccCameraHandler::HandleEvent( const TECAMEvent& /*aEvent*/ ) |
|
352 { |
|
353 } |
|
354 |
|
355 // ----------------------------------------------------------------------------- |
|
356 // CMccCameraHandler::ViewFinderReady |
|
357 // ----------------------------------------------------------------------------- |
|
358 // |
|
359 void CMccCameraHandler::ViewFinderReady( |
|
360 MCameraBuffer& /*aCameraBuffer*/, TInt /*aError*/ ) |
|
361 { |
|
362 } |
|
363 |
|
364 // ----------------------------------------------------------------------------- |
|
365 // CMccCameraHandler::ImageBufferReady |
|
366 // ----------------------------------------------------------------------------- |
|
367 // |
|
368 void CMccCameraHandler::ImageBufferReady( |
|
369 MCameraBuffer& /*aCameraBuffer*/,TInt /*aError*/ ) |
|
370 { |
|
371 } |
|
372 |
|
373 // ----------------------------------------------------------------------------- |
|
374 // CMccCameraHandler::VideoBufferReady |
|
375 // ----------------------------------------------------------------------------- |
|
376 // |
|
377 void CMccCameraHandler::VideoBufferReady( |
|
378 MCameraBuffer& /*aCameraBuffer*/,TInt /*aError*/ ) |
|
379 { |
|
380 } |
|
381 |
|
382 // ----------------------------------------------------------------------------- |
|
383 // CMccCameraHandler::TimerExpiredL |
|
384 // ----------------------------------------------------------------------------- |
|
385 // |
|
386 void CMccCameraHandler::TimerExpiredL( TMccTimerId /*aTimerId*/, TAny* /*aTimerParam*/ ) |
|
387 { |
|
388 } |
|
389 |
|
390 // ----------------------------------------------------------------------------- |
|
391 // CMccCameraHandler::SettingsChanged |
|
392 // ----------------------------------------------------------------------------- |
|
393 // |
|
394 TBool CMccCameraHandler::SettingsChanged( const TMccVideoSinkSetting& /*aSetting*/ ) const |
|
395 { |
|
396 return EFalse; |
|
397 } |
|
398 |
|
399 // ----------------------------------------------------------------------------- |
|
400 // CMccCameraHandler::UpdateCameraSettingsL |
|
401 // ----------------------------------------------------------------------------- |
|
402 // |
|
403 void CMccCameraHandler::UpdateCameraSettingsL() |
|
404 { |
|
405 } |
|
406 |
|
407 // ----------------------------------------------------------------------------- |
|
408 // CMccCameraHandler::ResetCameraHandler |
|
409 // ----------------------------------------------------------------------------- |
|
410 // |
|
411 void CMccCameraHandler::ResetCameraHandler() |
|
412 { |
|
413 |
|
414 } |
|
415 // End of file |
|
416 |