1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/imagingandcamerafws/camerafw/Include/ECam.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,1872 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedAll
1.22 + @released
1.23 +*/
1.24 +#ifndef ECAM_H
1.25 +#define ECAM_H
1.26 +
1.27 +#include <e32base.h>
1.28 +#include <ecamuids.hrh>
1.29 +#include <e32property.h>
1.30 +
1.31 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.32 +#include <ecamdef.h>
1.33 +#endif
1.34 +
1.35 +class MFrameBuffer;
1.36 +class RWsSession;
1.37 +class CWsScreenDevice;
1.38 +class RWindowBase;
1.39 +class CFbsBitmap;
1.40 +
1.41 +typedef TInt TPostCaptureControlId;
1.42 +
1.43 +/** Specifies camera device information.
1.44 +
1.45 +If either zoom or digital zoom are available then the appropriate entries
1.46 +in this class will be set to indicate the range of values that they may take.
1.47 +This should be implemented such that a setting of zero corresponds to no zoom,
1.48 +and a step of one corresponds to the smallest increment available, in a linear
1.49 +fashion.
1.50 +
1.51 +There are also zoom factors that correspond to the actual zoom factor when
1.52 +at minimum (non-digital only) and maximum zoom. Negative zoom values represent
1.53 +macro functionality.
1.54 +
1.55 +Image capture, if supported, is simply a case of transferring the current
1.56 +image from the camera to the client via MCameraObserver::ImageReady(). The
1.57 +camera class must set the iImageFormatsSupported bitfield to indicate the
1.58 +formats available.
1.59 +
1.60 +@publishedAll
1.61 +@released
1.62 +*/
1.63 +class TCameraInfo
1.64 + {
1.65 +public:
1.66 + /** Possible directions in which the camera may point.
1.67 + */
1.68 + enum TCameraOrientation
1.69 + {
1.70 + /** Outward pointing camera for taking pictures.
1.71 + Camera is directed away from the user. */
1.72 + EOrientationOutwards,
1.73 + /** Inward pointing camera for conferencing.
1.74 + Camera is directed towards the user. */
1.75 + EOrientationInwards,
1.76 + /** Mobile camera capable of multiple orientations.
1.77 + Camera orientation may be changed by the user. */
1.78 + EOrientationMobile,
1.79 + /** Camera orientation is not known. */
1.80 + EOrientationUnknown
1.81 + };
1.82 +
1.83 + /** Various flags describing the features available for a particular implementation
1.84 + */
1.85 + enum TOptions
1.86 + {
1.87 + /** View finder display direct-to-screen flag */
1.88 + EViewFinderDirectSupported = 0x0001,
1.89 + /** View finder bitmap generation flag */
1.90 + EViewFinderBitmapsSupported = 0x0002,
1.91 + /** Still image capture flag */
1.92 + EImageCaptureSupported = 0x0004,
1.93 + /** Video capture flag */
1.94 + EVideoCaptureSupported = 0x0008,
1.95 + /** View finder display mirroring flag */
1.96 + EViewFinderMirrorSupported = 0x0010,
1.97 + /** Contrast setting flag */
1.98 + EContrastSupported = 0x0020,
1.99 + /** Brightness setting flag */
1.100 + EBrightnessSupported = 0x0040,
1.101 + /** View finder clipping flag */
1.102 + EViewFinderClippingSupported = 0x0080,
1.103 + /** Still image capture clipping flag */
1.104 + EImageClippingSupported = 0x0100,
1.105 + /** Video capture clipping flag */
1.106 + EVideoClippingSupported = 0x0200
1.107 + };
1.108 +public:
1.109 + /** Version number and name of camera hardware. */
1.110 + TVersion iHardwareVersion;
1.111 + /** Version number and name of camera software (device driver). */
1.112 + TVersion iSoftwareVersion;
1.113 + /** Orientation of this particular camera device. */
1.114 + TCameraOrientation iOrientation;
1.115 +
1.116 + /** Bitfield of TOptions available */
1.117 + TUint32 iOptionsSupported;
1.118 + /** The supported flash modes.
1.119 +
1.120 + This is a bitfield of CCamera::TFlash values.
1.121 +
1.122 + If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the
1.123 + application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed
1.124 + from the implementation should be filtered by ECAM Implementation.
1.125 + To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L()
1.126 + to create camera object. This is an indication to ECAM implementation. In this case, application is assumed
1.127 + to be prepared to receive unrecognised enum values.
1.128 + @see CCamera::CCameraAdvancedSettings::SupportedFlashModes()
1.129 +
1.130 + */
1.131 + TUint32 iFlashModesSupported;
1.132 + /** The supported exposure modes.
1.133 +
1.134 + This is a bitfield of CCamera::TExposure values. */
1.135 + TUint32 iExposureModesSupported;
1.136 +
1.137 + /** The supported white balance settings.
1.138 +
1.139 + This is a bitfield of of CCamera::TWhiteBalance values.
1.140 +
1.141 + If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the
1.142 + application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed
1.143 + from the implementation should be filtered by ECAM Implementation.
1.144 + To receive unrecognised/extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L()
1.145 + to create camera object. This is an indication to ECAM implementation. In this case, application is assumed
1.146 + to be prepared to receive unrecognised enum values.
1.147 + Refer to CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes() implementation
1.148 +
1.149 + @see CCamera::CCameraAdvancedSettings::SupportedWhiteBalanceModes()
1.150 + */
1.151 + TUint32 iWhiteBalanceModesSupported;
1.152 +
1.153 + /** Minimum zoom value allowed.
1.154 +
1.155 + Must be negative, or zero if not supported.
1.156 +
1.157 + This is the minimum value that may be passed to CCamera::SetZoomFactorL(). */
1.158 + TInt iMinZoom;
1.159 + /** Maximum zoom value allowed.
1.160 +
1.161 + Must be positive, or zero if not supported.
1.162 +
1.163 + This is the maximum value that may be passed to CCamera::SetZoomFactorL(). */
1.164 + TInt iMaxZoom;
1.165 + /** Maximum digital zoom value allowed.
1.166 +
1.167 + Must be positive, or zero if not supported.
1.168 +
1.169 + This is the maximum value that may be passed to CCamera::SetDigitalZoomFactorL().
1.170 + Digital zoom factor is assumed to be a linear scale from 0 to iMaxDigitalZoom. */
1.171 + TInt iMaxDigitalZoom;
1.172 +
1.173 + /** Image size multiplier corresponding to minimum zoom value.
1.174 +
1.175 + Must be between 0 and 1 inclusive. Both 0 and 1 indicate that macro functionality
1.176 + is not supported. */
1.177 + TReal32 iMinZoomFactor;
1.178 + /** Image size multiplier corresponding to maximum zoom value.
1.179 +
1.180 + May take the value 0, or values greater than or equal to 1. Both 0 and 1 indicate
1.181 + that zoom functionality is not supported. */
1.182 + TReal32 iMaxZoomFactor;
1.183 + /** Image size multiplier corresponding to maximum digital zoom value.
1.184 +
1.185 + Implementation recommendation is to use 'appropriate value' for maximum digital zoom which could cover only values
1.186 + given by new digital zoom methods based on image format and capture mode.
1.187 +
1.188 + Must be greater than or equal to 1. */
1.189 + TReal32 iMaxDigitalZoomFactor;
1.190 +
1.191 + /** Count of still image capture sizes allowed.
1.192 +
1.193 + Number of different image sizes that CCamera::EnumerateCaptureSizes() will
1.194 + support, based on the index passed in. Index must be between 0 and iNumImageSizesSupported-1. */
1.195 + TInt iNumImageSizesSupported;
1.196 + /** The supported still image formats.
1.197 +
1.198 + This is a bitfield of CCamera::TFormat values. */
1.199 + TUint32 iImageFormatsSupported;
1.200 +
1.201 + /** Count of video frame sizes allowed.
1.202 +
1.203 + This is the number of different video frame sizes that CCamera::EnumerateVideoFrameSizes()
1.204 + will support, based on the specified index. The index must be between 0 and
1.205 + iNumVideoFrameSizesSupported-1. */
1.206 + TInt iNumVideoFrameSizesSupported;
1.207 + /** Count of video frame rates allowed.
1.208 +
1.209 + This is the number of different video frame rates that CCamera::EnumerateVideoFrameRates()
1.210 + will support, based on the specified index. The index must be between 0 and
1.211 + iNumVideoFrameRatesSupported-1. */
1.212 + TInt iNumVideoFrameRatesSupported;
1.213 + /** The supported video frame formats.
1.214 +
1.215 + This is a bitfield of video frame CCamera::TFormat values.
1.216 +
1.217 + If methods CCamera::New2L() or CCamera::NewDuplicate2L() are not used to create the CCamera object, it is assumed that the
1.218 + application may not be able to cope with any future additions to the enum values. So, any unrecognised enum value passed
1.219 + from the implementation should be filtered by the ECAM implementation.
1.220 + To receive unrecognised/extra added enum values, the application should rather use CCamera::New2L() or CCamera::NewDuplicate2L()
1.221 + to create the camera object. This is an indication to the ECAM implementation. In this case, the application is assumed
1.222 + to be prepared to receive unrecognised enum values.
1.223 + */
1.224 + TUint32 iVideoFrameFormatsSupported;
1.225 + /** Maximum number of frames per buffer that may be requested. */
1.226 + TInt iMaxFramesPerBufferSupported;
1.227 + /** Maximum number of buffers allowed */
1.228 + TInt iMaxBuffersSupported;
1.229 + };
1.230 +
1.231 +/** Mixin base class for camera clients.
1.232 +
1.233 +An application must implement an MCameraObserver or MCameraObserver2 (recommended)
1.234 +in order to use the camera API. This derived class is called when the camera is
1.235 +ready for use, an image has been captured or a buffer of video data is ready, including
1.236 +when errors occur.
1.237 +
1.238 +Implementations of the camera API should use MCameraObserver::FrameBufferReady()
1.239 +and MFrameBuffer::Release() to co-ordinate the mapping of any special memory
1.240 +objects.
1.241 +
1.242 +@publishedAll
1.243 +@released
1.244 +*/
1.245 +class MCameraObserver
1.246 + {
1.247 +public:
1.248 + /** Camera reservation is complete.
1.249 +
1.250 + Called asynchronously when CCamera::Reserve() completes.
1.251 +
1.252 + @param aError
1.253 + An error on failure and KErrNone on success.
1.254 + */
1.255 + virtual void ReserveComplete(TInt aError)=0;
1.256 +
1.257 + /** Indicates camera power on is complete.
1.258 +
1.259 + Called on completion of CCamera:PowerOn().
1.260 +
1.261 + @param aError
1.262 + KErrNone on success, KErrInUse if the camera is in
1.263 + use by another client or KErrNoMemory if insufficient system memory is available.
1.264 + */
1.265 + virtual void PowerOnComplete(TInt aError)=0;
1.266 +
1.267 + /** Tests whether transfer of view finder data has completed.
1.268 +
1.269 + Called periodically in response to the use of CCamera::StartViewFinderBitmapsL().
1.270 +
1.271 + @param aFrame
1.272 + The view finder frame.
1.273 + */
1.274 + virtual void ViewFinderFrameReady(CFbsBitmap& aFrame)=0;
1.275 +
1.276 + /** Transfers the current image from the camera to the client.
1.277 +
1.278 + Called asynchronously when CCamera::CaptureImage() completes.
1.279 +
1.280 + @param aBitmap
1.281 + On return, a pointer to an image held in CFbsBitmap form if
1.282 + this was the format specified in CCamera::PrepareImageCaptureL().
1.283 + @param aData
1.284 + On return, a pointer to an HBufC8 if this was the format specified
1.285 + in CCamera::PrepareImageCaptureL(). NULL if there was an error.
1.286 + @param aError
1.287 + KErrNone on success or an error code on failure.
1.288 + */
1.289 + virtual void ImageReady(CFbsBitmap* aBitmap,HBufC8* aData,TInt aError)=0;
1.290 +
1.291 + /** Passes a filled frame buffer to the client.
1.292 +
1.293 + Called asynchronously, when a buffer has been filled with the required number
1.294 + of video frames by CCamera::StartVideoCapture().
1.295 +
1.296 + @param aFrameBuffer
1.297 + On return, a pointer to an MFrameBuffer if successful,
1.298 + or NULL if not successful.
1.299 + @param aError
1.300 + KErrNone if successful, or an error code if not successful.
1.301 + */
1.302 + virtual void FrameBufferReady(MFrameBuffer* aFrameBuffer,TInt aError)=0;
1.303 + };
1.304 +
1.305 +
1.306 +/**
1.307 +Class used for passing camera picture data between camera and client in the V2 observer.
1.308 +Used for viewfinder, image capture and video capture.
1.309 +
1.310 +The class offers APIs for the client to access the data as a descriptor, a bitmap
1.311 +or a handle to a kernel chunk. Depending on the format previously requested by
1.312 +the client, one or more of the API choices may be inappropriate e.g. an image will
1.313 +not be avaiable as a bitmap in the FBS unless the client has specifically requested
1.314 +it.
1.315 +
1.316 +The buffer may contain multiple frames.
1.317 +
1.318 +@publishedAll
1.319 +@released
1.320 +*/
1.321 +class MCameraBuffer
1.322 + {
1.323 +public:
1.324 + /**
1.325 + Returns the number of frames of image data contained within the buffer. This
1.326 + would be 1 for a image capture, and match the requested count
1.327 + for video capture. For other methods in this class that take a aFrameIndex
1.328 + param, 0 <= aFrameIndex < NumFrames()
1.329 +
1.330 + @return The number of frames of image data in the buffer.
1.331 + */
1.332 + virtual TInt NumFrames()=0;
1.333 + /**
1.334 + Returns a pointer to a descriptor containing a frame of camera data. The format
1.335 + will have been previously specified by a CCamera class method.
1.336 +
1.337 + @param aFrameIndex
1.338 + The index of the required frame. For a still image this should be 0.
1.339 +
1.340 + @leave KErrArgument if aIndex is out of range and
1.341 + @leave KErrNotSupported if the camera data is actually bitmaps in the FBS.
1.342 +
1.343 + @return A pointer to a descriptor containing a frame of image data.
1.344 + */
1.345 + virtual TDesC8* DataL(TInt aFrameIndex)=0;
1.346 +
1.347 + /**
1.348 + Returns a reference to a FBS bitmap containing a frame of image data.
1.349 +
1.350 + @param aFrameIndex
1.351 + The index of the required frame. For a still image this should be 0.
1.352 +
1.353 + @leave KErrArgument if aIndex is out of range and
1.354 + @leave KErrNotSupported if the picture data is not a FBS bitmap.
1.355 +
1.356 + @return A reference to a FBS bitmap containing a frame of picture data.
1.357 + */
1.358 + virtual CFbsBitmap& BitmapL(TInt aFrameIndex)=0;
1.359 +
1.360 + /**
1.361 + Returns a handle for the chunk that contains the camera data.
1.362 + The RChunk is exposed so that it can potentially be shared between multiple
1.363 + processes.
1.364 + The ptr returned by DataL(aFrameIndex) is effectively derived from this
1.365 + RChunk (where both are supported simulataneously). The equivalent ptr would be:
1.366 + TPtrC8* ptr;
1.367 + ptr.Set(ChunkL().Base() + ChunkOffset(aFrameIndex), FrameSize(aFrameIndex));
1.368 +
1.369 + @leave KErrNotSupported if the chunk is not available.
1.370 +
1.371 + @return A reference to a handle to the chunk that contains the buffer of picture data.
1.372 + */
1.373 + virtual RChunk& ChunkL()=0;
1.374 +
1.375 + /**
1.376 + Returns the offset into the chunk that contains the frame specified by aFrameIndex.
1.377 + The client would add this offset to the ptr returned by ChunkL().Base() to
1.378 + get the address of the start of the frame data.
1.379 +
1.380 + @param aIndex
1.381 + The index of the required frame. For a still image this should be 0.
1.382 +
1.383 + @leave KErrNotSupported if the chunk is not available
1.384 + @leave KErrArgument if aIndex is out of range.
1.385 +
1.386 + @return The offset into the chunk for the start of the frame.
1.387 + */
1.388 + virtual TInt ChunkOffsetL(TInt aFrameIndex)=0;
1.389 +
1.390 + /**
1.391 + Returns the size of the data in bytes that comprises the frame specified by aIndex.
1.392 +
1.393 + @param aFrameIndex
1.394 + The index of the required frame. For a still image this should be 0.
1.395 +
1.396 + @leave KErrArgument
1.397 + if aIndex is out of range.
1.398 +
1.399 + @return Returns the size of the data in bytes that comprises the frame.
1.400 + */
1.401 + virtual TInt FrameSize(TInt aFrameIndex)=0;
1.402 +
1.403 + /**
1.404 + Releases the buffer. Once the client has processed
1.405 + the picture data it should use this method to signal to CCamera that the
1.406 + buffer can be re-used.
1.407 + */
1.408 + virtual void Release()=0;
1.409 +public:
1.410 +
1.411 + /**
1.412 + Sequential frame number of the first frame in the buffer, counting from when
1.413 + CCamera::StartVideoCapture() was called and including frames dropped due to
1.414 + lack of buffers. Always zero for still images. May also be used by client viewfinders.
1.415 + */
1.416 + TInt iIndexOfFirstFrameInBuffer;
1.417 +
1.418 + /**
1.419 + Time elapsed from when CCamera::StartVideoCapture() was called until the first
1.420 + frame in the buffer was captured. Always zero for still images.
1.421 + */
1.422 + TTimeIntervalMicroSeconds iElapsedTime;
1.423 + };
1.424 +
1.425 +/**
1.426 + Uid used to identify the event that the request to Reserve() has completed
1.427 +*/
1.428 +static const TUid KUidECamEventReserveComplete = {0x101F7D3B};
1.429 +
1.430 +/**
1.431 + Uid used to identify the event that the request to PowerOn() has completed
1.432 +*/
1.433 +static const TUid KUidECamEventPowerOnComplete = {0x101F7D3C};
1.434 +
1.435 +/**
1.436 + Uid used to identify the event that the client has lost
1.437 + control of the camera
1.438 +*/
1.439 +static const TUid KUidECamEventCameraNoLongerReserved = {0x101F7D3D};
1.440 +
1.441 +/**
1.442 +Uid used to notify the client who made the new reserve request.
1.443 +
1.444 +Error value KErrECamHighPriorityReserveRequesterExists indicates another such reserve request is outstanding and
1.445 +has higher priority than this one.
1.446 +Error value KErrCancel indicates a new reserve requester with higher priority than the current requester has
1.447 +been made. That's why, this one got cancelled.
1.448 +Any other error may also occur.
1.449 +@see CCamera::CCameraAdvancedSettings::ReserveL(const TTimeIntervalMicroseconds32& aMaxTimeToWait, TBool aKickOut);
1.450 +*/
1.451 +static const TUid KUidECamEventNewReserveComplete = {KUidECamEventNewReserveCompleteUidValue};
1.452 +
1.453 +/**
1.454 +@publishedAll
1.455 +@released
1.456 +
1.457 +General purpose class to describe an ECam event.
1.458 +
1.459 +Contains a UID to define the actual event type, and an integer to define the event code.
1.460 +
1.461 +*/
1.462 +
1.463 +class TECAMEvent
1.464 + {
1.465 +public:
1.466 +
1.467 + /**
1.468 + Constructor.
1.469 +
1.470 + @param aEventType
1.471 + A UID to define the type of event.
1.472 + @param aErrorCode
1.473 + The error code associated with the event.
1.474 +
1.475 + */
1.476 + IMPORT_C TECAMEvent(TUid aEventType, TInt aErrorCode);
1.477 +
1.478 + /**
1.479 + Default constructor.
1.480 +
1.481 + Provided so this class can be packaged in a TPckgBuf<>.
1.482 + */
1.483 + IMPORT_C TECAMEvent();
1.484 +
1.485 + /**
1.486 + A UID to define the event type.
1.487 + */
1.488 + TUid iEventType;
1.489 +
1.490 + /**
1.491 + The error code associated with the event.
1.492 + */
1.493 + TInt iErrorCode;
1.494 + };
1.495 +
1.496 +/**
1.497 +Uid used to identify a particular version of TECAMEvent base class being used i.e. TECAMEvent2 .
1.498 +Useful for MCameraObserver2::HandleEvent implementation to detect the version of TECAMEvent base class.
1.499 +*/
1.500 +static const TUid KUidECamEventClass2 = {KUidECamEventClass2UidValue};
1.501 +
1.502 +/**
1.503 +event indicating setting of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing.
1.504 +This event should be packed in TECAMEvent2 class.
1.505 +
1.506 +@note TECAMEvent2::iParam represents color entry.
1.507 +*/
1.508 +static const TUid KUidECamEventCIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue};
1.509 +static const TUid KUidECamEvent2CIPSetColorSwapEntry = {KUidECamEventCIPSetColorSwapEntryUidValue};
1.510 +
1.511 +/**
1.512 +event indicating removal of color entry in the color swap operation. This is a part of class CCamera::CCameraImageProcessing.
1.513 +This event should be packed in TECAMEvent2 class.
1.514 +
1.515 +@note TECAMEvent2::iParam represents color entry.
1.516 +*/
1.517 +static const TUid KUidECamEventCIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue};
1.518 +static const TUid KUidECamEvent2CIPRemoveColorSwapEntry = {KUidECamEventCIPRemoveColorSwapEntryUidValue};
1.519 +
1.520 +/**
1.521 +event indicating setting of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing.
1.522 +This event should be packed in TECAMEvent2 class.
1.523 +
1.524 +@note TECAMEvent2::iParam represents color entry.
1.525 +*/
1.526 +static const TUid KUidECamEventCIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue};
1.527 +static const TUid KUidECamEvent2CIPSetColorAccentEntry = {KUidECamEventCIPSetColorAccentEntryUidValue};
1.528 +
1.529 +/**
1.530 +event indicating removal of color entry in the color accent operation. This is a part of class CCamera::CCameraImageProcessing.
1.531 +This event should be packed in TECAMEvent2 class.
1.532 +
1.533 +@note TECAMEvent2::iParam represents color entry.
1.534 +*/
1.535 +static const TUid KUidECamEventCIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue};
1.536 +static const TUid KUidECamEvent2CIPRemoveColorAccentEntry = {KUidECamEventCIPRemoveColorAccentEntryUidValue};
1.537 +
1.538 +/**
1.539 +event indicating issue of pre capture warnings. This is a part of class CCamera::CCameraAdvancedSettings.
1.540 +This event should be packed in TECAMEvent2 class.
1.541 +
1.542 +This TUid is available from the following methods only to the API clients using CCamera::New2L() or CCamera::
1.543 +NewDuplicate2L():-
1.544 +void CCamera::CCameraAdvancedSettings::GetSupportedSettingsL(RArray<TUid>& aSettings) const;
1.545 +void CCamera::CCameraAdvancedSettings::GetActiveSettingsL(RArray<TUid>& aActiveSettings) const;
1.546 +void CCamera::CCameraAdvancedSettings::GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const;
1.547 +
1.548 +@note TECAMEvent2::iParam represents bit field describing all PreCaptureWarnings currently issued.
1.549 +*/
1.550 +static const TUid KUidECamEventCameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue};
1.551 +static const TUid KUidECamEvent2CameraSettingPreCaptureWarning = {KUidECamEventCameraSettingPreCaptureWarningUidValue};
1.552 +
1.553 +/**
1.554 +Special type of TECAMEvent class used to retrieve some extra information from particular events received
1.555 +
1.556 +@publishedAll
1.557 +@released
1.558 +*/
1.559 +class TECAMEvent2 : public TECAMEvent
1.560 + {
1.561 +public:
1.562 +
1.563 + IMPORT_C static TBool IsEventEncapsulationValid(const TECAMEvent& aECAMEvent);
1.564 +
1.565 + IMPORT_C TECAMEvent2(TUid aEventType, TInt aErrorCode, TInt aParam);
1.566 +
1.567 + IMPORT_C const TUid& EventClassUsed() const;
1.568 +
1.569 +private:
1.570 + /**
1.571 + Uid representing this version of TECAMEvent base class. Uid used is KUidECamEventClass2
1.572 + */
1.573 + TUid iEventClassUsed;
1.574 +
1.575 + /**
1.576 + Reserved for future
1.577 + TInt iReserved1; -> Made Public TInt iParam1
1.578 + */
1.579 +
1.580 + /**
1.581 + Reserved for future
1.582 + */
1.583 + TInt iReserved2;
1.584 +
1.585 +
1.586 +public:
1.587 + /**
1.588 + iParam1 will be used to provide extra information if iParam is not sufficient.
1.589 + This signifies different things for different valid events.
1.590 +
1.591 + Future events may also use this class member variable.
1.592 + */
1.593 + TInt iParam1;
1.594 +
1.595 + /**
1.596 + This signifies different things for different valid events.
1.597 +
1.598 + Future events may also use this class member variable.
1.599 + */
1.600 + TInt iParam;
1.601 + };
1.602 +
1.603 +/** Mixin base class V2 for camera clients.
1.604 +
1.605 +An application must implement an MCameraObserver2 (or MCameraObserver) in order to use the camera
1.606 +API. This derived class is called when the camera is ready for use, an image
1.607 +has been captured or a buffer of video data is ready, including when errors
1.608 +occur.
1.609 +
1.610 +@publishedAll
1.611 +@released
1.612 +*/
1.613 +
1.614 +class MCameraObserver2
1.615 + {
1.616 +public:
1.617 + /**
1.618 + A camera event has completed.
1.619 + @note Implementations of MCameraObserver2 should ignore events which are not recognised and should not leave.
1.620 +
1.621 + @param aEvent
1.622 + A reference to a TECAMEvent. This can be completion of a call to Reserve()
1.623 + or a call to PowerOn() or a notification that the client has lost control
1.624 + of the camera.
1.625 + The event contains a uid identifying the event and an accompanying
1.626 + error code (KErrNone for the successful completion of a request).
1.627 + The error will be KErrNotReady for a request that was made out of the
1.628 + correct sequence.
1.629 + The error will be KErrAccessDenied for a Reserve() request that failed
1.630 + because a higher priority client already controls the camera.
1.631 +
1.632 + @note This may internally call TECAMEvent2::IsEventEncapsulationValid(aEvent) and also for any other derived version of TECAMEvent
1.633 + class to know whether correct version of TECAMEvent base class has been used.
1.634 + */
1.635 + virtual void HandleEvent(const TECAMEvent& aEvent)=0;
1.636 +
1.637 + /**
1.638 + Notifies client of new view finder data. Called periodically in response to
1.639 + the use of CCamera::StartViewFinderL().
1.640 +
1.641 + @param aCameraBuffer
1.642 + A reference to an MCameraBuffer if successful, or NULL if not successful.
1.643 +
1.644 + @param aError
1.645 + KErrNone if successful, or an error code if not successful.
1.646 + */
1.647 + virtual void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
1.648 +
1.649 + /**
1.650 + Notifies the client of a new captured camera image. Called asynchronously
1.651 + when CCamera::CaptureImage() completes.
1.652 +
1.653 + @param aCameraBuffer
1.654 + A reference to an MCameraBuffer if successful, or NULL if not successful.
1.655 +
1.656 + @param aError
1.657 + KErrNone if successful, or an error code if not successful.
1.658 +
1.659 + @note If new image capture classes used, then this callback will not be used. Refer MCaptureImageObserver
1.660 + */
1.661 + virtual void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
1.662 +
1.663 + /**
1.664 + Notifies the client of new captured video. Called asynchronously and periodically
1.665 + after CCamera::StartVideoCapture() is called. The buffer has been filled with the
1.666 + required number of video frames specified PrepareVideoCaptureL().
1.667 +
1.668 + @param aCameraBuffer
1.669 + A reference to an MCameraBuffer if successful, or NULL if not successful.
1.670 +
1.671 + @param aError
1.672 + KErrNone if successful, or an error code if not successful.
1.673 + */
1.674 + virtual void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)=0;
1.675 + };
1.676 +
1.677 +
1.678 +/** Base class for camera devices.
1.679 +
1.680 +Provides the interface that an application uses to control, and acquire images
1.681 +from, the camera.
1.682 +
1.683 +An application must supply an implementation of MCameraObserver2 (or MCameraObserver).
1.684 +
1.685 +@publishedAll
1.686 +@released
1.687 +*/
1.688 +class CCamera : public CBase
1.689 +
1.690 + {
1.691 +
1.692 + friend class CCameraPlugin;
1.693 +
1.694 +public:
1.695 + class CCameraPresets;
1.696 + class CCameraAdvancedSettings;
1.697 + class CCameraImageProcessing;
1.698 + class CCameraHistogram;
1.699 + class CCameraV2Histogram;
1.700 + class CCameraOverlay;
1.701 + class CCameraSnapshot;
1.702 + class CCameraDirectViewFinder;
1.703 + class CCameraV2DirectViewFinder;
1.704 + class CCameraClientViewFinder;
1.705 + class CCameraPreImageCaptureControl;
1.706 + class CCameraImageCapture;
1.707 + class CCameraPostImageCaptureControl;
1.708 + class CCameraVideoCaptureControl;
1.709 + class CCameraDirectSnapshot;
1.710 + class CCameraContinuousZoom;
1.711 +
1.712 +public:
1.713 + /** Possible still image and video frame formats
1.714 +
1.715 + Formats are read from left to right, starting at the top of the image. YUV
1.716 + format is as defined by ITU-R BT.601-4. */
1.717 + enum TFormat
1.718 + {
1.719 + /** 8 bit greyscale values, 0=black, 255=white. */
1.720 + EFormatMonochrome = 0x0001,
1.721 + /** Packed RGB triplets, 4 bits per pixel with red in the least significant bits
1.722 + and the 4 most significant bits unused. */
1.723 + EFormat16bitRGB444 = 0x0002,
1.724 + /** Packed RGB triplets, 5 bits per pixel for red and blue and 6 bits for green,
1.725 + with red in the least significant bits. */
1.726 + EFormat16BitRGB565 = 0x0004,
1.727 + /** Packed RGB triplets, 8 bits per pixel with red in the least significant bits
1.728 + and the 8 most significant bits unused. */
1.729 + EFormat32BitRGB888 = 0x0008,
1.730 + /** JFIF JPEG. */
1.731 + EFormatJpeg = 0x0010,
1.732 + /** EXIF JPEG */
1.733 + EFormatExif = 0x0020,
1.734 + /** CFbsBitmap object with display mode EColor4K. */
1.735 + EFormatFbsBitmapColor4K = 0x0040,
1.736 + /** CFbsBitmap object with display mode EColor64K. */
1.737 + EFormatFbsBitmapColor64K = 0x0080,
1.738 + /** CFbsBitmap object with display mode EColor16M. */
1.739 + EFormatFbsBitmapColor16M = 0x0100,
1.740 + /** Implementation dependent. */
1.741 + EFormatUserDefined = 0x0200,
1.742 + /** 4:2:0 format, 8 bits per sample, Y00Y01Y10Y11UV. */
1.743 + EFormatYUV420Interleaved = 0x0400,
1.744 + /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0...V0... */
1.745 + EFormatYUV420Planar = 0x0800,
1.746 + /** 4:2:2 format, 8 bits per sample, UY0VY1. Maps to Graphics' EUidPixelFormatYUV_422Interleaved in pixelformats.h. */
1.747 + EFormatYUV422 = 0x1000,
1.748 + /** 4:2:2 format, 8 bits per sample, Y1VY0U. Maps to Graphics' EUidPixelFormatYUV_422InterleavedReversed in pixelformats.h. */
1.749 + EFormatYUV422Reversed = 0x2000,
1.750 + /** 4:4:4 format, 8 bits per sample, Y00U00V00 Y01U01V01... */
1.751 + EFormatYUV444 = 0x4000,
1.752 + /** 4:2:0 format, 8 bits per sample, Y00Y01Y02Y03...U0V0... */
1.753 + EFormatYUV420SemiPlanar = 0x8000,
1.754 + /** CFbsBitmap object with display mode EColor16MU. */
1.755 + EFormatFbsBitmapColor16MU = 0x00010000,
1.756 + /** Motion JPEG for video
1.757 + @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L().
1.758 + @internalTechnology
1.759 + */
1.760 + EFormatMJPEG = 0x00020000,
1.761 +
1.762 + /**
1.763 + Compressed H264 video format.
1.764 + @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L().
1.765 + @prototype
1.766 + */
1.767 + EFormatEncodedH264 = 0x00040000,
1.768 +
1.769 + /**
1.770 + 4:2:2 format, 8 bits per sample, Y0UY1V. Maps to Graphics' EUidPixelFormatYUV_422Reversed in pixelformats.h.
1.771 + @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L().
1.772 + @prototype
1.773 + */
1.774 + EFormatYUV222ReversedV2 = 0x00080000
1.775 + };
1.776 +
1.777 + /** Specifies whether contrast is set automatically. */
1.778 + enum TContrast
1.779 + {
1.780 + /** Sets the contrast automatically. */
1.781 + EContrastAuto = KMinTInt
1.782 + };
1.783 + /** Specifies whether brightness is set automatically. */
1.784 + enum TBrightness
1.785 + {
1.786 + /** Sets the brightness automatically. */
1.787 + EBrightnessAuto = KMinTInt
1.788 + };
1.789 + /** Specifies the type of flash. */
1.790 + enum TFlash
1.791 + {
1.792 + /** No flash, always supported. */
1.793 + EFlashNone = 0x0000,
1.794 + /** Flash will automatically fire when required. */
1.795 + EFlashAuto = 0x0001,
1.796 + /** Flash will always fire. */
1.797 + EFlashForced = 0x0002,
1.798 + /** Reduced flash for general lighting */
1.799 + EFlashFillIn = 0x0004,
1.800 + /** Red-eye reduction mode. */
1.801 + EFlashRedEyeReduce = 0x0008,
1.802 + /** Flash at the moment when shutter opens. */
1.803 + EFlashSlowFrontSync = 0x0010,
1.804 + /** Flash at the moment when shutter closes. */
1.805 + EFlashSlowRearSync = 0x0020,
1.806 + /** User configurable setting */
1.807 + EFlashManual = 0x0040,
1.808 + /** Constant emission of light during video mode
1.809 + @note This value is available only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L()
1.810 + */
1.811 + EFlashVideoLight = 0x0080
1.812 + };
1.813 + /** Specifies the type of exposure. - EExposureAuto is the default value. */
1.814 + enum TExposure
1.815 + {
1.816 + /** Set exposure automatically. Default, always supported.
1.817 + This may imply auto aperture so clients may receive a KUidEcamEvent2CameraSettingAutoAperture event notification some time later. */
1.818 + EExposureAuto = 0x0000,
1.819 + /** Night-time setting for long exposures. */
1.820 + EExposureNight = 0x0001,
1.821 + /** Backlight setting for bright backgrounds. */
1.822 + EExposureBacklight = 0x0002,
1.823 + /** Centered mode for ignoring surroundings. */
1.824 + EExposureCenter = 0x0004,
1.825 + /** Sport setting for very short exposures. */
1.826 + EExposureSport = 0x0008,
1.827 + /** Generalised setting for very long exposures. */
1.828 + EExposureVeryLong = 0x0010,
1.829 + /** Snow setting for daylight exposure. */
1.830 + EExposureSnow = 0x0020,
1.831 + /** Beach setting for daylight exposure with reflective glare. */
1.832 + EExposureBeach = 0x0040,
1.833 + /** Programmed exposure setting. */
1.834 + EExposureProgram = 0x0080,
1.835 + /** Aperture setting is given priority. */
1.836 + EExposureAperturePriority = 0x0100,
1.837 + /** Shutter speed setting is given priority.
1.838 + This may imply auto aperture so clients may receive a KUidEcamEvent2CameraSettingAutoAperture event notification some time later. */
1.839 + EExposureShutterPriority = 0x0200,
1.840 + /** User selectable exposure value setting. */
1.841 + EExposureManual = 0x0400,
1.842 + /** Exposure night setting with colour removed to get rid of colour noise. */
1.843 + EExposureSuperNight = 0x0800,
1.844 + /** Exposure for infra-red sensor on the camera */
1.845 + EExposureInfra = 0x1000
1.846 + };
1.847 +
1.848 + /** Specifies how the white balance is set. */
1.849 + enum TWhiteBalance
1.850 + {
1.851 + /** Set white balance automatically. Default, always supported. */
1.852 + EWBAuto = 0x0000,
1.853 + /** Normal daylight. */
1.854 + EWBDaylight = 0x0001,
1.855 + /** Overcast daylight. */
1.856 + EWBCloudy = 0x0002,
1.857 + /** Tungsten filament lighting. */
1.858 + EWBTungsten = 0x0004,
1.859 + /** Fluorescent tube lighting */
1.860 + EWBFluorescent = 0x0008,
1.861 + /** Flash lighting. */
1.862 + EWBFlash = 0x0010,
1.863 + /** High contrast daylight primarily snowy */
1.864 + EWBSnow = 0x0020,
1.865 + /** High contrast daylight primarily near the sea */
1.866 + EWBBeach = 0x0040,
1.867 + /** User configurable mode */
1.868 + EWBManual = 0x0080,
1.869 + /** Shade */
1.870 + EWBShade = 0x0100,
1.871 + /** auto skin
1.872 +
1.873 + If New2L()/NewDuplicate2L() are not used to create camera object, this
1.874 + enum value would be considered as unrecognized and filtered out in 'supported'
1.875 + or 'getter' methods.
1.876 + */
1.877 + EWBAutoSkin = 0x0200,
1.878 + /** horizon
1.879 +
1.880 + If New2L()/NewDuplicate2L() are not used to create camera object, this
1.881 + enum value would be considered as unrecognized and filtered out in 'supported'
1.882 + or 'getter' methods.
1.883 + */
1.884 + EWBHorizon = 0x0400,
1.885 + /** Daylight Under Water
1.886 +
1.887 + If New2L()/NewDuplicate2L() are not used to create camera object, this
1.888 + enum value would be considered as unrecognized and filtered out in 'supported'
1.889 + or 'getter' methods.
1.890 + */
1.891 + EWBDaylightUnderWater = 0x0800
1.892 + };
1.893 +
1.894 +public:
1.895 + /**
1.896 + Determines the number of cameras on the device.
1.897 +
1.898 + @return Count of cameras present on the device.
1.899 + */
1.900 + IMPORT_C static TInt CamerasAvailable();
1.901 +
1.902 + /**
1.903 + @deprecated Use static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1.904 +
1.905 + Creates an object representing a camera.
1.906 +
1.907 + @param aObserver
1.908 + Reference to class derived from MCameraObserver2 designed to receive
1.909 + notification of asynchronous event completion.
1.910 + @param aCameraIndex
1.911 + Index from 0 to CamerasAvailable()-1 inclusive specifying the
1.912 + camera device to use.
1.913 + @param aPriority
1.914 + Value from -100 to 100 indicating relative priority of client to
1.915 + use camera.
1.916 +
1.917 + @return Pointer to a fully constructed CCamera object. Ownership is passed
1.918 + to the caller.
1.919 +
1.920 + @leave KErrNoMemory if out of memory.
1.921 + @leave KErrNotSupported if aCameraIndex is out of range.
1.922 + @leave KErrPermissionDenied if the application does not have
1.923 + the UserEnvironment capability.
1.924 +
1.925 + @capability UserEnvironment
1.926 + An application that creates a CCamera object must have
1.927 + the UserEnvironment capability.
1.928 +
1.929 + @capability MultimediaDD
1.930 + A process requesting or using this method that has MultimediaDD capability will
1.931 + always have precedence over a process that does not have MultimediaDD.
1.932 +
1.933 + @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined).
1.934 + To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare
1.935 + themselves to receive unrecognised values.
1.936 + */
1.937 + IMPORT_C static CCamera* NewL(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1.938 +
1.939 + /**
1.940 + Creates an object representing a camera.
1.941 + Clients prepare themselves to receive unrecognised enum, uids etc.
1.942 +
1.943 + @param aObserver
1.944 + Reference to class derived from MCameraObserver2 designed to receive
1.945 + notification of asynchronous event completion.
1.946 + @param aCameraIndex
1.947 + Index from 0 to CamerasAvailable()-1 inclusive specifying the
1.948 + camera device to use.
1.949 + @param aPriority
1.950 + Value from -100 to 100 indicating relative priority of client to
1.951 + use camera.
1.952 +
1.953 + @return Pointer to a fully constructed CCamera object. Ownership is passed
1.954 + to the caller.
1.955 +
1.956 + @leave KErrNoMemory if out of memory.
1.957 + @leave KErrNotSupported if aCameraIndex is out of range.
1.958 + @leave KErrPermissionDenied if the application does not have
1.959 + the UserEnvironment capability.
1.960 +
1.961 + @capability UserEnvironment
1.962 + An application that creates a CCamera object must have
1.963 + the UserEnvironment capability.
1.964 +
1.965 + @capability MultimediaDD
1.966 + A process requesting or using this method that has MultimediaDD capability will
1.967 + always have precedence over a process that does not have MultimediaDD.
1.968 +
1.969 + @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids
1.970 + from 'supported' or 'getter' methods
1.971 + */
1.972 + IMPORT_C static CCamera* New2L(MCameraObserver2& aObserver,TInt aCameraIndex,TInt aPriority);
1.973 +
1.974 + /**
1.975 + Creates an object representing a camera.
1.976 +
1.977 + @param aObserver
1.978 + Reference to class derived from MCameraObserver designed to receive
1.979 + notification of asynchronous event completion.
1.980 + @param aCameraIndex
1.981 + Index from 0 to CamerasAvailable()-1 inclusive specifying the
1.982 + camera device to use.
1.983 +
1.984 + @leave KErrNoMemory if out of memory.
1.985 + @leave KErrNotSupported if aCameraIndex is out of range.
1.986 + @leave KErrPermissionDenied if the application does not have
1.987 + the UserEnvironment capability.
1.988 +
1.989 + @return Pointer to a fully constructed CCamera object. Ownership is passed
1.990 + to the caller.
1.991 +
1.992 + @capability UserEnvironment
1.993 + An application that creates a CCamera object must have
1.994 + the UserEnvironment capability.
1.995 +
1.996 + @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined).
1.997 + To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare
1.998 + themselves to receive unrecognised values.
1.999 + */
1.1000 + IMPORT_C static CCamera* NewL(MCameraObserver& aObserver,TInt aCameraIndex);
1.1001 +
1.1002 + /**
1.1003 + @deprecated Use static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle);
1.1004 +
1.1005 + Duplicates the original camera object for use by, for example, multimedia systems.
1.1006 +
1.1007 + May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid.
1.1008 +
1.1009 + @param aObserver
1.1010 + Reference to an observer.
1.1011 + @param aCameraHandle Handle of an existing camera object.
1.1012 +
1.1013 + @leave KErrNoMemory if out of memory.
1.1014 + @leave KErrNotFound if aCameraHandle is not valid.
1.1015 + @leave KErrPermissionDenied if the application does not have
1.1016 + the UserEnvironment capability.
1.1017 +
1.1018 + @return Duplicate of the original camera object.
1.1019 +
1.1020 + @capability UserEnvironment
1.1021 + An application that creates a CCamera object must have
1.1022 + the UserEnvironment capability.
1.1023 +
1.1024 + @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined).
1.1025 + To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare
1.1026 + themselves to receive unrecognised values.
1.1027 + */
1.1028 + IMPORT_C static CCamera* NewDuplicateL(MCameraObserver2& aObserver,TInt aCameraHandle);
1.1029 +
1.1030 + /**
1.1031 + Duplicates the original camera object for use by, for example, multimedia systems.
1.1032 + Clients prepare themselves to receive unrecognised enum, uids etc.
1.1033 +
1.1034 + May leave with KErrNoMemory or KErrNotFound if aCameraHandle is not valid.
1.1035 +
1.1036 + @param aObserver
1.1037 + Reference to an observer.
1.1038 + @param aCameraHandle Handle of an existing camera object.
1.1039 +
1.1040 + @leave KErrNoMemory if out of memory.
1.1041 + @leave KErrNotFound if aCameraHandle is not valid.
1.1042 + @leave KErrPermissionDenied if the application does not have
1.1043 + the UserEnvironment capability.
1.1044 +
1.1045 + @return Duplicate of the original camera object.
1.1046 +
1.1047 + @capability UserEnvironment
1.1048 + An application that creates a CCamera object must have
1.1049 + the UserEnvironment capability.
1.1050 +
1.1051 + @note Clients using this creation method should prepare themselves to receive any unrecognised enum values, uids
1.1052 + from 'supported' or 'getter' methods
1.1053 + */
1.1054 + IMPORT_C static CCamera* NewDuplicate2L(MCameraObserver2& aObserver,TInt aCameraHandle);
1.1055 +
1.1056 + /**
1.1057 + Duplicates the original camera object for use by, for example, multimedia systems.
1.1058 +
1.1059 + @leave KErrNoMemory if out of memory.
1.1060 + @leave KErrNotFound if aCameraHandle is not valid.
1.1061 + @leave KErrPermissionDenied if the application does not have
1.1062 + the UserEnvironment capability.
1.1063 +
1.1064 + @param aObserver
1.1065 + Reference to an observer.
1.1066 + @param aCameraHandle Handle of an existing camera object.
1.1067 +
1.1068 + @return Duplicate of the original camera object.
1.1069 +
1.1070 + @capability UserEnvironment
1.1071 + An application that creates a CCamera object must have
1.1072 + the UserEnvironment capability.
1.1073 +
1.1074 + @note Applications using this method to create camera object may not receive enums/uids added in future(after being baselined).
1.1075 + To receive them, they should rather use New2L() or NewDuplicate2L(), in which case, they should prepare
1.1076 + themselves to receive unrecognised values.
1.1077 + */
1.1078 + IMPORT_C static CCamera* NewDuplicateL(MCameraObserver& aObserver,TInt aCameraHandle);
1.1079 +
1.1080 + /**
1.1081 + Gets information about the camera device.
1.1082 +
1.1083 + @param aInfo
1.1084 + On return, information about the camera device. See TCameraInfo.
1.1085 + */
1.1086 + virtual void CameraInfo(TCameraInfo& aInfo) const=0;
1.1087 +
1.1088 + /**
1.1089 + Asynchronous function that performs any required initialisation and reserves
1.1090 + the camera for exclusive use.
1.1091 +
1.1092 + Calls MCameraObserver:: ReserveComplete() when complete.
1.1093 + */
1.1094 + virtual void Reserve()=0;
1.1095 +
1.1096 + /**
1.1097 + De-initialises the camera, allowing it to be used by other clients.
1.1098 + */
1.1099 + virtual void Release()=0;
1.1100 +
1.1101 + /**
1.1102 + Asynchronous method to switch on camera power.
1.1103 +
1.1104 + User must have successfully called Reserve() prior to calling this function.
1.1105 +
1.1106 + Calls MCameraObserver::PowerOnComplete() when power on is complete.
1.1107 + */
1.1108 + virtual void PowerOn()=0;
1.1109 +
1.1110 + /**
1.1111 + Synchronous function for switching off camera power.
1.1112 + */
1.1113 + virtual void PowerOff()=0;
1.1114 +
1.1115 + /**
1.1116 + Gets the device-unique handle of this camera object.
1.1117 +
1.1118 + @return The device-unique handle of this camera object.
1.1119 + */
1.1120 + virtual TInt Handle()=0;
1.1121 +
1.1122 + /**
1.1123 + Sets the zoom factor.
1.1124 +
1.1125 + This must be in the range of TCameraInfo::iMinZoom to TCameraInfo::iMaxZoom
1.1126 + inclusive. May leave with KErrNotSupported if the specified zoom factor is
1.1127 + out of range.
1.1128 +
1.1129 + @param aZoomFactor
1.1130 + Required zoom factor.
1.1131 + */
1.1132 + virtual void SetZoomFactorL(TInt aZoomFactor = 0)=0;
1.1133 +
1.1134 + /**
1.1135 + Gets the currently set zoom factor.
1.1136 +
1.1137 + @return The currently set zoom factor.
1.1138 + */
1.1139 + virtual TInt ZoomFactor() const=0;
1.1140 +
1.1141 + /**
1.1142 + Sets the digital zoom factor.
1.1143 +
1.1144 + This must be in the range of 0 to TCameraInfo::iMaxDigitalZoom inclusive.
1.1145 +
1.1146 + May leave with KErrNotSupported if the zoom factor is out of range.
1.1147 +
1.1148 + @param aDigitalZoomFactor
1.1149 + The required digital zoom factor.
1.1150 + */
1.1151 + virtual void SetDigitalZoomFactorL(TInt aDigitalZoomFactor = 0)=0;
1.1152 +
1.1153 + /**
1.1154 + Gets the currently set digital zoom factor.
1.1155 +
1.1156 + @return The currently set digital zoom factor.
1.1157 + */
1.1158 + virtual TInt DigitalZoomFactor() const=0;
1.1159 +
1.1160 + /**
1.1161 + Sets the contrast adjustment of the device.
1.1162 +
1.1163 + This must be in the range of -100 to +100 or EContrastAuto. May leave with
1.1164 + KErrNotSupported if the specified contrast value is out of range.
1.1165 +
1.1166 + @param aContrast
1.1167 + Required contrast value. See TCameraInfo::iContrastSupported
1.1168 + */
1.1169 + virtual void SetContrastL(TInt aContrast)=0;
1.1170 +
1.1171 + /**
1.1172 + Gets the currently set contrast value.
1.1173 +
1.1174 + @return The currently set contrast value.
1.1175 + */
1.1176 + virtual TInt Contrast() const=0;
1.1177 +
1.1178 + /**
1.1179 + Sets the brightness adjustment of the device.
1.1180 +
1.1181 + No effect if this is not supported, see TCameraInfo::iBrightnessSupported.
1.1182 +
1.1183 + This must be in the range of -100 to +100 or EBrightnessAuto. May leave
1.1184 + with KErrNotSupported if the brightness adjustment is out of range.
1.1185 +
1.1186 + @param aBrightness
1.1187 + The required brightness adjustment.
1.1188 + */
1.1189 + virtual void SetBrightnessL(TInt aBrightness)=0;
1.1190 +
1.1191 + /**
1.1192 + Gets the currently set brightness adjustment value.
1.1193 +
1.1194 + @return The currently set brightness adjustment value.
1.1195 + */
1.1196 + virtual TInt Brightness() const=0;
1.1197 +
1.1198 + /**
1.1199 + Sets the flash mode.
1.1200 +
1.1201 + No effect if this is not supported, see TCameraInfo::iFlashModesSupported.
1.1202 +
1.1203 + May leave with KErrNotSupported if the specified flash mode is invalid.
1.1204 +
1.1205 + @param aFlash
1.1206 + The required flash mode.
1.1207 + */
1.1208 + virtual void SetFlashL(TFlash aFlash = EFlashNone)=0;
1.1209 +
1.1210 + /**
1.1211 + Gets the currently set flash mode.
1.1212 +
1.1213 + @return The currently set flash mode.
1.1214 + @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that
1.1215 + application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised)
1.1216 + (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation.
1.1217 + To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L()
1.1218 + to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set.
1.1219 + In this case, application is assumed to be prepared to receive unrecognised enum values.
1.1220 +
1.1221 + @see CCamera::CCameraAdvancedSettings::FlashMode()
1.1222 + */
1.1223 + virtual TFlash Flash() const=0;
1.1224 +
1.1225 + /**
1.1226 + Sets the exposure adjustment of the device.
1.1227 +
1.1228 + No effect if this is not supported, see CameraInfo::iExposureModesSupported.
1.1229 +
1.1230 + May leave with KErrNotSupported if the specified exposure adjustment is invalid.
1.1231 +
1.1232 + @param aExposure
1.1233 + The required exposure adjustment.
1.1234 + */
1.1235 + virtual void SetExposureL(TExposure aExposure = EExposureAuto)=0;
1.1236 +
1.1237 + /**
1.1238 + Gets the currently set exposure setting value.
1.1239 +
1.1240 + @return The currently set exposure setting value.
1.1241 + */
1.1242 + virtual TExposure Exposure() const=0;
1.1243 +
1.1244 + /**
1.1245 + Sets the white balance adjustment of the device.
1.1246 +
1.1247 + No effect if this is not supported, see TCameraInfo::iWhiteBalanceModesSupported.
1.1248 +
1.1249 + @param aWhiteBalance
1.1250 + The required white balance adjustment.
1.1251 +
1.1252 + @leave KErrNotSupported if the specified white balance adjustment
1.1253 + is invalid.
1.1254 + */
1.1255 + virtual void SetWhiteBalanceL(TWhiteBalance aWhiteBalance = EWBAuto)=0;
1.1256 +
1.1257 + /**
1.1258 + Gets the currently set white balance adjustment value.
1.1259 +
1.1260 + @return The currently set white balance adjustment value.
1.1261 +
1.1262 + @note if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that
1.1263 + application is not prepared to receive extra added enum values (unrecognised). So, any extra enum value(unrecognised)
1.1264 + (set in the ECAM implementation because of sharing clients) should not be returned from the ECAM implementation.
1.1265 + To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L()
1.1266 + to create camera object. ECAM implementation, after verifying this,(by checking version no.) may send new values, if set.
1.1267 + In this case, application is assumed to be prepared to receive unrecognised enum values.
1.1268 + Refer CCamera::CCameraAdvancedSettings::WhiteBalanceMode() implementation
1.1269 +
1.1270 + @see CCamera::CCameraAdvancedSettings::WhiteBalanceMode()
1.1271 + */
1.1272 + virtual TWhiteBalance WhiteBalance() const=0;
1.1273 +
1.1274 + /**
1.1275 + Starts transfer of view finder data to the given portion of the screen using
1.1276 + direct screen access.
1.1277 +
1.1278 + The aScreenRect parameter is in screen co-ordinates and may be modified if,
1.1279 + eg, the camera requires the destination to have a certain byte alignment, etc.
1.1280 +
1.1281 + @param aWs
1.1282 + Window server session.
1.1283 + @param aScreenDevice
1.1284 + Screen device.
1.1285 + @param aWindow
1.1286 + Displayable window.
1.1287 + @param aScreenRect
1.1288 + Portion of the screen to which view finder data is to be
1.1289 + transferred. This is in screen co-ordinates and may be modified if, for example,
1.1290 + the camera requires the destination to have a certain byte alignment.
1.1291 +
1.1292 + @leave KErrNotReady if PowerOn() has either not
1.1293 + been called, or has not yet completed.
1.1294 +
1.1295 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1296 + refer viewfinders started using CCamera methods.
1.1297 +
1.1298 + @see CCamera::CCameraV2DirectViewFinder
1.1299 + */
1.1300 + virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect)=0;
1.1301 +
1.1302 + /**
1.1303 + Starts transfer of view finder data to the given portion of the screen using
1.1304 + direct screen access and also clips to the specified portion of the screen.
1.1305 +
1.1306 + The view finder has the same size and position as aScreenRect but is only
1.1307 + visible in the intersection of aScreenRect and aClipRect. May leave with KErrNotSupported
1.1308 + or KErrNotReady if Reserve() has not been called, or has not yet completed.
1.1309 +
1.1310 + @param aWs
1.1311 + Window server session.
1.1312 + @param aScreenDevice
1.1313 + Screen device.
1.1314 + @param aWindow
1.1315 + Displayable window.
1.1316 + @param aScreenRect
1.1317 + Portion of the screen to which view finder data is to be
1.1318 + transferred. This is in screen co-ordinates and may be modified if, for example,
1.1319 + the camera requires the destination to have a certain byte alignment.
1.1320 + @param aClipRect
1.1321 + The rectangle to which the screen will be clipped.
1.1322 +
1.1323 + @leave KErrNotReady if PowerOn() hasn't been called successfully.
1.1324 +
1.1325 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1326 + refer viewfinders started using CCamera methods.
1.1327 +
1.1328 + @see CCamera::CCameraClientViewFinder
1.1329 + */
1.1330 + virtual void StartViewFinderDirectL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWindow,TRect& aScreenRect,TRect& aClipRect)=0;
1.1331 +
1.1332 + /**
1.1333 + Starts transfer of view finder data.
1.1334 +
1.1335 + Bitmaps are returned by MCameraObserver::ViewFinderFrameReady().
1.1336 +
1.1337 + @param aSize
1.1338 + On return, the size used.
1.1339 + @leave KErrNotReady if PowerOn() has not been called, or has not yet completed.
1.1340 +
1.1341 + @note This method is assumed to be meant for default display only.
1.1342 +
1.1343 + @see CCamera::CCameraClientViewFinder
1.1344 + */
1.1345 + virtual void StartViewFinderBitmapsL(TSize& aSize)=0;
1.1346 +
1.1347 + /**
1.1348 + Starts transfer of view finder data and clips the bitmap to the specified clip
1.1349 + rectangle.
1.1350 +
1.1351 + The bitmap is the size of the intersection of aSize and aClipRect, not simply
1.1352 + aSize padded with white space.
1.1353 +
1.1354 + @param aSize
1.1355 + On return, the size used.
1.1356 + @param aClipRect
1.1357 + Required clip rectangle. May be modified if, for example,
1.1358 + the camera only supports certain byte alignments.
1.1359 +
1.1360 + @leave KErrInUse if Reserve() hasn't been called successfully.
1.1361 + @leave KErrNotReady if PowerOn() hasn't been called successfully.
1.1362 +
1.1363 + @note This method is assumed to be meant for default display only.
1.1364 +
1.1365 + @see CCamera::CCameraClientViewFinder
1.1366 + */
1.1367 + virtual void StartViewFinderBitmapsL(TSize& aSize,TRect& aClipRect)=0;
1.1368 +
1.1369 + /**
1.1370 + Starts transfer of view finder data.
1.1371 +
1.1372 + Picture data is returned by MCameraObserver2::ViewFinderReady().
1.1373 +
1.1374 + @param aImageFormat
1.1375 + The image format requested by the client.
1.1376 + @param aSize
1.1377 + On return, the size used.
1.1378 + @leave KErrNotSupported
1.1379 + @leave KErrNotReady if Reserve() has not been
1.1380 + called, or has not yet completed.
1.1381 +
1.1382 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1383 + refer viewfinders started using CCamera methods.
1.1384 +
1.1385 + @see CCamera::CCameraClientViewFinder
1.1386 + */
1.1387 + virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize)=0;
1.1388 +
1.1389 + /**
1.1390 + Starts transfer of view finder data and clips the picture to the specified clip
1.1391 + rectangle. Picture data is returned by MCameraObserver2::ViewFinderReady().
1.1392 +
1.1393 + The picture is the size of the intersection of aSize and aClipRect, not simply
1.1394 + aSize padded with white space.
1.1395 +
1.1396 + @param aImageFormat
1.1397 + The image format.
1.1398 + @param aSize
1.1399 + On return, the size used.
1.1400 + @param aClipRect
1.1401 + Required clip rectangle. May be modified if, for example,
1.1402 + the camera only supports certain byte alignments.
1.1403 +
1.1404 + @leave KErrInUse if Reserve() hasn't been called successfully,
1.1405 + @leave KErrNotReady if PowerOn() hasn't been called successfully.
1.1406 +
1.1407 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1408 + refer viewfinders started using CCamera methods.
1.1409 +
1.1410 + @see CCamera::CCameraClientViewFinder
1.1411 + */
1.1412 + virtual void StartViewFinderL(TFormat aImageFormat,TSize& aSize,TRect& aClipRect)=0;
1.1413 +
1.1414 + /**
1.1415 + Stops transfer of view finder data to the screen.
1.1416 +
1.1417 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1418 + refer viewfinders started using CCamera methods.
1.1419 +
1.1420 + @see CCamera::CCameraV2DirectViewFinder
1.1421 + @see CCamera::CCameraClientViewFinder
1.1422 + */
1.1423 + virtual void StopViewFinder()=0;
1.1424 +
1.1425 + /**
1.1426 + Queries whether the view finder is active.
1.1427 +
1.1428 + @return ETrue if the view finder is active. EFalse if the view finder is not
1.1429 + active.
1.1430 +
1.1431 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1432 + refer viewfinders started using CCamera methods.
1.1433 +
1.1434 + @see CCamera::CCameraV2DirectViewFinder
1.1435 + @see CCamera::CCameraClientViewFinder
1.1436 + */
1.1437 + virtual TBool ViewFinderActive() const=0;
1.1438 +
1.1439 + /**
1.1440 + Sets whether view finder mirroring is on.
1.1441 +
1.1442 + Used to switch between what the camera sees and what you would see if the
1.1443 + device were a mirror.
1.1444 +
1.1445 + @param aMirror
1.1446 + ETrue to set mirroring on, EFalse to set mirroring off.
1.1447 +
1.1448 + @leave KErrNotSupported.
1.1449 +
1.1450 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1451 + refer viewfinders started using CCamera methods.
1.1452 +
1.1453 + @see CCamera::CCameraV2DirectViewFinder
1.1454 + @see CCamera::CCameraClientViewFinder
1.1455 + */
1.1456 + virtual void SetViewFinderMirrorL(TBool aMirror)=0;
1.1457 +
1.1458 + /**
1.1459 + Gets whether view finder mirroring is active.
1.1460 +
1.1461 + @return ETrue if mirroring is set, EFalse if mirroring is not set.
1.1462 +
1.1463 + @note This method is assumed to be meant for default display only. KECamDefaultViewFinderHandle should be used to
1.1464 + refer viewfinders started using CCamera methods.
1.1465 +
1.1466 + @see CCamera::CCameraV2DirectViewFinder
1.1467 + @see CCamera::CCameraClientViewFinder
1.1468 + */
1.1469 + virtual TBool ViewFinderMirror() const=0;
1.1470 +
1.1471 + /**
1.1472 + Performs setup and allocation of memory.
1.1473 +
1.1474 + Called prior to calling CaptureImage() to keep the latency of that function
1.1475 + to a minimum.
1.1476 +
1.1477 + Needs to be called only once for multiple CaptureImage() calls. May leave
1.1478 + with KErrNotSupported or KErrNoMemory or KErrInUse or KErrNotReady.
1.1479 +
1.1480 + The specified image format must be one of the formats supported
1.1481 + (see TCameraInfo::iImageFormatsSupported).
1.1482 +
1.1483 + The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1
1.1484 + inclusive.
1.1485 +
1.1486 + @param aImageFormat
1.1487 + The image format.
1.1488 + @param aSizeIndex
1.1489 + Size index.
1.1490 +
1.1491 + @leave KErrNotSupported
1.1492 + @leave KErrNoMemory
1.1493 + @leave KErrNotReady if PowerOn() hasn't been called successfully.
1.1494 +
1.1495 + @note Depending on the ECAM implementation and underlying hardware, preparing both image capture and video capture
1.1496 + at the same time may not be possible. In this case, the recommendation is to unprepare video capture before preparing
1.1497 + image capture if PrepareVideoCaptureL() has already been called.
1.1498 +
1.1499 + @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters)
1.1500 + */
1.1501 + virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex)=0;
1.1502 +
1.1503 + /**
1.1504 + Performs setup and allocation of memory and clips the image to the specified
1.1505 + rectangle.
1.1506 +
1.1507 + No effect unless TCameraInfo::iImageClippingSupported is set to ETrue. The
1.1508 + image captured is the intersection of aClipRect and the rectangle from (0,0)
1.1509 + to aSize. Needs to be called only once for multiple CaptureImage() calls.
1.1510 + May leave with KErrNotSupported or KErrNoMemory.
1.1511 +
1.1512 + The specified image format must be one of the formats supported (see TCameraInfo::iImageFormatsSupported).
1.1513 +
1.1514 + The specified size index must be in the range of 0 to TCameraInfo::iNumImageSizesSupported-1
1.1515 + inclusive.
1.1516 +
1.1517 + @param aImageFormat
1.1518 + The image format.
1.1519 + @param aSizeIndex
1.1520 + Size index.
1.1521 + @param aClipRect
1.1522 + The rectangle to which the image is to be clipped.
1.1523 +
1.1524 + @leave KErrNotSupported
1.1525 + @leave KErrNoMemory
1.1526 + @leave KErrInUse if Reserve() hasn't been called successfully
1.1527 + @leave KErrNotReady if PowerOn()
1.1528 + hasn't been called successfully.
1.1529 +
1.1530 + @note Depending on the ECAM implementation and underlying hardware, preparing both image capture and video capture
1.1531 + at the same time may not be possible. In this case, the recommendation is to unprepare video capture before preparing
1.1532 + image capture if PrepareVideoCaptureL() has already been called.
1.1533 +
1.1534 + @see CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(TPrepareImageParameters aPrepareImageParameters)
1.1535 + */
1.1536 + virtual void PrepareImageCaptureL(TFormat aImageFormat,TInt aSizeIndex,const TRect& aClipRect)=0;
1.1537 +
1.1538 + /**
1.1539 + Asynchronously performs still image capture.
1.1540 +
1.1541 + Calls MCameraObserver::ImageReady() when complete.
1.1542 +
1.1543 + @see CCamera::CCameraImageCapture
1.1544 + @see CCamera::CCameraPreImageCaptureControl
1.1545 + */
1.1546 + virtual void CaptureImage()=0;
1.1547 +
1.1548 + /**
1.1549 + Cancels the asynchronous still image capture.
1.1550 +
1.1551 + @see CCamera::CCameraImageCapture
1.1552 + */
1.1553 + virtual void CancelCaptureImage()=0;
1.1554 +
1.1555 + /**
1.1556 + Enumerates through the available image capture sizes, based on the specified
1.1557 + size index and format
1.1558 +
1.1559 + The size index must be in the range 0 to TCameraInfo::iNumImageSizesSupported-1
1.1560 + inclusive.
1.1561 +
1.1562 + @param aSize
1.1563 + Image size.
1.1564 + @param aSizeIndex
1.1565 + Size index.
1.1566 + @param aFormat
1.1567 + The image format.
1.1568 + */
1.1569 + virtual void EnumerateCaptureSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0;
1.1570 +
1.1571 + /**
1.1572 + Prepares for video capture.
1.1573 +
1.1574 + Performs setup and allocation of memory prior to calling StartVideoCapture()
1.1575 + to keep the latency of that function to a minimum.
1.1576 +
1.1577 + May leave with KErrNotSupported or KErrNoMemory.
1.1578 +
1.1579 + @param aFormat
1.1580 + Format must be one of the video frame formats supported (see
1.1581 + TCameraInfo::iVideoFrameFormatsSupported).
1.1582 + @param aSizeIndex
1.1583 + Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1.1584 + inclusive.
1.1585 + @param aRateIndex
1.1586 + The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
1.1587 + inclusive.
1.1588 + @param aBuffersToUse
1.1589 + The number of discrete buffers to use.
1.1590 + @param aFramesPerBuffer
1.1591 + How large the buffers are to be. Must be less than
1.1592 + or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned
1.1593 + to MCameraObserver::FrameBufferReady() at a time.
1.1594 +
1.1595 + @leave May leave with KErrNotSupported, KErrNoMemory, or KErrNotReady if PowerOn()
1.1596 + hasn't been called successfully.
1.1597 +
1.1598 + @note Depending on the ECAM implementation and underlying hardware, preparing both image capture and video capture
1.1599 + at the same time may not be possible. In this case, the recommendation is to unprepare image capture before preparing
1.1600 + video capture if PrepareImageCaptureL() has already been called.
1.1601 +
1.1602 + @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters)
1.1603 + */
1.1604 + virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer)=0;
1.1605 +
1.1606 + /**
1.1607 + Prepares for video capture and clips the frames to the given rectangle.
1.1608 +
1.1609 + Performs setup and allocation of memory prior to calling StartVideoCapture()
1.1610 + to keep the latency of that function to a minimum.
1.1611 +
1.1612 + May leave with KErrNotSupported or KErrNoMemory.
1.1613 +
1.1614 + @param aFormat
1.1615 + Format must be one of the video frame formats supported (see
1.1616 + TCameraInfo::iVideoFrameFormatsSupported).
1.1617 + @param aSizeIndex
1.1618 + Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1.1619 + inclusive.
1.1620 + @param aRateIndex
1.1621 + The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
1.1622 + inclusive.
1.1623 + @param aBuffersToUse
1.1624 + The number of discrete buffers to use.
1.1625 + @param aFramesPerBuffer
1.1626 + How large the buffers are to be. Must be less than
1.1627 + or equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned
1.1628 + to MCameraObserver::FrameBufferReady() at a time.
1.1629 + @param aClipRect
1.1630 + The rectangle to which the image is to be clipped.
1.1631 + @leave KErrNotSupported
1.1632 + @leave KErrNoMemory,
1.1633 + @leave KErrInUse if Reserve() hasn't been called successfully
1.1634 + @leave KErrNotReady if PowerOn() hasn't been called successfully.
1.1635 +
1.1636 + @note Depending on the ECAM implementation and underlying hardware, preparing both image capture and video capture
1.1637 + at the same time may not be possible. In this case, the recommendation is to unprepare image capture before preparing
1.1638 + video capture if PrepareImageCaptureL() has already been called.
1.1639 +
1.1640 + @see CCamera::CCameraVideoCaptureControl::PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters)
1.1641 + */
1.1642 + virtual void PrepareVideoCaptureL(TFormat aFormat,TInt aSizeIndex,TInt aRateIndex,TInt aBuffersToUse,TInt aFramesPerBuffer,const TRect& aClipRect)=0;
1.1643 +
1.1644 + /**
1.1645 + Starts capturing video.
1.1646 +
1.1647 + Calls MCameraObserver::FrameBufferReady() when each buffer has been filled
1.1648 + with the required number of frames, as set by PrepareVideoCaptureL().
1.1649 + */
1.1650 + virtual void StartVideoCapture()=0;
1.1651 +
1.1652 + /**
1.1653 + Stops video capture.
1.1654 + */
1.1655 + virtual void StopVideoCapture()=0;
1.1656 +
1.1657 + /**
1.1658 + Tests whether video capture is active.
1.1659 +
1.1660 + @return ETrue if video capture is active. EFalse if video capture is not active
1.1661 + */
1.1662 + virtual TBool VideoCaptureActive() const=0;
1.1663 +
1.1664 + /**
1.1665 + Enumerates through the available video frame sizes, based on the specified
1.1666 + size index and format.
1.1667 +
1.1668 + @param aSize
1.1669 + On return the available video frame sizes. Sizes should be returned
1.1670 + in order, largest first, so clients do not have to iterate through every one.
1.1671 + @param aSizeIndex
1.1672 + Size index. Must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1
1.1673 + inclusive
1.1674 + @param aFormat
1.1675 + Image format.
1.1676 + */
1.1677 + virtual void EnumerateVideoFrameSizes(TSize& aSize,TInt aSizeIndex,TFormat aFormat) const=0;
1.1678 +
1.1679 + /**
1.1680 + Enumerates through the available video frame rates, based on the specified
1.1681 + rate index, video frame format, size index and exposure mode.
1.1682 +
1.1683 + @param aRate
1.1684 + On return, the available video frame rates. Some rates may not
1.1685 + be available due to, for example, current flash mode setting. In those cases
1.1686 + a rate of 0 will be returned. Rates should be returned in order, highest first,
1.1687 + so clients do not have to iterate through every one.
1.1688 + @param aRateIndex
1.1689 + The rate index. Must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1
1.1690 + inclusive.
1.1691 + @param aFormat
1.1692 + The format.
1.1693 + @param aSizeIndex
1.1694 + The size index.
1.1695 + @param aExposure
1.1696 + The exposure mode.
1.1697 + */
1.1698 + virtual void EnumerateVideoFrameRates(TReal32& aRate,TInt aRateIndex,TFormat aFormat,TInt aSizeIndex,TExposure aExposure = EExposureAuto) const=0;
1.1699 +
1.1700 + /**
1.1701 + Gets the frame size currently in use.
1.1702 +
1.1703 + @param aSize
1.1704 + The frame size currently in use.
1.1705 + */
1.1706 + virtual void GetFrameSize(TSize& aSize) const=0;
1.1707 +
1.1708 + /**
1.1709 + Gets the frame rate currently in use.
1.1710 +
1.1711 + @return The frame rate currently in use.
1.1712 + */
1.1713 + virtual TReal32 FrameRate() const=0;
1.1714 +
1.1715 + /**
1.1716 + Gets the number of buffers currently in use.
1.1717 +
1.1718 + @return The number of buffers currently in use.
1.1719 + */
1.1720 + virtual TInt BuffersInUse() const=0;
1.1721 +
1.1722 + /**
1.1723 + Gets the number of frames per buffer currently in use.
1.1724 +
1.1725 + @return The number of frames per buffer currently in use.
1.1726 + */
1.1727 + virtual TInt FramesPerBuffer() const=0;
1.1728 +
1.1729 + /**
1.1730 + Sets the quality value to use if jpeg is a supported image for video format.
1.1731 +
1.1732 + Ignored if jpeg is not a supported image for video format.
1.1733 +
1.1734 + @param aQuality
1.1735 + The quality value to use, clamped to the range 1 to 100.
1.1736 +
1.1737 + @see CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters::iImageMaxMemorySize
1.1738 + */
1.1739 + virtual void SetJpegQuality(TInt aQuality)=0;
1.1740 +
1.1741 + /**
1.1742 + Gets the currently set jpeg quality value.
1.1743 +
1.1744 + Returns 0 if not supported.
1.1745 +
1.1746 + @return The currently set jpeg quality value.
1.1747 +
1.1748 + @see CCamera::CCameraPreImageCaptureControl::GetImageMaxMemorySizeL(TUint& aMemorySize)
1.1749 + */
1.1750 + virtual TInt JpegQuality() const=0;
1.1751 +
1.1752 + /**
1.1753 + Gets a custom interface. The client has to cast the returned pointer
1.1754 + to the appropriate type.
1.1755 +
1.1756 + @param aInterface
1.1757 + The Uid of the particular interface function required.
1.1758 +
1.1759 + @return Custom interface pointer. NULL if the requested interface is not supported.
1.1760 + */
1.1761 + virtual TAny* CustomInterface(TUid aInterface)=0;
1.1762 +
1.1763 + /**
1.1764 + @internalComponent
1.1765 + Returns the camera API version no.
1.1766 + */
1.1767 + IMPORT_C TInt CameraVersion();
1.1768 +
1.1769 +private:
1.1770 +
1.1771 + /**
1.1772 + Default Constructor
1.1773 +
1.1774 + Prevents implementers from deriving from CCamera.
1.1775 + Implementation requires derivation from CCameraPlugin instead.
1.1776 + */
1.1777 + IMPORT_C CCamera();
1.1778 + };
1.1779 +
1.1780 +/**
1.1781 +Buffer class for passing video frames between camera and client.
1.1782 +
1.1783 +May contain multiple frames.
1.1784 +
1.1785 +@publishedAll
1.1786 +@released
1.1787 +*/
1.1788 +class MFrameBuffer
1.1789 + {
1.1790 +public:
1.1791 + /**
1.1792 + Gets a non-bitmap frame in the buffer.
1.1793 +
1.1794 + @param aIndex
1.1795 + The index of the required, non-bitmap, frame.
1.1796 +
1.1797 + @leave KErrArgument if aIndex is out of range
1.1798 + @leave KErrNotSupported if the frame format is bitmap.
1.1799 + @return A pointer to the specified non-bitmap format frame of video data.
1.1800 + */
1.1801 + virtual TDesC8* DataL(TInt aIndex)=0;
1.1802 +
1.1803 + /**
1.1804 + Gets a bitmap frame in the buffer.
1.1805 +
1.1806 + @param aIndex
1.1807 + The index of the required, bitmap format, frame.
1.1808 +
1.1809 + @leave KErrArgument if aIndex is out of range and
1.1810 + @leave KErrNotSupported if
1.1811 + the frame format is not a bitmap.
1.1812 + @return A pointer to the specified bitmap format frame of video data.
1.1813 + */
1.1814 + virtual CFbsBitmap* FrameL(TInt aIndex)=0;
1.1815 +
1.1816 + /**
1.1817 + Releases the buffer for re-use by the camera once the client has processed
1.1818 + the frame data.
1.1819 +
1.1820 + Signals to CCamera that the buffer data has been used and that the buffer
1.1821 + is free for re-use.
1.1822 + */
1.1823 + virtual void Release()=0;
1.1824 +
1.1825 +public:
1.1826 +
1.1827 + /**
1.1828 + Sequential frame number of the first frame in the buffer, counting from when
1.1829 + CCamera::StartVideoCapture() was called and including frames dropped due to
1.1830 + lack of buffers.
1.1831 + */
1.1832 + TInt iIndexOfFirstFrameInBuffer;
1.1833 +
1.1834 + /**
1.1835 + Time elapsed from when CCamera::StartVideoCapture() was called until the first
1.1836 + frame in the buffer was captured.
1.1837 + */
1.1838 + TTimeIntervalMicroSeconds iElapsedTime;
1.1839 + };
1.1840 +
1.1841 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.1842 +#include <ecamconst.h>
1.1843 +#endif
1.1844 +
1.1845 +class MReserveObserver;
1.1846 +
1.1847 +
1.1848 +/**
1.1849 +An active object class implemented by Symbian and used to subscribe for the updates in the Properties, retrieve the
1.1850 +Properties and forward the notification to the client.
1.1851 +
1.1852 +@note Serialized part of the ECam implementation is assumed to define the Properties and publish them whenever there is
1.1853 + change in the reserve status.
1.1854 +*/
1.1855 +class CCameraStatusWatch : public CActive
1.1856 + {
1.1857 +public:
1.1858 + IMPORT_C ~CCameraStatusWatch();
1.1859 + static CCameraStatusWatch* NewL(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId);
1.1860 +private:
1.1861 +
1.1862 + CCameraStatusWatch(MReserveObserver& aReserveObserver, TInt aCameraIndex, TInt aSecureId);
1.1863 + void ConstructL();
1.1864 + void RunL();
1.1865 + void DoCancel();
1.1866 +
1.1867 +private:
1.1868 + RProperty iProperty;
1.1869 + MReserveObserver& iReserveObserver;
1.1870 + TInt iCameraIndex;
1.1871 + TInt iSecureId;
1.1872 + };
1.1873 +
1.1874 +
1.1875 +#endif // ECAM_H