1 ecam.h |
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedAll |
|
21 @released |
|
22 */ |
|
23 #ifndef ECAM_H |
|
24 #define ECAM_H |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <ecamuids.hrh> |
|
28 #include <e32property.h> |
|
29 |
|
30 class MFrameBuffer; |
|
31 class RWsSession; |
|
32 class CWsScreenDevice; |
|
33 class RWindowBase; |
|
34 class CFbsBitmap; |
|
35 |
|
36 typedef TInt TPostCaptureControlId; |
|
37 |
|
38 /** Specifies camera device information. |
|
39 |
|
40 If either zoom or digital zoom are available then the appropriate entries |
|
41 in this class will be set to indicate the range of values that they may take. |
|
42 This should be implemented such that a setting of zero corresponds to no zoom, |
|
43 and a step of one corresponds to the smallest increment available, in a linear |
|
44 fashion. |
|
45 |
|
46 There are also zoom factors that correspond to the actual zoom factor when |
|
47 at minimum (non-digital only) and maximum zoom. Negative zoom values represent |
|
48 macro functionality. |
|
49 |
|
50 Image capture, if supported, is simply a case of transferring the current |
|
51 image from the camera to the client via MCameraObserver::ImageReady(). The |
|
52 camera class must set the iImageFormatsSupported bitfield to indicate the |
|
53 formats available. |
|
54 |
|
55 @publishedAll |
|
56 @released |
|
57 */ |
|
58 class TCameraInfo |
|
59 { |
|
60 public: |
|
61 /** Possible directions in which the camera may point. |
|
62 */ |
|
63 enum TCameraOrientation |
|
64 { |
|
65 /** Outward pointing camera for taking pictures. |
|
66 Camera is directed away from the user. */ |
|
67 EOrientationOutwards, |
|
68 /** Inward pointing camera for conferencing. |
|
69 Camera is directed towards the user. */ |
|
70 EOrientationInwards, |
|
71 /** Mobile camera capable of multiple orientations. |
|
72 Camera orientation may be changed by the user. */ |
|
73 EOrientationMobile, |
|
74 /** Camera orientation is not known. */ |
|
75 EOrientationUnknown |
|
76 }; |
|
77 |
|
78 /** Various flags describing the features available for a particular implementation |
|
79 */ |
|
80 enum TOptions |
|
81 { |
|
82 /** View finder display direct-to-screen flag */ |
|
83 EViewFinderDirectSupported = 0x0001, |
|
84 /** View finder bitmap generation flag */ |
|
85 EViewFinderBitmapsSupported = 0x0002, |
|
86 /** Still image capture flag */ |
|
87 EImageCaptureSupported = 0x0004, |
|
88 /** Video capture flag */ |
|
89 EVideoCaptureSupported = 0x0008, |
|
90 /** View finder display mirroring flag */ |
|
91 EViewFinderMirrorSupported = 0x0010, |
|
92 /** Contrast setting flag */ |
|
93 EContrastSupported = 0x0020, |
|
94 /** Brightness setting flag */ |
|
95 EBrightnessSupported = 0x0040, |
|
96 /** View finder clipping flag */ |
|
97 EViewFinderClippingSupported = 0x0080, |
|
98 /** Still image capture clipping flag */ |
|
99 EImageClippingSupported = 0x0100, |
|
100 /** Video capture clipping flag */ |
|
101 EVideoClippingSupported = 0x0200 |
|
102 }; |
|
103 public: |
|
104 /** Version number and name of camera hardware. */ |
|
105 TVersion iHardwareVersion; |
|
106 /** Version number and name of camera software (device driver). */ |
|
107 TVersion iSoftwareVersion; |
|
108 /** Orientation of this particular camera device. */ |
|
109 TCameraOrientation iOrientation; |
|
110 |
|
111 /** Bitfield of TOptions available */ |
|
112 TUint32 iOptionsSupported; |
|
113 /** The supported flash modes. |
|
114 |
|
115 This is a bitfield of CCamera::TFlash values. |
|
116 |
|
117 If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the |
|
118 application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed |
|
119 from the implementation should be filtered by ECAM Implementation. |
|
120 To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
121 to create camera object. This is an indication to ECAM implementation. In this case, application is assumed |
|
122 to be prepared to receive unrecognised enum values. |
|
123 @see CCamera::CCameraAdvancedSettings::SupportedFlashModes() |
|
124 |
|
125 */ |
|
126 TUint32 iFlashModesSupported; |
|
127 /** The supported exposure modes. |
|
128 |
|
129 This is a bitfield of CCamera::TExposure values. */ |
|
130 TUint32 iExposureModesSupported; |
|
131 |
|
132 /** The supported white balance settings. |
|
133 |
|
134 This is a bitfield of of CCamera::TWhiteBalance values. |
|
135 |
|
136 If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the |
|
137 application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed |
|
138 from the implementation should be filtered by ECAM Implementation. |
|
139 To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
140 to create camera object. This is an indication to ECAM implementation. In this case, application is assumed |
|
141 to be prepared to receive unrecognised enum values. |
|
142 Refer to CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes() implementation |
|
143 |
|
144 @see CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes() |
|
145 */ |
|
146 TUint32 iWhiteBalanceModesSupported; |
|
147 |
|
148 /** Minimum zoom value allowed. |
|
149 |
|
150 Must be negative, or zero if not supported. |
|
151 |
|
152 This is the minimum value that may be passed to CCamera::SetZoomFactorL(). */ |
|
153 TInt iMinZoom; |
|
154 /** Maximum zoom value allowed. |
|
155 |
|
156 Must be positive, or zero if not supported. |
|
157 |
|
158 This is the maximum value that may be passed to CCamera::SetZoomFactorL(). */ |
|
159 TInt iMaxZoom; |
|
160 /** Maximum digital zoom value allowed. |
|
161 |
|
162 Must be positive, or zero if not supported. |
|
163 |
|
164 This is the maximum value that may be passed to CCamera::SetDigitalZoomFactorL(). |
|
165 Digital zoom factor is assumed to be a linear scale from 0 to iMaxDigitalZoom. */ |
|
166 TInt iMaxDigitalZoom; |
|
167 |
|
168 /** Image size multiplier corresponding to minimum zoom value. |
|
169 |
|
170 Must be between 0 and 1 inclusive. Both 0 and 1 indicate that macro functionality |
|
171 is not supported. */ |
|
172 TReal32 iMinZoomFactor; |
|
173 /** Image size multiplier corresponding to maximum zoom value. |
|
174 |
|
175 May take the value 0, or values greater than or equal to 1. Both 0 and 1 indicate |
|
176 that zoom functionality is not supported. */ |
|
177 TReal32 iMaxZoomFactor; |
|
178 /** Image size multiplier corresponding to maximum digital zoom value. |
|
179 |
|
180 Implementation recommendation is to use 'appropriate value' for maximum digital zoom which could cover only values |
|
181 given by new digital zoom methods based on image format and capture mode. |
|
182 |
|
183 Must be greater than or equal to 1. */ |
|
184 TReal32 iMaxDigitalZoomFactor; |
|
185 |
|
186 /** Count of still image capture sizes allowed. |
|
187 |
|
188 Number of different image sizes that CCamera::EnumerateCaptureSizes() will |
|
189 support, based on the index passed in. Index must be between 0 and iNumImageSizesSupported-1. */ |
|
190 TInt iNumImageSizesSupported; |
|
191 /** The supported still image formats. |
|
192 |
|
193 This is a bitfield of CCamera::TFormat values. */ |
|
194 TUint32 iImageFormatsSupported; |
|
195 |
|
196 /** Count of video frame sizes allowed. |
|
197 |
|
198 This is the number of different video frame sizes that CCamera::EnumerateVideoFrameSizes() |
|
199 will support, based on the specified index. The index must be between 0 and |
|
200 iNumVideoFrameSizesSupported-1. */ |
|
201 TInt iNumVideoFrameSizesSupported; |
|
202 /** Count of video frame rates allowed. |
|
203 |
|
204 This is the number of different video frame rates that CCamera::EnumerateVideoFrameRates() |
|
205 will support, based on the specified index. The index must be between 0 and |
|
206 iNumVideoFrameRatesSupported-1. */ |
|
207 TInt iNumVideoFrameRatesSupported; |
|
208 /** The supported video frame formats. |
|
209 |
|
210 This is a bitfield of video frame CCamera::TFormat values. |
|
211 |
|
212 If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the |
|
213 application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed |
|
214 from the implementation should be filtered by the ECAM implementation. |
|
215 To receive unrecognised/extra added enum values, the application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
216 to create the camera object. This is an indication to the ECAM implementation. In this case, the application is assumed |
|
217 to be prepared to receive unrecognised enum values. |
|
218 */ |
|
219 TUint32 iVideoFrameFormatsSupported; |
|
220 /** Maximum number of frames per buffer that may be requested. */ |
|
221 TInt iMaxFramesPerBufferSupported; |
|
222 /** Maximum number of buffers allowed */ |
|
223 TInt iMaxBuffersSupported; |
|
224 }; |
|
225 |
|
226 /** Mixin base class for camera clients. |
|
227 |
|
228 An application must implement an MCameraObserver or MCameraObserver2 (recommended) |
|
229 in order to use the camera API. This derived class is called when the camera is |
|
230 ready for use, an image has been captured or a buffer of video data is ready, including |
|
231 when errors occur. |
|
232 |
|
233 Implementations of the camera API should use MCameraObserver::FrameBufferReady() |
|
234 and MFrameBuffer::Release() to co-ordinate the mapping of any special memory |
|
235 objects. |
|
236 |
|
237 @publishedAll |
|
238 @released |
|
239 */ |
|
240 class MCameraObserver |
|
241 { |
|
242 public: |
|
243 /** Camera reservation is complete. |
|
244 |
|
245 Called asynchronously when CCamera::Reserve() completes. |
|
246 |
|
247 @param aError |
|
248 An error on failure and KErrNone on success. |
|
249 */ |
|
250 virtual void ReserveComplete(TInt aError)=0; |
|
251 |
|
252 /** Indicates camera power on is complete. |
|
253 |
|
254 Called on completion of CCamera:PowerOn(). |
|
255 |
|
256 @param aError |
|
257 KErrNone on success, KErrInUse if the camera is in |
|
258 use by another client or KErrNoMemory if insufficient system memory is available. |
|
259 */ |
|
260 virtual void PowerOnComplete(TInt aError)=0; |
|
261 |
|
262 /** Tests whether transfer of view finder data has completed. |
|
263 |
|
264 Called periodically in response to the use of CCamera::StartViewFinderBitmapsL(). |
|
265 |
|
266 @param aFrame |
|
267 The view finder frame. |
|
268 */ |
|
269 virtual void ViewFinderFrameReady(CFbsBitmap& aFrame)=0; |
|
270 |
|
271 /** Transfers the current image from the camera to the client. |
|
272 |
|
273 Called asynchronously when CCamera::CaptureImage() completes. |
|
274 |
|
275 @param aBitmap |
|
276 On return, a pointer to an image held in CFbsBitmap form if |
|
277 this was the format specified in CCamera::PrepareImageCaptureL(). |
|
278 @param aData |
|
279 On return, a pointer to an HBufC8 if this was the format specified |
|
280 in CCamera::PrepareImageCaptureL(). NULL if there was an error. |
|
281 @param aError |
|
282 KErrNone on success or an error code on failure. |
|
283 */ |
|
284 virtual void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError)=0; |
|
285 |
|
286 /** Passes a filled frame buffer to the client. |
|
287 |
|
288 Called asynchronously, when a buffer has been filled with the required number |
|
289 of video frames by CCamera::StartVideoCapture(). |
|
290 |
|
291 @param aFrameBuffer |
|
292 On return, a pointer to an MFrameBuffer if successful, |
|
293 or NULL if not successful. |
|
294 @param aError |
|
295 KErrNone if successful, or an error code if not successful. |
|
296 */ |
|
297 virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError)=0; |
|
298 }; |
|
299 |
|
300 |
|
301 /** |
|
302 Class used for passing camera picture data between camera and client in the V2 observer. |
|
303 Used for viewfinder, image capture and video capture. |
|
304 |
|
305 The class offers APIs for the client to access the data as a descriptor, a bitmap |
|
306 or a handle to a kernel chunk. Depending on the format previously requested by |
|
307 the client, one or more of the API choices may be inappropriate e.g. an image will |
|
308 not be avaiable as a bitmap in the FBS unless the client has specifically requested |
|
309 it. |
|
310 |
|
311 The buffer may contain multiple frames. |
|
312 |
|
313 @publishedAll |
|
314 @released |
|
315 */ |
|
316 class MCameraBuffer |
|
317 { |
|
318 public: |
|
319 /** |
|
320 Returns the number of frames of image data contained within the buffer. This |
|
321 would be 1 for a image capture, and match the requested count |
|
322 for video capture. For other methods in this class that take a aFrameIndex |
|
323 param, 0 <= aFrameIndex < NumFrames() |
|
324 |
|
325 @return The number of frames of image data in the buffer. |
|
326 */ |
|
327 virtual TInt NumFrames()=0; |
|
328 /** |
|
329 Returns a pointer to a descriptor containing a frame of camera data. The format |
|
330 will have been previously specified by a CCamera class method. |
|
331 |
|
332 @param aFrameIndex |
|
333 The index of the required frame. For a still image this should be 0. |
|
334 |
|
335 @leave KErrArgument if aIndex is out of range and |
|
336 @leave KErrNotSupported if the camera data is actually bitmaps in the FBS. |
|
337 |
|
338 @return A pointer to a descriptor containing a frame of image data. |
|
339 */ |
|
340 virtual TDesC8* DataL(TInt aFrameIndex)=0; |
|
341 |
|
342 /** |
|
343 Returns a reference to a FBS bitmap containing a frame of image data. |
|
344 |
|
345 @param aFrameIndex |
|
346 The index of the required frame. For a still image this should be 0. |
|
347 |
|
348 @leave KErrArgument if aIndex is out of range and |
|
349 @leave KErrNotSupported if the picture data is not a FBS bitmap. |
|
350 |
|
351 @return A reference to a FBS bitmap containing a frame of picture data. |
|
352 */ |
|
353 virtual CFbsBitmap& BitmapL(TInt aFrameIndex)=0; |
|
354 |
|
355 /** |
|
356 Returns a handle for the chunk that contains the camera data. |
|
357 The RChunk is exposed so that it can potentially be shared between multiple |
|
358 processes. |
|
359 The ptr returned by DataL(aFrameIndex) is effectively derived from this |
|
360 RChunk (where both are supported simulataneously). The equivalent ptr would be: |
|
361 TPtrC8* ptr; |
|
362 ptr.Set(ChunkL().Base() + ChunkOffset(aFrameIndex), FrameSize(aFrameIndex)); |
|
363 |
|
364 @leave KErrNotSupported if the chunk is not available. |
|
365 |
|
366 @return A reference to a handle to the chunk that contains the buffer of picture data. |
|
367 */ |
|
368 virtual RChunk& ChunkL()=0; |
|
369 |
|
370 /** |
|
371 Returns the offset into the chunk that contains the frame specified by aFrameIndex. |
|
372 The client would add this offset to the ptr returned by ChunkL().Base() to |
|
373 get the address of the start of the frame data. |
|
374 |
|
375 @param aIndex |
|
376 The index of the required frame. For a still image this should be 0. |
|
377 |
|
378 @leave KErrNotSupported if the chunk is not available |
|
379 @leave KErrArgument if aIndex is out of range. |
|
380 |
|
381 @return The offset into the chunk for the start of the frame. |
|
382 */ |
|
383 virtual TInt ChunkOffsetL(TInt aFrameIndex)=0; |
|
384 |
|
385 /** |
|
386 Returns the size of the data in bytes that comprises the frame specified by aIndex. |
|
387 |
|
388 @param aFrameIndex |
|
389 The index of the required frame. For a still image this should be 0. |
|
390 |
|
391 @leave KErrArgument |
|
392 if aIndex is out of range. |
|
393 |
|
394 @return Returns the size of the data in bytes that comprises the frame. |
|
395 */ |
|
396 virtual TInt FrameSize(TInt aFrameIndex)=0; |
|
397 |
|
398 /** |
|
399 Releases the buffer. Once the client has processed |
|
400 the picture data it should use this method to signal to CCamera that the |
|
401 buffer can be re-used. |
|
402 */ |
|
403 virtual void Release()=0; |
|
404 public: |
|
405 |
|
406 /** |
|
407 Sequential frame number of the first frame in the buffer, counting from when |
|
408 CCamera::StartVideoCapture() was called and including frames dropped due to |
|
409 lack of buffers. Always zero for still images. May also be used by client viewfinders. |
|
410 */ |
|
411 TInt iIndexOfFirstFrameInBuffer; |
|
412 |
|
413 /** |
|
414 Time elapsed from when CCamera::StartVideoCapture() was called until the first |
|
415 frame in the buffer was captured. Always zero for still images. |
|
416 */ |
|
417 TTimeIntervalMicroSeconds iElapsedTime; |
|
418 }; |
|
419 |
|
420 /** |
|
421 This class is used to provide extra buffer informations through a custom interface. |
|
422 |
|
423 @see MCameraImageBuffer |
|
424 |
|
425 @publishedPartner |
|
426 @prototype |
|
427 */ |
|
428 class MCameraBuffer2 : public MCameraBuffer |
|
429 { |
|
430 public: |
|
431 /** |
|
432 Retrieves an array of uids which represents the class identifier used for buffer extension. |
|
433 |
|
434 @param aInterfaceUids |
|
435 An array of uids which represents the class identifier. |
|
436 |
|
437 @return The error code. |
|
438 */ |
|
439 virtual TInt GetInterfaceUids(RArray<TUid>& aInterfaceUids) = 0; |
|
440 |
|
441 /** |
|
442 Gets a custom interface for extra buffer information. |
|
443 |
|
444 @param aInterface |
|
445 The Uid of the particular interface function required for buffer information. |
|
446 |
|
447 @param aPtrInterface |
|
448 The client has to cast the custom interface pointer to the appropriate type. |
|
449 |
|
450 @return The error code. |
|
451 */ |
|
452 virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface) = 0; |
|
453 }; |
|
454 |
|
455 /** |
|
456 Uid used to identify the event that the request to Reserve() has completed |
|
457 */ |
|
458 static const TUid KUidECamEventReserveComplete = {0x101F7D3B}; |
|
459 |
|
460 /** |
|
461 Uid used to identify the event that the request to PowerOn() has completed |
|
462 */ |
|
463 static const TUid KUidECamEventPowerOnComplete = {0x101F7D3C}; |
|
464 |
|
465 /** |
|
466 Uid used to identify the event that the client has lost |
|
467 control of the camera |
|
468 */ |
|
469 static const TUid KUidECamEventCameraNoLongerReserved = {0x101F7D3D}; |
|
470 |
|
471 /** |
|
472 Uid used to notify the client who made the new reserve request. |
|
473 |
|
474 Error value KErrECamHighPriorityReserveRequesterExists indicates another such reserve request is outstanding and |
|
475 has higher priority than this one. |
|
476 Error value KErrCancel indicates a new reserve requester with higher priority than the current requester has |
|
477 been made. That's why, this one got cancelled. |
|
478 Any other error may also occur. |
|
479 @see CCamera::CCameraAdvancedSettings::ReserveL(const TTimeIntervalMicroseconds32& aMaxTimeToWait, TBool aKickOut); |
|
480 */ |
|
481 static const TUid KUidECamEventNewReserveComplete = {KUidECamEventNewReserveCompleteUidValue}; |
|
482 |
|
483 /** |
|
484 @publishedAll |
|
485 @released |
|
486 |
|
487 General purpose class to describe an ECam event. |
|
488 |
|
489 Contains a UID to define the actual event type, and an integer to define the event code. |
|
490 |
|
491 */ |
|
492 |
|
493 class TECAMEvent |
|
494 { |
|
495 public: |
|
496 |
|
497 /** |
|
498 Constructor. |
|
499 |
|
500 @param aEventType |
|
501 A UID to define the type of event. |
|
502 @param aErrorCode |
|
503 The error code associated with the event. |
|
504 |
|
505 */ |
|
506 IMPORT_C TECAMEvent(TUid aEventType, TInt aErrorCode); |
|
507 |
|
508 /** |
|
509 Default constructor. |
|
510 |
|
511 Provided so this class can be packaged in a TPckgBuf<>. |
|
512 */ |
|
513 IMPORT_C TECAMEvent(); |
|
514 |
|
515 /** |
|
516 A UID to define the event type. |
|
517 */ |
|
518 TUid iEventType; |
|
519 |
|
520 /** |
|
521 The error code associated with the event. |
|
522 */ |
|
523 TInt iErrorCode; |
|
524 }; |
|
525 |
|
526 /** |
|
527 Uid used to identify a particular version of TECAMEvent base class being used i.e. TECAMEvent2 . |
|
528 Useful for MCameraObserver2::HandleEvent implementation to detect the version of TECAMEvent base class. |
|
529 */ |
|
530 static const TUid KUidECamEventClass2 = {KUidECamEventClass2UidValue}; |
|
531 |
|
532 /** |
|
533 event indicating setting of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing. |
|
534 This event should be packed in TECAMEvent2 class. |
|
535 |
|
536 @note TECAMEvent2::iParam represents color entry. |
|
537 */ |
|
538 static const TUid KUidECamEventCIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue}; |
|
539 static const TUid KUidECamEvent2CIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue}; |
|
540 |
|
541 /** |
|
542 event indicating removal of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing. |
|
543 This event should be packed in TECAMEvent2 class. |
|
544 |
|
545 @note TECAMEvent2::iParam represents color entry. |
|
546 */ |
|
547 static const TUid KUidECamEventCIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue}; |
|
548 static const TUid KUidECamEvent2CIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue}; |
|
549 |
|
550 /** |
|
551 event indicating setting of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing. |
|
552 This event should be packed in TECAMEvent2 class. |
|
553 |
|
554 @note TECAMEvent2::iParam represents color entry. |
|
555 */ |
|
556 static const TUid KUidECamEventCIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue}; |
|
557 static const TUid KUidECamEvent2CIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue}; |
|
558 |
|
559 /** |
|
560 event indicating removal of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing. |
|
561 This event should be packed in TECAMEvent2 class. |
|
562 |
|
563 @note TECAMEvent2::iParam represents color entry. |
|
564 */ |
|
565 static const TUid KUidECamEventCIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue}; |
|
566 static const TUid KUidECamEvent2CIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue}; |
|
567 |
|
568 /** |
|
569 event indicating issue of pre capture warnings. This is a part of class CCamera::CCameraAdvancedSettings. |
|
570 This event should be packed in TECAMEvent2 class. |
|
571 |
|
572 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: |
|
573 NewDuplicate2L():- |
|
574 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
575 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
576 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
577 |
|
578 @note TECAMEvent2::iParam represents bit field describing all PreCaptureWarnings currently issued. |
|
579 */ |
|
580 static const TUid KUidECamEventCameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue}; |
|
581 static const TUid KUidECamEvent2CameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue}; |
|
582 |
|
583 /** |
|
584 Event indicating continuous zoom progess. This event is used for StartContinuousZoomL feature. This is a part of class |
|
585 CCamera::CCameraAdvancedSettings. This event should be packed in TECAMEvent2 class. |
|
586 |
|
587 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: |
|
588 NewDuplicate2L(): |
|
589 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
590 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
591 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
592 |
|
593 Note: TECAMEvent2::iParam represents percentage continuous zoom completion. |
|
594 |
|
595 @note If zoom direction is EZoomDirectionWide, percentage completion will target minimum possible value as 100%. |
|
596 @note If zoom direction is EZoomDirectionTele, percentage completion will target maximum possible value as 100%. |
|
597 |
|
598 @publishedPartner |
|
599 @prototype |
|
600 */ |
|
601 static const TUid KUidECamEvent2CameraSettingContinuousZoomPercentageCompletion = {KUidECamEvent2CameraSettingContinuousZoomPercentageCompletionUidValue}; |
|
602 |
|
603 /** |
|
604 Notifies that unrequested feature changes have occurred. The method GetIndirectFeatureChangesL() is called to |
|
605 retrieve the list of unrequested feature changes. The unrequested feature changes are ECAM component wide. |
|
606 |
|
607 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
608 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
609 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
610 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
611 |
|
612 Note: TECAMEvent2::iParam represents the TInt used to obtain a uid which represents the requested feature change. |
|
613 |
|
614 @publishedPartner |
|
615 @prototype |
|
616 */ |
|
617 static const TUid KUidECamEvent2IndirectFeatureChange = {KUidECamEvent2IndirectFeatureChangeUidValue}; |
|
618 |
|
619 |
|
620 /** |
|
621 Viewfinder fading effect has been set. |
|
622 This event should be packed in TECAMEvent2 class. |
|
623 |
|
624 Note: TECAMEvent2::iParam represents viewfinder handle. |
|
625 |
|
626 @internalTechnology |
|
627 */ |
|
628 static const TUid KUidECamEvent2ViewFinderFadingEffect = {KUidECamEvent2ViewFinderFadingEffectUidValue}; |
|
629 |
|
630 /** |
|
631 Event indicating auto aperture is being used. |
|
632 This event should be packed in TECAMEvent2 class. |
|
633 |
|
634 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: |
|
635 NewDuplicate2L(): |
|
636 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
637 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
638 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
639 |
|
640 Note: TECAMEvent2::iParam represents actual value of aperture being used if camera is capable of. Otherwise, KErrNotFound will be retrieved. |
|
641 |
|
642 @internalTechnology |
|
643 */ |
|
644 static const TUid KUidECamEvent2CameraSettingAutoAperture = {KUidECamEvent2CameraSettingAutoApertureUidValue}; |
|
645 |
|
646 /** |
|
647 Event providing focussing feedback. The focussing feedback will be provided whenever the focussing state changes for the |
|
648 selected spot combination. |
|
649 This event should be packed in TECAMEvent2 class. |
|
650 Note: TECAMEvent2::iParam represents bitfield of chosen spots which are in focus. |
|
651 Note: TECAMEvent2::iParam1 represents bitfield of chosen spots which are not in focus. |
|
652 |
|
653 @internalTechnology |
|
654 */ |
|
655 static const TUid KECamEvent2ImageCaptureControlFocussingInformation = {KECamEvent2ImageCaptureControlFocussingInformationUidValue}; |
|
656 |
|
657 /** |
|
658 Focussing spot combination. This event tells about completion of the setting operation for the spot combination. |
|
659 This event should be packed in TECAMEvent2 class. |
|
660 |
|
661 @note static_cast<CCamera::CCameraAdvancedSettings::TFocusMode>(TECAMEvent2::iParam) represents the focus mode for |
|
662 which the spot combination has to be set for receiving focussing feedback. |
|
663 |
|
664 @internalTechnology |
|
665 */ |
|
666 static const TUid KUidECamEvent2ImageCaptureControlSpotCombination = {KUidECamEvent2ImageCaptureControlSpotCombinationUidValue}; |
|
667 |
|
668 /** |
|
669 Viewfinder magnification has been set. |
|
670 This event should be packed in TECAMEvent2 class. |
|
671 |
|
672 Note: TECAMEvent2::iParam represents viewfinder handle. |
|
673 |
|
674 @internalTechnology |
|
675 */ |
|
676 static const TUid KUidECamEvent2ViewFinderMagnification = {KUidECamEvent2ViewFinderMagnificationUidValue}; |
|
677 |
|
678 /** |
|
679 Notifies the current camera reserver that the camera control will be forcefully overtaken by another requesting client |
|
680 after a specific time interval. |
|
681 |
|
682 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
683 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
684 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
685 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
686 |
|
687 @note TTimeIntervalMicroSeconds32(TECAMEvent2::iParam) represents the maximum time to wait. |
|
688 TECAMEvent2::iParam needs to be passed as argument in order to construct the TTimeIntervalMicroSeconds32 object. |
|
689 |
|
690 Note: TECAMEvent2::iParam1 represents the priority of the requestor client to whom the camera control will be forcibly |
|
691 passed after a specific time interval. |
|
692 |
|
693 @internalTechnology |
|
694 */ |
|
695 static const TUid KUidECamEvent2CameraRequestForcedTimedTakeOver = {KUidECamEvent2CameraRequestForcedTimedTakeOverUidValue}; |
|
696 |
|
697 /** |
|
698 Notifies the current camera reserver that another client is requesting for camera control in a specific time interval. |
|
699 |
|
700 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
701 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
702 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
703 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
704 |
|
705 @note TTimeIntervalMicroSeconds32(TECAMEvent2::iParam) represents the maximum requested time within which the current |
|
706 reserver may release the camera if it wishes to do so. |
|
707 TECAMEvent2::iParam needs to be passed as argument in order to construct the TTimeIntervalMicroSeconds32 object. |
|
708 |
|
709 Note: TECAMEvent2::iParam1 represents the priority of the requestor client to whom the camera control will be passed |
|
710 should the current reserver wish to do so. |
|
711 |
|
712 @internalTechnology |
|
713 */ |
|
714 static const TUid KUidECamEvent2CameraRequestTimedTakeOver = {KUidECamEvent2CameraRequestTimedTakeOverUidValue}; |
|
715 |
|
716 /** |
|
717 Notifies the manual gain setting completion for the particular channel. |
|
718 |
|
719 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
720 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
721 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
722 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
723 |
|
724 Note: TECAMEvent2::iParam represents the specific channel for which the manual gain value has been set. |
|
725 |
|
726 @internalTechnology |
|
727 */ |
|
728 static const TUid KUidECamEvent2CameraSettingManualGain = {KUidECamEvent2CameraSettingManualGainUidValue}; |
|
729 |
|
730 /** |
|
731 Retrieves the optimal focussing feedback while using manual focus. This will be issued as a result of setting operation |
|
732 CCamera::CCameraAdvancedSettings::SetFocusDistance(TInt aDistance). |
|
733 |
|
734 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
735 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
736 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
737 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
738 |
|
739 @note If TECAMEvent2::iParam > 1, information is unavailable; if TECAMEvent2::iParam < 0, error case. |
|
740 Otherwise, static_cast<TBool>(TECAMEvent2::iParam) retrieves whether optimal focussing has been achieved or not. |
|
741 |
|
742 @internalTechnology |
|
743 */ |
|
744 static const TUid KUidECamEvent2CameraSettingFocusDistance = {KUidECamEvent2CameraSettingFocusDistanceUidValue}; |
|
745 |
|
746 /** |
|
747 Instructs the client to change its priority in order to allow the legacy client to get hold of the camera. Client should |
|
748 restore their priority when they receive the notification 'KUidECamEventCameraSettingRestoreClientPriority'. |
|
749 |
|
750 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): |
|
751 void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const; |
|
752 void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const; |
|
753 void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const; |
|
754 |
|
755 Note: TECAMEvent2::iParam represents the target priority to which the client should set itself using the method SetClientPriorityL() |
|
756 |
|
757 @internalTechnology |
|
758 */ |
|
759 static const TUid KUidECamEvent2CameraSettingChangeClientPriority = {KUidECamEvent2CameraSettingChangeClientPriorityUidValue}; |
|
760 |
|
761 /** |
|
762 Event indicating image enhancement setting has been applied. |
|
763 This event should be packed in TECAMEvent2 class. |
|
764 |
|
765 Note: TECAMEvent2::iParam represents viewfinder handle. |
|
766 |
|
767 @internalTechnology |
|
768 */ |
|
769 static const TUid KUidECamEvent2ViewFinderImageEnhancement = {KUidECamEvent2ViewFinderImageEnhancementUidValue}; |
|
770 |
|
771 /** |
|
772 Provides the various available schemes for event filtering. This will inform how the listed uids have to be interpreted |
|
773 by the implementation for filtering the events. |
|
774 |
|
775 @see CCamera::CCameraAdvancedSettings::RegisterEventsL(TECAMEventFilterScheme aEventFilter, const RArray<TUid>& aEvents); |
|
776 @see CCamera::CCameraAdvancedSettings::GetRegisterEventsL(TECAMEventFilterScheme aEventFilter, RArray<TUid>& aEvents) const; |
|
777 |
|
778 @internalTechnology |
|
779 */ |
|
780 enum TECAMEventFilterScheme |
|
781 { |
|
782 /** Black listing will mean not to receive specific events */ |
|
783 EECAMEventFilterSchemeBlackList, |
|
784 /** White listing will mean to receive only specific events */ |
|
785 EECAMEventFilterSchemeWhiteList |
|
786 }; |
|
787 |
|
788 /** |
|
789 Special type of TECAMEvent class used to retrieve some extra information from particular events received |
|
790 |
|
791 @publishedAll |
|
792 @released |
|
793 */ |
|
794 class TECAMEvent2 : public TECAMEvent |
|
795 { |
|
796 public: |
|
797 |
|
798 IMPORT_C static TBool IsEventEncapsulationValid(const TECAMEvent& aECAMEvent); |
|
799 |
|
800 IMPORT_C TECAMEvent2(TUid aEventType, TInt aErrorCode, TInt aParam); |
|
801 |
|
802 IMPORT_C const TUid& EventClassUsed() const; |
|
803 |
|
804 private: |
|
805 /** |
|
806 Uid representing this version of TECAMEvent base class. Uid used is KUidECamEventClass2 |
|
807 */ |
|
808 TUid iEventClassUsed; |
|
809 |
|
810 /** |
|
811 Reserved for future |
|
812 TInt iReserved1; -> Made Public TInt iParam1 |
|
813 */ |
|
814 |
|
815 /** |
|
816 Reserved for future |
|
817 */ |
|
818 TInt iReserved2; |
|
819 |
|
820 |
|
821 public: |
|
822 /** |
|
823 iParam1 will be used to provide extra information if iParam is not sufficient. |
|
824 This signifies different things for different valid events. |
|
825 |
|
826 Future events may also use this class member variable. |
|
827 */ |
|
828 TInt iParam1; |
|
829 |
|
830 /** |
|
831 This signifies different things for different valid events. |
|
832 |
|
833 Future events may also use this class member variable. |
|
834 */ |
|
835 TInt iParam; |
|
836 }; |
|
837 |
|
838 /** Mixin base class V2 for camera clients. |
|
839 |
|
840 An application must implement an MCameraObserver2 (or MCameraObserver) in order to use the camera |
|
841 API. This derived class is called when the camera is ready for use, an image |
|
842 has been captured or a buffer of video data is ready, including when errors |
|
843 occur. |
|
844 |
|
845 @publishedAll |
|
846 @released |
|
847 */ |
|
848 |
|
849 class MCameraObserver2 |
|
850 { |
|
851 public: |
|
852 /** |
|
853 A camera event has completed. |
|
854 @note Implementations of MCameraObserver2 should ignore events which are not recognised and should not leave. |
|
855 |
|
856 @param aEvent |
|
857 A reference to a TECAMEvent. This can be completion of a call to Reserve() |
|
858 or a call to PowerOn() or a notification that the client has lost control |
|
859 of the camera. |
|
860 The event contains a uid identifying the event and an accompanying |
|
861 error code (KErrNone for the successful completion of a request). |
|
862 The error will be KErrNotReady for a request that was made out of the |
|
863 correct sequence. |
|
864 The error will be KErrAccessDenied for a Reserve() request that failed |
|
865 because a higher priority client already controls the camera. |
|
866 |
|
867 @note This may internally call TECAMEvent2::IsEventEncapsulationValid(aEvent) and also for any other derived version of TECAMEvent |
|
868 class to know whether correct version of TECAMEvent base class has been used. |
|
869 */ |
|
870 virtual void HandleEvent(const TECAMEvent& aEvent)=0; |
|
871 |
|
872 /** |
|
873 Notifies client of new view finder data. Called periodically in response to |
|
874 the use of CCamera::StartViewFinderL(). |
|
875 |
|
876 @param aCameraBuffer |
|
877 A reference to an MCameraBuffer if successful, or NULL if not successful. |
|
878 |
|
879 @param aError |
|
880 KErrNone if successful, or an error code if not successful. |
|
881 */ |
|
882 virtual void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; |
|
883 |
|
884 /** |
|
885 Notifies the client of a new captured camera image. Called asynchronously |
|
886 when CCamera::CaptureImage() completes. |
|
887 |
|
888 @param aCameraBuffer |
|
889 A reference to an MCameraBuffer if successful, or NULL if not successful. |
|
890 |
|
891 @param aError |
|
892 KErrNone if successful, or an error code if not successful. |
|
893 |
|
894 @note If new image capture classes used, then this callback will not be used. Refer MCaptureImageObserver |
|
895 */ |
|
896 virtual void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; |
|
897 |
|
898 /** |
|
899 Notifies the client of new captured video. Called asynchronously and periodically |
|
900 after CCamera::StartVideoCapture() is called. The buffer has been filled with the |
|
901 required number of video frames specified PrepareVideoCaptureL(). |
|
902 |
|
903 @param aCameraBuffer |
|
904 A reference to an MCameraBuffer if successful, or NULL if not successful. |
|
905 |
|
906 @param aError |
|
907 KErrNone if successful, or an error code if not successful. |
|
908 */ |
|
909 virtual void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; |
|
910 }; |
|
911 |
|
912 |
|
913 /** Base class for camera devices. |
|
914 |
|
915 Provides the interface that an application uses to control, and acquire images |
|
916 from, the camera. |
|
917 |
|
918 An application must supply an implementation of MCameraObserver2 (or MCameraObserver). |
|
919 |
|
920 @publishedAll |
|
921 @released |
|
922 */ |
|
923 class CCamera : public CBase |
|
924 |
|
925 { |
|
926 |
|
927 friend class CCameraPlugin; |
|
928 |
|
929 public: |
|
930 class CCameraPresets; |
|
931 class CCameraAdvancedSettings; |
|
932 class CCameraImageProcessing; |
|
933 class CCameraHistogram; |
|
934 class CCameraV2Histogram; |
|
935 class CCameraOverlay; |
|
936 class CCameraSnapshot; |
|
937 class CCameraDirectViewFinder; |
|
938 class CCameraV2DirectViewFinder; |
|
939 class CCameraClientViewFinder; |
|
940 class CCameraPreImageCaptureControl; |
|
941 class CCameraImageCapture; |
|
942 class CCameraPostImageCaptureControl; |
|
943 class CCameraVideoCaptureControl; |
|
944 class CCameraDirectSnapshot; |
|
945 |
|
946 public: |
|
947 /** Possible still image and video frame formats |
|
948 |
|
949 Formats are read from left to right, starting at the top of the image. YUV |
|
950 format is as defined by ITU-R BT.601-4. */ |
|
951 enum TFormat |
|
952 { |
|
953 /** 8 bit greyscale values, 0=black, 255=white. */ |
|
954 EFormatMonochrome = 0x0001, |
|
955 /** Packed RGB triplets, 4 bits per pixel with red in the least significant bits |
|
956 and the 4 most significant bits unused. */ |
|
957 EFormat16bitRGB444 = 0x0002, |
|
958 /** Packed RGB triplets, 5 bits per pixel for red and blue and 6 bits for green, |
|
959 with red in the least significant bits. */ |
|
960 EFormat16BitRGB565 = 0x0004, |
|
961 /** Packed RGB triplets, 8 bits per pixel with red in the least significant bits |
|
962 and the 8 most significant bits unused. */ |
|
963 EFormat32BitRGB888 = 0x0008, |
|
964 /** JFIF JPEG. */ |
|
965 EFormatJpeg = 0x0010, |
|
966 /** EXIF JPEG */ |
|
967 EFormatExif = 0x0020, |
|
968 /** CFbsBitmap object with display mode EColor4K. */ |
|
969 EFormatFbsBitmapColor4K = 0x0040, |
|
970 /** CFbsBitmap object with display mode EColor64K. */ |
|
971 EFormatFbsBitmapColor64K = 0x0080, |
|
972 /** CFbsBitmap object with display mode EColor16M. */ |
|
973 EFormatFbsBitmapColor16M = 0x0100, |
|
974 /** Implementation dependent. */ |
|
975 EFormatUserDefined = 0x0200, |
|
976 /** 4:2:0 format, 8 bits per sample, Y00Y01Y10Y11UV. */ |
|
977 EFormatYUV420Interleaved = 0x0400, |
|
978 /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0...V0... */ |
|
979 EFormatYUV420Planar = 0x0800, |
|
980 /** 4:2:2 format, 8 bits per sample, UY0VY1. */ |
|
981 EFormatYUV422 = 0x1000, |
|
982 /** 4:2:2 format, 8 bits per sample, Y1VY0U. */ |
|
983 EFormatYUV422Reversed = 0x2000, |
|
984 /** 4:4:4 format, 8 bits per sample, Y00U00V00 Y01U01V01... */ |
|
985 EFormatYUV444 = 0x4000, |
|
986 /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0V0... */ |
|
987 EFormatYUV420SemiPlanar = 0x8000, |
|
988 /** CFbsBitmap object with display mode EColor16MU. */ |
|
989 EFormatFbsBitmapColor16MU = 0x00010000, |
|
990 /** Motion JPEG for video |
|
991 @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L() |
|
992 |
|
993 @internalTechnology |
|
994 */ |
|
995 EFormatMJPEG = 0x00020000, |
|
996 |
|
997 /** |
|
998 Compressed H264 video format. |
|
999 @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
|
1000 |
|
1001 @publishedPartner |
|
1002 @prototype |
|
1003 */ |
|
1004 EFormatEncodedH264 = 0x00040000 |
|
1005 }; |
|
1006 |
|
1007 /** Specifies whether contrast is set automatically. */ |
|
1008 enum TContrast |
|
1009 { |
|
1010 /** Sets the contrast automatically. */ |
|
1011 EContrastAuto = KMinTInt |
|
1012 }; |
|
1013 /** Specifies whether brightness is set automatically. */ |
|
1014 enum TBrightness |
|
1015 { |
|
1016 /** Sets the brightness automatically. */ |
|
1017 EBrightnessAuto = KMinTInt |
|
1018 }; |
|
1019 /** Specifies the type of flash. */ |
|
1020 enum TFlash |
|
1021 { |
|
1022 /** No flash, always supported. */ |
|
1023 EFlashNone = 0x0000, |
|
1024 /** Flash will automatically fire when required. */ |
|
1025 EFlashAuto = 0x0001, |
|
1026 /** Flash will always fire. */ |
|
1027 EFlashForced = 0x0002, |
|
1028 /** Reduced flash for general lighting */ |
|
1029 EFlashFillIn = 0x0004, |
|
1030 /** Red-eye reduction mode. */ |
|
1031 EFlashRedEyeReduce = 0x0008, |
|
1032 /** Flash at the moment when shutter opens. */ |
|
1033 EFlashSlowFrontSync = 0x0010, |
|
1034 /** Flash at the moment when shutter closes. */ |
|
1035 EFlashSlowRearSync = 0x0020, |
|
1036 /** User configurable setting */ |
|
1037 EFlashManual = 0x0040, |
|
1038 /** Constant emission of light during video mode |
|
1039 @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L() |
|
1040 */ |
|
1041 EFlashVideoLight = 0x0080 |
|
1042 }; |
|
1043 /** Specifies the type of exposure. - EExposureAuto is the default value. */ |
|
1044 enum TExposure |
|
1045 { |
|
1046 /** Set exposure automatically. Default, always supported. */ |
|
1047 EExposureAuto = 0x0000, |
|
1048 /** Night-time setting for long exposures. */ |
|
1049 EExposureNight = 0x0001, |
|
1050 /** Backlight setting for bright backgrounds. */ |
|
1051 EExposureBacklight = 0x0002, |
|
1052 /** Centered mode for ignoring surroundings. */ |
|
1053 EExposureCenter = 0x0004, |
|
1054 /** Sport setting for very short exposures. */ |
|
1055 EExposureSport = 0x0008, |
|
1056 /** Generalised setting for very long exposures. */ |
|
1057 EExposureVeryLong = 0x0010, |
|
1058 /** Snow setting for daylight exposure. */ |
|
1059 EExposureSnow = 0x0020, |
|
1060 /** Beach setting for daylight exposure with reflective glare. */ |
|
1061 EExposureBeach = 0x0040, |
|
1062 /** Programmed exposure setting. */ |
|
1063 EExposureProgram = 0x0080, |
|
1064 /** Aperture setting is given priority. */ |
|
1065 EExposureAperturePriority = 0x0100, |
|
1066 /** Shutter speed setting is given priority. */ |
|
1067 EExposureShutterPriority = 0x0200, |
|
1068 /** User selectable exposure value setting. */ |
|
1069 EExposureManual = 0x0400, |
|
1070 /** Exposure night setting with colour removed to get rid of colour noise. */ |
|
1071 EExposureSuperNight = 0x0800, |
|
1072 /** Exposure for infra-red sensor on the camera */ |
|
1073 EExposureInfra = 0x1000 |
|
1074 }; |
|
1075 |
|
1076 /** Specifies how the white balance is set. */ |
|
1077 enum TWhiteBalance |
|
1078 { |
|
1079 /** Set white balance automatically. Default, always supported. */ |
|
1080 EWBAuto = 0x0000, |
|
1081 /** Normal daylight. */ |
|
1082 EWBDaylight = 0x0001, |
|
1083 /** Overcast daylight. */ |
|
1084 EWBCloudy = 0x0002, |
|
1085 /** Tungsten filament lighting. */ |
|
1086 EWBTungsten = 0x0004, |
|
1087 /** Fluorescent tube lighting */ |
|
1088 EWBFluorescent = 0x0008, |
|
1089 /** Flash lighting. */ |
|
1090 EWBFlash = 0x0010, |
|
1091 /** High contrast daylight primarily snowy */ |
|
1092 EWBSnow = 0x0020, |
|
1093 /** High contrast daylight primarily near the sea */ |
|
1094 EWBBeach = 0x0040, |
|
1095 /** User configurable mode */ |
|
1096 EWBManual = 0x0080, |
|
1097 /** Shade */ |
|
1098 EWBShade = 0x0100, |
|
1099 /** auto skin |
|
1100 |
|
1101 If New2L()/NewDuplicate2L() are not used to create camera object, this |
|
1102 enum value would be considered as unrecognized and filtered out in 'supported' |
|
1103 or 'getter' methods. |
|
1104 */ |
|
1105 EWBAutoSkin = 0x0200, |
|
1106 /** horizon |
|
1107 |
|
1108 If New2L()/NewDuplicate2L() are not used to create camera object, this |
|
1109 enum value would be considered as unrecognized and filtered out in 'supported' |
|
1110 or 'getter' methods. |
|
1111 */ |
|
1112 EWBHorizon = 0x0400, |
|
1113 /** Daylight Under Water |
|
1114 |
|
1115 If New2L()/NewDuplicate2L() are not used to create camera object, this |
|
1116 enum value would be considered as unrecognized and filtered out in 'supported' |
|
1117 or 'getter' methods. |
|
1118 */ |
|
1119 EWBDaylightUnderWater = 0x0800 |
|
1120 }; |
|
1121 |
|
1122 public: |
|
1123 /** |
|
1124 Determines the number of cameras on the device. |
|
1125 |
|
1126 @return Count of cameras present on the device. |
|
1127 */ |
|
1128 IMPORT_C static TInt CamerasAvailable(); |
|
1129 |
|
1130 /** |
|
1131 @deprecated Use static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); |
|
1132 |
|
1133 Creates an object representing a camera. |
|
1134 |
|
1135 @param aObserver |
|
1136 Reference to class derived from MCameraObserver2 designed to receive |
|
1137 notification of asynchronous event completion. |
|
1138 @param aCameraIndex |
|
1139 Index from 0 to CamerasAvailable()-1 inclusive specifying the |
|
1140 camera device to use. |
|
1141 @param aPriority |
|
1142 Value from -100 to 100 indicating relative priority of client to |
|
1143 use camera. |
|
1144 |
|
1145 @return Pointer to a fully constructed CCamera object. Ownership is passed |
|
1146 to the caller. |
|
1147 |
|
1148 @leave KErrNoMemory if out of memory. |
|
1149 @leave KErrNotSupported if aCameraIndex is out of range. |
|
1150 @leave KErrPermissionDenied if the application does not have |
|
1151 the UserEnvironment capability. |
|
1152 |
|
1153 @capability UserEnvironment |
|
1154 An application that creates a CCamera object must have |
|
1155 the UserEnvironment capability. |
|
1156 |
|
1157 @capability MultimediaDD |
|
1158 A process requesting or using this method that has MultimediaDD capability will |
|
1159 always have precedence over a process that does not have MultimediaDD. |
|
1160 |
|
1161 @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). |
|
1162 To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare |
|
1163 themselves to receive unrecognised values. |
|
1164 */ |
|
1165 IMPORT_C static CCamera* NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); |
|
1166 |
|
1167 /** |
|
1168 Creates an object representing a camera. |
|
1169 Clients prepare themselves to receive unrecognised enum, uids etc. |
|
1170 |
|
1171 @param aObserver |
|
1172 Reference to class derived from MCameraObserver2 designed to receive |
|
1173 notification of asynchronous event completion. |
|
1174 @param aCameraIndex |
|
1175 Index from 0 to CamerasAvailable()-1 inclusive specifying the |
|
1176 camera device to use. |
|
1177 @param aPriority |
|
1178 Value from -100 to 100 indicating relative priority of client to |
|
1179 use camera. |
|
1180 |
|
1181 @return Pointer to a fully constructed CCamera object. Ownership is passed |
|
1182 to the caller. |
|
1183 |
|
1184 @leave KErrNoMemory if out of memory. |
|
1185 @leave KErrNotSupported if aCameraIndex is out of range. |
|
1186 @leave KErrPermissionDenied if the application does not have |
|
1187 the UserEnvironment capability. |
|
1188 |
|
1189 @capability UserEnvironment |
|
1190 An application that creates a CCamera object must have |
|
1191 the UserEnvironment capability. |
|
1192 |
|
1193 @capability MultimediaDD |
|
1194 A process requesting or using this method that has MultimediaDD capability will |
|
1195 always have precedence over a process that does not have MultimediaDD. |
|
1196 |
|
1197 @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids |
|
1198 from 'supported' or 'getter' methods |
|
1199 */ |
|
1200 IMPORT_C static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); |
|
1201 |
|
1202 /** |
|
1203 Creates an object representing a camera. |
|
1204 |
|
1205 @param aObserver |
|
1206 Reference to class derived from MCameraObserver designed to receive |
|
1207 notification of asynchronous event completion. |
|
1208 @param aCameraIndex |
|
1209 Index from 0 to CamerasAvailable()-1 inclusive specifying the |
|
1210 camera device to use. |
|
1211 |
|
1212 @leave KErrNoMemory if out of memory. |
|
1213 @leave KErrNotSupported if aCameraIndex is out of range. |
|
1214 @leave KErrPermissionDenied if the application does not have |
|
1215 the UserEnvironment capability. |
|
1216 |
|
1217 @return Pointer to a fully constructed CCamera object. Ownership is passed |
|
1218 to the caller. |
|
1219 |
|
1220 @capability UserEnvironment |
|
1221 An application that creates a CCamera object must have |
|
1222 the UserEnvironment capability. |
|
1223 |
|
1224 @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). |
|
1225 To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare |
|
1226 themselves to receive unrecognised values. |
|
1227 */ |
|
1228 IMPORT_C static CCamera* NewL(MCameraObserver& aObserver,TInt aCameraIndex); |
|
1229 |
|
1230 /** |
|
1231 @deprecated Use static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle); |
|
1232 |
|
1233 Duplicates the original camera object for use by, for example, multimedia systems. |
|
1234 |
|
1235 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. |
|
1236 |
|
1237 @param aObserver |
|
1238 Reference to an observer. |
|
1239 @param aCameraHandle Handle of an existing camera object. |
|
1240 |
|
1241 @leave KErrNoMemory if out of memory. |
|
1242 @leave KErrNotFound if aCameraHandle is not valid. |
|
1243 @leave KErrPermissionDenied if the application does not have |
|
1244 the UserEnvironment capability. |
|
1245 |
|
1246 @return Duplicate of the original camera object. |
|
1247 |
|
1248 @capability UserEnvironment |
|
1249 An application that creates a CCamera object must have |
|
1250 the UserEnvironment capability. |
|
1251 |
|
1252 @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). |
|
1253 To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare |
|
1254 themselves to receive unrecognised values. |
|
1255 */ |
|
1256 IMPORT_C static CCamera* NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle); |
|
1257 |
|
1258 /** |
|
1259 Duplicates the original camera object for use by, for example, multimedia systems. |
|
1260 Clients prepare themselves to receive unrecognised enum, uids etc. |
|
1261 |
|
1262 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. |
|
1263 |
|
1264 @param aObserver |
|
1265 Reference to an observer. |
|
1266 @param aCameraHandle Handle of an existing camera object. |
|
1267 |
|
1268 @leave KErrNoMemory if out of memory. |
|
1269 @leave KErrNotFound if aCameraHandle is not valid. |
|
1270 @leave KErrPermissionDenied if the application does not have |
|
1271 the UserEnvironment capability. |
|
1272 |
|
1273 @return Duplicate of the original camera object. |
|
1274 |
|
1275 @capability UserEnvironment |
|
1276 An application that creates a CCamera object must have |
|
1277 the UserEnvironment capability. |
|
1278 |
|
1279 @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids |
|
1280 from 'supported' or 'getter' methods |
|
1281 */ |
|
1282 IMPORT_C static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle); |
|
1283 |
|
1284 /** |
|
1285 Duplicates the original camera object for use by, for example, multimedia systems. |
|
1286 |
|
1287 @leave KErrNoMemory if out of memory. |
|
1288 @leave KErrNotFound if aCameraHandle is not valid. |
|
1289 @leave KErrPermissionDenied if the application does not have |
|
1290 the UserEnvironment capability. |
|
1291 |
|
1292 @param aObserver |
|
1293 Reference to an observer. |
|
1294 @param aCameraHandle Handle of an existing camera object. |
|
1295 |
|
1296 @return Duplicate of the original camera object. |
|
1297 |
|
1298 @capability UserEnvironment |
|
1299 An application that creates a CCamera object must have |
|
1300 the UserEnvironment capability. |
|
1301 |
|
1302 @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). |
|
1303 To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare |
|
1304 themselves to receive unrecognised values. |
|
1305 */ |
|
1306 IMPORT_C static CCamera* NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle); |
|
1307 |
|
1308 /** |
|
1309 Gets information about the camera device. |
|
1310 |
|
1311 @param aInfo |
|
1312 On return, information about the camera device. See TCameraInfo. |
|
1313 */ |
|
1314 virtual void CameraInfo(TCameraInfo& aInfo) const=0; |
|
1315 |
|
1316 /** |
|
1317 Asynchronous function that performs any required initialisation and reserves |
|
1318 the camera for exclusive use. |
|
1319 |
|
1320 Calls MCameraObserver:: ReserveComplete() when complete. |
|
1321 */ |
|
1322 virtual void Reserve()=0; |
|
1323 |
|
1324 /** |
|
1325 De-initialises the camera, allowing it to be used by other clients. |
|
1326 */ |
|
1327 virtual void Release()=0; |
|
1328 |
|
1329 /** |
|
1330 Asynchronous method to switch on camera power. |
|
1331 |
|
1332 User must have successfully called Reserve() prior to calling this function. |
|
1333 |
|
1334 Calls MCameraObserver::PowerOnComplete() when power on is complete. |
|
1335 */ |
|
1336 virtual void PowerOn()=0; |
|
1337 |
|
1338 /** |
|
1339 Synchronous function for switching off camera power. |
|
1340 */ |
|
1341 virtual void PowerOff()=0; |
|
1342 |
|
1343 /** |
|
1344 Gets the device-unique handle of this camera object. |
|
1345 |
|
1346 @return The device-unique handle of this camera object. |
|
1347 */ |
|
1348 virtual TInt Handle()=0; |
|
1349 |
|
1350 /** |
|
1351 Sets the zoom factor. |
|
1352 |
|
1353 This must be in the range of TCameraInfo::iMinZoom to TCameraInfo::iMaxZoom |
|
1354 inclusive. May leave with KErrNotSupported if the specified zoom factor is |
|
1355 out of range. |
|
1356 |
|
1357 @param aZoomFactor |
|
1358 Required zoom factor. |
|
1359 */ |
|
1360 virtual void SetZoomFactorL(TInt aZoomFactor = 0)=0; |
|
1361 |
|
1362 /** |
|
1363 Gets the currently set zoom factor. |
|
1364 |
|
1365 @return The currently set zoom factor. |
|
1366 */ |
|
1367 virtual TInt ZoomFactor() const=0; |
|
1368 |
|
1369 /** |
|
1370 Sets the digital zoom factor. |
|
1371 |
|
1372 This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom inclusive. |
|
1373 |
|
1374 May leave with KErrNotSupported if the zoom factor is out of range. |
|
1375 |
|
1376 @param aDigitalZoomFactor |
|
1377 The required digital zoom factor. |
|
1378 */ |
|
1379 virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0)=0; |
|
1380 |
|
1381 /** |
|
1382 Gets the currently set digital zoom factor. |
|
1383 |
|
1384 @return The currently set digital zoom factor. |
|
1385 */ |
|
1386 virtual TInt DigitalZoomFactor() const=0; |
|
1387 |
|
1388 /** |
|
1389 Sets the contrast adjustment of the device. |
|
1390 |
|
1391 This must be in the range of -100 to +100 or EContrastAuto. May leave with |
|
1392 KErrNotSupported if the specified contrast value is out of range. |
|
1393 |
|
1394 @param aContrast |
|
1395 Required contrast value. See TCameraInfo::iContrastSupported |
|
1396 */ |
|
1397 virtual void SetContrastL(TInt aContrast)=0; |
|
1398 |
|
1399 /** |
|
1400 Gets the currently set contrast value. |
|
1401 |
|
1402 @return The currently set contrast value. |
|
1403 */ |
|
1404 virtual TInt Contrast() const=0; |
|
1405 |
|
1406 /** |
|
1407 Sets the brightness adjustment of the device. |
|
1408 |
|
1409 No effect if this is not supported, see TCameraInfo::iBrightnessSupported. |
|
1410 |
|
1411 This must be in the range of -100 to +100 or EBrightnessAuto. May leave |
|
1412 with KErrNotSupported if the brightness adjustment is out of range. |
|
1413 |
|
1414 @param aBrightness |
|
1415 The required brightness adjustment. |
|
1416 */ |
|
1417 virtual void SetBrightnessL(TInt aBrightness)=0; |
|
1418 |
|
1419 /** |
|
1420 Gets the currently set brightness adjustment value. |
|
1421 |
|
1422 @return The currently set brightness adjustment value. |
|
1423 */ |
|
1424 virtual TInt Brightness() const=0; |
|
1425 |
|
1426 /** |
|
1427 Sets the flash mode. |
|
1428 |
|
1429 No effect if this is not supported, see TCameraInfo::iFlashModesSupported. |
|
1430 |
|
1431 May leave with KErrNotSupported if the specified flash mode is invalid. |
|
1432 |
|
1433 @param aFlash |
|
1434 The required flash mode. |
|
1435 */ |
|
1436 virtual void SetFlashL(TFlash aFlash = EFlashNone)=0; |
|
1437 |
|
1438 /** |
|
1439 Gets the currently set flash mode. |
|
1440 |
|
1441 @return The currently set flash mode. |
|
1442 @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
1443 application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised) |
|
1444 (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation. |
|
1445 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
1446 to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set. |
|
1447 In this case, application is assumed to be prepared to receive unrecognised enum values. |
|
1448 |
|
1449 @see CCamera::CCameraAdvancedSettings::FlashMode() |
|
1450 */ |
|
1451 virtual TFlash Flash() const=0; |
|
1452 |
|
1453 /** |
|
1454 Sets the exposure adjustment of the device. |
|
1455 |
|
1456 No effect if this is not supported, see CameraInfo::iExposureModesSupported. |
|
1457 |
|
1458 May leave with KErrNotSupported if the specified exposure adjustment is invalid. |
|
1459 |
|
1460 @param aExposure |
|
1461 The required exposure adjustment. |
|
1462 */ |
|
1463 virtual void SetExposureL(TExposure aExposure = EExposureAuto)=0; |
|
1464 |
|
1465 /** |
|
1466 Gets the currently set exposure setting value. |
|
1467 |
|
1468 @return The currently set exposure setting value. |
|
1469 */ |
|
1470 virtual TExposure Exposure() const=0; |
|
1471 |
|
1472 /** |
|
1473 Sets the white balance adjustment of the device. |
|
1474 |
|
1475 No effect if this is not supported, see TCameraInfo::iWhiteBalanceModesSupported. |
|
1476 |
|
1477 @param aWhiteBalance |
|
1478 The required white balance adjustment. |
|
1479 |
|
1480 @leave KErrNotSupported if the specified white balance adjustment |
|
1481 is invalid. |
|
1482 */ |
|
1483 virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto)=0; |
|
1484 |
|
1485 /** |
|
1486 Gets the currently set white balance adjustment value. |
|
1487 |
|
1488 @return The currently set white balance adjustment value. |
|
1489 |
|
1490 @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
1491 application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised) |
|
1492 (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation. |
|
1493 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
1494 to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set. |
|
1495 In this case, application is assumed to be prepared to receive unrecognised enum values. |
|
1496 Refer CCamera::CCameraAdvancedSettings::WhiteBalanceMode() implementation |
|
1497 |
|
1498 @see CCamera::CCameraAdvancedSettings::WhiteBalanceMode() |
|
1499 */ |
|
1500 virtual TWhiteBalance WhiteBalance() const=0; |
|
1501 |
|
1502 /** |
|
1503 Starts transfer of view finder data to the given portion of the screen using |
|
1504 direct screen access. |
|
1505 |
|
1506 The aScreenRect parameter is in screen co-ordinates and may be modified if, |
|
1507 eg, the camera requires the destination to have a certain byte alignment, etc. |
|
1508 |
|
1509 @param aWs |
|
1510 Window server session. |
|
1511 @param aScreenDevice |
|
1512 Screen device. |
|
1513 @param aWindow |
|
1514 Displayable window. |
|
1515 @param aScreenRect |
|
1516 Portion of the screen to which view finder data is to be |
|
1517 transferred. This is in screen co-ordinates and may be modified if, for example, |
|
1518 the camera requires the destination to have a certain byte alignment. |
|
1519 |
|
1520 @leave KErrNotReady if PowerOn() has either not |
|
1521 been called, or has not yet completed. |
|
1522 |
|
1523 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1524 refer viewfinders started using CCamera methods. |
|
1525 |
|
1526 @see CCamera::CCameraV2DirectViewFinder |
|
1527 */ |
|
1528 virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect)=0; |
|
1529 |
|
1530 /** |
|
1531 Starts transfer of view finder data to the given portion of the screen using |
|
1532 direct screen access and also clips to the specified portion of the screen. |
|
1533 |
|
1534 The view finder has the same size and position as aScreenRect but is only |
|
1535 visible in the intersection of aScreenRect and aClipRect. May leave with KErrNotSupported |
|
1536 or KErrNotReady if Reserve() has not been called, or has not yet completed. |
|
1537 |
|
1538 @param aWs |
|
1539 Window server session. |
|
1540 @param aScreenDevice |
|
1541 Screen device. |
|
1542 @param aWindow |
|
1543 Displayable window. |
|
1544 @param aScreenRect |
|
1545 Portion of the screen to which view finder data is to be |
|
1546 transferred. This is in screen co-ordinates and may be modified if, for example, |
|
1547 the camera requires the destination to have a certain byte alignment. |
|
1548 @param aClipRect |
|
1549 The rectangle to which the screen will be clipped. |
|
1550 |
|
1551 @leave KErrNotReady if PowerOn() hasn't been called successfully. |
|
1552 |
|
1553 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1554 refer viewfinders started using CCamera methods. |
|
1555 |
|
1556 @see CCamera::CCameraClientViewFinder |
|
1557 */ |
|
1558 virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect)=0; |
|
1559 |
|
1560 /** |
|
1561 Starts transfer of view finder data. |
|
1562 |
|
1563 Bitmaps are returned by MCameraObserver::ViewFinderFrameReady(). |
|
1564 |
|
1565 @param aSize |
|
1566 On return, the size used. |
|
1567 @leave KErrNotReady if PowerOn() has not been called, or has not yet completed. |
|
1568 |
|
1569 @note This method is assumed to be meant for default display only. |
|
1570 |
|
1571 @see CCamera::CCameraClientViewFinder |
|
1572 */ |
|
1573 virtual void StartViewFinderBitmapsL(TSize& aSize)=0; |
|
1574 |
|
1575 /** |
|
1576 Starts transfer of view finder data and clips the bitmap to the specified clip |
|
1577 rectangle. |
|
1578 |
|
1579 The bitmap is the size of the intersection of aSize and aClipRect, not simply |
|
1580 aSize padded with white space. |
|
1581 |
|
1582 @param aSize |
|
1583 On return, the size used. |
|
1584 @param aClipRect |
|
1585 Required clip rectangle. May be modified if, for example, |
|
1586 the camera only supports certain byte alignments. |
|
1587 |
|
1588 @leave KErrInUse if Reserve() hasn't been called successfully. |
|
1589 @leave KErrNotReady if PowerOn() hasn't been called successfully. |
|
1590 |
|
1591 @note This method is assumed to be meant for default display only. |
|
1592 |
|
1593 @see CCamera::CCameraClientViewFinder |
|
1594 */ |
|
1595 virtual void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect)=0; |
|
1596 |
|
1597 /** |
|
1598 Starts transfer of view finder data. |
|
1599 |
|
1600 Picture data is returned by MCameraObserver2::ViewFinderReady(). |
|
1601 |
|
1602 @param aImageFormat |
|
1603 The image format requested by the client. |
|
1604 @param aSize |
|
1605 On return, the size used. |
|
1606 @leave KErrNotSupported |
|
1607 @leave KErrNotReady if Reserve() has not been |
|
1608 called, or has not yet completed. |
|
1609 |
|
1610 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1611 refer viewfinders started using CCamera methods. |
|
1612 |
|
1613 @see CCamera::CCameraClientViewFinder |
|
1614 */ |
|
1615 virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize)=0; |
|
1616 |
|
1617 /** |
|
1618 Starts transfer of view finder data and clips the picture to the specified clip |
|
1619 rectangle. Picture data is returned by MCameraObserver2::ViewFinderReady(). |
|
1620 |
|
1621 The picture is the size of the intersection of aSize and aClipRect, not simply |
|
1622 aSize padded with white space. |
|
1623 |
|
1624 @param aImageFormat |
|
1625 The image format. |
|
1626 @param aSize |
|
1627 On return, the size used. |
|
1628 @param aClipRect |
|
1629 Required clip rectangle. May be modified if, for example, |
|
1630 the camera only supports certain byte alignments. |
|
1631 |
|
1632 @leave KErrInUse if Reserve() hasn't been called successfully, |
|
1633 @leave KErrNotReady if PowerOn() hasn't been called successfully. |
|
1634 |
|
1635 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1636 refer viewfinders started using CCamera methods. |
|
1637 |
|
1638 @see CCamera::CCameraClientViewFinder |
|
1639 */ |
|
1640 virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect)=0; |
|
1641 |
|
1642 /** |
|
1643 Stops transfer of view finder data to the screen. |
|
1644 |
|
1645 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1646 refer viewfinders started using CCamera methods. |
|
1647 |
|
1648 @see CCamera::CCameraV2DirectViewFinder |
|
1649 @see CCamera::CCameraClientViewFinder |
|
1650 */ |
|
1651 virtual void StopViewFinder()=0; |
|
1652 |
|
1653 /** |
|
1654 Queries whether the view finder is active. |
|
1655 |
|
1656 @return ETrue if the view finder is active. EFalse if the view finder is not |
|
1657 active. |
|
1658 |
|
1659 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1660 refer viewfinders started using CCamera methods. |
|
1661 |
|
1662 @see CCamera::CCameraV2DirectViewFinder |
|
1663 @see CCamera::CCameraClientViewFinder |
|
1664 */ |
|
1665 virtual TBool ViewFinderActive() const=0; |
|
1666 |
|
1667 /** |
|
1668 Sets whether view finder mirroring is on. |
|
1669 |
|
1670 Used to switch between what the camera sees and what you would see if the |
|
1671 device were a mirror. |
|
1672 |
|
1673 @param aMirror |
|
1674 ETrue to set mirroring on, EFalse to set mirroring off. |
|
1675 |
|
1676 @leave KErrNotSupported. |
|
1677 |
|
1678 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1679 refer viewfinders started using CCamera methods. |
|
1680 |
|
1681 @see CCamera::CCameraV2DirectViewFinder |
|
1682 @see CCamera::CCameraClientViewFinder |
|
1683 */ |
|
1684 virtual void SetViewFinderMirrorL(TBool aMirror)=0; |
|
1685 |
|
1686 /** |
|
1687 Gets whether view finder mirroring is active. |
|
1688 |
|
1689 @return ETrue if mirroring is set, EFalse if mirroring is not set. |
|
1690 |
|
1691 @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to |
|
1692 refer viewfinders started using CCamera methods. |
|
1693 |
|
1694 @see CCamera::CCameraV2DirectViewFinder |
|
1695 @see CCamera::CCameraClientViewFinder |
|
1696 */ |
|
1697 virtual TBool ViewFinderMirror() const=0; |
|
1698 |
|
1699 /** |
|
1700 Performs setup and allocation of memory. |
|
1701 |
|
1702 Called prior to calling CaptureImage() to keep the latency of that function |
|
1703 to a minimum. |
|
1704 |
|
1705 Needs to be called only once for multiple CaptureImage() calls. May leave |
|
1706 with KErrNotSupported or KErrNoMemory or KErrInUse or KErrNotReady. |
|
1707 |
|
1708 The specified image format must be one of the formats supported |
|
1709 (see TCameraInfo::iImageFormatsSupported). |
|
1710 |
|
1711 The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 |
|
1712 inclusive. |
|
1713 |
|
1714 @param aImageFormat |
|
1715 The image format. |
|
1716 @param aSizeIndex |
|
1717 Size index. |
|
1718 |
|
1719 @leave KErrNotSupported |
|
1720 @leave KErrNoMemory |
|
1721 @leave KErrNotReady if PowerOn() hasn't been called successfully. |
|
1722 |
|
1723 @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters) |
|
1724 */ |
|
1725 virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex)=0; |
|
1726 |
|
1727 /** |
|
1728 Performs setup and allocation of memory and clips the image to the specified |
|
1729 rectangle. |
|
1730 |
|
1731 No effect unless TCameraInfo::iImageClippingSupported is set to ETrue. The |
|
1732 image captured is the intersection of aClipRect and the rectangle from (0,0) |
|
1733 to aSize. Needs to be called only once for multiple CaptureImage() calls. |
|
1734 May leave with KErrNotSupported or KErrNoMemory. |
|
1735 |
|
1736 The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported). |
|
1737 |
|
1738 The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 |
|
1739 inclusive. |
|
1740 |
|
1741 @param aImageFormat |
|
1742 The image format. |
|
1743 @param aSizeIndex |
|
1744 Size index. |
|
1745 @param aClipRect |
|
1746 The rectangle to which the image is to be clipped. |
|
1747 |
|
1748 @leave KErrNotSupported |
|
1749 @leave KErrNoMemory |
|
1750 @leave KErrInUse if Reserve() hasn't been called successfully |
|
1751 @leave KErrNotReady if PowerOn() |
|
1752 hasn't been called successfully. |
|
1753 |
|
1754 @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters) |
|
1755 */ |
|
1756 virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect)=0; |
|
1757 |
|
1758 /** |
|
1759 Asynchronously performs still image capture. |
|
1760 |
|
1761 Calls MCameraObserver::ImageReady() when complete. |
|
1762 |
|
1763 @see CCamera::CCameraImageCapture |
|
1764 @see CCamera::CCameraPreImageCaptureControl |
|
1765 */ |
|
1766 virtual void CaptureImage()=0; |
|
1767 |
|
1768 /** |
|
1769 Cancels the asynchronous still image capture. |
|
1770 |
|
1771 @see CCamera::CCameraImageCapture |
|
1772 */ |
|
1773 virtual void CancelCaptureImage()=0; |
|
1774 |
|
1775 /** |
|
1776 Enumerates through the available image capture sizes, based on the specified |
|
1777 size index and format |
|
1778 |
|
1779 The size index must be in the range 0 to TCameraInfo::iNumImageSizesSupported-1 |
|
1780 inclusive. |
|
1781 |
|
1782 @param aSize |
|
1783 Image size. |
|
1784 @param aSizeIndex |
|
1785 Size index. |
|
1786 @param aFormat |
|
1787 The image format. |
|
1788 */ |
|
1789 virtual void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0; |
|
1790 |
|
1791 /** |
|
1792 Prepares for video capture. |
|
1793 |
|
1794 Performs setup and allocation of memory prior to calling StartVideoCapture() |
|
1795 to keep the latency of that function to a minimum. |
|
1796 |
|
1797 May leave with KErrNotSupported or KErrNoMemory. |
|
1798 |
|
1799 @param aFormat |
|
1800 Format must be one of the video frame formats supported (see |
|
1801 TCameraInfo::iVideoFrameFormatsSupported). |
|
1802 @param aSizeIndex |
|
1803 Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 |
|
1804 inclusive. |
|
1805 @param aRateIndex |
|
1806 The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 |
|
1807 inclusive. |
|
1808 @param aBuffersToUse |
|
1809 The number of discrete buffers to use. |
|
1810 @param aFramesPerBuffer |
|
1811 How large the buffers are to be. Must be less than |
|
1812 or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned |
|
1813 to MCameraObserver::FrameBufferReady() at a time. |
|
1814 |
|
1815 @leave May leave with KErrNotSupported, KErrNoMemory, or KErrNotReady if PowerOn() |
|
1816 hasn't been called successfully. |
|
1817 |
|
1818 @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters) |
|
1819 */ |
|
1820 virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer)=0; |
|
1821 |
|
1822 /** |
|
1823 Prepares for video capture and clips the frames to the given rectangle. |
|
1824 |
|
1825 Performs setup and allocation of memory prior to calling StartVideoCapture() |
|
1826 to keep the latency of that function to a minimum. |
|
1827 |
|
1828 May leave with KErrNotSupported or KErrNoMemory. |
|
1829 |
|
1830 @param aFormat |
|
1831 Format must be one of the video frame formats supported (see |
|
1832 TCameraInfo::iVideoFrameFormatsSupported). |
|
1833 @param aSizeIndex |
|
1834 Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 |
|
1835 inclusive. |
|
1836 @param aRateIndex |
|
1837 The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 |
|
1838 inclusive. |
|
1839 @param aBuffersToUse |
|
1840 The number of discrete buffers to use. |
|
1841 @param aFramesPerBuffer |
|
1842 How large the buffers are to be. Must be less than |
|
1843 or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned |
|
1844 to MCameraObserver::FrameBufferReady() at a time. |
|
1845 @param aClipRect |
|
1846 The rectangle to which the image is to be clipped. |
|
1847 @leave KErrNotSupported |
|
1848 @leave KErrNoMemory, |
|
1849 @leave KErrInUse if Reserve() hasn't been called successfully |
|
1850 @leave KErrNotReady if PowerOn() hasn't been called successfully. |
|
1851 |
|
1852 @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters) |
|
1853 */ |
|
1854 virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect)=0; |
|
1855 |
|
1856 /** |
|
1857 Starts capturing video. |
|
1858 |
|
1859 Calls MCameraObserver::FrameBufferReady() when each buffer has been filled |
|
1860 with the required number of frames, as set by PrepareVideoCaptureL(). |
|
1861 */ |
|
1862 virtual void StartVideoCapture()=0; |
|
1863 |
|
1864 /** |
|
1865 Stops video capture. |
|
1866 */ |
|
1867 virtual void StopVideoCapture()=0; |
|
1868 |
|
1869 /** |
|
1870 Tests whether video capture is active. |
|
1871 |
|
1872 @return ETrue if video capture is active. EFalse if video capture is not active |
|
1873 */ |
|
1874 virtual TBool VideoCaptureActive() const=0; |
|
1875 |
|
1876 /** |
|
1877 Enumerates through the available video frame sizes, based on the specified |
|
1878 size index and format. |
|
1879 |
|
1880 @param aSize |
|
1881 On return the available video frame sizes. Sizes should be returned |
|
1882 in order, largest first, so clients do not have to iterate through every one. |
|
1883 @param aSizeIndex |
|
1884 Size index. Must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 |
|
1885 inclusive |
|
1886 @param aFormat |
|
1887 Image format. |
|
1888 */ |
|
1889 virtual void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0; |
|
1890 |
|
1891 /** |
|
1892 Enumerates through the available video frame rates, based on the specified |
|
1893 rate index, video frame format, size index and exposure mode. |
|
1894 |
|
1895 @param aRate |
|
1896 On return, the available video frame rates. Some rates may not |
|
1897 be available due to, for example, current flash mode setting. In those cases |
|
1898 a rate of 0 will be returned. Rates should be returned in order, highest first, |
|
1899 so clients do not have to iterate through every one. |
|
1900 @param aRateIndex |
|
1901 The rate index. Must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 |
|
1902 inclusive. |
|
1903 @param aFormat |
|
1904 The format. |
|
1905 @param aSizeIndex |
|
1906 The size index. |
|
1907 @param aExposure |
|
1908 The exposure mode. |
|
1909 */ |
|
1910 virtual void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const=0; |
|
1911 |
|
1912 /** |
|
1913 Gets the frame size currently in use. |
|
1914 |
|
1915 @param aSize |
|
1916 The frame size currently in use. |
|
1917 */ |
|
1918 virtual void GetFrameSize(TSize& aSize) const=0; |
|
1919 |
|
1920 /** |
|
1921 Gets the frame rate currently in use. |
|
1922 |
|
1923 @return The frame rate currently in use. |
|
1924 */ |
|
1925 virtual TReal32 FrameRate() const=0; |
|
1926 |
|
1927 /** |
|
1928 Gets the number of buffers currently in use. |
|
1929 |
|
1930 @return The number of buffers currently in use. |
|
1931 */ |
|
1932 virtual TInt BuffersInUse() const=0; |
|
1933 |
|
1934 /** |
|
1935 Gets the number of frames per buffer currently in use. |
|
1936 |
|
1937 @return The number of frames per buffer currently in use. |
|
1938 */ |
|
1939 virtual TInt FramesPerBuffer() const=0; |
|
1940 |
|
1941 /** |
|
1942 Sets the quality value to use if jpeg is a supported image for video format. |
|
1943 |
|
1944 Ignored if jpeg is not a supported image for video format. |
|
1945 |
|
1946 @param aQuality |
|
1947 The quality value to use, clamped to the range 1 to 100. |
|
1948 |
|
1949 @see CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters::iImageMaxMemorySize |
|
1950 */ |
|
1951 virtual void SetJpegQuality(TInt aQuality)=0; |
|
1952 |
|
1953 /** |
|
1954 Gets the currently set jpeg quality value. |
|
1955 |
|
1956 Returns 0 if not supported. |
|
1957 |
|
1958 @return The currently set jpeg quality value. |
|
1959 |
|
1960 @see CCamera::CCameraPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& aMemorySize) |
|
1961 */ |
|
1962 virtual TInt JpegQuality() const=0; |
|
1963 |
|
1964 /** |
|
1965 Gets a custom interface. The client has to cast the returned pointer |
|
1966 to the appropriate type. |
|
1967 |
|
1968 @param aInterface |
|
1969 The Uid of the particular interface function required. |
|
1970 |
|
1971 @return Custom interface pointer. NULL if the requested interface is not supported. |
|
1972 */ |
|
1973 virtual TAny* CustomInterface(TUid aInterface)=0; |
|
1974 |
|
1975 /** |
|
1976 @internalComponent |
|
1977 |
|
1978 Returns the camera API version no. |
|
1979 */ |
|
1980 IMPORT_C TInt CameraVersion(); |
|
1981 |
|
1982 private: |
|
1983 |
|
1984 /** |
|
1985 Default Constructor |
|
1986 |
|
1987 Prevents implementers from deriving from CCamera. |
|
1988 Implementation requires derivation from CCameraPlugin instead. |
|
1989 */ |
|
1990 IMPORT_C CCamera(); |
|
1991 }; |
|
1992 |
|
1993 /** |
|
1994 Buffer class for passing video frames between camera and client. |
|
1995 |
|
1996 May contain multiple frames. |
|
1997 |
|
1998 @publishedAll |
|
1999 @released |
|
2000 */ |
|
2001 class MFrameBuffer |
|
2002 { |
|
2003 public: |
|
2004 /** |
|
2005 Gets a non-bitmap frame in the buffer. |
|
2006 |
|
2007 @param aIndex |
|
2008 The index of the required, non-bitmap, frame. |
|
2009 |
|
2010 @leave KErrArgument if aIndex is out of range |
|
2011 @leave KErrNotSupported if the frame format is bitmap. |
|
2012 @return A pointer to the specified non-bitmap format frame of video data. |
|
2013 */ |
|
2014 virtual TDesC8* DataL(TInt aIndex)=0; |
|
2015 |
|
2016 /** |
|
2017 Gets a bitmap frame in the buffer. |
|
2018 |
|
2019 @param aIndex |
|
2020 The index of the required, bitmap format, frame. |
|
2021 |
|
2022 @leave KErrArgument if aIndex is out of range and |
|
2023 @leave KErrNotSupported if |
|
2024 the frame format is not a bitmap. |
|
2025 @return A pointer to the specified bitmap format frame of video data. |
|
2026 */ |
|
2027 virtual CFbsBitmap* FrameL(TInt aIndex)=0; |
|
2028 |
|
2029 /** |
|
2030 Releases the buffer for re-use by the camera once the client has processed |
|
2031 the frame data. |
|
2032 |
|
2033 Signals to CCamera that the buffer data has been used and that the buffer |
|
2034 is free for re-use. |
|
2035 */ |
|
2036 virtual void Release()=0; |
|
2037 |
|
2038 public: |
|
2039 |
|
2040 /** |
|
2041 Sequential frame number of the first frame in the buffer, counting from when |
|
2042 CCamera::StartVideoCapture() was called and including frames dropped due to |
|
2043 lack of buffers. |
|
2044 */ |
|
2045 TInt iIndexOfFirstFrameInBuffer; |
|
2046 |
|
2047 /** |
|
2048 Time elapsed from when CCamera::StartVideoCapture() was called until the first |
|
2049 frame in the buffer was captured. |
|
2050 */ |
|
2051 TTimeIntervalMicroSeconds iElapsedTime; |
|
2052 }; |
|
2053 |
|
2054 /** Specifies whether the camera is reserved or not. |
|
2055 The enumeration list may be extended in future. |
|
2056 |
|
2057 @publishedPartner |
|
2058 @prototype |
|
2059 */ |
|
2060 enum TECamReserveStatus |
|
2061 { |
|
2062 /** Camera Status unknown */ |
|
2063 ECameraStatusUnknown, |
|
2064 /** Camera is reserved */ |
|
2065 ECameraReserved, |
|
2066 /** Camera is unreserved */ |
|
2067 ECameraUnReserved |
|
2068 }; |
|
2069 |
|
2070 /** Mixin base class for camera clients to handle the notification of Reserve status. |
|
2071 |
|
2072 Client must implement MReserveObserver in order to handle the notifications and take appropriate steps accordingly. |
|
2073 |
|
2074 @note By the time client gets unreserved status via callback, the camera may be on its way getting reserved by another client who |
|
2075 might be continuously polling for it. |
|
2076 So, there is no guarantee that the client will be able to reserve it. But it is guaranteed that the client will |
|
2077 receive the notification about change in reserve status. |
|
2078 |
|
2079 @publishedPartner |
|
2080 @prototype |
|
2081 */ |
|
2082 class MReserveObserver |
|
2083 { |
|
2084 public: |
|
2085 /** |
|
2086 This notification is send to provide the reserve status for the camera. |
|
2087 |
|
2088 @param aCameraIndex |
|
2089 The camera index for which the Reserve status has to be provided. |
|
2090 |
|
2091 @param aReserveStatus |
|
2092 The reserve status for the camera. |
|
2093 |
|
2094 @param aErrorCode |
|
2095 The error value. |
|
2096 |
|
2097 @note If error is not KErrNone, then the client is expected to destroy the CCameraStatusWatch retrieved through |
|
2098 TReservedInfo::SubscribeReserveInfoL and re-subscribe if desired. |
|
2099 */ |
|
2100 virtual void ReserveStatus(TInt iCameraIndex, TECamReserveStatus aReserveStatus, TInt aErrorCode) =0; |
|
2101 }; |
|
2102 |
|
2103 class CCameraStatusWatch; |
|
2104 |
|
2105 /** |
|
2106 @publishedPartner |
|
2107 @prototype |
|
2108 |
|
2109 Client uses it to asynchronously receive the reserve status of a camera index through MReserveObserver |
|
2110 */ |
|
2111 class TReservedInfo |
|
2112 { |
|
2113 public: |
|
2114 IMPORT_C static void SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch); |
|
2115 }; |
|
2116 |
|
2117 /** |
|
2118 An active object class implemented by Symbian and used to subscribe for the updates in the Properties, retrieve the |
|
2119 Properties and forward the notification to the client. |
|
2120 |
|
2121 @note Serialized part of the ECam implementation is assumed to define the Properties and publish them whenever there is |
|
2122 change in the reserve status. |
|
2123 */ |
|
2124 class CCameraStatusWatch : public CActive |
|
2125 { |
|
2126 friend void TReservedInfo::SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch); |
|
2127 |
|
2128 public: |
|
2129 IMPORT_C ~CCameraStatusWatch(); |
|
2130 |
|
2131 private: |
|
2132 static CCameraStatusWatch* NewL(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId); |
|
2133 |
|
2134 CCameraStatusWatch(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId); |
|
2135 void ConstructL(); |
|
2136 void RunL(); |
|
2137 void DoCancel(); |
|
2138 |
|
2139 private: |
|
2140 RProperty iProperty; |
|
2141 MReserveObserver& iReserveObserver; |
|
2142 TInt iCameraIndex; |
|
2143 TInt iSecureId; |
|
2144 }; |
|
2145 |
|
2146 #endif // ECAM_H |