Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
27 #include <ecamuids.hrh>
28 #include <e32property.h>
32 class CWsScreenDevice;
36 typedef TInt TPostCaptureControlId;
38 /** Specifies camera device information.
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
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
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
61 /** Possible directions in which the camera may point.
63 enum TCameraOrientation
65 /** Outward pointing camera for taking pictures.
66 Camera is directed away from the user. */
68 /** Inward pointing camera for conferencing.
69 Camera is directed towards the user. */
71 /** Mobile camera capable of multiple orientations.
72 Camera orientation may be changed by the user. */
74 /** Camera orientation is not known. */
78 /** Various flags describing the features available for a particular implementation
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
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;
111 /** Bitfield of TOptions available */
112 TUint32 iOptionsSupported;
113 /** The supported flash modes.
115 This is a bitfield of CCamera::TFlash values.
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()
126 TUint32 iFlashModesSupported;
127 /** The supported exposure modes.
129 This is a bitfield of CCamera::TExposure values. */
130 TUint32 iExposureModesSupported;
132 /** The supported white balance settings.
134 This is a bitfield of of CCamera::TWhiteBalance values.
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
144 @see CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes()
146 TUint32 iWhiteBalanceModesSupported;
148 /** Minimum zoom value allowed.
150 Must be negative, or zero if not supported.
152 This is the minimum value that may be passed to CCamera::SetZoomFactorL(). */
154 /** Maximum zoom value allowed.
156 Must be positive, or zero if not supported.
158 This is the maximum value that may be passed to CCamera::SetZoomFactorL(). */
160 /** Maximum digital zoom value allowed.
162 Must be positive, or zero if not supported.
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;
168 /** Image size multiplier corresponding to minimum zoom value.
170 Must be between 0 and 1 inclusive. Both 0 and 1 indicate that macro functionality
172 TReal32 iMinZoomFactor;
173 /** Image size multiplier corresponding to maximum zoom value.
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.
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.
183 Must be greater than or equal to 1. */
184 TReal32 iMaxDigitalZoomFactor;
186 /** Count of still image capture sizes allowed.
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.
193 This is a bitfield of CCamera::TFormat values. */
194 TUint32 iImageFormatsSupported;
196 /** Count of video frame sizes allowed.
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.
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.
210 This is a bitfield of video frame CCamera::TFormat values.
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.
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;
226 /** Mixin base class for camera clients.
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
233 Implementations of the camera API should use MCameraObserver::FrameBufferReady()
234 and MFrameBuffer::Release() to co-ordinate the mapping of any special memory
240 class MCameraObserver
243 /** Camera reservation is complete.
245 Called asynchronously when CCamera::Reserve() completes.
248 An error on failure and KErrNone on success.
250 virtual void ReserveComplete(TInt aError)=0;
252 /** Indicates camera power on is complete.
254 Called on completion of CCamera:PowerOn().
257 KErrNone on success, KErrInUse if the camera is in
258 use by another client or KErrNoMemory if insufficient system memory is available.
260 virtual void PowerOnComplete(TInt aError)=0;
262 /** Tests whether transfer of view finder data has completed.
264 Called periodically in response to the use of CCamera::StartViewFinderBitmapsL().
267 The view finder frame.
269 virtual void ViewFinderFrameReady(CFbsBitmap& aFrame)=0;
271 /** Transfers the current image from the camera to the client.
273 Called asynchronously when CCamera::CaptureImage() completes.
276 On return, a pointer to an image held in CFbsBitmap form if
277 this was the format specified in CCamera::PrepareImageCaptureL().
279 On return, a pointer to an HBufC8 if this was the format specified
280 in CCamera::PrepareImageCaptureL(). NULL if there was an error.
282 KErrNone on success or an error code on failure.
284 virtual void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError)=0;
286 /** Passes a filled frame buffer to the client.
288 Called asynchronously, when a buffer has been filled with the required number
289 of video frames by CCamera::StartVideoCapture().
292 On return, a pointer to an MFrameBuffer if successful,
293 or NULL if not successful.
295 KErrNone if successful, or an error code if not successful.
297 virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError)=0;
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.
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
311 The buffer may contain multiple frames.
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()
325 @return The number of frames of image data in the buffer.
327 virtual TInt NumFrames()=0;
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.
333 The index of the required frame. For a still image this should be 0.
335 @leave KErrArgument if aIndex is out of range and
336 @leave KErrNotSupported if the camera data is actually bitmaps in the FBS.
338 @return A pointer to a descriptor containing a frame of image data.
340 virtual TDesC8* DataL(TInt aFrameIndex)=0;
343 Returns a reference to a FBS bitmap containing a frame of image data.
346 The index of the required frame. For a still image this should be 0.
348 @leave KErrArgument if aIndex is out of range and
349 @leave KErrNotSupported if the picture data is not a FBS bitmap.
351 @return A reference to a FBS bitmap containing a frame of picture data.
353 virtual CFbsBitmap& BitmapL(TInt aFrameIndex)=0;
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
359 The ptr returned by DataL(aFrameIndex) is effectively derived from this
360 RChunk (where both are supported simulataneously). The equivalent ptr would be:
362 ptr.Set(ChunkL().Base() + ChunkOffset(aFrameIndex), FrameSize(aFrameIndex));
364 @leave KErrNotSupported if the chunk is not available.
366 @return A reference to a handle to the chunk that contains the buffer of picture data.
368 virtual RChunk& ChunkL()=0;
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.
376 The index of the required frame. For a still image this should be 0.
378 @leave KErrNotSupported if the chunk is not available
379 @leave KErrArgument if aIndex is out of range.
381 @return The offset into the chunk for the start of the frame.
383 virtual TInt ChunkOffsetL(TInt aFrameIndex)=0;
386 Returns the size of the data in bytes that comprises the frame specified by aIndex.
389 The index of the required frame. For a still image this should be 0.
392 if aIndex is out of range.
394 @return Returns the size of the data in bytes that comprises the frame.
396 virtual TInt FrameSize(TInt aFrameIndex)=0;
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.
403 virtual void Release()=0;
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.
411 TInt iIndexOfFirstFrameInBuffer;
414 Time elapsed from when CCamera::StartVideoCapture() was called until the first
415 frame in the buffer was captured. Always zero for still images.
417 TTimeIntervalMicroSeconds iElapsedTime;
421 This class is used to provide extra buffer informations through a custom interface.
423 @see MCameraImageBuffer
428 class MCameraBuffer2 : public MCameraBuffer
432 Retrieves an array of uids which represents the class identifier used for buffer extension.
434 @param aInterfaceUids
435 An array of uids which represents the class identifier.
437 @return The error code.
439 virtual TInt GetInterfaceUids(RArray<TUid>& aInterfaceUids) = 0;
442 Gets a custom interface for extra buffer information.
445 The Uid of the particular interface function required for buffer information.
448 The client has to cast the custom interface pointer to the appropriate type.
450 @return The error code.
452 virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface) = 0;
456 Uid used to identify the event that the request to Reserve() has completed
458 static const TUid KUidECamEventReserveComplete = {0x101F7D3B};
461 Uid used to identify the event that the request to PowerOn() has completed
463 static const TUid KUidECamEventPowerOnComplete = {0x101F7D3C};
466 Uid used to identify the event that the client has lost
467 control of the camera
469 static const TUid KUidECamEventCameraNoLongerReserved = {0x101F7D3D};
472 Uid used to notify the client who made the new reserve request.
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);
481 static const TUid KUidECamEventNewReserveComplete = {KUidECamEventNewReserveCompleteUidValue};
487 General purpose class to describe an ECam event.
489 Contains a UID to define the actual event type, and an integer to define the event code.
501 A UID to define the type of event.
503 The error code associated with the event.
506 IMPORT_C TECAMEvent(TUid aEventType, TInt aErrorCode);
511 Provided so this class can be packaged in a TPckgBuf<>.
513 IMPORT_C TECAMEvent();
516 A UID to define the event type.
521 The error code associated with the event.
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.
530 static const TUid KUidECamEventClass2 = {KUidECamEventClass2UidValue};
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.
536 @note TECAMEvent2::iParam represents color entry.
538 static const TUid KUidECamEventCIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue};
539 static const TUid KUidECamEvent2CIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue};
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.
545 @note TECAMEvent2::iParam represents color entry.
547 static const TUid KUidECamEventCIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue};
548 static const TUid KUidECamEvent2CIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue};
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.
554 @note TECAMEvent2::iParam represents color entry.
556 static const TUid KUidECamEventCIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue};
557 static const TUid KUidECamEvent2CIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue};
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.
563 @note TECAMEvent2::iParam represents color entry.
565 static const TUid KUidECamEventCIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue};
566 static const TUid KUidECamEvent2CIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue};
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.
572 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::
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;
578 @note TECAMEvent2::iParam represents bit field describing all PreCaptureWarnings currently issued.
580 static const TUid KUidECamEventCameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue};
581 static const TUid KUidECamEvent2CameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue};
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.
587 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::
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;
593 Note: TECAMEvent2::iParam represents percentage continuous zoom completion.
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%.
601 static const TUid KUidECamEvent2CameraSettingContinuousZoomPercentageCompletion = {KUidECamEvent2CameraSettingContinuousZoomPercentageCompletionUidValue};
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.
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;
612 Note: TECAMEvent2::iParam represents the TInt used to obtain a uid which represents the requested feature change.
617 static const TUid KUidECamEvent2IndirectFeatureChange = {KUidECamEvent2IndirectFeatureChangeUidValue};
621 Viewfinder fading effect has been set.
622 This event should be packed in TECAMEvent2 class.
624 Note: TECAMEvent2::iParam represents viewfinder handle.
628 static const TUid KUidECamEvent2ViewFinderFadingEffect = {KUidECamEvent2ViewFinderFadingEffectUidValue};
631 Event indicating auto aperture is being used.
632 This event should be packed in TECAMEvent2 class.
634 This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::
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;
640 Note: TECAMEvent2::iParam represents actual value of aperture being used if camera is capable of. Otherwise, KErrNotFound will be retrieved.
644 static const TUid KUidECamEvent2CameraSettingAutoAperture = {KUidECamEvent2CameraSettingAutoApertureUidValue};
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.
655 static const TUid KECamEvent2ImageCaptureControlFocussingInformation = {KECamEvent2ImageCaptureControlFocussingInformationUidValue};
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.
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.
666 static const TUid KUidECamEvent2ImageCaptureControlSpotCombination = {KUidECamEvent2ImageCaptureControlSpotCombinationUidValue};
669 Viewfinder magnification has been set.
670 This event should be packed in TECAMEvent2 class.
672 Note: TECAMEvent2::iParam represents viewfinder handle.
676 static const TUid KUidECamEvent2ViewFinderMagnification = {KUidECamEvent2ViewFinderMagnificationUidValue};
679 Notifies the current camera reserver that the camera control will be forcefully overtaken by another requesting client
680 after a specific time interval.
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;
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.
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.
695 static const TUid KUidECamEvent2CameraRequestForcedTimedTakeOver = {KUidECamEvent2CameraRequestForcedTimedTakeOverUidValue};
698 Notifies the current camera reserver that another client is requesting for camera control in a specific time interval.
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;
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.
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.
714 static const TUid KUidECamEvent2CameraRequestTimedTakeOver = {KUidECamEvent2CameraRequestTimedTakeOverUidValue};
717 Notifies the manual gain setting completion for the particular channel.
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;
724 Note: TECAMEvent2::iParam represents the specific channel for which the manual gain value has been set.
728 static const TUid KUidECamEvent2CameraSettingManualGain = {KUidECamEvent2CameraSettingManualGainUidValue};
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).
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;
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.
744 static const TUid KUidECamEvent2CameraSettingFocusDistance = {KUidECamEvent2CameraSettingFocusDistanceUidValue};
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'.
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;
755 Note: TECAMEvent2::iParam represents the target priority to which the client should set itself using the method SetClientPriorityL()
759 static const TUid KUidECamEvent2CameraSettingChangeClientPriority = {KUidECamEvent2CameraSettingChangeClientPriorityUidValue};
762 Event indicating image enhancement setting has been applied.
763 This event should be packed in TECAMEvent2 class.
765 Note: TECAMEvent2::iParam represents viewfinder handle.
769 static const TUid KUidECamEvent2ViewFinderImageEnhancement = {KUidECamEvent2ViewFinderImageEnhancementUidValue};
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.
775 @see CCamera::CCameraAdvancedSettings::RegisterEventsL(TECAMEventFilterScheme aEventFilter, const RArray<TUid>& aEvents);
776 @see CCamera::CCameraAdvancedSettings::GetRegisterEventsL(TECAMEventFilterScheme aEventFilter, RArray<TUid>& aEvents) const;
780 enum TECAMEventFilterScheme
782 /** Black listing will mean not to receive specific events */
783 EECAMEventFilterSchemeBlackList,
784 /** White listing will mean to receive only specific events */
785 EECAMEventFilterSchemeWhiteList
789 Special type of TECAMEvent class used to retrieve some extra information from particular events received
794 class TECAMEvent2 : public TECAMEvent
798 IMPORT_C static TBool IsEventEncapsulationValid(const TECAMEvent& aECAMEvent);
800 IMPORT_C TECAMEvent2(TUid aEventType, TInt aErrorCode, TInt aParam);
802 IMPORT_C const TUid& EventClassUsed() const;
806 Uid representing this version of TECAMEvent base class. Uid used is KUidECamEventClass2
808 TUid iEventClassUsed;
812 TInt iReserved1; -> Made Public TInt iParam1
823 iParam1 will be used to provide extra information if iParam is not sufficient.
824 This signifies different things for different valid events.
826 Future events may also use this class member variable.
831 This signifies different things for different valid events.
833 Future events may also use this class member variable.
838 /** Mixin base class V2 for camera clients.
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
849 class MCameraObserver2
853 A camera event has completed.
854 @note Implementations of MCameraObserver2 should ignore events which are not recognised and should not leave.
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
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
864 The error will be KErrAccessDenied for a Reserve() request that failed
865 because a higher priority client already controls the camera.
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.
870 virtual void HandleEvent(const TECAMEvent& aEvent)=0;
873 Notifies client of new view finder data. Called periodically in response to
874 the use of CCamera::StartViewFinderL().
877 A reference to an MCameraBuffer if successful, or NULL if not successful.
880 KErrNone if successful, or an error code if not successful.
882 virtual void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
885 Notifies the client of a new captured camera image. Called asynchronously
886 when CCamera::CaptureImage() completes.
889 A reference to an MCameraBuffer if successful, or NULL if not successful.
892 KErrNone if successful, or an error code if not successful.
894 @note If new image capture classes used, then this callback will not be used. Refer MCaptureImageObserver
896 virtual void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
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().
904 A reference to an MCameraBuffer if successful, or NULL if not successful.
907 KErrNone if successful, or an error code if not successful.
909 virtual void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
913 /** Base class for camera devices.
915 Provides the interface that an application uses to control, and acquire images
918 An application must supply an implementation of MCameraObserver2 (or MCameraObserver).
923 class CCamera : public CBase
927 friend class CCameraPlugin;
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;
947 /** Possible still image and video frame formats
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. */
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,
965 EFormatJpeg = 0x0010,
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()
995 EFormatMJPEG = 0x00020000,
998 Compressed H264 video format.
999 @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L().
1004 EFormatEncodedH264 = 0x00040000
1007 /** Specifies whether contrast is set automatically. */
1010 /** Sets the contrast automatically. */
1011 EContrastAuto = KMinTInt
1013 /** Specifies whether brightness is set automatically. */
1016 /** Sets the brightness automatically. */
1017 EBrightnessAuto = KMinTInt
1019 /** Specifies the type of flash. */
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()
1041 EFlashVideoLight = 0x0080
1043 /** Specifies the type of exposure. - EExposureAuto is the default value. */
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
1076 /** Specifies how the white balance is set. */
1079 /** Set white balance automatically. Default, always supported. */
1081 /** Normal daylight. */
1082 EWBDaylight = 0x0001,
1083 /** Overcast daylight. */
1085 /** Tungsten filament lighting. */
1086 EWBTungsten = 0x0004,
1087 /** Fluorescent tube lighting */
1088 EWBFluorescent = 0x0008,
1089 /** Flash lighting. */
1091 /** High contrast daylight primarily snowy */
1093 /** High contrast daylight primarily near the sea */
1095 /** User configurable mode */
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.
1105 EWBAutoSkin = 0x0200,
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.
1112 EWBHorizon = 0x0400,
1113 /** Daylight Under Water
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.
1119 EWBDaylightUnderWater = 0x0800
1124 Determines the number of cameras on the device.
1126 @return Count of cameras present on the device.
1128 IMPORT_C static TInt CamerasAvailable();
1131 @deprecated Use static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1133 Creates an object representing a camera.
1136 Reference to class derived from MCameraObserver2 designed to receive
1137 notification of asynchronous event completion.
1139 Index from 0 to CamerasAvailable()-1 inclusive specifying the
1140 camera device to use.
1142 Value from -100 to 100 indicating relative priority of client to
1145 @return Pointer to a fully constructed CCamera object. Ownership is passed
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.
1153 @capability UserEnvironment
1154 An application that creates a CCamera object must have
1155 the UserEnvironment capability.
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.
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.
1165 IMPORT_C static CCamera* NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1168 Creates an object representing a camera.
1169 Clients prepare themselves to receive unrecognised enum, uids etc.
1172 Reference to class derived from MCameraObserver2 designed to receive
1173 notification of asynchronous event completion.
1175 Index from 0 to CamerasAvailable()-1 inclusive specifying the
1176 camera device to use.
1178 Value from -100 to 100 indicating relative priority of client to
1181 @return Pointer to a fully constructed CCamera object. Ownership is passed
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.
1189 @capability UserEnvironment
1190 An application that creates a CCamera object must have
1191 the UserEnvironment capability.
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.
1197 @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids
1198 from 'supported' or 'getter' methods
1200 IMPORT_C static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1203 Creates an object representing a camera.
1206 Reference to class derived from MCameraObserver designed to receive
1207 notification of asynchronous event completion.
1209 Index from 0 to CamerasAvailable()-1 inclusive specifying the
1210 camera device to use.
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.
1217 @return Pointer to a fully constructed CCamera object. Ownership is passed
1220 @capability UserEnvironment
1221 An application that creates a CCamera object must have
1222 the UserEnvironment capability.
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.
1228 IMPORT_C static CCamera* NewL(MCameraObserver& aObserver,TInt aCameraIndex);
1231 @deprecated Use static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle);
1233 Duplicates the original camera object for use by, for example, multimedia systems.
1235 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid.
1238 Reference to an observer.
1239 @param aCameraHandle Handle of an existing camera object.
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.
1246 @return Duplicate of the original camera object.
1248 @capability UserEnvironment
1249 An application that creates a CCamera object must have
1250 the UserEnvironment capability.
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.
1256 IMPORT_C static CCamera* NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle);
1259 Duplicates the original camera object for use by, for example, multimedia systems.
1260 Clients prepare themselves to receive unrecognised enum, uids etc.
1262 May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid.
1265 Reference to an observer.
1266 @param aCameraHandle Handle of an existing camera object.
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.
1273 @return Duplicate of the original camera object.
1275 @capability UserEnvironment
1276 An application that creates a CCamera object must have
1277 the UserEnvironment capability.
1279 @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids
1280 from 'supported' or 'getter' methods
1282 IMPORT_C static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle);
1285 Duplicates the original camera object for use by, for example, multimedia systems.
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.
1293 Reference to an observer.
1294 @param aCameraHandle Handle of an existing camera object.
1296 @return Duplicate of the original camera object.
1298 @capability UserEnvironment
1299 An application that creates a CCamera object must have
1300 the UserEnvironment capability.
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.
1306 IMPORT_C static CCamera* NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle);
1309 Gets information about the camera device.
1312 On return, information about the camera device. See TCameraInfo.
1314 virtual void CameraInfo(TCameraInfo& aInfo) const=0;
1317 Asynchronous function that performs any required initialisation and reserves
1318 the camera for exclusive use.
1320 Calls MCameraObserver:: ReserveComplete() when complete.
1322 virtual void Reserve()=0;
1325 De-initialises the camera, allowing it to be used by other clients.
1327 virtual void Release()=0;
1330 Asynchronous method to switch on camera power.
1332 User must have successfully called Reserve() prior to calling this function.
1334 Calls MCameraObserver::PowerOnComplete() when power on is complete.
1336 virtual void PowerOn()=0;
1339 Synchronous function for switching off camera power.
1341 virtual void PowerOff()=0;
1344 Gets the device-unique handle of this camera object.
1346 @return The device-unique handle of this camera object.
1348 virtual TInt Handle()=0;
1351 Sets the zoom factor.
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
1358 Required zoom factor.
1360 virtual void SetZoomFactorL(TInt aZoomFactor = 0)=0;
1363 Gets the currently set zoom factor.
1365 @return The currently set zoom factor.
1367 virtual TInt ZoomFactor() const=0;
1370 Sets the digital zoom factor.
1372 This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom inclusive.
1374 May leave with KErrNotSupported if the zoom factor is out of range.
1376 @param aDigitalZoomFactor
1377 The required digital zoom factor.
1379 virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0)=0;
1382 Gets the currently set digital zoom factor.
1384 @return The currently set digital zoom factor.
1386 virtual TInt DigitalZoomFactor() const=0;
1389 Sets the contrast adjustment of the device.
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.
1395 Required contrast value. See TCameraInfo::iContrastSupported
1397 virtual void SetContrastL(TInt aContrast)=0;
1400 Gets the currently set contrast value.
1402 @return The currently set contrast value.
1404 virtual TInt Contrast() const=0;
1407 Sets the brightness adjustment of the device.
1409 No effect if this is not supported, see TCameraInfo::iBrightnessSupported.
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.
1415 The required brightness adjustment.
1417 virtual void SetBrightnessL(TInt aBrightness)=0;
1420 Gets the currently set brightness adjustment value.
1422 @return The currently set brightness adjustment value.
1424 virtual TInt Brightness() const=0;
1427 Sets the flash mode.
1429 No effect if this is not supported, see TCameraInfo::iFlashModesSupported.
1431 May leave with KErrNotSupported if the specified flash mode is invalid.
1434 The required flash mode.
1436 virtual void SetFlashL(TFlash aFlash = EFlashNone)=0;
1439 Gets the currently set flash mode.
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.
1449 @see CCamera::CCameraAdvancedSettings::FlashMode()
1451 virtual TFlash Flash() const=0;
1454 Sets the exposure adjustment of the device.
1456 No effect if this is not supported, see CameraInfo::iExposureModesSupported.
1458 May leave with KErrNotSupported if the specified exposure adjustment is invalid.
1461 The required exposure adjustment.
1463 virtual void SetExposureL(TExposure aExposure = EExposureAuto)=0;
1466 Gets the currently set exposure setting value.
1468 @return The currently set exposure setting value.
1470 virtual TExposure Exposure() const=0;
1473 Sets the white balance adjustment of the device.
1475 No effect if this is not supported, see TCameraInfo::iWhiteBalanceModesSupported.
1477 @param aWhiteBalance
1478 The required white balance adjustment.
1480 @leave KErrNotSupported if the specified white balance adjustment
1483 virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto)=0;
1486 Gets the currently set white balance adjustment value.
1488 @return The currently set white balance adjustment value.
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
1498 @see CCamera::CCameraAdvancedSettings::WhiteBalanceMode()
1500 virtual TWhiteBalance WhiteBalance() const=0;
1503 Starts transfer of view finder data to the given portion of the screen using
1504 direct screen access.
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.
1510 Window server session.
1511 @param aScreenDevice
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.
1520 @leave KErrNotReady if PowerOn() has either not
1521 been called, or has not yet completed.
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.
1526 @see CCamera::CCameraV2DirectViewFinder
1528 virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect)=0;
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.
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.
1539 Window server session.
1540 @param aScreenDevice
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.
1549 The rectangle to which the screen will be clipped.
1551 @leave KErrNotReady if PowerOn() hasn't been called successfully.
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.
1556 @see CCamera::CCameraClientViewFinder
1558 virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect)=0;
1561 Starts transfer of view finder data.
1563 Bitmaps are returned by MCameraObserver::ViewFinderFrameReady().
1566 On return, the size used.
1567 @leave KErrNotReady if PowerOn() has not been called, or has not yet completed.
1569 @note This method is assumed to be meant for default display only.
1571 @see CCamera::CCameraClientViewFinder
1573 virtual void StartViewFinderBitmapsL(TSize& aSize)=0;
1576 Starts transfer of view finder data and clips the bitmap to the specified clip
1579 The bitmap is the size of the intersection of aSize and aClipRect, not simply
1580 aSize padded with white space.
1583 On return, the size used.
1585 Required clip rectangle. May be modified if, for example,
1586 the camera only supports certain byte alignments.
1588 @leave KErrInUse if Reserve() hasn't been called successfully.
1589 @leave KErrNotReady if PowerOn() hasn't been called successfully.
1591 @note This method is assumed to be meant for default display only.
1593 @see CCamera::CCameraClientViewFinder
1595 virtual void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect)=0;
1598 Starts transfer of view finder data.
1600 Picture data is returned by MCameraObserver2::ViewFinderReady().
1603 The image format requested by the client.
1605 On return, the size used.
1606 @leave KErrNotSupported
1607 @leave KErrNotReady if Reserve() has not been
1608 called, or has not yet completed.
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.
1613 @see CCamera::CCameraClientViewFinder
1615 virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize)=0;
1618 Starts transfer of view finder data and clips the picture to the specified clip
1619 rectangle. Picture data is returned by MCameraObserver2::ViewFinderReady().
1621 The picture is the size of the intersection of aSize and aClipRect, not simply
1622 aSize padded with white space.
1627 On return, the size used.
1629 Required clip rectangle. May be modified if, for example,
1630 the camera only supports certain byte alignments.
1632 @leave KErrInUse if Reserve() hasn't been called successfully,
1633 @leave KErrNotReady if PowerOn() hasn't been called successfully.
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.
1638 @see CCamera::CCameraClientViewFinder
1640 virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect)=0;
1643 Stops transfer of view finder data to the screen.
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.
1648 @see CCamera::CCameraV2DirectViewFinder
1649 @see CCamera::CCameraClientViewFinder
1651 virtual void StopViewFinder()=0;
1654 Queries whether the view finder is active.
1656 @return ETrue if the view finder is active. EFalse if the view finder is not
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.
1662 @see CCamera::CCameraV2DirectViewFinder
1663 @see CCamera::CCameraClientViewFinder
1665 virtual TBool ViewFinderActive() const=0;
1668 Sets whether view finder mirroring is on.
1670 Used to switch between what the camera sees and what you would see if the
1671 device were a mirror.
1674 ETrue to set mirroring on, EFalse to set mirroring off.
1676 @leave KErrNotSupported.
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.
1681 @see CCamera::CCameraV2DirectViewFinder
1682 @see CCamera::CCameraClientViewFinder
1684 virtual void SetViewFinderMirrorL(TBool aMirror)=0;
1687 Gets whether view finder mirroring is active.
1689 @return ETrue if mirroring is set, EFalse if mirroring is not set.
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.
1694 @see CCamera::CCameraV2DirectViewFinder
1695 @see CCamera::CCameraClientViewFinder
1697 virtual TBool ViewFinderMirror() const=0;
1700 Performs setup and allocation of memory.
1702 Called prior to calling CaptureImage() to keep the latency of that function
1705 Needs to be called only once for multiple CaptureImage() calls. May leave
1706 with KErrNotSupported or KErrNoMemory or KErrInUse or KErrNotReady.
1708 The specified image format must be one of the formats supported
1709 (see TCameraInfo::iImageFormatsSupported).
1711 The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1
1719 @leave KErrNotSupported
1721 @leave KErrNotReady if PowerOn() hasn't been called successfully.
1723 @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters)
1725 virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex)=0;
1728 Performs setup and allocation of memory and clips the image to the specified
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.
1736 The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported).
1738 The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1
1746 The rectangle to which the image is to be clipped.
1748 @leave KErrNotSupported
1750 @leave KErrInUse if Reserve() hasn't been called successfully
1751 @leave KErrNotReady if PowerOn()
1752 hasn't been called successfully.
1754 @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters)
1756 virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect)=0;
1759 Asynchronously performs still image capture.
1761 Calls MCameraObserver::ImageReady() when complete.
1763 @see CCamera::CCameraImageCapture
1764 @see CCamera::CCameraPreImageCaptureControl
1766 virtual void CaptureImage()=0;
1769 Cancels the asynchronous still image capture.
1771 @see CCamera::CCameraImageCapture
1773 virtual void CancelCaptureImage()=0;
1776 Enumerates through the available image capture sizes, based on the specified
1777 size index and format
1779 The size index must be in the range 0 to TCameraInfo::iNumImageSizesSupported-1
1789 virtual void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0;
1792 Prepares for video capture.
1794 Performs setup and allocation of memory prior to calling StartVideoCapture()
1795 to keep the latency of that function to a minimum.
1797 May leave with KErrNotSupported or KErrNoMemory.
1800 Format must be one of the video frame formats supported (see
1801 TCameraInfo::iVideoFrameFormatsSupported).
1803 Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1806 The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
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.
1815 @leave May leave with KErrNotSupported, KErrNoMemory, or KErrNotReady if PowerOn()
1816 hasn't been called successfully.
1818 @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters)
1820 virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer)=0;
1823 Prepares for video capture and clips the frames to the given rectangle.
1825 Performs setup and allocation of memory prior to calling StartVideoCapture()
1826 to keep the latency of that function to a minimum.
1828 May leave with KErrNotSupported or KErrNoMemory.
1831 Format must be one of the video frame formats supported (see
1832 TCameraInfo::iVideoFrameFormatsSupported).
1834 Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1837 The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
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.
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.
1852 @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters)
1854 virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect)=0;
1857 Starts capturing video.
1859 Calls MCameraObserver::FrameBufferReady() when each buffer has been filled
1860 with the required number of frames, as set by PrepareVideoCaptureL().
1862 virtual void StartVideoCapture()=0;
1865 Stops video capture.
1867 virtual void StopVideoCapture()=0;
1870 Tests whether video capture is active.
1872 @return ETrue if video capture is active. EFalse if video capture is not active
1874 virtual TBool VideoCaptureActive() const=0;
1877 Enumerates through the available video frame sizes, based on the specified
1878 size index and format.
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.
1884 Size index. Must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1889 virtual void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0;
1892 Enumerates through the available video frame rates, based on the specified
1893 rate index, video frame format, size index and exposure mode.
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.
1901 The rate index. Must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
1910 virtual void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const=0;
1913 Gets the frame size currently in use.
1916 The frame size currently in use.
1918 virtual void GetFrameSize(TSize& aSize) const=0;
1921 Gets the frame rate currently in use.
1923 @return The frame rate currently in use.
1925 virtual TReal32 FrameRate() const=0;
1928 Gets the number of buffers currently in use.
1930 @return The number of buffers currently in use.
1932 virtual TInt BuffersInUse() const=0;
1935 Gets the number of frames per buffer currently in use.
1937 @return The number of frames per buffer currently in use.
1939 virtual TInt FramesPerBuffer() const=0;
1942 Sets the quality value to use if jpeg is a supported image for video format.
1944 Ignored if jpeg is not a supported image for video format.
1947 The quality value to use, clamped to the range 1 to 100.
1949 @see CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters::iImageMaxMemorySize
1951 virtual void SetJpegQuality(TInt aQuality)=0;
1954 Gets the currently set jpeg quality value.
1956 Returns 0 if not supported.
1958 @return The currently set jpeg quality value.
1960 @see CCamera::CCameraPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& aMemorySize)
1962 virtual TInt JpegQuality() const=0;
1965 Gets a custom interface. The client has to cast the returned pointer
1966 to the appropriate type.
1969 The Uid of the particular interface function required.
1971 @return Custom interface pointer. NULL if the requested interface is not supported.
1973 virtual TAny* CustomInterface(TUid aInterface)=0;
1978 Returns the camera API version no.
1980 IMPORT_C TInt CameraVersion();
1987 Prevents implementers from deriving from CCamera.
1988 Implementation requires derivation from CCameraPlugin instead.
1994 Buffer class for passing video frames between camera and client.
1996 May contain multiple frames.
2005 Gets a non-bitmap frame in the buffer.
2008 The index of the required, non-bitmap, frame.
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.
2014 virtual TDesC8* DataL(TInt aIndex)=0;
2017 Gets a bitmap frame in the buffer.
2020 The index of the required, bitmap format, frame.
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.
2027 virtual CFbsBitmap* FrameL(TInt aIndex)=0;
2030 Releases the buffer for re-use by the camera once the client has processed
2033 Signals to CCamera that the buffer data has been used and that the buffer
2036 virtual void Release()=0;
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
2045 TInt iIndexOfFirstFrameInBuffer;
2048 Time elapsed from when CCamera::StartVideoCapture() was called until the first
2049 frame in the buffer was captured.
2051 TTimeIntervalMicroSeconds iElapsedTime;
2054 /** Specifies whether the camera is reserved or not.
2055 The enumeration list may be extended in future.
2060 enum TECamReserveStatus
2062 /** Camera Status unknown */
2063 ECameraStatusUnknown,
2064 /** Camera is reserved */
2066 /** Camera is unreserved */
2070 /** Mixin base class for camera clients to handle the notification of Reserve status.
2072 Client must implement MReserveObserver in order to handle the notifications and take appropriate steps accordingly.
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.
2082 class MReserveObserver
2086 This notification is send to provide the reserve status for the camera.
2089 The camera index for which the Reserve status has to be provided.
2091 @param aReserveStatus
2092 The reserve status for the camera.
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.
2100 virtual void ReserveStatus(TInt iCameraIndex, TECamReserveStatus aReserveStatus, TInt aErrorCode) =0;
2103 class CCameraStatusWatch;
2109 Client uses it to asynchronously receive the reserve status of a camera index through MReserveObserver
2114 IMPORT_C static void SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch);
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.
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.
2124 class CCameraStatusWatch : public CActive
2126 friend void TReservedInfo::SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch);
2129 IMPORT_C ~CCameraStatusWatch();
2132 static CCameraStatusWatch* NewL(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId);
2134 CCameraStatusWatch(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId);
2140 RProperty iProperty;
2141 MReserveObserver& iReserveObserver;