williamr@2: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: #ifndef ECAM_H williamr@2: #define ECAM_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: class MFrameBuffer; williamr@2: class RWsSession; williamr@2: class CWsScreenDevice; williamr@2: class RWindowBase; williamr@2: class CFbsBitmap; williamr@2: williamr@2: typedef TInt TPostCaptureControlId; williamr@2: williamr@2: /** Specifies camera device information. williamr@2: williamr@2: If either zoom or digital zoom are available then the appropriate entries williamr@2: in this class will be set to indicate the range of values that they may take. williamr@2: This should be implemented such that a setting of zero corresponds to no zoom, williamr@2: and a step of one corresponds to the smallest increment available, in a linear williamr@2: fashion. williamr@2: williamr@2: There are also zoom factors that correspond to the actual zoom factor when williamr@2: at minimum (non-digital only) and maximum zoom. Negative zoom values represent williamr@2: macro functionality. williamr@2: williamr@2: Image capture, if supported, is simply a case of transferring the current williamr@2: image from the camera to the client via MCameraObserver::ImageReady(). The williamr@2: camera class must set the iImageFormatsSupported bitfield to indicate the williamr@2: formats available. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TCameraInfo williamr@2: { williamr@2: public: williamr@2: /** Possible directions in which the camera may point. williamr@2: */ williamr@2: enum TCameraOrientation williamr@2: { williamr@2: /** Outward pointing camera for taking pictures. williamr@2: Camera is directed away from the user. */ williamr@2: EOrientationOutwards, williamr@2: /** Inward pointing camera for conferencing. williamr@2: Camera is directed towards the user. */ williamr@2: EOrientationInwards, williamr@2: /** Mobile camera capable of multiple orientations. williamr@2: Camera orientation may be changed by the user. */ williamr@2: EOrientationMobile, williamr@2: /** Camera orientation is not known. */ williamr@2: EOrientationUnknown williamr@2: }; williamr@2: williamr@2: /** Various flags describing the features available for a particular implementation williamr@2: */ williamr@2: enum TOptions williamr@2: { williamr@2: /** View finder display direct-to-screen flag */ williamr@2: EViewFinderDirectSupported = 0x0001, williamr@2: /** View finder bitmap generation flag */ williamr@2: EViewFinderBitmapsSupported = 0x0002, williamr@2: /** Still image capture flag */ williamr@2: EImageCaptureSupported = 0x0004, williamr@2: /** Video capture flag */ williamr@2: EVideoCaptureSupported = 0x0008, williamr@2: /** View finder display mirroring flag */ williamr@2: EViewFinderMirrorSupported = 0x0010, williamr@2: /** Contrast setting flag */ williamr@2: EContrastSupported = 0x0020, williamr@2: /** Brightness setting flag */ williamr@2: EBrightnessSupported = 0x0040, williamr@2: /** View finder clipping flag */ williamr@2: EViewFinderClippingSupported = 0x0080, williamr@2: /** Still image capture clipping flag */ williamr@2: EImageClippingSupported = 0x0100, williamr@2: /** Video capture clipping flag */ williamr@2: EVideoClippingSupported = 0x0200 williamr@2: }; williamr@2: public: williamr@2: /** Version number and name of camera hardware. */ williamr@2: TVersion iHardwareVersion; williamr@2: /** Version number and name of camera software (device driver). */ williamr@2: TVersion iSoftwareVersion; williamr@2: /** Orientation of this particular camera device. */ williamr@2: TCameraOrientation iOrientation; williamr@2: williamr@2: /** Bitfield of TOptions available */ williamr@2: TUint32 iOptionsSupported; williamr@2: /** The supported flash modes. williamr@2: williamr@2: This is a bitfield of CCamera::TFlash values. williamr@2: williamr@2: If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the williamr@2: application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed williamr@2: from the implementation should be filtered by ECAM Implementation. williamr@2: To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: to create camera object. This is an indication to ECAM implementation. In this case, application is assumed williamr@2: to be prepared to receive unrecognised enum values. williamr@2: @see CCamera::CCameraAdvancedSettings::SupportedFlashModes() williamr@2: williamr@2: */ williamr@2: TUint32 iFlashModesSupported; williamr@2: /** The supported exposure modes. williamr@2: williamr@2: This is a bitfield of CCamera::TExposure values. */ williamr@2: TUint32 iExposureModesSupported; williamr@2: williamr@2: /** The supported white balance settings. williamr@2: williamr@2: This is a bitfield of of CCamera::TWhiteBalance values. williamr@2: williamr@2: If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the williamr@2: application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed williamr@2: from the implementation should be filtered by ECAM Implementation. williamr@2: To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: to create camera object. This is an indication to ECAM implementation. In this case, application is assumed williamr@2: to be prepared to receive unrecognised enum values. williamr@2: Refer to CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes() implementation williamr@2: williamr@2: @see CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes() williamr@2: */ williamr@2: TUint32 iWhiteBalanceModesSupported; williamr@2: williamr@2: /** Minimum zoom value allowed. williamr@2: williamr@2: Must be negative, or zero if not supported. williamr@2: williamr@2: This is the minimum value that may be passed to CCamera::SetZoomFactorL(). */ williamr@2: TInt iMinZoom; williamr@2: /** Maximum zoom value allowed. williamr@2: williamr@2: Must be positive, or zero if not supported. williamr@2: williamr@2: This is the maximum value that may be passed to CCamera::SetZoomFactorL(). */ williamr@2: TInt iMaxZoom; williamr@2: /** Maximum digital zoom value allowed. williamr@2: williamr@2: Must be positive, or zero if not supported. williamr@2: williamr@2: This is the maximum value that may be passed to CCamera::SetDigitalZoomFactorL(). williamr@2: Digital zoom factor is assumed to be a linear scale from 0 to iMaxDigitalZoom. */ williamr@2: TInt iMaxDigitalZoom; williamr@2: williamr@2: /** Image size multiplier corresponding to minimum zoom value. williamr@2: williamr@2: Must be between 0 and 1 inclusive. Both 0 and 1 indicate that macro functionality williamr@2: is not supported. */ williamr@2: TReal32 iMinZoomFactor; williamr@2: /** Image size multiplier corresponding to maximum zoom value. williamr@2: williamr@2: May take the value 0, or values greater than or equal to 1. Both 0 and 1 indicate williamr@2: that zoom functionality is not supported. */ williamr@2: TReal32 iMaxZoomFactor; williamr@2: /** Image size multiplier corresponding to maximum digital zoom value. williamr@2: williamr@2: Implementation recommendation is to use 'appropriate value' for maximum digital zoom which could cover only values williamr@2: given by new digital zoom methods based on image format and capture mode. williamr@2: williamr@2: Must be greater than or equal to 1. */ williamr@2: TReal32 iMaxDigitalZoomFactor; williamr@2: williamr@2: /** Count of still image capture sizes allowed. williamr@2: williamr@2: Number of different image sizes that CCamera::EnumerateCaptureSizes() will williamr@2: support, based on the index passed in. Index must be between 0 and iNumImageSizesSupported-1. */ williamr@2: TInt iNumImageSizesSupported; williamr@2: /** The supported still image formats. williamr@2: williamr@2: This is a bitfield of CCamera::TFormat values. */ williamr@2: TUint32 iImageFormatsSupported; williamr@2: williamr@2: /** Count of video frame sizes allowed. williamr@2: williamr@2: This is the number of different video frame sizes that CCamera::EnumerateVideoFrameSizes() williamr@2: will support, based on the specified index. The index must be between 0 and williamr@2: iNumVideoFrameSizesSupported-1. */ williamr@2: TInt iNumVideoFrameSizesSupported; williamr@2: /** Count of video frame rates allowed. williamr@2: williamr@2: This is the number of different video frame rates that CCamera::EnumerateVideoFrameRates() williamr@2: will support, based on the specified index. The index must be between 0 and williamr@2: iNumVideoFrameRatesSupported-1. */ williamr@2: TInt iNumVideoFrameRatesSupported; williamr@2: /** The supported video frame formats. williamr@2: williamr@2: This is a bitfield of video frame CCamera::TFormat values. williamr@2: williamr@2: If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the williamr@2: application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed williamr@2: from the implementation should be filtered by the ECAM implementation. williamr@2: To receive unrecognised/extra added enum values, the application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: to create the camera object. This is an indication to the ECAM implementation. In this case, the application is assumed williamr@2: to be prepared to receive unrecognised enum values. williamr@2: */ williamr@2: TUint32 iVideoFrameFormatsSupported; williamr@2: /** Maximum number of frames per buffer that may be requested. */ williamr@2: TInt iMaxFramesPerBufferSupported; williamr@2: /** Maximum number of buffers allowed */ williamr@2: TInt iMaxBuffersSupported; williamr@2: }; williamr@2: williamr@2: /** Mixin base class for camera clients. williamr@2: williamr@2: An application must implement an MCameraObserver or MCameraObserver2 (recommended) williamr@2: in order to use the camera API. This derived class is called when the camera is williamr@2: ready for use, an image has been captured or a buffer of video data is ready, including williamr@2: when errors occur. williamr@2: williamr@2: Implementations of the camera API should use MCameraObserver::FrameBufferReady() williamr@2: and MFrameBuffer::Release() to co-ordinate the mapping of any special memory williamr@2: objects. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MCameraObserver williamr@2: { williamr@2: public: williamr@2: /** Camera reservation is complete. williamr@2: williamr@2: Called asynchronously when CCamera::Reserve() completes. williamr@2: williamr@2: @param aError williamr@2: An error on failure and KErrNone on success. williamr@2: */ williamr@2: virtual void ReserveComplete(TInt aError)=0; williamr@2: williamr@2: /** Indicates camera power on is complete. williamr@2: williamr@2: Called on completion of CCamera:PowerOn(). williamr@2: williamr@2: @param aError williamr@2: KErrNone on success, KErrInUse if the camera is in williamr@2: use by another client or KErrNoMemory if insufficient system memory is available. williamr@2: */ williamr@2: virtual void PowerOnComplete(TInt aError)=0; williamr@2: williamr@2: /** Tests whether transfer of view finder data has completed. williamr@2: williamr@2: Called periodically in response to the use of CCamera::StartViewFinderBitmapsL(). williamr@2: williamr@2: @param aFrame williamr@2: The view finder frame. williamr@2: */ williamr@2: virtual void ViewFinderFrameReady(CFbsBitmap& aFrame)=0; williamr@2: williamr@2: /** Transfers the current image from the camera to the client. williamr@2: williamr@2: Called asynchronously when CCamera::CaptureImage() completes. williamr@2: williamr@2: @param aBitmap williamr@2: On return, a pointer to an image held in CFbsBitmap form if williamr@2: this was the format specified in CCamera::PrepareImageCaptureL(). williamr@2: @param aData williamr@2: On return, a pointer to an HBufC8 if this was the format specified williamr@2: in CCamera::PrepareImageCaptureL(). NULL if there was an error. williamr@2: @param aError williamr@2: KErrNone on success or an error code on failure. williamr@2: */ williamr@2: virtual void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError)=0; williamr@2: williamr@2: /** Passes a filled frame buffer to the client. williamr@2: williamr@2: Called asynchronously, when a buffer has been filled with the required number williamr@2: of video frames by CCamera::StartVideoCapture(). williamr@2: williamr@2: @param aFrameBuffer williamr@2: On return, a pointer to an MFrameBuffer if successful, williamr@2: or NULL if not successful. williamr@2: @param aError williamr@2: KErrNone if successful, or an error code if not successful. williamr@2: */ williamr@2: virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError)=0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: Class used for passing camera picture data between camera and client in the V2 observer. williamr@2: Used for viewfinder, image capture and video capture. williamr@2: williamr@2: The class offers APIs for the client to access the data as a descriptor, a bitmap williamr@2: or a handle to a kernel chunk. Depending on the format previously requested by williamr@2: the client, one or more of the API choices may be inappropriate e.g. an image will williamr@2: not be avaiable as a bitmap in the FBS unless the client has specifically requested williamr@2: it. williamr@2: williamr@2: The buffer may contain multiple frames. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MCameraBuffer williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Returns the number of frames of image data contained within the buffer. This williamr@2: would be 1 for a image capture, and match the requested count williamr@2: for video capture. For other methods in this class that take a aFrameIndex williamr@2: param, 0 <= aFrameIndex < NumFrames() williamr@2: williamr@2: @return The number of frames of image data in the buffer. williamr@2: */ williamr@2: virtual TInt NumFrames()=0; williamr@2: /** williamr@2: Returns a pointer to a descriptor containing a frame of camera data. The format williamr@2: will have been previously specified by a CCamera class method. williamr@2: williamr@2: @param aFrameIndex williamr@2: The index of the required frame. For a still image this should be 0. williamr@2: williamr@2: @leave KErrArgument if aIndex is out of range and williamr@2: @leave KErrNotSupported if the camera data is actually bitmaps in the FBS. williamr@2: williamr@2: @return A pointer to a descriptor containing a frame of image data. williamr@2: */ williamr@2: virtual TDesC8* DataL(TInt aFrameIndex)=0; williamr@2: williamr@2: /** williamr@2: Returns a reference to a FBS bitmap containing a frame of image data. williamr@2: williamr@2: @param aFrameIndex williamr@2: The index of the required frame. For a still image this should be 0. williamr@2: williamr@2: @leave KErrArgument if aIndex is out of range and williamr@2: @leave KErrNotSupported if the picture data is not a FBS bitmap. williamr@2: williamr@2: @return A reference to a FBS bitmap containing a frame of picture data. williamr@2: */ williamr@2: virtual CFbsBitmap& BitmapL(TInt aFrameIndex)=0; williamr@2: williamr@2: /** williamr@2: Returns a handle for the chunk that contains the camera data. williamr@2: The RChunk is exposed so that it can potentially be shared between multiple williamr@2: processes. williamr@2: The ptr returned by DataL(aFrameIndex) is effectively derived from this williamr@2: RChunk (where both are supported simulataneously). The equivalent ptr would be: williamr@2: TPtrC8* ptr; williamr@2: ptr.Set(ChunkL().Base() + ChunkOffset(aFrameIndex), FrameSize(aFrameIndex)); williamr@2: williamr@2: @leave KErrNotSupported if the chunk is not available. williamr@2: williamr@2: @return A reference to a handle to the chunk that contains the buffer of picture data. williamr@2: */ williamr@2: virtual RChunk& ChunkL()=0; williamr@2: williamr@2: /** williamr@2: Returns the offset into the chunk that contains the frame specified by aFrameIndex. williamr@2: The client would add this offset to the ptr returned by ChunkL().Base() to williamr@2: get the address of the start of the frame data. williamr@2: williamr@2: @param aIndex williamr@2: The index of the required frame. For a still image this should be 0. williamr@2: williamr@2: @leave KErrNotSupported if the chunk is not available williamr@2: @leave KErrArgument if aIndex is out of range. williamr@2: williamr@2: @return The offset into the chunk for the start of the frame. williamr@2: */ williamr@2: virtual TInt ChunkOffsetL(TInt aFrameIndex)=0; williamr@2: williamr@2: /** williamr@2: Returns the size of the data in bytes that comprises the frame specified by aIndex. williamr@2: williamr@2: @param aFrameIndex williamr@2: The index of the required frame. For a still image this should be 0. williamr@2: williamr@2: @leave KErrArgument williamr@2: if aIndex is out of range. williamr@2: williamr@2: @return Returns the size of the data in bytes that comprises the frame. williamr@2: */ williamr@2: virtual TInt FrameSize(TInt aFrameIndex)=0; williamr@2: williamr@2: /** williamr@2: Releases the buffer. Once the client has processed williamr@2: the picture data it should use this method to signal to CCamera that the williamr@2: buffer can be re-used. williamr@2: */ williamr@2: virtual void Release()=0; williamr@2: public: williamr@2: williamr@2: /** williamr@2: Sequential frame number of the first frame in the buffer, counting from when williamr@2: CCamera::StartVideoCapture() was called and including frames dropped due to williamr@2: lack of buffers. Always zero for still images. May also be used by client viewfinders. williamr@2: */ williamr@2: TInt iIndexOfFirstFrameInBuffer; williamr@2: williamr@2: /** williamr@2: Time elapsed from when CCamera::StartVideoCapture() was called until the first williamr@2: frame in the buffer was captured. Always zero for still images. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iElapsedTime; williamr@2: }; williamr@2: williamr@2: /** williamr@2: This class is used to provide extra buffer informations through a custom interface. williamr@2: williamr@2: @see MCameraImageBuffer williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MCameraBuffer2 : public MCameraBuffer williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Retrieves an array of uids which represents the class identifier used for buffer extension. williamr@2: williamr@2: @param aInterfaceUids williamr@2: An array of uids which represents the class identifier. williamr@2: williamr@2: @return The error code. williamr@2: */ williamr@2: virtual TInt GetInterfaceUids(RArray& aInterfaceUids) = 0; williamr@2: williamr@2: /** williamr@2: Gets a custom interface for extra buffer information. williamr@2: williamr@2: @param aInterface williamr@2: The Uid of the particular interface function required for buffer information. williamr@2: williamr@2: @param aPtrInterface williamr@2: The client has to cast the custom interface pointer to the appropriate type. williamr@2: williamr@2: @return The error code. williamr@2: */ williamr@2: virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: Uid used to identify the event that the request to Reserve() has completed williamr@2: */ williamr@2: static const TUid KUidECamEventReserveComplete = {0x101F7D3B}; williamr@2: williamr@2: /** williamr@2: Uid used to identify the event that the request to PowerOn() has completed williamr@2: */ williamr@2: static const TUid KUidECamEventPowerOnComplete = {0x101F7D3C}; williamr@2: williamr@2: /** williamr@2: Uid used to identify the event that the client has lost williamr@2: control of the camera williamr@2: */ williamr@2: static const TUid KUidECamEventCameraNoLongerReserved = {0x101F7D3D}; williamr@2: williamr@2: /** williamr@2: Uid used to notify the client who made the new reserve request. williamr@2: williamr@2: Error value KErrECamHighPriorityReserveRequesterExists indicates another such reserve request is outstanding and williamr@2: has higher priority than this one. williamr@2: Error value KErrCancel indicates a new reserve requester with higher priority than the current requester has williamr@2: been made. That's why, this one got cancelled. williamr@2: Any other error may also occur. williamr@2: @see CCamera::CCameraAdvancedSettings::ReserveL(const TTimeIntervalMicroseconds32& aMaxTimeToWait, TBool aKickOut); williamr@2: */ williamr@2: static const TUid KUidECamEventNewReserveComplete = {KUidECamEventNewReserveCompleteUidValue}; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: General purpose class to describe an ECam event. williamr@2: williamr@2: Contains a UID to define the actual event type, and an integer to define the event code. williamr@2: williamr@2: */ williamr@2: williamr@2: class TECAMEvent williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Constructor. williamr@2: williamr@2: @param aEventType williamr@2: A UID to define the type of event. williamr@2: @param aErrorCode williamr@2: The error code associated with the event. williamr@2: williamr@2: */ williamr@2: IMPORT_C TECAMEvent(TUid aEventType, TInt aErrorCode); williamr@2: williamr@2: /** williamr@2: Default constructor. williamr@2: williamr@2: Provided so this class can be packaged in a TPckgBuf<>. williamr@2: */ williamr@2: IMPORT_C TECAMEvent(); williamr@2: williamr@2: /** williamr@2: A UID to define the event type. williamr@2: */ williamr@2: TUid iEventType; williamr@2: williamr@2: /** williamr@2: The error code associated with the event. williamr@2: */ williamr@2: TInt iErrorCode; williamr@2: }; williamr@2: williamr@2: /** williamr@2: Uid used to identify a particular version of TECAMEvent base class being used i.e. TECAMEvent2 . williamr@2: Useful for MCameraObserver2::HandleEvent implementation to detect the version of TECAMEvent base class. williamr@2: */ williamr@2: static const TUid KUidECamEventClass2 = {KUidECamEventClass2UidValue}; williamr@2: williamr@2: /** williamr@2: event indicating setting of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: @note TECAMEvent2::iParam represents color entry. williamr@2: */ williamr@2: static const TUid KUidECamEventCIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue}; williamr@2: static const TUid KUidECamEvent2CIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue}; williamr@2: williamr@2: /** williamr@2: event indicating removal of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: @note TECAMEvent2::iParam represents color entry. williamr@2: */ williamr@2: static const TUid KUidECamEventCIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue}; williamr@2: static const TUid KUidECamEvent2CIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue}; williamr@2: williamr@2: /** williamr@2: event indicating setting of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: @note TECAMEvent2::iParam represents color entry. williamr@2: */ williamr@2: static const TUid KUidECamEventCIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue}; williamr@2: static const TUid KUidECamEvent2CIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue}; williamr@2: williamr@2: /** williamr@2: event indicating removal of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: @note TECAMEvent2::iParam represents color entry. williamr@2: */ williamr@2: static const TUid KUidECamEventCIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue}; williamr@2: static const TUid KUidECamEvent2CIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue}; williamr@2: williamr@2: /** williamr@2: event indicating issue of pre capture warnings. This is a part of class CCamera::CCameraAdvancedSettings. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: williamr@2: NewDuplicate2L():- williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: @note TECAMEvent2::iParam represents bit field describing all PreCaptureWarnings currently issued. williamr@2: */ williamr@2: static const TUid KUidECamEventCameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue}; williamr@2: static const TUid KUidECamEvent2CameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue}; williamr@2: williamr@2: /** williamr@2: Event indicating continuous zoom progess. This event is used for StartContinuousZoomL feature. This is a part of class williamr@2: CCamera::CCameraAdvancedSettings. This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: williamr@2: NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: Note: TECAMEvent2::iParam represents percentage continuous zoom completion. williamr@2: williamr@2: @note If zoom direction is EZoomDirectionWide, percentage completion will target minimum possible value as 100%. williamr@2: @note If zoom direction is EZoomDirectionTele, percentage completion will target maximum possible value as 100%. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraSettingContinuousZoomPercentageCompletion = {KUidECamEvent2CameraSettingContinuousZoomPercentageCompletionUidValue}; williamr@2: williamr@2: /** williamr@2: Notifies that unrequested feature changes have occurred. The method GetIndirectFeatureChangesL() is called to williamr@2: retrieve the list of unrequested feature changes. The unrequested feature changes are ECAM component wide. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: Note: TECAMEvent2::iParam represents the TInt used to obtain a uid which represents the requested feature change. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: static const TUid KUidECamEvent2IndirectFeatureChange = {KUidECamEvent2IndirectFeatureChangeUidValue}; williamr@2: williamr@2: williamr@2: /** williamr@2: Viewfinder fading effect has been set. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: Note: TECAMEvent2::iParam represents viewfinder handle. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2ViewFinderFadingEffect = {KUidECamEvent2ViewFinderFadingEffectUidValue}; williamr@2: williamr@2: /** williamr@2: Event indicating auto aperture is being used. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera:: williamr@2: NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: Note: TECAMEvent2::iParam represents actual value of aperture being used if camera is capable of. Otherwise, KErrNotFound will be retrieved. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraSettingAutoAperture = {KUidECamEvent2CameraSettingAutoApertureUidValue}; williamr@2: williamr@2: /** williamr@2: Event providing focussing feedback. The focussing feedback will be provided whenever the focussing state changes for the williamr@2: selected spot combination. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: Note: TECAMEvent2::iParam represents bitfield of chosen spots which are in focus. williamr@2: Note: TECAMEvent2::iParam1 represents bitfield of chosen spots which are not in focus. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KECamEvent2ImageCaptureControlFocussingInformation = {KECamEvent2ImageCaptureControlFocussingInformationUidValue}; williamr@2: williamr@2: /** williamr@2: Focussing spot combination. This event tells about completion of the setting operation for the spot combination. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: @note static_cast(TECAMEvent2::iParam) represents the focus mode for williamr@2: which the spot combination has to be set for receiving focussing feedback. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2ImageCaptureControlSpotCombination = {KUidECamEvent2ImageCaptureControlSpotCombinationUidValue}; williamr@2: williamr@2: /** williamr@2: Viewfinder magnification has been set. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: Note: TECAMEvent2::iParam represents viewfinder handle. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2ViewFinderMagnification = {KUidECamEvent2ViewFinderMagnificationUidValue}; williamr@2: williamr@2: /** williamr@2: Notifies the current camera reserver that the camera control will be forcefully overtaken by another requesting client williamr@2: after a specific time interval. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: @note TTimeIntervalMicroSeconds32(TECAMEvent2::iParam) represents the maximum time to wait. williamr@2: TECAMEvent2::iParam needs to be passed as argument in order to construct the TTimeIntervalMicroSeconds32 object. williamr@2: williamr@2: Note: TECAMEvent2::iParam1 represents the priority of the requestor client to whom the camera control will be forcibly williamr@2: passed after a specific time interval. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraRequestForcedTimedTakeOver = {KUidECamEvent2CameraRequestForcedTimedTakeOverUidValue}; williamr@2: williamr@2: /** williamr@2: Notifies the current camera reserver that another client is requesting for camera control in a specific time interval. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: @note TTimeIntervalMicroSeconds32(TECAMEvent2::iParam) represents the maximum requested time within which the current williamr@2: reserver may release the camera if it wishes to do so. williamr@2: TECAMEvent2::iParam needs to be passed as argument in order to construct the TTimeIntervalMicroSeconds32 object. williamr@2: williamr@2: Note: TECAMEvent2::iParam1 represents the priority of the requestor client to whom the camera control will be passed williamr@2: should the current reserver wish to do so. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraRequestTimedTakeOver = {KUidECamEvent2CameraRequestTimedTakeOverUidValue}; williamr@2: williamr@2: /** williamr@2: Notifies the manual gain setting completion for the particular channel. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: Note: TECAMEvent2::iParam represents the specific channel for which the manual gain value has been set. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraSettingManualGain = {KUidECamEvent2CameraSettingManualGainUidValue}; williamr@2: williamr@2: /** williamr@2: Retrieves the optimal focussing feedback while using manual focus. This will be issued as a result of setting operation williamr@2: CCamera::CCameraAdvancedSettings::SetFocusDistance(TInt aDistance). williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: @note If TECAMEvent2::iParam > 1, information is unavailable; if TECAMEvent2::iParam < 0, error case. williamr@2: Otherwise, static_cast(TECAMEvent2::iParam) retrieves whether optimal focussing has been achieved or not. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraSettingFocusDistance = {KUidECamEvent2CameraSettingFocusDistanceUidValue}; williamr@2: williamr@2: /** williamr@2: Instructs the client to change its priority in order to allow the legacy client to get hold of the camera. Client should williamr@2: restore their priority when they receive the notification 'KUidECamEventCameraSettingRestoreClientPriority'. williamr@2: williamr@2: This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(): williamr@2: void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray& aSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray& aActiveSettings) const; williamr@2: void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray& aDisabledSettings) const; williamr@2: williamr@2: Note: TECAMEvent2::iParam represents the target priority to which the client should set itself using the method SetClientPriorityL() williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2CameraSettingChangeClientPriority = {KUidECamEvent2CameraSettingChangeClientPriorityUidValue}; williamr@2: williamr@2: /** williamr@2: Event indicating image enhancement setting has been applied. williamr@2: This event should be packed in TECAMEvent2 class. williamr@2: williamr@2: Note: TECAMEvent2::iParam represents viewfinder handle. williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: static const TUid KUidECamEvent2ViewFinderImageEnhancement = {KUidECamEvent2ViewFinderImageEnhancementUidValue}; williamr@2: williamr@2: /** williamr@2: Provides the various available schemes for event filtering. This will inform how the listed uids have to be interpreted williamr@2: by the implementation for filtering the events. williamr@2: williamr@2: @see CCamera::CCameraAdvancedSettings::RegisterEventsL(TECAMEventFilterScheme aEventFilter, const RArray& aEvents); williamr@2: @see CCamera::CCameraAdvancedSettings::GetRegisterEventsL(TECAMEventFilterScheme aEventFilter, RArray& aEvents) const; williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: enum TECAMEventFilterScheme williamr@2: { williamr@2: /** Black listing will mean not to receive specific events */ williamr@2: EECAMEventFilterSchemeBlackList, williamr@2: /** White listing will mean to receive only specific events */ williamr@2: EECAMEventFilterSchemeWhiteList williamr@2: }; williamr@2: williamr@2: /** williamr@2: Special type of TECAMEvent class used to retrieve some extra information from particular events received williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TECAMEvent2 : public TECAMEvent williamr@2: { williamr@2: public: williamr@2: williamr@2: IMPORT_C static TBool IsEventEncapsulationValid(const TECAMEvent& aECAMEvent); williamr@2: williamr@2: IMPORT_C TECAMEvent2(TUid aEventType, TInt aErrorCode, TInt aParam); williamr@2: williamr@2: IMPORT_C const TUid& EventClassUsed() const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: Uid representing this version of TECAMEvent base class. Uid used is KUidECamEventClass2 williamr@2: */ williamr@2: TUid iEventClassUsed; williamr@2: williamr@2: /** williamr@2: Reserved for future williamr@2: TInt iReserved1; -> Made Public TInt iParam1 williamr@2: */ williamr@2: williamr@2: /** williamr@2: Reserved for future williamr@2: */ williamr@2: TInt iReserved2; williamr@2: williamr@2: williamr@2: public: williamr@2: /** williamr@2: iParam1 will be used to provide extra information if iParam is not sufficient. williamr@2: This signifies different things for different valid events. williamr@2: williamr@2: Future events may also use this class member variable. williamr@2: */ williamr@2: TInt iParam1; williamr@2: williamr@2: /** williamr@2: This signifies different things for different valid events. williamr@2: williamr@2: Future events may also use this class member variable. williamr@2: */ williamr@2: TInt iParam; williamr@2: }; williamr@2: williamr@2: /** Mixin base class V2 for camera clients. williamr@2: williamr@2: An application must implement an MCameraObserver2 (or MCameraObserver) in order to use the camera williamr@2: API. This derived class is called when the camera is ready for use, an image williamr@2: has been captured or a buffer of video data is ready, including when errors williamr@2: occur. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: class MCameraObserver2 williamr@2: { williamr@2: public: williamr@2: /** williamr@2: A camera event has completed. williamr@2: @note Implementations of MCameraObserver2 should ignore events which are not recognised and should not leave. williamr@2: williamr@2: @param aEvent williamr@2: A reference to a TECAMEvent. This can be completion of a call to Reserve() williamr@2: or a call to PowerOn() or a notification that the client has lost control williamr@2: of the camera. williamr@2: The event contains a uid identifying the event and an accompanying williamr@2: error code (KErrNone for the successful completion of a request). williamr@2: The error will be KErrNotReady for a request that was made out of the williamr@2: correct sequence. williamr@2: The error will be KErrAccessDenied for a Reserve() request that failed williamr@2: because a higher priority client already controls the camera. williamr@2: williamr@2: @note This may internally call TECAMEvent2::IsEventEncapsulationValid(aEvent) and also for any other derived version of TECAMEvent williamr@2: class to know whether correct version of TECAMEvent base class has been used. williamr@2: */ williamr@2: virtual void HandleEvent(const TECAMEvent& aEvent)=0; williamr@2: williamr@2: /** williamr@2: Notifies client of new view finder data. Called periodically in response to williamr@2: the use of CCamera::StartViewFinderL(). williamr@2: williamr@2: @param aCameraBuffer williamr@2: A reference to an MCameraBuffer if successful, or NULL if not successful. williamr@2: williamr@2: @param aError williamr@2: KErrNone if successful, or an error code if not successful. williamr@2: */ williamr@2: virtual void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; williamr@2: williamr@2: /** williamr@2: Notifies the client of a new captured camera image. Called asynchronously williamr@2: when CCamera::CaptureImage() completes. williamr@2: williamr@2: @param aCameraBuffer williamr@2: A reference to an MCameraBuffer if successful, or NULL if not successful. williamr@2: williamr@2: @param aError williamr@2: KErrNone if successful, or an error code if not successful. williamr@2: williamr@2: @note If new image capture classes used, then this callback will not be used. Refer MCaptureImageObserver williamr@2: */ williamr@2: virtual void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; williamr@2: williamr@2: /** williamr@2: Notifies the client of new captured video. Called asynchronously and periodically williamr@2: after CCamera::StartVideoCapture() is called. The buffer has been filled with the williamr@2: required number of video frames specified PrepareVideoCaptureL(). williamr@2: williamr@2: @param aCameraBuffer williamr@2: A reference to an MCameraBuffer if successful, or NULL if not successful. williamr@2: williamr@2: @param aError williamr@2: KErrNone if successful, or an error code if not successful. williamr@2: */ williamr@2: virtual void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0; williamr@2: }; williamr@2: williamr@2: williamr@2: /** Base class for camera devices. williamr@2: williamr@2: Provides the interface that an application uses to control, and acquire images williamr@2: from, the camera. williamr@2: williamr@2: An application must supply an implementation of MCameraObserver2 (or MCameraObserver). williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CCamera : public CBase williamr@2: williamr@2: { williamr@2: williamr@2: friend class CCameraPlugin; williamr@2: williamr@2: public: williamr@2: class CCameraPresets; williamr@2: class CCameraAdvancedSettings; williamr@2: class CCameraImageProcessing; williamr@2: class CCameraHistogram; williamr@2: class CCameraV2Histogram; williamr@2: class CCameraOverlay; williamr@2: class CCameraSnapshot; williamr@2: class CCameraDirectViewFinder; williamr@2: class CCameraV2DirectViewFinder; williamr@2: class CCameraClientViewFinder; williamr@2: class CCameraPreImageCaptureControl; williamr@2: class CCameraImageCapture; williamr@2: class CCameraPostImageCaptureControl; williamr@2: class CCameraVideoCaptureControl; williamr@2: class CCameraDirectSnapshot; williamr@2: williamr@2: public: williamr@2: /** Possible still image and video frame formats williamr@2: williamr@2: Formats are read from left to right, starting at the top of the image. YUV williamr@2: format is as defined by ITU-R BT.601-4. */ williamr@2: enum TFormat williamr@2: { williamr@2: /** 8 bit greyscale values, 0=black, 255=white. */ williamr@2: EFormatMonochrome = 0x0001, williamr@2: /** Packed RGB triplets, 4 bits per pixel with red in the least significant bits williamr@2: and the 4 most significant bits unused. */ williamr@2: EFormat16bitRGB444 = 0x0002, williamr@2: /** Packed RGB triplets, 5 bits per pixel for red and blue and 6 bits for green, williamr@2: with red in the least significant bits. */ williamr@2: EFormat16BitRGB565 = 0x0004, williamr@2: /** Packed RGB triplets, 8 bits per pixel with red in the least significant bits williamr@2: and the 8 most significant bits unused. */ williamr@2: EFormat32BitRGB888 = 0x0008, williamr@2: /** JFIF JPEG. */ williamr@2: EFormatJpeg = 0x0010, williamr@2: /** EXIF JPEG */ williamr@2: EFormatExif = 0x0020, williamr@2: /** CFbsBitmap object with display mode EColor4K. */ williamr@2: EFormatFbsBitmapColor4K = 0x0040, williamr@2: /** CFbsBitmap object with display mode EColor64K. */ williamr@2: EFormatFbsBitmapColor64K = 0x0080, williamr@2: /** CFbsBitmap object with display mode EColor16M. */ williamr@2: EFormatFbsBitmapColor16M = 0x0100, williamr@2: /** Implementation dependent. */ williamr@2: EFormatUserDefined = 0x0200, williamr@2: /** 4:2:0 format, 8 bits per sample, Y00Y01Y10Y11UV. */ williamr@2: EFormatYUV420Interleaved = 0x0400, williamr@2: /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0...V0... */ williamr@2: EFormatYUV420Planar = 0x0800, williamr@2: /** 4:2:2 format, 8 bits per sample, UY0VY1. */ williamr@2: EFormatYUV422 = 0x1000, williamr@2: /** 4:2:2 format, 8 bits per sample, Y1VY0U. */ williamr@2: EFormatYUV422Reversed = 0x2000, williamr@2: /** 4:4:4 format, 8 bits per sample, Y00U00V00 Y01U01V01... */ williamr@2: EFormatYUV444 = 0x4000, williamr@2: /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0V0... */ williamr@2: EFormatYUV420SemiPlanar = 0x8000, williamr@2: /** CFbsBitmap object with display mode EColor16MU. */ williamr@2: EFormatFbsBitmapColor16MU = 0x00010000, williamr@2: /** Motion JPEG for video williamr@2: @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: williamr@2: @internalTechnology williamr@2: */ williamr@2: EFormatMJPEG = 0x00020000, williamr@2: williamr@2: /** williamr@2: Compressed H264 video format. williamr@2: @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: EFormatEncodedH264 = 0x00040000 williamr@2: }; williamr@2: williamr@2: /** Specifies whether contrast is set automatically. */ williamr@2: enum TContrast williamr@2: { williamr@2: /** Sets the contrast automatically. */ williamr@2: EContrastAuto = KMinTInt williamr@2: }; williamr@2: /** Specifies whether brightness is set automatically. */ williamr@2: enum TBrightness williamr@2: { williamr@2: /** Sets the brightness automatically. */ williamr@2: EBrightnessAuto = KMinTInt williamr@2: }; williamr@2: /** Specifies the type of flash. */ williamr@2: enum TFlash williamr@2: { williamr@2: /** No flash, always supported. */ williamr@2: EFlashNone = 0x0000, williamr@2: /** Flash will automatically fire when required. */ williamr@2: EFlashAuto = 0x0001, williamr@2: /** Flash will always fire. */ williamr@2: EFlashForced = 0x0002, williamr@2: /** Reduced flash for general lighting */ williamr@2: EFlashFillIn = 0x0004, williamr@2: /** Red-eye reduction mode. */ williamr@2: EFlashRedEyeReduce = 0x0008, williamr@2: /** Flash at the moment when shutter opens. */ williamr@2: EFlashSlowFrontSync = 0x0010, williamr@2: /** Flash at the moment when shutter closes. */ williamr@2: EFlashSlowRearSync = 0x0020, williamr@2: /** User configurable setting */ williamr@2: EFlashManual = 0x0040, williamr@2: /** Constant emission of light during video mode williamr@2: @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: */ williamr@2: EFlashVideoLight = 0x0080 williamr@2: }; williamr@2: /** Specifies the type of exposure. - EExposureAuto is the default value. */ williamr@2: enum TExposure williamr@2: { williamr@2: /** Set exposure automatically. Default, always supported. */ williamr@2: EExposureAuto = 0x0000, williamr@2: /** Night-time setting for long exposures. */ williamr@2: EExposureNight = 0x0001, williamr@2: /** Backlight setting for bright backgrounds. */ williamr@2: EExposureBacklight = 0x0002, williamr@2: /** Centered mode for ignoring surroundings. */ williamr@2: EExposureCenter = 0x0004, williamr@2: /** Sport setting for very short exposures. */ williamr@2: EExposureSport = 0x0008, williamr@2: /** Generalised setting for very long exposures. */ williamr@2: EExposureVeryLong = 0x0010, williamr@2: /** Snow setting for daylight exposure. */ williamr@2: EExposureSnow = 0x0020, williamr@2: /** Beach setting for daylight exposure with reflective glare. */ williamr@2: EExposureBeach = 0x0040, williamr@2: /** Programmed exposure setting. */ williamr@2: EExposureProgram = 0x0080, williamr@2: /** Aperture setting is given priority. */ williamr@2: EExposureAperturePriority = 0x0100, williamr@2: /** Shutter speed setting is given priority. */ williamr@2: EExposureShutterPriority = 0x0200, williamr@2: /** User selectable exposure value setting. */ williamr@2: EExposureManual = 0x0400, williamr@2: /** Exposure night setting with colour removed to get rid of colour noise. */ williamr@2: EExposureSuperNight = 0x0800, williamr@2: /** Exposure for infra-red sensor on the camera */ williamr@2: EExposureInfra = 0x1000 williamr@2: }; williamr@2: williamr@2: /** Specifies how the white balance is set. */ williamr@2: enum TWhiteBalance williamr@2: { williamr@2: /** Set white balance automatically. Default, always supported. */ williamr@2: EWBAuto = 0x0000, williamr@2: /** Normal daylight. */ williamr@2: EWBDaylight = 0x0001, williamr@2: /** Overcast daylight. */ williamr@2: EWBCloudy = 0x0002, williamr@2: /** Tungsten filament lighting. */ williamr@2: EWBTungsten = 0x0004, williamr@2: /** Fluorescent tube lighting */ williamr@2: EWBFluorescent = 0x0008, williamr@2: /** Flash lighting. */ williamr@2: EWBFlash = 0x0010, williamr@2: /** High contrast daylight primarily snowy */ williamr@2: EWBSnow = 0x0020, williamr@2: /** High contrast daylight primarily near the sea */ williamr@2: EWBBeach = 0x0040, williamr@2: /** User configurable mode */ williamr@2: EWBManual = 0x0080, williamr@2: /** Shade */ williamr@2: EWBShade = 0x0100, williamr@2: /** auto skin williamr@2: williamr@2: If New2L()/NewDuplicate2L() are not used to create camera object, this williamr@2: enum value would be considered as unrecognized and filtered out in 'supported' williamr@2: or 'getter' methods. williamr@2: */ williamr@2: EWBAutoSkin = 0x0200, williamr@2: /** horizon williamr@2: williamr@2: If New2L()/NewDuplicate2L() are not used to create camera object, this williamr@2: enum value would be considered as unrecognized and filtered out in 'supported' williamr@2: or 'getter' methods. williamr@2: */ williamr@2: EWBHorizon = 0x0400, williamr@2: /** Daylight Under Water williamr@2: williamr@2: If New2L()/NewDuplicate2L() are not used to create camera object, this williamr@2: enum value would be considered as unrecognized and filtered out in 'supported' williamr@2: or 'getter' methods. williamr@2: */ williamr@2: EWBDaylightUnderWater = 0x0800 williamr@2: }; williamr@2: williamr@2: public: williamr@2: /** williamr@2: Determines the number of cameras on the device. williamr@2: williamr@2: @return Count of cameras present on the device. williamr@2: */ williamr@2: IMPORT_C static TInt CamerasAvailable(); williamr@2: williamr@2: /** williamr@2: @deprecated Use static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); williamr@2: williamr@2: Creates an object representing a camera. williamr@2: williamr@2: @param aObserver williamr@2: Reference to class derived from MCameraObserver2 designed to receive williamr@2: notification of asynchronous event completion. williamr@2: @param aCameraIndex williamr@2: Index from 0 to CamerasAvailable()-1 inclusive specifying the williamr@2: camera device to use. williamr@2: @param aPriority williamr@2: Value from -100 to 100 indicating relative priority of client to williamr@2: use camera. williamr@2: williamr@2: @return Pointer to a fully constructed CCamera object. Ownership is passed williamr@2: to the caller. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotSupported if aCameraIndex is out of range. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @capability MultimediaDD williamr@2: A process requesting or using this method that has MultimediaDD capability will williamr@2: always have precedence over a process that does not have MultimediaDD. williamr@2: williamr@2: @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). williamr@2: To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare williamr@2: themselves to receive unrecognised values. williamr@2: */ williamr@2: IMPORT_C static CCamera* NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); williamr@2: williamr@2: /** williamr@2: Creates an object representing a camera. williamr@2: Clients prepare themselves to receive unrecognised enum, uids etc. williamr@2: williamr@2: @param aObserver williamr@2: Reference to class derived from MCameraObserver2 designed to receive williamr@2: notification of asynchronous event completion. williamr@2: @param aCameraIndex williamr@2: Index from 0 to CamerasAvailable()-1 inclusive specifying the williamr@2: camera device to use. williamr@2: @param aPriority williamr@2: Value from -100 to 100 indicating relative priority of client to williamr@2: use camera. williamr@2: williamr@2: @return Pointer to a fully constructed CCamera object. Ownership is passed williamr@2: to the caller. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotSupported if aCameraIndex is out of range. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @capability MultimediaDD williamr@2: A process requesting or using this method that has MultimediaDD capability will williamr@2: always have precedence over a process that does not have MultimediaDD. williamr@2: williamr@2: @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids williamr@2: from 'supported' or 'getter' methods williamr@2: */ williamr@2: IMPORT_C static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority); williamr@2: williamr@2: /** williamr@2: Creates an object representing a camera. williamr@2: williamr@2: @param aObserver williamr@2: Reference to class derived from MCameraObserver designed to receive williamr@2: notification of asynchronous event completion. williamr@2: @param aCameraIndex williamr@2: Index from 0 to CamerasAvailable()-1 inclusive specifying the williamr@2: camera device to use. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotSupported if aCameraIndex is out of range. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @return Pointer to a fully constructed CCamera object. Ownership is passed williamr@2: to the caller. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). williamr@2: To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare williamr@2: themselves to receive unrecognised values. williamr@2: */ williamr@2: IMPORT_C static CCamera* NewL(MCameraObserver& aObserver,TInt aCameraIndex); williamr@2: williamr@2: /** williamr@2: @deprecated Use static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle); williamr@2: williamr@2: Duplicates the original camera object for use by, for example, multimedia systems. williamr@2: williamr@2: May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. williamr@2: williamr@2: @param aObserver williamr@2: Reference to an observer. williamr@2: @param aCameraHandle Handle of an existing camera object. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotFound if aCameraHandle is not valid. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @return Duplicate of the original camera object. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). williamr@2: To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare williamr@2: themselves to receive unrecognised values. williamr@2: */ williamr@2: IMPORT_C static CCamera* NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle); williamr@2: williamr@2: /** williamr@2: Duplicates the original camera object for use by, for example, multimedia systems. williamr@2: Clients prepare themselves to receive unrecognised enum, uids etc. williamr@2: williamr@2: May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid. williamr@2: williamr@2: @param aObserver williamr@2: Reference to an observer. williamr@2: @param aCameraHandle Handle of an existing camera object. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotFound if aCameraHandle is not valid. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @return Duplicate of the original camera object. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids williamr@2: from 'supported' or 'getter' methods williamr@2: */ williamr@2: IMPORT_C static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle); williamr@2: williamr@2: /** williamr@2: Duplicates the original camera object for use by, for example, multimedia systems. williamr@2: williamr@2: @leave KErrNoMemory if out of memory. williamr@2: @leave KErrNotFound if aCameraHandle is not valid. williamr@2: @leave KErrPermissionDenied if the application does not have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @param aObserver williamr@2: Reference to an observer. williamr@2: @param aCameraHandle Handle of an existing camera object. williamr@2: williamr@2: @return Duplicate of the original camera object. williamr@2: williamr@2: @capability UserEnvironment williamr@2: An application that creates a CCamera object must have williamr@2: the UserEnvironment capability. williamr@2: williamr@2: @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined). williamr@2: To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare williamr@2: themselves to receive unrecognised values. williamr@2: */ williamr@2: IMPORT_C static CCamera* NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle); williamr@2: williamr@2: /** williamr@2: Gets information about the camera device. williamr@2: williamr@2: @param aInfo williamr@2: On return, information about the camera device. See TCameraInfo. williamr@2: */ williamr@2: virtual void CameraInfo(TCameraInfo& aInfo) const=0; williamr@2: williamr@2: /** williamr@2: Asynchronous function that performs any required initialisation and reserves williamr@2: the camera for exclusive use. williamr@2: williamr@2: Calls MCameraObserver:: ReserveComplete() when complete. williamr@2: */ williamr@2: virtual void Reserve()=0; williamr@2: williamr@2: /** williamr@2: De-initialises the camera, allowing it to be used by other clients. williamr@2: */ williamr@2: virtual void Release()=0; williamr@2: williamr@2: /** williamr@2: Asynchronous method to switch on camera power. williamr@2: williamr@2: User must have successfully called Reserve() prior to calling this function. williamr@2: williamr@2: Calls MCameraObserver::PowerOnComplete() when power on is complete. williamr@2: */ williamr@2: virtual void PowerOn()=0; williamr@2: williamr@2: /** williamr@2: Synchronous function for switching off camera power. williamr@2: */ williamr@2: virtual void PowerOff()=0; williamr@2: williamr@2: /** williamr@2: Gets the device-unique handle of this camera object. williamr@2: williamr@2: @return The device-unique handle of this camera object. williamr@2: */ williamr@2: virtual TInt Handle()=0; williamr@2: williamr@2: /** williamr@2: Sets the zoom factor. williamr@2: williamr@2: This must be in the range of TCameraInfo::iMinZoom to TCameraInfo::iMaxZoom williamr@2: inclusive. May leave with KErrNotSupported if the specified zoom factor is williamr@2: out of range. williamr@2: williamr@2: @param aZoomFactor williamr@2: Required zoom factor. williamr@2: */ williamr@2: virtual void SetZoomFactorL(TInt aZoomFactor = 0)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set zoom factor. williamr@2: williamr@2: @return The currently set zoom factor. williamr@2: */ williamr@2: virtual TInt ZoomFactor() const=0; williamr@2: williamr@2: /** williamr@2: Sets the digital zoom factor. williamr@2: williamr@2: This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom inclusive. williamr@2: williamr@2: May leave with KErrNotSupported if the zoom factor is out of range. williamr@2: williamr@2: @param aDigitalZoomFactor williamr@2: The required digital zoom factor. williamr@2: */ williamr@2: virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set digital zoom factor. williamr@2: williamr@2: @return The currently set digital zoom factor. williamr@2: */ williamr@2: virtual TInt DigitalZoomFactor() const=0; williamr@2: williamr@2: /** williamr@2: Sets the contrast adjustment of the device. williamr@2: williamr@2: This must be in the range of -100 to +100 or EContrastAuto. May leave with williamr@2: KErrNotSupported if the specified contrast value is out of range. williamr@2: williamr@2: @param aContrast williamr@2: Required contrast value. See TCameraInfo::iContrastSupported williamr@2: */ williamr@2: virtual void SetContrastL(TInt aContrast)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set contrast value. williamr@2: williamr@2: @return The currently set contrast value. williamr@2: */ williamr@2: virtual TInt Contrast() const=0; williamr@2: williamr@2: /** williamr@2: Sets the brightness adjustment of the device. williamr@2: williamr@2: No effect if this is not supported, see TCameraInfo::iBrightnessSupported. williamr@2: williamr@2: This must be in the range of -100 to +100 or EBrightnessAuto. May leave williamr@2: with KErrNotSupported if the brightness adjustment is out of range. williamr@2: williamr@2: @param aBrightness williamr@2: The required brightness adjustment. williamr@2: */ williamr@2: virtual void SetBrightnessL(TInt aBrightness)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set brightness adjustment value. williamr@2: williamr@2: @return The currently set brightness adjustment value. williamr@2: */ williamr@2: virtual TInt Brightness() const=0; williamr@2: williamr@2: /** williamr@2: Sets the flash mode. williamr@2: williamr@2: No effect if this is not supported, see TCameraInfo::iFlashModesSupported. williamr@2: williamr@2: May leave with KErrNotSupported if the specified flash mode is invalid. williamr@2: williamr@2: @param aFlash williamr@2: The required flash mode. williamr@2: */ williamr@2: virtual void SetFlashL(TFlash aFlash = EFlashNone)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set flash mode. williamr@2: williamr@2: @return The currently set flash mode. williamr@2: @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that williamr@2: application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised) williamr@2: (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation. williamr@2: To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set. williamr@2: In this case, application is assumed to be prepared to receive unrecognised enum values. williamr@2: williamr@2: @see CCamera::CCameraAdvancedSettings::FlashMode() williamr@2: */ williamr@2: virtual TFlash Flash() const=0; williamr@2: williamr@2: /** williamr@2: Sets the exposure adjustment of the device. williamr@2: williamr@2: No effect if this is not supported, see CameraInfo::iExposureModesSupported. williamr@2: williamr@2: May leave with KErrNotSupported if the specified exposure adjustment is invalid. williamr@2: williamr@2: @param aExposure williamr@2: The required exposure adjustment. williamr@2: */ williamr@2: virtual void SetExposureL(TExposure aExposure = EExposureAuto)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set exposure setting value. williamr@2: williamr@2: @return The currently set exposure setting value. williamr@2: */ williamr@2: virtual TExposure Exposure() const=0; williamr@2: williamr@2: /** williamr@2: Sets the white balance adjustment of the device. williamr@2: williamr@2: No effect if this is not supported, see TCameraInfo::iWhiteBalanceModesSupported. williamr@2: williamr@2: @param aWhiteBalance williamr@2: The required white balance adjustment. williamr@2: williamr@2: @leave KErrNotSupported if the specified white balance adjustment williamr@2: is invalid. williamr@2: */ williamr@2: virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set white balance adjustment value. williamr@2: williamr@2: @return The currently set white balance adjustment value. williamr@2: williamr@2: @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that williamr@2: application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised) williamr@2: (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation. williamr@2: To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() williamr@2: to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set. williamr@2: In this case, application is assumed to be prepared to receive unrecognised enum values. williamr@2: Refer CCamera::CCameraAdvancedSettings::WhiteBalanceMode() implementation williamr@2: williamr@2: @see CCamera::CCameraAdvancedSettings::WhiteBalanceMode() williamr@2: */ williamr@2: virtual TWhiteBalance WhiteBalance() const=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data to the given portion of the screen using williamr@2: direct screen access. williamr@2: williamr@2: The aScreenRect parameter is in screen co-ordinates and may be modified if, williamr@2: eg, the camera requires the destination to have a certain byte alignment, etc. williamr@2: williamr@2: @param aWs williamr@2: Window server session. williamr@2: @param aScreenDevice williamr@2: Screen device. williamr@2: @param aWindow williamr@2: Displayable window. williamr@2: @param aScreenRect williamr@2: Portion of the screen to which view finder data is to be williamr@2: transferred. This is in screen co-ordinates and may be modified if, for example, williamr@2: the camera requires the destination to have a certain byte alignment. williamr@2: williamr@2: @leave KErrNotReady if PowerOn() has either not williamr@2: been called, or has not yet completed. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraV2DirectViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect)=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data to the given portion of the screen using williamr@2: direct screen access and also clips to the specified portion of the screen. williamr@2: williamr@2: The view finder has the same size and position as aScreenRect but is only williamr@2: visible in the intersection of aScreenRect and aClipRect. May leave with KErrNotSupported williamr@2: or KErrNotReady if Reserve() has not been called, or has not yet completed. williamr@2: williamr@2: @param aWs williamr@2: Window server session. williamr@2: @param aScreenDevice williamr@2: Screen device. williamr@2: @param aWindow williamr@2: Displayable window. williamr@2: @param aScreenRect williamr@2: Portion of the screen to which view finder data is to be williamr@2: transferred. This is in screen co-ordinates and may be modified if, for example, williamr@2: the camera requires the destination to have a certain byte alignment. williamr@2: @param aClipRect williamr@2: The rectangle to which the screen will be clipped. williamr@2: williamr@2: @leave KErrNotReady if PowerOn() hasn't been called successfully. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect)=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data. williamr@2: williamr@2: Bitmaps are returned by MCameraObserver::ViewFinderFrameReady(). williamr@2: williamr@2: @param aSize williamr@2: On return, the size used. williamr@2: @leave KErrNotReady if PowerOn() has not been called, or has not yet completed. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. williamr@2: williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderBitmapsL(TSize& aSize)=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data and clips the bitmap to the specified clip williamr@2: rectangle. williamr@2: williamr@2: The bitmap is the size of the intersection of aSize and aClipRect, not simply williamr@2: aSize padded with white space. williamr@2: williamr@2: @param aSize williamr@2: On return, the size used. williamr@2: @param aClipRect williamr@2: Required clip rectangle. May be modified if, for example, williamr@2: the camera only supports certain byte alignments. williamr@2: williamr@2: @leave KErrInUse if Reserve() hasn't been called successfully. williamr@2: @leave KErrNotReady if PowerOn() hasn't been called successfully. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. williamr@2: williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect)=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data. williamr@2: williamr@2: Picture data is returned by MCameraObserver2::ViewFinderReady(). williamr@2: williamr@2: @param aImageFormat williamr@2: The image format requested by the client. williamr@2: @param aSize williamr@2: On return, the size used. williamr@2: @leave KErrNotSupported williamr@2: @leave KErrNotReady if Reserve() has not been williamr@2: called, or has not yet completed. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize)=0; williamr@2: williamr@2: /** williamr@2: Starts transfer of view finder data and clips the picture to the specified clip williamr@2: rectangle. Picture data is returned by MCameraObserver2::ViewFinderReady(). williamr@2: williamr@2: The picture is the size of the intersection of aSize and aClipRect, not simply williamr@2: aSize padded with white space. williamr@2: williamr@2: @param aImageFormat williamr@2: The image format. williamr@2: @param aSize williamr@2: On return, the size used. williamr@2: @param aClipRect williamr@2: Required clip rectangle. May be modified if, for example, williamr@2: the camera only supports certain byte alignments. williamr@2: williamr@2: @leave KErrInUse if Reserve() hasn't been called successfully, williamr@2: @leave KErrNotReady if PowerOn() hasn't been called successfully. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect)=0; williamr@2: williamr@2: /** williamr@2: Stops transfer of view finder data to the screen. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraV2DirectViewFinder williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void StopViewFinder()=0; williamr@2: williamr@2: /** williamr@2: Queries whether the view finder is active. williamr@2: williamr@2: @return ETrue if the view finder is active. EFalse if the view finder is not williamr@2: active. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraV2DirectViewFinder williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual TBool ViewFinderActive() const=0; williamr@2: williamr@2: /** williamr@2: Sets whether view finder mirroring is on. williamr@2: williamr@2: Used to switch between what the camera sees and what you would see if the williamr@2: device were a mirror. williamr@2: williamr@2: @param aMirror williamr@2: ETrue to set mirroring on, EFalse to set mirroring off. williamr@2: williamr@2: @leave KErrNotSupported. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraV2DirectViewFinder williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual void SetViewFinderMirrorL(TBool aMirror)=0; williamr@2: williamr@2: /** williamr@2: Gets whether view finder mirroring is active. williamr@2: williamr@2: @return ETrue if mirroring is set, EFalse if mirroring is not set. williamr@2: williamr@2: @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to williamr@2: refer viewfinders started using CCamera methods. williamr@2: williamr@2: @see CCamera::CCameraV2DirectViewFinder williamr@2: @see CCamera::CCameraClientViewFinder williamr@2: */ williamr@2: virtual TBool ViewFinderMirror() const=0; williamr@2: williamr@2: /** williamr@2: Performs setup and allocation of memory. williamr@2: williamr@2: Called prior to calling CaptureImage() to keep the latency of that function williamr@2: to a minimum. williamr@2: williamr@2: Needs to be called only once for multiple CaptureImage() calls. May leave williamr@2: with KErrNotSupported or KErrNoMemory or KErrInUse or KErrNotReady. williamr@2: williamr@2: The specified image format must be one of the formats supported williamr@2: (see TCameraInfo::iImageFormatsSupported). williamr@2: williamr@2: The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 williamr@2: inclusive. williamr@2: williamr@2: @param aImageFormat williamr@2: The image format. williamr@2: @param aSizeIndex williamr@2: Size index. williamr@2: williamr@2: @leave KErrNotSupported williamr@2: @leave KErrNoMemory williamr@2: @leave KErrNotReady if PowerOn() hasn't been called successfully. williamr@2: williamr@2: @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters) williamr@2: */ williamr@2: virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex)=0; williamr@2: williamr@2: /** williamr@2: Performs setup and allocation of memory and clips the image to the specified williamr@2: rectangle. williamr@2: williamr@2: No effect unless TCameraInfo::iImageClippingSupported is set to ETrue. The williamr@2: image captured is the intersection of aClipRect and the rectangle from (0,0) williamr@2: to aSize. Needs to be called only once for multiple CaptureImage() calls. williamr@2: May leave with KErrNotSupported or KErrNoMemory. williamr@2: williamr@2: The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported). williamr@2: williamr@2: The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1 williamr@2: inclusive. williamr@2: williamr@2: @param aImageFormat williamr@2: The image format. williamr@2: @param aSizeIndex williamr@2: Size index. williamr@2: @param aClipRect williamr@2: The rectangle to which the image is to be clipped. williamr@2: williamr@2: @leave KErrNotSupported williamr@2: @leave KErrNoMemory williamr@2: @leave KErrInUse if Reserve() hasn't been called successfully williamr@2: @leave KErrNotReady if PowerOn() williamr@2: hasn't been called successfully. williamr@2: williamr@2: @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters) williamr@2: */ williamr@2: virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect)=0; williamr@2: williamr@2: /** williamr@2: Asynchronously performs still image capture. williamr@2: williamr@2: Calls MCameraObserver::ImageReady() when complete. williamr@2: williamr@2: @see CCamera::CCameraImageCapture williamr@2: @see CCamera::CCameraPreImageCaptureControl williamr@2: */ williamr@2: virtual void CaptureImage()=0; williamr@2: williamr@2: /** williamr@2: Cancels the asynchronous still image capture. williamr@2: williamr@2: @see CCamera::CCameraImageCapture williamr@2: */ williamr@2: virtual void CancelCaptureImage()=0; williamr@2: williamr@2: /** williamr@2: Enumerates through the available image capture sizes, based on the specified williamr@2: size index and format williamr@2: williamr@2: The size index must be in the range 0 to TCameraInfo::iNumImageSizesSupported-1 williamr@2: inclusive. williamr@2: williamr@2: @param aSize williamr@2: Image size. williamr@2: @param aSizeIndex williamr@2: Size index. williamr@2: @param aFormat williamr@2: The image format. williamr@2: */ williamr@2: virtual void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0; williamr@2: williamr@2: /** williamr@2: Prepares for video capture. williamr@2: williamr@2: Performs setup and allocation of memory prior to calling StartVideoCapture() williamr@2: to keep the latency of that function to a minimum. williamr@2: williamr@2: May leave with KErrNotSupported or KErrNoMemory. williamr@2: williamr@2: @param aFormat williamr@2: Format must be one of the video frame formats supported (see williamr@2: TCameraInfo::iVideoFrameFormatsSupported). williamr@2: @param aSizeIndex williamr@2: Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 williamr@2: inclusive. williamr@2: @param aRateIndex williamr@2: The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 williamr@2: inclusive. williamr@2: @param aBuffersToUse williamr@2: The number of discrete buffers to use. williamr@2: @param aFramesPerBuffer williamr@2: How large the buffers are to be. Must be less than williamr@2: or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned williamr@2: to MCameraObserver::FrameBufferReady() at a time. williamr@2: williamr@2: @leave May leave with KErrNotSupported, KErrNoMemory, or KErrNotReady if PowerOn() williamr@2: hasn't been called successfully. williamr@2: williamr@2: @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters) williamr@2: */ williamr@2: virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer)=0; williamr@2: williamr@2: /** williamr@2: Prepares for video capture and clips the frames to the given rectangle. williamr@2: williamr@2: Performs setup and allocation of memory prior to calling StartVideoCapture() williamr@2: to keep the latency of that function to a minimum. williamr@2: williamr@2: May leave with KErrNotSupported or KErrNoMemory. williamr@2: williamr@2: @param aFormat williamr@2: Format must be one of the video frame formats supported (see williamr@2: TCameraInfo::iVideoFrameFormatsSupported). williamr@2: @param aSizeIndex williamr@2: Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 williamr@2: inclusive. williamr@2: @param aRateIndex williamr@2: The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 williamr@2: inclusive. williamr@2: @param aBuffersToUse williamr@2: The number of discrete buffers to use. williamr@2: @param aFramesPerBuffer williamr@2: How large the buffers are to be. Must be less than williamr@2: or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned williamr@2: to MCameraObserver::FrameBufferReady() at a time. williamr@2: @param aClipRect williamr@2: The rectangle to which the image is to be clipped. williamr@2: @leave KErrNotSupported williamr@2: @leave KErrNoMemory, williamr@2: @leave KErrInUse if Reserve() hasn't been called successfully williamr@2: @leave KErrNotReady if PowerOn() hasn't been called successfully. williamr@2: williamr@2: @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters) williamr@2: */ williamr@2: virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect)=0; williamr@2: williamr@2: /** williamr@2: Starts capturing video. williamr@2: williamr@2: Calls MCameraObserver::FrameBufferReady() when each buffer has been filled williamr@2: with the required number of frames, as set by PrepareVideoCaptureL(). williamr@2: */ williamr@2: virtual void StartVideoCapture()=0; williamr@2: williamr@2: /** williamr@2: Stops video capture. williamr@2: */ williamr@2: virtual void StopVideoCapture()=0; williamr@2: williamr@2: /** williamr@2: Tests whether video capture is active. williamr@2: williamr@2: @return ETrue if video capture is active. EFalse if video capture is not active williamr@2: */ williamr@2: virtual TBool VideoCaptureActive() const=0; williamr@2: williamr@2: /** williamr@2: Enumerates through the available video frame sizes, based on the specified williamr@2: size index and format. williamr@2: williamr@2: @param aSize williamr@2: On return the available video frame sizes. Sizes should be returned williamr@2: in order, largest first, so clients do not have to iterate through every one. williamr@2: @param aSizeIndex williamr@2: Size index. Must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 williamr@2: inclusive williamr@2: @param aFormat williamr@2: Image format. williamr@2: */ williamr@2: virtual void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0; williamr@2: williamr@2: /** williamr@2: Enumerates through the available video frame rates, based on the specified williamr@2: rate index, video frame format, size index and exposure mode. williamr@2: williamr@2: @param aRate williamr@2: On return, the available video frame rates. Some rates may not williamr@2: be available due to, for example, current flash mode setting. In those cases williamr@2: a rate of 0 will be returned. Rates should be returned in order, highest first, williamr@2: so clients do not have to iterate through every one. williamr@2: @param aRateIndex williamr@2: The rate index. Must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 williamr@2: inclusive. williamr@2: @param aFormat williamr@2: The format. williamr@2: @param aSizeIndex williamr@2: The size index. williamr@2: @param aExposure williamr@2: The exposure mode. williamr@2: */ williamr@2: virtual void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const=0; williamr@2: williamr@2: /** williamr@2: Gets the frame size currently in use. williamr@2: williamr@2: @param aSize williamr@2: The frame size currently in use. williamr@2: */ williamr@2: virtual void GetFrameSize(TSize& aSize) const=0; williamr@2: williamr@2: /** williamr@2: Gets the frame rate currently in use. williamr@2: williamr@2: @return The frame rate currently in use. williamr@2: */ williamr@2: virtual TReal32 FrameRate() const=0; williamr@2: williamr@2: /** williamr@2: Gets the number of buffers currently in use. williamr@2: williamr@2: @return The number of buffers currently in use. williamr@2: */ williamr@2: virtual TInt BuffersInUse() const=0; williamr@2: williamr@2: /** williamr@2: Gets the number of frames per buffer currently in use. williamr@2: williamr@2: @return The number of frames per buffer currently in use. williamr@2: */ williamr@2: virtual TInt FramesPerBuffer() const=0; williamr@2: williamr@2: /** williamr@2: Sets the quality value to use if jpeg is a supported image for video format. williamr@2: williamr@2: Ignored if jpeg is not a supported image for video format. williamr@2: williamr@2: @param aQuality williamr@2: The quality value to use, clamped to the range 1 to 100. williamr@2: williamr@2: @see CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters::iImageMaxMemorySize williamr@2: */ williamr@2: virtual void SetJpegQuality(TInt aQuality)=0; williamr@2: williamr@2: /** williamr@2: Gets the currently set jpeg quality value. williamr@2: williamr@2: Returns 0 if not supported. williamr@2: williamr@2: @return The currently set jpeg quality value. williamr@2: williamr@2: @see CCamera::CCameraPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& aMemorySize) williamr@2: */ williamr@2: virtual TInt JpegQuality() const=0; williamr@2: williamr@2: /** williamr@2: Gets a custom interface. The client has to cast the returned pointer williamr@2: to the appropriate type. williamr@2: williamr@2: @param aInterface williamr@2: The Uid of the particular interface function required. williamr@2: williamr@2: @return Custom interface pointer. NULL if the requested interface is not supported. williamr@2: */ williamr@2: virtual TAny* CustomInterface(TUid aInterface)=0; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: williamr@2: Returns the camera API version no. williamr@2: */ williamr@2: IMPORT_C TInt CameraVersion(); williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: Default Constructor williamr@2: williamr@2: Prevents implementers from deriving from CCamera. williamr@2: Implementation requires derivation from CCameraPlugin instead. williamr@2: */ williamr@2: IMPORT_C CCamera(); williamr@2: }; williamr@2: williamr@2: /** williamr@2: Buffer class for passing video frames between camera and client. williamr@2: williamr@2: May contain multiple frames. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MFrameBuffer williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Gets a non-bitmap frame in the buffer. williamr@2: williamr@2: @param aIndex williamr@2: The index of the required, non-bitmap, frame. williamr@2: williamr@2: @leave KErrArgument if aIndex is out of range williamr@2: @leave KErrNotSupported if the frame format is bitmap. williamr@2: @return A pointer to the specified non-bitmap format frame of video data. williamr@2: */ williamr@2: virtual TDesC8* DataL(TInt aIndex)=0; williamr@2: williamr@2: /** williamr@2: Gets a bitmap frame in the buffer. williamr@2: williamr@2: @param aIndex williamr@2: The index of the required, bitmap format, frame. williamr@2: williamr@2: @leave KErrArgument if aIndex is out of range and williamr@2: @leave KErrNotSupported if williamr@2: the frame format is not a bitmap. williamr@2: @return A pointer to the specified bitmap format frame of video data. williamr@2: */ williamr@2: virtual CFbsBitmap* FrameL(TInt aIndex)=0; williamr@2: williamr@2: /** williamr@2: Releases the buffer for re-use by the camera once the client has processed williamr@2: the frame data. williamr@2: williamr@2: Signals to CCamera that the buffer data has been used and that the buffer williamr@2: is free for re-use. williamr@2: */ williamr@2: virtual void Release()=0; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: Sequential frame number of the first frame in the buffer, counting from when williamr@2: CCamera::StartVideoCapture() was called and including frames dropped due to williamr@2: lack of buffers. williamr@2: */ williamr@2: TInt iIndexOfFirstFrameInBuffer; williamr@2: williamr@2: /** williamr@2: Time elapsed from when CCamera::StartVideoCapture() was called until the first williamr@2: frame in the buffer was captured. williamr@2: */ williamr@2: TTimeIntervalMicroSeconds iElapsedTime; williamr@2: }; williamr@2: williamr@2: /** Specifies whether the camera is reserved or not. williamr@2: The enumeration list may be extended in future. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: enum TECamReserveStatus williamr@2: { williamr@2: /** Camera Status unknown */ williamr@2: ECameraStatusUnknown, williamr@2: /** Camera is reserved */ williamr@2: ECameraReserved, williamr@2: /** Camera is unreserved */ williamr@2: ECameraUnReserved williamr@2: }; williamr@2: williamr@2: /** Mixin base class for camera clients to handle the notification of Reserve status. williamr@2: williamr@2: Client must implement MReserveObserver in order to handle the notifications and take appropriate steps accordingly. williamr@2: williamr@2: @note By the time client gets unreserved status via callback, the camera may be on its way getting reserved by another client who williamr@2: might be continuously polling for it. williamr@2: So, there is no guarantee that the client will be able to reserve it. But it is guaranteed that the client will williamr@2: receive the notification about change in reserve status. williamr@2: williamr@2: @publishedPartner williamr@2: @prototype williamr@2: */ williamr@2: class MReserveObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: This notification is send to provide the reserve status for the camera. williamr@2: williamr@2: @param aCameraIndex williamr@2: The camera index for which the Reserve status has to be provided. williamr@2: williamr@2: @param aReserveStatus williamr@2: The reserve status for the camera. williamr@2: williamr@2: @param aErrorCode williamr@2: The error value. williamr@2: williamr@2: @note If error is not KErrNone, then the client is expected to destroy the CCameraStatusWatch retrieved through williamr@2: TReservedInfo::SubscribeReserveInfoL and re-subscribe if desired. williamr@2: */ williamr@2: virtual void ReserveStatus(TInt iCameraIndex, TECamReserveStatus aReserveStatus, TInt aErrorCode) =0; williamr@2: }; williamr@2: williamr@2: class CCameraStatusWatch; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @prototype williamr@2: williamr@2: Client uses it to asynchronously receive the reserve status of a camera index through MReserveObserver williamr@2: */ williamr@2: class TReservedInfo williamr@2: { williamr@2: public: williamr@2: IMPORT_C static void SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch); williamr@2: }; williamr@2: williamr@2: /** williamr@2: An active object class implemented by Symbian and used to subscribe for the updates in the Properties, retrieve the williamr@2: Properties and forward the notification to the client. williamr@2: williamr@2: @note Serialized part of the ECam implementation is assumed to define the Properties and publish them whenever there is williamr@2: change in the reserve status. williamr@2: */ williamr@2: class CCameraStatusWatch : public CActive williamr@2: { williamr@2: friend void TReservedInfo::SubscribeReserveInfoL(MReserveObserver& aReserveObserver, TInt aCameraIndex, CCameraStatusWatch*& aCameraStatusWatch); williamr@2: williamr@2: public: williamr@2: IMPORT_C ~CCameraStatusWatch(); williamr@2: williamr@2: private: williamr@2: static CCameraStatusWatch* NewL(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId); williamr@2: williamr@2: CCameraStatusWatch(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId); williamr@2: void ConstructL(); williamr@2: void RunL(); williamr@2: void DoCancel(); williamr@2: williamr@2: private: williamr@2: RProperty iProperty; williamr@2: MReserveObserver& iReserveObserver; williamr@2: TInt iCameraIndex; williamr@2: TInt iSecureId; williamr@2: }; williamr@2: williamr@2: #endif // ECAM_H