os/mm/imagingandcamerafws/camerafw/Include/ecamcapturecontrol.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @publishedPartner
sl@0
    19
 @prototype
sl@0
    20
*/
sl@0
    21
#ifndef  ECAMCAPTURECONTROL_H
sl@0
    22
#define  ECAMCAPTURECONTROL_H
sl@0
    23
sl@0
    24
#include <e32base.h>
sl@0
    25
#include <ecam.h>
sl@0
    26
#include <ecamadvsettings.h>
sl@0
    27
sl@0
    28
#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    29
#include <ecamconst.h>
sl@0
    30
#include <ecamadvsettingsconst.h>
sl@0
    31
#endif
sl@0
    32
sl@0
    33
#include <mm/conversioncoefficient.h>
sl@0
    34
sl@0
    35
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
sl@0
    36
#include <ecamcapturecontrolconst.h>
sl@0
    37
#endif
sl@0
    38
sl@0
    39
class MCameraPreImageCaptureControl;
sl@0
    40
class MCameraImageCapture;
sl@0
    41
class MCameraPostImageCaptureControl;
sl@0
    42
class MCameraVideoCaptureControl;
sl@0
    43
sl@0
    44
class MHistogramV2Buffer;
sl@0
    45
sl@0
    46
/** 
sl@0
    47
Special ImageMaxMemorySize when client does not have any specific preference. Also used when 
sl@0
    48
this setting of maximum memory size is not supported. 
sl@0
    49
*/
sl@0
    50
static const TInt KECamNoSpecificMaxMemorySize = -1;
sl@0
    51
sl@0
    52
/** 
sl@0
    53
The current Version of the TPrepareImageParameters class.
sl@0
    54
*/
sl@0
    55
static const TUint KECamPrepareImageParametersCurrentVersion = 1;
sl@0
    56
sl@0
    57
/** 
sl@0
    58
The current Version of the TPrepareVideoParameters class.
sl@0
    59
*/
sl@0
    60
static const TUint KECamPrepareVideoParametersCurrentVersion = 1;
sl@0
    61
sl@0
    62
/**
sl@0
    63
The current Version of the TDriveModeDependentAttributes class. 
sl@0
    64
sl@0
    65
@publishedPartner
sl@0
    66
@prototype
sl@0
    67
*/
sl@0
    68
static const TUint KECamDriveModeDependentAttributesCurrentVersion = 1;
sl@0
    69
sl@0
    70
/**
sl@0
    71
	Uid used to identify the CCameraPreImageCaptureControl API.
sl@0
    72
	This API is used to control the pre-imagecapture operations.
sl@0
    73
	
sl@0
    74
	@see CCamera::CCameraPreImageCaptureControl
sl@0
    75
*/
sl@0
    76
static const TUid  KECamPreImageCaptureControlUid 	= {KECamPreImageCaptureControlUidValue};
sl@0
    77
sl@0
    78
/**
sl@0
    79
	Uid used to identify the CCameraImageCapture API.
sl@0
    80
	This API is used to capture the image and perform other control operations after capture the image.
sl@0
    81
	
sl@0
    82
	@see CCamera::CCameraImageCapture
sl@0
    83
*/
sl@0
    84
static const TUid  KECamImageCaptureUid 	= {KECamImageCaptureUidValue};
sl@0
    85
sl@0
    86
/**
sl@0
    87
	Uid used to identify the CCameraPostImageCaptureControl API.
sl@0
    88
	This API is used to control the post-imagecapture operations.
sl@0
    89
	
sl@0
    90
	@see CCamera::CCameraPostImageCaptureControl
sl@0
    91
*/
sl@0
    92
static const TUid  KECamPostImageCaptureControlUid 	= {KECamPostImageCaptureControlUidValue};
sl@0
    93
sl@0
    94
/**
sl@0
    95
	Uid used to identify the CCamera Video Capture Control API.
sl@0
    96
	This API is used to control the video capture operations.
sl@0
    97
	
sl@0
    98
	@see CCamera::CCameraVideoCaptureControl
sl@0
    99
*/
sl@0
   100
static const TUid  KECamVideoCaptureControlUid 	= {KECamVideoCaptureControlUidValue};
sl@0
   101
sl@0
   102
/** 
sl@0
   103
Notification that the camera is ready for next prepare. Next prepare can either be still or video.
sl@0
   104
@note  If drive mode is EDriveModeTimeNudgeCapture this callback will only be received when the client deletes the 
sl@0
   105
	   existing CCameraImageCapture object as more than one instance can not be created if this drive mode is used.
sl@0
   106
*/
sl@0
   107
static const TUid  KUidECamEventReadyForNextPrepare = {KUidECamEventReadyForNextPrepareUidValue};
sl@0
   108
sl@0
   109
/** 
sl@0
   110
Notification that the camera is ready for next capture. Next capture can either be still or video.
sl@0
   111
@note  If drive mode is EDriveModeTimeNudgeCapture this callback will only be received once the total required amount
sl@0
   112
	   of images are captured (ie. pre-capture images + 1 + post-capture images) and the implementation is ready with
sl@0
   113
	   another set of pre-capture images (so implementation is prepared for next CaptureImage() call).
sl@0
   114
*/
sl@0
   115
static const TUid  KUidECamEventReadyForNextCapture = {KUidECamEventReadyForNextCaptureUidValue};
sl@0
   116
sl@0
   117
/** 
sl@0
   118
Notification that the image has been exposed to the sensor.
sl@0
   119
ECam implementation will notify the client that the image has been exposed to the sensor.
sl@0
   120
@see CCamera::CCameraPreImageCaptureControl::GetCaptureEventSupportInfoL
sl@0
   121
*/
sl@0
   122
static const TUid  KUidECamEventImageCaptureEvent = {KUidECamEventImageCaptureEventUidValue};
sl@0
   123
sl@0
   124
/**
sl@0
   125
Specifies the priority which may be assigned to the captured images which are still pending.
sl@0
   126
sl@0
   127
The enumeration list may be extended in future.
sl@0
   128
*/
sl@0
   129
enum TECamImagePriority
sl@0
   130
	{
sl@0
   131
	/** Low Priority */
sl@0
   132
	EECamImagePriorityLow,
sl@0
   133
	/** Medium Priority */
sl@0
   134
	EECamImagePriorityMedium,
sl@0
   135
	/** Standard Priority */
sl@0
   136
	EECamImagePriorityStandard,
sl@0
   137
	/** High Priority */
sl@0
   138
	EECamImagePriorityHigh,
sl@0
   139
	/** Very High Priority */
sl@0
   140
	EECamImagePriorityVeryHigh
sl@0
   141
	};
sl@0
   142
sl@0
   143
/**	
sl@0
   144
A mixin class to be implemented by the client in order to use the PreImageCaptureControl API. The derived class methods 
sl@0
   145
are called by the implementation when the pre image capture operations are ready to be notified accordingly.
sl@0
   146
sl@0
   147
@see CCamera::CCameraPreImageCaptureControl
sl@0
   148
*/	
sl@0
   149
class MPreImageCaptureControlObserver
sl@0
   150
	{
sl@0
   151
public:
sl@0
   152
	/**
sl@0
   153
	Implementation sends this callback as a result of PrepareImageCapture completion. Every time client calls 
sl@0
   154
	CCameraPreImageCaptureControl::PrepareImageCapture, a new CCameraImageCapture* will be passed to the client for
sl@0
   155
	image capture operations. Implementation will create the CCameraImageCapture* object after allocating the memory 
sl@0
   156
	resources required. Ownership of CCameraImageCapture* object will be passed to the client.
sl@0
   157
	
sl@0
   158
	@param aCaptureImageHandle
sl@0
   159
		   Retrieves pointer to the CCameraImageCapture object created by the implementation.
sl@0
   160
		   
sl@0
   161
	@param aErrorCode
sl@0
   162
		   Appropriate error code. 
sl@0
   163
		   KErrECamImageResourceNotReleased when camera device is capable of preparing only still or video.
sl@0
   164
		   KErrECamVideoResourceNotReleased when camera device is capable of preparing only still or video.
sl@0
   165
	
sl@0
   166
	@note  Every time client needs to change the prepare image settings, a new instance of CCameraImageCapture will be 
sl@0
   167
		   provided to it by the implementation.
sl@0
   168
		   
sl@0
   169
	@note  If error is KErrECamImageResourceNotReleased and client wants to successfully call the Prepare method again, 
sl@0
   170
		   client needs to delete all CCameraImageCapture objects and any Snapshot and Histogram objects associated with
sl@0
   171
		   it as well.   
sl@0
   172
	
sl@0
   173
	@note  If error is KErrECamVideoResourceNotReleased and client wants to successfully call the Prepare method again,
sl@0
   174
		   client needs to call ReleaseVideoResource to unprepare video and then delete any Snapshot and Histogram 
sl@0
   175
		   objects associated with it as well.
sl@0
   176
	
sl@0
   177
	@note  If drive mode is set to EDriveModeTimeNudgeCapture the client will only receive this callback once the implementation
sl@0
   178
		   is ready with the number of pre-capture images specified in TDriveModeDependentAttributes.
sl@0
   179
	*/
sl@0
   180
	virtual void PrepareImageComplete(CCamera::CCameraImageCapture* aCaptureImageHandle, TInt aErrorCode)=0;
sl@0
   181
	
sl@0
   182
	/**
sl@0
   183
	Gets a custom interface for future callbacks. This method will be called by the implementation to get a new interface
sl@0
   184
	which would support future callbacks.
sl@0
   185
sl@0
   186
	@param  aInterface
sl@0
   187
		    The Uid of the particular interface function required for callbacks.
sl@0
   188
		   
sl@0
   189
	@param  aPtrInterface
sl@0
   190
		    The implementation has to type-cast the retrieved custom interface pointer to the appropriate type.	
sl@0
   191
sl@0
   192
	@return The error code.
sl@0
   193
	*/
sl@0
   194
	virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface)=0;
sl@0
   195
	}; 
sl@0
   196
sl@0
   197
/**
sl@0
   198
A mixin class to be implemented by the client in order to use the Capture Image API. The derived class methods are 
sl@0
   199
called by the implementation when the image capture operations are ready to be notified accordingly.
sl@0
   200
Implementation shall keep track of CCameraImageCapture object deletion. It has to ensure that a callback is not send 
sl@0
   201
should the client destroy the CCameraImageCapture class object when the callback is queued to be send across. 
sl@0
   202
Ownership of CCameraImageCapture is retained by the client.
sl@0
   203
sl@0
   204
@see CCamera::CCameraImageCapture
sl@0
   205
@see CCamera::CCameraPostImageCaptureControl
sl@0
   206
*/
sl@0
   207
class MCaptureImageObserver
sl@0
   208
	{
sl@0
   209
public:
sl@0
   210
	/**
sl@0
   211
	Implementation sends this callback to provide client the handle to control individual images to be captured. For
sl@0
   212
	example, client may want to destroy the image even before the completion for some reasons.
sl@0
   213
	This callback may be send to the client after the image is exposed to the sensor.
sl@0
   214
	
sl@0
   215
	@param  aCaptureImageHandle
sl@0
   216
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   217
			CCameraPostImageCaptureControl instances will be owned by CCameraImageCapture and would be available until 
sl@0
   218
			new capture command is issued using the owning CCameraImageCapture instance. If client wishes to initiate new 
sl@0
   219
			capture but preserve the CCameraPostImageCaptureControl instances from previous capture, it would have to 
sl@0
   220
			create a new CCameraImageCapture instance and use that for the new capture.
sl@0
   221
			
sl@0
   222
	@param  aPostCaptureControlId
sl@0
   223
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   224
			CCameraImageCapture class object. This will be used to control the individual image.
sl@0
   225
	
sl@0
   226
	@note   If, in case, there is some problem at implementation level while the image capture operation, for example, not
sl@0
   227
			enough memory to create the class object CCameraPostImageCaptureControl, this callback may not be send. In such
sl@0
   228
			cases, ImageCaptureComplete callback can be send with appropriate error code.
sl@0
   229
			
sl@0
   230
	@note   Whether direct saving option is used or buffers are used for images, this callback will be received in both 
sl@0
   231
			the cases.
sl@0
   232
	*/
sl@0
   233
	virtual void IndividualImageControlHandle(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId)=0;
sl@0
   234
																									  
sl@0
   235
	/**
sl@0
   236
	Implementation sends this callback when the individual image is ready and direct saving option is not used.
sl@0
   237
	
sl@0
   238
	@param  aCaptureImageHandle
sl@0
   239
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   240
			CCameraPostImageCaptureControl instances will be owned by CCameraImageCapture and would be available until 
sl@0
   241
			new capture command is issued using the owning CCameraImageCapture instance. If client wishes to initiate new 
sl@0
   242
			capture but preserve the CCameraPostImageCaptureControl instances from previous capture, it would have to 
sl@0
   243
			create a new CCameraImageCapture instance and use that for the new capture.
sl@0
   244
	
sl@0
   245
	@param  aPostCaptureControlId
sl@0
   246
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   247
			CCameraImageCapture class object. This will be used to retrieve the individual image buffer.
sl@0
   248
	
sl@0
   249
	@param  aErrorCode
sl@0
   250
			Appropriate error code. 
sl@0
   251
	
sl@0
   252
	@note	If direct saving option is not used, this callback will be received by the client. 
sl@0
   253
	*/
sl@0
   254
	virtual void ImageBufferReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode)=0;
sl@0
   255
	
sl@0
   256
	/** 
sl@0
   257
	Implementation sends this callback when a particular client snapshot data is available. The snapshot data represents
sl@0
   258
	the individual image which may be in any drive mode. 
sl@0
   259
sl@0
   260
	If a call to CCameraSnapshot::EnableSnapshotL() (on the CCameraImageCapture instance) is made without a successful call 
sl@0
   261
	to CCameraSnapshot::PrepareSnapshotL(const TSnapshotParameters& aSnapshotParameters) (on the CCameraImageCapture 
sl@0
   262
	instance), then the callback returns KErrBadHandle.
sl@0
   263
sl@0
   264
	@param  aCaptureImageHandle
sl@0
   265
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   266
	
sl@0
   267
	@param  aPostCaptureControlId
sl@0
   268
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   269
			CCameraImageCapture class object. This is needed to identify the image which is represented by this snapshot.
sl@0
   270
	
sl@0
   271
	@param  aSnapshotBuffer
sl@0
   272
			Pointer to MCameraBuffer2 which retrieves the snapshot data for the individual image. The ownership will be 
sl@0
   273
			retained by the implementation. Client needs to call Release in order to indicate the implementation
sl@0
   274
			that the buffer can be re-used. Client shall never try to delete the pointer. NULL, if error.
sl@0
   275
	
sl@0
   276
	@param  aErrorCode
sl@0
   277
			Appropriate error code.
sl@0
   278
	*/
sl@0
   279
	virtual void ClientSnapshotForImageReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MCameraBuffer2* aSnapshotBuffer, TInt aErrorCode)=0;
sl@0
   280
	
sl@0
   281
	/** 
sl@0
   282
	Implementation sends this callback when the cut down version(lower resolution) of the individual image has
sl@0
   283
	been directly saved to the file.
sl@0
   284
	Client may use the cut down version of the actual image to view the image beforehand and may cancel the actual
sl@0
   285
	individual image.
sl@0
   286
	
sl@0
   287
	@param  aCaptureImageHandle
sl@0
   288
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   289
	
sl@0
   290
	@param  aPostCaptureControlId
sl@0
   291
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   292
			CCameraImageCapture class object. This may be used to cancel the actual image which might be currently 
sl@0
   293
			undergoing any processing options or even pause/resume ongoing processing options.
sl@0
   294
	
sl@0
   295
	@param  aErrorCode
sl@0
   296
			Appropriate error code.
sl@0
   297
	
sl@0
   298
	@note	If direct saving option is being used, this callback may be received by the client.
sl@0
   299
	*/
sl@0
   300
	virtual void CutDownImageDirectSavingCompleted(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode)=0;
sl@0
   301
	
sl@0
   302
	/** 
sl@0
   303
	Implementation sends this callback when the individual image has been directly saved to the file.
sl@0
   304
	This implies that the processing options associated with the image has been finally completed.
sl@0
   305
sl@0
   306
	@param  aCaptureImageHandle
sl@0
   307
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   308
			CCameraPostImageCaptureControl instances will be owned by CCameraImageCapture and would be available until 
sl@0
   309
			new capture command is issued using the owning CCameraImageCapture instance. If client wishes to initiate new 
sl@0
   310
			capture but preserve the CCameraPostImageCaptureControl instances from previous capture, it would have to 
sl@0
   311
			create a new CCameraImageCapture instance and use that for the new capture.
sl@0
   312
	
sl@0
   313
	@param  aPostCaptureControlId
sl@0
   314
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   315
			CCameraImageCapture class object.
sl@0
   316
	
sl@0
   317
	@param  aErrorCode
sl@0
   318
			Appropriate error code.
sl@0
   319
	
sl@0
   320
	@note	If direct saving option is being used, this callback will be received by the client.
sl@0
   321
	*/
sl@0
   322
	virtual void ImageDirectSavingCompleted(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode)=0;
sl@0
   323
sl@0
   324
	/**
sl@0
   325
	Implementation sends this callback when the Capture Image operation has been completed. This will be send to mark the 
sl@0
   326
	completion of the image capture even if direct saving option is being used.
sl@0
   327
	
sl@0
   328
	@param  aCaptureImageHandle
sl@0
   329
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   330
			CCameraPostImageCaptureControl instances will be owned by CCameraImageCapture and would be available until 
sl@0
   331
			new capture command is issued using the owning CCameraImageCapture instance. If client wishes to initiate new 
sl@0
   332
			capture but preserve the CCameraPostImageCaptureControl instances from previous capture, it would have to 
sl@0
   333
			create a new CCameraImageCapture instance and use that for the new capture. 
sl@0
   334
			
sl@0
   335
	@param  aErrorCode
sl@0
   336
			Appropriate error code. 
sl@0
   337
			
sl@0
   338
	@note	This callback marks the completion of image capture operation. So, whether direct saving option is used or 
sl@0
   339
			buffers are used for images, this callback will be received in both the cases.
sl@0
   340
			
sl@0
   341
	@note  If drive mode is EDriveModeTimeNudgeCapture this callback will only be received once the total required amount
sl@0
   342
		   of images are captured (ie. pre-capture images + 1 + post-capture images) and the implementation is ready with
sl@0
   343
		   another set of pre-capture images (so implementation is prepared for next CaptureImage() call).
sl@0
   344
	*/
sl@0
   345
	virtual void ImageCaptureComplete(CCamera::CCameraImageCapture& aCaptureImageHandle, TInt aErrorCode)=0;
sl@0
   346
	
sl@0
   347
	/**
sl@0
   348
	Implementation sends this callback in order to notify the client about availability of the histogram data for the
sl@0
   349
	individual image. If a call to CCameraV2Histogram::StartHistogram() (on the CCameraImageCapture instance) is made 
sl@0
   350
	without	a previous successful call to CCameraV2Histogram::PrepareClientHistogramL() (on the CCameraImageCapture 
sl@0
   351
	instance) then the callback returns KErrBadHandle.
sl@0
   352
	
sl@0
   353
	@param  aCaptureImageHandle
sl@0
   354
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   355
	
sl@0
   356
	@param  aPostCaptureControlId
sl@0
   357
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   358
			CCameraImageCapture class object. This provides the individual image for which the client histogram data 
sl@0
   359
			is available.
sl@0
   360
	
sl@0
   361
	@param  aClientHistogramBuffer
sl@0
   362
			Pointer to MHistogramV2Buffer which retrieves a single histogram for the individual image alongwith 
sl@0
   363
			relevant information about it. The ownership will be retained by the implementation. Client needs to call 
sl@0
   364
			Release in order to indicate the implementation that the buffer can be re-used. Client shall never try to 
sl@0
   365
			delete the pointer. NULL, if error.
sl@0
   366
	
sl@0
   367
	@param  aErrorCode
sl@0
   368
			Appropriate error code.
sl@0
   369
	*/
sl@0
   370
	virtual void ClientHistogramForImageReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode)=0;
sl@0
   371
	
sl@0
   372
	/**
sl@0
   373
	Implementation sends this callback in order to notify the client about availability of the histogram data for the
sl@0
   374
	snapshot of the individual image. If a call to CCameraV2Histogram::StartHistogram() (on the snapshot) is made without
sl@0
   375
	a previous successful call to CCameraV2Histogram::PrepareClientHistogramL() (on the snapshot) then the callback 
sl@0
   376
	returns KErrBadHandle.
sl@0
   377
	
sl@0
   378
	@param  aCaptureImageHandle
sl@0
   379
			Reference to CCameraImageCapture class object which was used to issue the capture image operation. This 
sl@0
   380
			provides handle to the snapshot(CCameraImageCapture::GetSnapshotHandleL()) for which the histogram data 
sl@0
   381
			is available.
sl@0
   382
	
sl@0
   383
	@param  aPostCaptureControlId
sl@0
   384
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given 
sl@0
   385
			CCameraImageCapture class object. This provides a mapping between the individual image and the snapshot for 
sl@0
   386
			which the client histogram data is available.
sl@0
   387
	
sl@0
   388
	@param  aClientHistogramBuffer
sl@0
   389
			Pointer to MHistogramV2Buffer which retrieves a single histogram for the snapshot of the individual image 
sl@0
   390
			alongwith relevant information about it. The ownership will be retained by the implementation. Client needs to call 
sl@0
   391
			Release in order to indicate the implementation that the buffer can be re-used. Client shall never try to 
sl@0
   392
			delete the pointer. NULL, if error.
sl@0
   393
	
sl@0
   394
	@param  aErrorCode
sl@0
   395
			Appropriate error code. 
sl@0
   396
	*/
sl@0
   397
	virtual void ClientHistogramForSnapshotReady(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode)=0;
sl@0
   398
sl@0
   399
	/**
sl@0
   400
	Implementation sends this callback in order to notify the client about the failure of processing options for the 
sl@0
   401
	individual image.
sl@0
   402
	
sl@0
   403
	@param  aCaptureImageHandle
sl@0
   404
			Reference to CCameraImageCapture class object which was used to issue the capture image operation.
sl@0
   405
	
sl@0
   406
	@param  aPostCaptureControlId
sl@0
   407
			Id used to identify a particular CCameraPostImageCaptureControl object associated with the given
sl@0
   408
			CCameraImageCapture class object. This provides the individual image for which the processing options
sl@0
   409
			has failed.
sl@0
   410
sl@0
   411
	@param  aProcessingTypes
sl@0
   412
			Bitfield of TEcamProcessingOptions associated with the image that have failed.
sl@0
   413
	
sl@0
   414
	@param  aErrorCode
sl@0
   415
			Appropriate error code.
sl@0
   416
	*/
sl@0
   417
	virtual void ProcessingFailed(CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TUint aProcessingTypes, TInt aErrorCode) = 0;
sl@0
   418
	/**
sl@0
   419
	Gets a custom interface for future callbacks. This method will be called by the implementation to get a new interface
sl@0
   420
	which would support future callbacks.
sl@0
   421
sl@0
   422
	@param  aInterface
sl@0
   423
		    The Uid of the particular interface function required for callbacks.
sl@0
   424
		   
sl@0
   425
	@param  aPtrInterface
sl@0
   426
		    The implementation has to type-cast the retrieved custom interface pointer to the appropriate type.	
sl@0
   427
sl@0
   428
	@return The error code.
sl@0
   429
	*/
sl@0
   430
	virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface)=0;
sl@0
   431
	};
sl@0
   432
sl@0
   433
/** 
sl@0
   434
CCameraPreImageCaptureControl class exposes an API for controlling image operations/settings prior to image capture. 
sl@0
   435
sl@0
   436
@note  This class is not intended for sub-classing and used to standardise existing
sl@0
   437
       varieties of implementations.
sl@0
   438
       
sl@0
   439
@note  If the class methods leave, the output type parameter value is not guaranteed to be valid.
sl@0
   440
sl@0
   441
@note  Client should not use old Capture methods present in class CCamera. Class CCameraImageCapture and class 
sl@0
   442
	   CCameraPostImageCaptureControl should be used rather.
sl@0
   443
sl@0
   444
@publishedPartner
sl@0
   445
@prototype
sl@0
   446
*/
sl@0
   447
class CCamera::CCameraPreImageCaptureControl : public CBase
sl@0
   448
	{
sl@0
   449
	/* so can use internal factory functions etc. */
sl@0
   450
	friend class CCamera;
sl@0
   451
sl@0
   452
public:
sl@0
   453
sl@0
   454
	/**
sl@0
   455
	Specifies the type of direct saving.
sl@0
   456
	The enumeration list may be extended in future.
sl@0
   457
	*/
sl@0
   458
	enum TDirectSavingType
sl@0
   459
		{
sl@0
   460
		/** Image saved in buffers. Direct saving to file not being used. Callback used is 
sl@0
   461
		MCaptureImageObserver::ImageBufferReady. */
sl@0
   462
		EDirectSavingNotUsed					= 0x00,
sl@0
   463
		/** Image saved to file as per the format specified. Image saved after any processing options have completed. 
sl@0
   464
		Callback used is MCaptureImageObserver::ImageDirectSavingCompleted(). */
sl@0
   465
		EDirectSavingHighResolutionFileOnly		= 0x01,
sl@0
   466
		/** Image saved to file as per the format specified. Also, a lower resolution image gets saved in a separately 
sl@0
   467
		specified file. This helps in retrieving the lower resolution image sooner than the higher resolution
sl@0
   468
		image gets saved. Callback used for lower resolution image saving is MCaptureImageObserver::
sl@0
   469
		CutDownImageDirectSavingCompleted(). */
sl@0
   470
		EDirectSavingWithLowerResolutionFile	= 0x02
sl@0
   471
		};
sl@0
   472
	
sl@0
   473
	/**
sl@0
   474
	Specifies the various type of direct snapshot support.
sl@0
   475
	The enumeration list may be extended in future.
sl@0
   476
	*/	
sl@0
   477
	enum TDirectSnapshotType
sl@0
   478
		{
sl@0
   479
		/** Direct snapshot not supported. */
sl@0
   480
		EDirectSnapshotNotSupported			= 0x00,
sl@0
   481
		/** Direct Snapshot supported. It will be displayed on the same direct viewfinder screen, out of which it has 
sl@0
   482
		been created */
sl@0
   483
		EDirectSnapshotSupported			= 0x01
sl@0
   484
		};
sl@0
   485
sl@0
   486
	/** Provides any extra drive mode dependent parameters to be used for image capture. */ 
sl@0
   487
	class TDriveModeDependentAttributes
sl@0
   488
		{
sl@0
   489
	public:
sl@0
   490
		IMPORT_C TDriveModeDependentAttributes();
sl@0
   491
sl@0
   492
		IMPORT_C TUint Size() const;
sl@0
   493
		IMPORT_C TUint Version() const;
sl@0
   494
sl@0
   495
	private:
sl@0
   496
		//for future expansion
sl@0
   497
		TUint iSize:24;
sl@0
   498
		TUint iVersion:8;
sl@0
   499
sl@0
   500
		//for future use
sl@0
   501
		TInt iReserved1;
sl@0
   502
		TInt iReserved2;
sl@0
   503
		TInt iReserved3;
sl@0
   504
sl@0
   505
	public:
sl@0
   506
		/** If drive mode is EDriveModeTimeNudgeCapture this represents the number of images to be captured
sl@0
   507
		(pre-capture images) before client initiates actual image capture operation. */
sl@0
   508
		TInt iParam1;
sl@0
   509
		/** If drive mode is EDriveModeTimeNudgeCapture this represents the number of images to be captured
sl@0
   510
		(post-capture images) after client initiates actual image capture operation. */
sl@0
   511
		TInt iParam2;
sl@0
   512
		};
sl@0
   513
sl@0
   514
	/**
sl@0
   515
	Specifies the available processing options.
sl@0
   516
	The enumeration list may be extended in future.
sl@0
   517
	
sl@0
   518
	@publishedPartner
sl@0
   519
	@prototype
sl@0
   520
	*/	
sl@0
   521
	enum TEcamProcessingOptions
sl@0
   522
		{
sl@0
   523
		/** Processing options are not supported.*/
sl@0
   524
		EEcamProcessingNone 		= 0x00000000,
sl@0
   525
		/** Enable normal processing when image capture is initiated.*/
sl@0
   526
		EEcamNormalProcessing 		= 0x00000001,
sl@0
   527
		/** Enable background processing when image capture is initiated.*/
sl@0
   528
		EEcamBackgroundProcessing 	= 0x00000002
sl@0
   529
		};
sl@0
   530
		
sl@0
   531
	/** Provides the parameters necessary to perform set-up and allocation of memory for the images to be captured.	*/
sl@0
   532
	class TPrepareImageParameters
sl@0
   533
		{
sl@0
   534
	public:
sl@0
   535
		IMPORT_C TPrepareImageParameters();
sl@0
   536
		
sl@0
   537
		IMPORT_C TUint Size() const;
sl@0
   538
		IMPORT_C TUint Version() const;
sl@0
   539
		
sl@0
   540
		IMPORT_C void SetImageProcessingOptions(TUint aImageProcessingOptions);
sl@0
   541
		IMPORT_C void GetImageProcessingOptions(TUint& aImageProcessingOptions) const;
sl@0
   542
				
sl@0
   543
	private:
sl@0
   544
		//for future expansion
sl@0
   545
		TUint iSize:24;
sl@0
   546
		TUint iVersion:8;
sl@0
   547
		
sl@0
   548
		//for future use
sl@0
   549
		TInt iReserved1;
sl@0
   550
		TInt iReserved2;
sl@0
   551
		/** Bitfield of selected TEcamProcessingOptions which should be used after the images are captured from the sensor. */
sl@0
   552
		TUint iImageProcessingOptions;
sl@0
   553
		
sl@0
   554
	public:
sl@0
   555
		/** The image format. */
sl@0
   556
		CCamera::TFormat iImageFormat;
sl@0
   557
		/** The image size. */
sl@0
   558
		TSize iImageSize;
sl@0
   559
		/** Pixel aspect ratio to be used for the image. */
sl@0
   560
		CCamera::CCameraAdvancedSettings::TPixelAspectRatio iPixelAspectRatio;
sl@0
   561
		/** The drive mode in which the images will be captured. */
sl@0
   562
		CCamera::CCameraAdvancedSettings::TDriveMode iDriveMode;
sl@0
   563
		/** The number of images to be captured if the drive mode is burst. */
sl@0
   564
		TInt iBurstImages;
sl@0
   565
		/** The maximum memory size in kilo bytes when encoding to the image format. This shall be 
sl@0
   566
		KECamNoSpecificMaxMemorySize if client has no specific preference or if this setting is not supported.
sl@0
   567
		In case of JPEG, the maximum memory size will take preference over JPEG quality if the maximum memory size is 
sl@0
   568
		not sufficient to achieve the desired quality. Refer CCamera::JpegQuality(). */ 
sl@0
   569
		TInt iImageMaxMemorySize;
sl@0
   570
		/** Identifies the rectangle to which the image is to be clipped.
sl@0
   571
		If no specifc clipping rectangle desired by the client, the clipping region can be given by 
sl@0
   572
		origin as the top-left corner and size as iImageSize. */
sl@0
   573
		TRect iClipRect;
sl@0
   574
		/** The attributes dependent on the type of drive mode used. */
sl@0
   575
		TDriveModeDependentAttributes iDriveModeAttributes;
sl@0
   576
		};
sl@0
   577
	
sl@0
   578
private:
sl@0
   579
	/**
sl@0
   580
	Different types of color space. Camera will print or capture images in given color space.
sl@0
   581
	The enumeration list may be extended in future.
sl@0
   582
	
sl@0
   583
	@internalTechnology
sl@0
   584
	*/	
sl@0
   585
	enum TColorSpace
sl@0
   586
		{
sl@0
   587
		/** not known */
sl@0
   588
		EColorSpaceUnknown 				= 0x0000,
sl@0
   589
		/** sRGB color space */
sl@0
   590
		EColorSpacesRGB					= 0x0001,
sl@0
   591
		/** adobeRGB color space */
sl@0
   592
		EColorSpaceAdobeRGB				= 0x0002,
sl@0
   593
		/** adobeWideGamutRGB color space */
sl@0
   594
		EColorSpaceAdobeWideGamutRGB	= 0x0004,
sl@0
   595
		/** CMY(K) color space */
sl@0
   596
		EColorSpaceCMYK					= 0x0008,
sl@0
   597
		/** YIQ color space*/
sl@0
   598
		EColorSpaceYIQ					= 0x0010,
sl@0
   599
		/** YUV color space */
sl@0
   600
		EColorSpaceYUV					= 0x0020,
sl@0
   601
		/** YDbDr color space */
sl@0
   602
		EColorSpaceYDbDr				= 0x0040,
sl@0
   603
		/** YCbCr color space */
sl@0
   604
		EColorSpaceYCbCr				= 0x0080,
sl@0
   605
		/** HSB color space */
sl@0
   606
		EColorSpaceHSB					= 0x0100,
sl@0
   607
		/** HSL color space */
sl@0
   608
		EColorSpaceHSL					= 0x0200
sl@0
   609
		};
sl@0
   610
		
sl@0
   611
	/** 
sl@0
   612
	Specifies direction of panning. 
sl@0
   613
	The enumeration list may be extended in future.
sl@0
   614
	
sl@0
   615
	@internalTechnology
sl@0
   616
	*/
sl@0
   617
	enum TPanoDirection
sl@0
   618
		{
sl@0
   619
		/** Viewfinder displays towards the right of already captured images */
sl@0
   620
		EPanoRight,
sl@0
   621
		/** Viewfinder displays towards the left of already captured images */
sl@0
   622
		EPanoLeft,
sl@0
   623
		/** Viewfinder displays towards the top of already captured images */
sl@0
   624
		EPanoUp,
sl@0
   625
		/** Viewfinder displays towards the bottom of already captured images */
sl@0
   626
		EPanoDown  
sl@0
   627
		};
sl@0
   628
	
sl@0
   629
	/** 
sl@0
   630
	Specifies the stitching options when panning is started.
sl@0
   631
	The enumeration list may be extended in future.
sl@0
   632
	
sl@0
   633
	@internalTechnology
sl@0
   634
	*/
sl@0
   635
	enum TStitchingOption
sl@0
   636
		{
sl@0
   637
		/** Stitching of panned images is not supported by the ECAM Implementation.*/
sl@0
   638
		EStitchingOptionNone			= 0x00,
sl@0
   639
		/** Stitching of panned images can be done by the ECAM Implementation.*/
sl@0
   640
		EStitchingOptionEnable			= 0x01,
sl@0
   641
		/** Stitching of panned images can be disabled/discarded by the ECAM Implementation.*/
sl@0
   642
		EStitchingOptionDisable			= 0x02
sl@0
   643
		};
sl@0
   644
		
sl@0
   645
	/** 
sl@0
   646
	Specifies whether the panned images captured under 'stitching enabled option' would be discarded by the implementation.
sl@0
   647
	The enumeration list may be extended in future.
sl@0
   648
	
sl@0
   649
	@internalTechnology
sl@0
   650
	*/
sl@0
   651
	enum TStitchedImageRetrieval
sl@0
   652
		{
sl@0
   653
		/** allow ecam implementation to provide the stitched images. */
sl@0
   654
		EStitchedImageRetrieve,
sl@0
   655
		/** instruct ECAM Implementation to discard the stitched images. */
sl@0
   656
		EStitchedImageDiscard
sl@0
   657
		};
sl@0
   658
	
sl@0
   659
public:
sl@0
   660
	/** 
sl@0
   661
	Provides information regarding streamed image buffers or sub-frames. 
sl@0
   662
	@publishedPartner
sl@0
   663
	*/
sl@0
   664
	class TImageBufferInfo
sl@0
   665
		{
sl@0
   666
	public:
sl@0
   667
		IMPORT_C TImageBufferInfo(); 
sl@0
   668
		
sl@0
   669
		IMPORT_C TUint Size() const;
sl@0
   670
		IMPORT_C TUint Version() const;
sl@0
   671
sl@0
   672
		IMPORT_C TBool IsSubFrameUsed() const ;
sl@0
   673
		
sl@0
   674
		IMPORT_C void SetSubFrameState(TBool aIsSubFrameUsed);
sl@0
   675
		
sl@0
   676
		IMPORT_C TBool IsParallelStreamedBufferUsed() const;
sl@0
   677
		
sl@0
   678
		IMPORT_C void SetParallelStreamedBufferState(TBool aIsParallelStreamedBufferUsed);
sl@0
   679
		
sl@0
   680
		IMPORT_C TUint SubFrameSequenceNumber() const;
sl@0
   681
		
sl@0
   682
		IMPORT_C TInt SetSubFrameSequenceNumber(TUint aSubFrameSequenceNumber);
sl@0
   683
		
sl@0
   684
		IMPORT_C TUint TotalSubFrames() const;
sl@0
   685
		
sl@0
   686
		IMPORT_C TInt SetTotalSubFrames(TUint aTotalSubFrames);
sl@0
   687
				
sl@0
   688
	private:
sl@0
   689
		//for future expansion
sl@0
   690
		TUint iSize:24;
sl@0
   691
		TUint iVersion:8; 
sl@0
   692
		
sl@0
   693
		//for future use
sl@0
   694
		TInt iReserved1;
sl@0
   695
		TInt iReserved2;
sl@0
   696
		TInt iReserved3;
sl@0
   697
		TInt iReserved4;
sl@0
   698
		TInt iReserved5;
sl@0
   699
		TInt iReserved6;
sl@0
   700
		TUint iReservedBits:11;
sl@0
   701
				
sl@0
   702
		/** Indicates whether the streamed image scheme or sub-frame scheme is being used. 
sl@0
   703
		One bit is enough to provide such information */
sl@0
   704
		TUint iIsSubFrameUsed:1;
sl@0
   705
		/** Indicates whether the parallel buffering is being used by the implementation in order to speed up the streamed
sl@0
   706
		image operation, as a whole. One bit is enough to provide such information. 
sl@0
   707
		Parallel buffering indicates that implementation is using more than one buffer to handle the various sub-frames;
sl@0
   708
		hence speeding up the operation.*/
sl@0
   709
		TUint iIsParallelBufferUsed:1;
sl@0
   710
		/** Sequence number of the sub-frame. 
sl@0
   711
		9 bits used for sequence no. assuming that KECamMaxTotalSubFrames sub-frames would be used at max */
sl@0
   712
		TUint iSubFrameSequenceNumber:9;
sl@0
   713
		/** Total number of sub-frames to be retrieved by the client in order to properly reconstruct the actual image.
sl@0
   714
		It does not give the number of outstanding sub-frames needed to reconstruct the image. 
sl@0
   715
		This value will be same for every sub-frames needed to re-construct the actual image. 
sl@0
   716
		Maximum no. of total sub-frames is KECamMaxTotalSubFrames.*/ 
sl@0
   717
		TUint iTotalSubFrames:10;
sl@0
   718
		
sl@0
   719
	public:
sl@0
   720
		/** The exact position of the sub-frame within the actual image frame. The actual image frame's bounding rectangle
sl@0
   721
		is defined by origin as top-left and TSize parameter used to prepare the image capture. */
sl@0
   722
		TRect iSubFramePosition;
sl@0
   723
		
sl@0
   724
		/** The parameters used for this image */
sl@0
   725
		TPrepareImageParameters iImageParameters;
sl@0
   726
		};
sl@0
   727
	
sl@0
   728
public:
sl@0
   729
	
sl@0
   730
    IMPORT_C static CCameraPreImageCaptureControl* NewL(CCamera& aCamera, MPreImageCaptureControlObserver& aPreImageCaptureControlObserver);
sl@0
   731
    
sl@0
   732
   	IMPORT_C void GetDirectSnapshotSupportInfoL(TUint& aIsDirectSnapshotSupported) const;
sl@0
   733
	
sl@0
   734
	IMPORT_C void GetSupportedEmbeddedStillCaptureSettingsL(RArray<TUid>& aSupportedEmbeddedStillCaptureSettings) const;
sl@0
   735
	
sl@0
   736
	IMPORT_C void GetSupportedDirectSavingTypeL(TDirectSavingType& aSupportedDirectSavingType) const;
sl@0
   737
	
sl@0
   738
	IMPORT_C void SetSequentialImageFilenameL(const TDesC8& aFilename, TInt aStartingSequenceNumber);
sl@0
   739
	
sl@0
   740
	IMPORT_C void SetLowerResolutionSequentialImageFilenameL(const TDesC8& aLowerResolutionFilename, TInt aStartingSequenceNumber);
sl@0
   741
sl@0
   742
    IMPORT_C void GetDirectSavingTypeL(TDirectSavingType& aDirectSavingType) const;
sl@0
   743
    
sl@0
   744
    IMPORT_C void SetDirectSavingTypeL(TDirectSavingType aDirectSavingType);
sl@0
   745
    
sl@0
   746
    IMPORT_C void GetCaptureEventSupportInfoL(TUint& aSupportedDriveModes) const;
sl@0
   747
	
sl@0
   748
	IMPORT_C void GetImageFormatsSupportedL(TUint& aImageFormatsSupported, const TSize& aSize) const;
sl@0
   749
	
sl@0
   750
	IMPORT_C void GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat aImageFormat, const TSize& aSize) const;
sl@0
   751
	
sl@0
   752
	IMPORT_C void PrepareImageCapture(const TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver);
sl@0
   753
	
sl@0
   754
	IMPORT_C void GetImageMaxMemorySizeSettingSupportInfoL(TBool& aIsImageMaxMemorySizeSettingSupported) const;
sl@0
   755
	
sl@0
   756
	IMPORT_C void GetImageMaxMemorySizeL(TUint& aMemorySize) const;
sl@0
   757
	
sl@0
   758
    IMPORT_C ~CCameraPreImageCaptureControl();
sl@0
   759
	
sl@0
   760
    IMPORT_C void GetSupportedProcessingOptionsL(TUint& aECamProcessingOptionsSupported) const;
sl@0
   761
	
sl@0
   762
private:
sl@0
   763
	CCameraPreImageCaptureControl(CCamera& aOwner);
sl@0
   764
	void ConstructL(MPreImageCaptureControlObserver& aPreImageCaptureControlObserver);
sl@0
   765
	
sl@0
   766
private:
sl@0
   767
	void GetMaximumSpotsL(CCamera::CCameraAdvancedSettings::TFocusMode aFocusMode, TInt& aMaximumSpots) const;
sl@0
   768
	void GetSupportedSpotsCombinationL(CCamera::CCameraAdvancedSettings::TFocusMode aFocusMode, RArray<TUint>& aPossibleSpotCombinations) const;
sl@0
   769
	void GetSpotsCombinationL(CCamera::CCameraAdvancedSettings::TFocusMode aFocusMode, TUint& aSpotsCombination) const;
sl@0
   770
	void SetSpotsCombination(CCamera::CCameraAdvancedSettings::TFocusMode aFocusMode, TUint aSpotsCombination);
sl@0
   771
sl@0
   772
	void GetStreamedImageSupportInfoL(TBool& aIsStreamedImageSupported) const;
sl@0
   773
    void EnableSubFramesL();
sl@0
   774
    void DisableSubFramesL();
sl@0
   775
	void GetSubFramesStateL(TBool& aIsSubFrameEnabled) const;
sl@0
   776
	void GetStreamedImageSupportedTransformationsL(RArray<TUid>& aStreamedImageSupportedTransformations) const;
sl@0
   777
	
sl@0
   778
	void GetPanoModeSupportInfoL(TBool& aIsPanoModeSupported, TInt& aSupportedStitchingOption) const;
sl@0
   779
	void StartPanoMode(TStitchingOption aStitchingOption);
sl@0
   780
	void StartPanoMode(TStitchingOption aStitchingOption, const RArray<TInt>& aVFHandle);
sl@0
   781
	void GetPanoDirectionL(TPanoDirection& aPanoDirection) const;
sl@0
   782
	void SetPanoDirection(TPanoDirection aPanoDirection);
sl@0
   783
	void StopPanoModeL(TStitchedImageRetrieval aStitchedImageRetrieval);
sl@0
   784
	
sl@0
   785
	void GetSupportedColorSpaceL(TUint& aSupportedColorSpace) const;
sl@0
   786
	void GetColorSpaceL(TColorSpace& aColorSpace) const;
sl@0
   787
	void SetColorSpace(TColorSpace aColorSpace);
sl@0
   788
	
sl@0
   789
	void StartEmbeddedStillCaptureSettingsL();
sl@0
   790
	void EndEmbeddedStillCaptureSettingsL();
sl@0
   791
	void GetFailedEmbeddedStillCaptureSettingsL(RArray<TUid>& aFailedEmbeddedStillCaptureSettings) const;
sl@0
   792
	
sl@0
   793
private:
sl@0
   794
	CCamera& iOwner;
sl@0
   795
	MCameraPreImageCaptureControl* iImpl;  // not owned
sl@0
   796
	};
sl@0
   797
	
sl@0
   798
/** 
sl@0
   799
CCameraImageCapture class exposes an API for capturing the image and controlling the overall capture. This class gets 
sl@0
   800
created by the implementation of MCameraPreImageCaptureControl::PrepareImageCapture and passed to the client through 
sl@0
   801
callback MPreImageCaptureControlObserver::PrepareImageComplete.
sl@0
   802
Destruction of this class is equivalent to releasing the resources owned in order to prepare and allocate memory for 
sl@0
   803
capturing images.
sl@0
   804
sl@0
   805
@note  This class is not intended for sub-classing and used to standardise existing
sl@0
   806
       varieties of implementations.
sl@0
   807
       
sl@0
   808
@note  If the class methods leave, the output type parameter value is not guaranteed to be valid.
sl@0
   809
sl@0
   810
@note  The use of this class implies that client will be able to issue image capture call even if previous
sl@0
   811
	   captures are still outstanding. 
sl@0
   812
	   
sl@0
   813
@note  Clients must implement an MCaptureImageObserver in order to use this CCameraImageCapture API. 
sl@0
   814
	   MCameraObserver2::ImageBufferReady will not be used with this class.
sl@0
   815
sl@0
   816
@publishedPartner
sl@0
   817
@prototype
sl@0
   818
*/
sl@0
   819
class CCamera::CCameraImageCapture : public CBase
sl@0
   820
	{
sl@0
   821
	/* so can use internal factory functions etc. */
sl@0
   822
	friend class CCamera;
sl@0
   823
	
sl@0
   824
	/* so can use the MCameraImageCapture* as well. */
sl@0
   825
	friend class CCameraPostImageCaptureControl;
sl@0
   826
	
sl@0
   827
public:
sl@0
   828
	IMPORT_C static CCameraImageCapture* CreateL(CCamera& aCamera, const CCamera::CCameraPreImageCaptureControl::
sl@0
   829
				        TPrepareImageParameters& aPrepareImageParameters, MCaptureImageObserver& aCaptureImageObserver);
sl@0
   830
sl@0
   831
	IMPORT_C CCamera::CCameraV2Histogram* CreateHistogramHandleL() const;
sl@0
   832
	
sl@0
   833
	IMPORT_C CCamera::CCameraSnapshot* GetSnapshotHandleL(TInt aClientViewFinderId) const;
sl@0
   834
	
sl@0
   835
	IMPORT_C CCamera::CCameraImageProcessing* GetTransformationHandleL() const;
sl@0
   836
	
sl@0
   837
	IMPORT_C void GetPrepareImageParametersL(CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters) const;
sl@0
   838
sl@0
   839
	IMPORT_C void CaptureImage();
sl@0
   840
	
sl@0
   841
	IMPORT_C void CancelCaptureImage();
sl@0
   842
	
sl@0
   843
	IMPORT_C void GetNumImagesExposedL(TUint& aNumImagesExposed) const;
sl@0
   844
	
sl@0
   845
	IMPORT_C void GetNumTotalImagesL(TUint& aNumTotalImages) const;
sl@0
   846
	
sl@0
   847
	IMPORT_C void GetPostCaptureControlHandleL(CCamera::CCameraPostImageCaptureControl*& aPostCaptureControlHandle, TPostCaptureControlId aPostCaptureControlId) const;
sl@0
   848
sl@0
   849
	IMPORT_C void SetCaptureImagePriorityL(TECamImagePriority aCaptureImagePriority);
sl@0
   850
	
sl@0
   851
	IMPORT_C void GetCaptureImagePriorityL(TECamImagePriority& aCaptureImagePriority) const;
sl@0
   852
	
sl@0
   853
	IMPORT_C void PauseProcessing(TUint aProcessingTypes);
sl@0
   854
	
sl@0
   855
	IMPORT_C void ResumeProcessingL(TUint aProcessingTypes);
sl@0
   856
	
sl@0
   857
	IMPORT_C ~CCameraImageCapture();
sl@0
   858
sl@0
   859
private:
sl@0
   860
	CCameraImageCapture(CCamera& aOwner);
sl@0
   861
	void ConstructL(const CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters& aPrepareImageParameters, 
sl@0
   862
												MCaptureImageObserver& aCaptureImageObserver);
sl@0
   863
	
sl@0
   864
	MCameraImageCapture* Impl() const;
sl@0
   865
	
sl@0
   866
private:
sl@0
   867
	CCamera& iOwner;
sl@0
   868
	MCameraImageCapture* iImpl;  // not owned
sl@0
   869
	};
sl@0
   870
	
sl@0
   871
/** This class is used to provide further information about still image data.
sl@0
   872
sl@0
   873
@see MCameraBuffer
sl@0
   874
@see MCameraBuffer2
sl@0
   875
sl@0
   876
@publishedPartner
sl@0
   877
@prototype
sl@0
   878
*/
sl@0
   879
class MCameraImageBuffer : public MCameraBuffer2
sl@0
   880
	{
sl@0
   881
public:
sl@0
   882
	/**
sl@0
   883
	Retrieves information regarding the image data received.
sl@0
   884
	
sl@0
   885
	@param aImageBufferInfo
sl@0
   886
		   Retrieves the info regarding the image data received.
sl@0
   887
	
sl@0
   888
	@return KErrArgument if implementation finds a different extended version of the TImageBufferInfo class.
sl@0
   889
sl@0
   890
	@return May leave with other error codes.
sl@0
   891
		    
sl@0
   892
	@note  When there is a sub-frame, each image buffer retrieved contains only one sub-frame. If any of the subframe 
sl@0
   893
		   delivery reports an error, then no further subframes of this image would be delivered to the client.
sl@0
   894
	
sl@0
   895
	@note  Also retrieves information in order to distinguish the retrieved image buffer when shot-to-shot reduced latency 
sl@0
   896
		   scheme is used.
sl@0
   897
	*/
sl@0
   898
	virtual TInt GetImageBufferInfo(CCamera::CCameraPreImageCaptureControl::TImageBufferInfo& aImageBufferInfo) const=0;
sl@0
   899
	};
sl@0
   900
	
sl@0
   901
/** 
sl@0
   902
CCameraPostImageCaptureControl class exposes an API for retrieving the image data from individual images (in case 
sl@0
   903
continuous drive mode is used for capturing the images) and also to apply control on the captured images individually.
sl@0
   904
sl@0
   905
CCameraPostImageCaptureControl instances will be owned by CCameraImageCapture and would be available until new capture 
sl@0
   906
command is issued using the owning CCameraImageCapture instance. If client wishes to initiate new capture but preserve 
sl@0
   907
the CCameraPostImageCaptureControl instances from previous capture, it would have to create a new CCameraImageCapture 
sl@0
   908
instance and use that for the new capture.
sl@0
   909
sl@0
   910
@note  This class is not intended for sub-classing and used to standardise existing
sl@0
   911
       varieties of implementations.
sl@0
   912
       
sl@0
   913
@note  If the class methods leave, the output type parameter value is not guaranteed to be valid.
sl@0
   914
sl@0
   915
@note  The use of this class implies that client will be able to issue image capture call even if previous
sl@0
   916
	   captures are still outstanding. 
sl@0
   917
	   
sl@0
   918
@note  Clients must implement an MCaptureImageObserver in order to use this CCameraPostImageCaptureControl API. 
sl@0
   919
	   MCameraObserver2::ImageBufferReady will not be used with this class.
sl@0
   920
sl@0
   921
@publishedPartner
sl@0
   922
@prototype
sl@0
   923
*/
sl@0
   924
class CCamera::CCameraPostImageCaptureControl : public CBase
sl@0
   925
	{
sl@0
   926
public:
sl@0
   927
	/**
sl@0
   928
	Specifies the various states in which the individual images could be.
sl@0
   929
	The enumeration list may be extended in future.
sl@0
   930
	*/
sl@0
   931
	enum TImageState
sl@0
   932
		{
sl@0
   933
		/** The image has been exposed to the sensor but still pending for any processing options. */
sl@0
   934
		EProcessingPending,
sl@0
   935
		/** The image is undergoing processing for the required processing options. */
sl@0
   936
		EProcessingOngoing,
sl@0
   937
		/** The processing options associated with the image has been cancelled. */
sl@0
   938
		EProcessingCancelled,
sl@0
   939
		/** The processing options associated with the image has been completed. This implies that either the
sl@0
   940
			image buffers are ready or the image is directly saved to the file. */
sl@0
   941
		EProcessingCompleted
sl@0
   942
		};
sl@0
   943
		
sl@0
   944
	/**
sl@0
   945
	Specifies the various states in which the individual image buffers could be.
sl@0
   946
	The enumeration list may be extended in future.
sl@0
   947
	*/
sl@0
   948
	enum TBufferState
sl@0
   949
		{
sl@0
   950
		/** If Direct Saving option used, then user accessible buffers are not present. Hence buffer state will always be EBufferNotPresent.
sl@0
   951
			If Direct Saving option not used, this buffer state implies that processing options have not been completed. */
sl@0
   952
		EBufferNotPresent,
sl@0
   953
		/** This buffer state implies that processing options have been completed. Client may retrieve the image buffers 
sl@0
   954
			once this state is reached. */
sl@0
   955
		EBufferReady,
sl@0
   956
		/** This buffer state implies that client has released the image buffers after retrieving the data. */
sl@0
   957
		EBufferReleased
sl@0
   958
		};
sl@0
   959
		
sl@0
   960
public:
sl@0
   961
	IMPORT_C static CCameraPostImageCaptureControl* CreateL(CCameraImageCapture* aCameraImageCapture, TPostCaptureControlId aPostCaptureControlId);
sl@0
   962
	
sl@0
   963
	IMPORT_C void GetPostCaptureControlId(TPostCaptureControlId& aPostCaptureControlId) const;
sl@0
   964
	
sl@0
   965
	IMPORT_C CCamera::CCameraImageCapture* ImageCaptureHandle() const;
sl@0
   966
	
sl@0
   967
	IMPORT_C void GetImageSequenceNumberL(TUint& aSequenceNumber) const;
sl@0
   968
	
sl@0
   969
	IMPORT_C void CancelImage();
sl@0
   970
sl@0
   971
	IMPORT_C void SetImagePriorityL(TECamImagePriority aImagePriority);
sl@0
   972
	
sl@0
   973
	IMPORT_C void GetImagePriorityL(TECamImagePriority& aImagePriority) const;
sl@0
   974
	
sl@0
   975
	IMPORT_C void PauseProcessing(TUint aProcessingTypes);
sl@0
   976
	
sl@0
   977
	IMPORT_C void ResumeProcessingL(TUint aProcessingTypes);
sl@0
   978
sl@0
   979
	IMPORT_C void GetImageBufferL(MCameraImageBuffer& aCameraImageBuffer) const;
sl@0
   980
	
sl@0
   981
	IMPORT_C void GetImageStateL(TImageState& aImageState) const;
sl@0
   982
	
sl@0
   983
	IMPORT_C void GetBufferStateL(TBufferState& aBufferState) const;
sl@0
   984
	
sl@0
   985
	IMPORT_C ~CCameraPostImageCaptureControl();
sl@0
   986
sl@0
   987
private:
sl@0
   988
	CCameraPostImageCaptureControl(CCamera::CCameraImageCapture* aCameraImageCapture, TPostCaptureControlId aPostCaptureControlId);
sl@0
   989
	void ConstructL();
sl@0
   990
	
sl@0
   991
private:
sl@0
   992
	TPostCaptureControlId iPostCaptureControlId;
sl@0
   993
	CCamera::CCameraImageCapture* iCameraImageCapture;	// not owned
sl@0
   994
	MCameraPostImageCaptureControl* iImpl;  // not owned
sl@0
   995
	};
sl@0
   996
	
sl@0
   997
/** 
sl@0
   998
Notification of set-up completion before video capture.
sl@0
   999
@note  If error is KErrECamImageResourceNotReleased and client wants to successfully call the Prepare method again, 
sl@0
  1000
	   client needs to delete all CCameraImageCapture objects and any Snapshot and Histogram objects associated with
sl@0
  1001
	   it as well.   
sl@0
  1002
	
sl@0
  1003
@note  If error is KErrECamVideoResourceNotReleased and client wants to successfully call the Prepare method again,
sl@0
  1004
	   client needs to call ReleaseVideoResource to unprepare video and then delete any Snapshot and Histogram 
sl@0
  1005
	   objects associated with it as well.
sl@0
  1006
*/
sl@0
  1007
static const TUid KUidECamEventVideoCaptureControlPrepareComplete = {KUidECamEventVideoCaptureControlPrepareCompleteUidValue};
sl@0
  1008
sl@0
  1009
/**
sl@0
  1010
Notifies that range of certain camera settings have been changed because of desired video settings.
sl@0
  1011
Client may call GetRangeAffectedSettingsL(RArray<TUid>& aRangeAffectedSettings) const to get the list of affected camera settings.
sl@0
  1012
*/
sl@0
  1013
static const TUid KUidECamEventVideoCaptureControlSettingsRangeChanged = {KUidECamEventVideoCaptureControlSettingsRangeChangedUidValue};
sl@0
  1014
sl@0
  1015
/**
sl@0
  1016
Notifies that value of certain camera settings have been changed because of desired video settings.
sl@0
  1017
Client may call GetValueAffectedSettingsL(RArray<TUid>& aValueAffectedSettings) const to get the list of affected camera settings.
sl@0
  1018
*/
sl@0
  1019
static const TUid KUidECamEventVideoCaptureControlSettingsValueChanged = {KUidECamEventVideoCaptureControlSettingsValueChangedUidValue};
sl@0
  1020
sl@0
  1021
/**
sl@0
  1022
Notifies that value of certain camera settings have been disabled because of desired video settings.
sl@0
  1023
Client may call GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const to get the list of affected camera settings.
sl@0
  1024
*/
sl@0
  1025
static const TUid KUidECamEventVideoCaptureControlSettingsDisabled = {KUidECamEventVideoCaptureControlSettingsDisabledUidValue};
sl@0
  1026
sl@0
  1027
/**
sl@0
  1028
A mixin class to be implemented by the client in order to use the video capture control API(CCameraVideoCaptureControl). 
sl@0
  1029
The derived class methods are called by the implementation when the video capture operations are ready to be notified 
sl@0
  1030
accordingly.
sl@0
  1031
sl@0
  1032
@see CCamera::CCameraVideoCaptureControl
sl@0
  1033
*/
sl@0
  1034
class MCaptureVideoObserver
sl@0
  1035
	{
sl@0
  1036
public:
sl@0
  1037
	/**
sl@0
  1038
	Implementation sends this callback in order to notify the client about the availability of video frames.
sl@0
  1039
	
sl@0
  1040
	@param  aVideoBuffer
sl@0
  1041
			Pointer to MCameraBuffer2 class object which retrieves the video frames. The ownership will be retained by 
sl@0
  1042
			the implementation. Client needs to call Release in order to indicate the implementation that the buffer can 
sl@0
  1043
			be re-used. Client shall never try to delete the pointer. NULL, if error.
sl@0
  1044
						
sl@0
  1045
	@param  aErrorCode
sl@0
  1046
			Appropriate error code.
sl@0
  1047
	*/
sl@0
  1048
	virtual void VideoBufferReady(MCameraBuffer2* aVideoBuffer, TInt aErrorCode)=0;
sl@0
  1049
																									  
sl@0
  1050
	/**
sl@0
  1051
	Implementation sends this callback in order to notify the client about the availability of client snapshot data for the
sl@0
  1052
	video being captured.
sl@0
  1053
	
sl@0
  1054
	If a call to CCameraSnapshot::EnableSnapshotL() (on the CCameraVideoCaptureControl instance) is made without a 
sl@0
  1055
	successful call to CCameraSnapshot::PrepareSnapshotL(const TSnapshotParameters& aSnapshotParameters) (on the 
sl@0
  1056
	CCameraVideoCaptureControl instance), then the callback returns KErrBadHandle.
sl@0
  1057
	
sl@0
  1058
	@param  aSnapshotBuffer
sl@0
  1059
			Pointer to MCameraBuffer2 class object which retrieves the snapshot for the video being captured. The 
sl@0
  1060
			ownership will be retained by the implementation. Client needs to call Release in order to indicate the 
sl@0
  1061
			implementation that the buffer can be re-used. Client shall never try to delete the pointer. NULL, if error.
sl@0
  1062
	
sl@0
  1063
	@param  aErrorCode
sl@0
  1064
			Appropriate error code. 
sl@0
  1065
	*/
sl@0
  1066
	virtual void ClientSnapshotReady(MCameraBuffer2* aSnapshotBuffer, TInt aErrorCode)=0;
sl@0
  1067
	
sl@0
  1068
	/**
sl@0
  1069
	Implementation sends this callback in order to notify the client about availability of the histogram data. If a call 
sl@0
  1070
	to CCameraV2Histogram::StartHistogram() is made without a previous successful call to CCameraV2Histogram::
sl@0
  1071
	PrepareClientHistogramL() then the callback returns KErrBadHandle.
sl@0
  1072
	
sl@0
  1073
	@param  aClientHistogramBuffer
sl@0
  1074
			Pointer to MHistogramV2Buffer which retrieves a single histogram alongwith relevant information about it. The 
sl@0
  1075
			ownership will be retained by the implementation. Client needs to call Release in order to indicate the 
sl@0
  1076
			implementation that the buffer can be re-used. Client shall never try to delete the pointer. NULL, if error.
sl@0
  1077
			
sl@0
  1078
	@param  aErrorCode
sl@0
  1079
			Appropriate error code. 
sl@0
  1080
	
sl@0
  1081
	@note   Client shall use the currently available histogram for the video frames until a new histogram is available.
sl@0
  1082
	*/
sl@0
  1083
	virtual void ClientHistogramReady(MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode)=0;
sl@0
  1084
	
sl@0
  1085
	/**
sl@0
  1086
	Implementation sends this callback in order to notify the client about the failure of image processing for the video 
sl@0
  1087
	frames.
sl@0
  1088
	
sl@0
  1089
	@param  aErrorCode
sl@0
  1090
			The reason of failure of the image processing. 
sl@0
  1091
	*/
sl@0
  1092
	virtual void ImageProcessingFailed(TInt aErrorCode)=0;
sl@0
  1093
	
sl@0
  1094
	/**
sl@0
  1095
	Implementation sends this callback in order to notify the client about the failure of direct video capture operation.
sl@0
  1096
	
sl@0
  1097
	@param  aErrorCode
sl@0
  1098
			The reason of failure of the direct video capture. The error code could be ECam specific. Client shall 
sl@0
  1099
			be prepared to handle unrecognized error code.
sl@0
  1100
	*/
sl@0
  1101
	virtual void DirectVideoCaptureFailed(TInt aErrorCode)=0;
sl@0
  1102
	
sl@0
  1103
	/**
sl@0
  1104
	Gets a custom interface for future callbacks. This method will be called by the implementation to get a new interface
sl@0
  1105
	which would support future callbacks.
sl@0
  1106
sl@0
  1107
	@param  aInterface
sl@0
  1108
		    The Uid of the particular interface function required for callbacks.
sl@0
  1109
		   
sl@0
  1110
	@param  aPtrInterface
sl@0
  1111
		    The implementation has to type-cast the retrieved custom interface pointer to the appropriate type.	
sl@0
  1112
sl@0
  1113
	@return The error code.
sl@0
  1114
	*/
sl@0
  1115
	virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface)=0;
sl@0
  1116
	};
sl@0
  1117
sl@0
  1118
/** 
sl@0
  1119
CCamera Video Capture Control class exposes an API for controlling operations related to video capture. This gives priority
sl@0
  1120
to the low latency aspect by postponing the post processing activity involved with current video captured data(while 
sl@0
  1121
stopping the video capture) in order to capture/prepare for next still image.
sl@0
  1122
sl@0
  1123
@note This class is not intended for sub-classing and used to standardise existing varieties of implementations.
sl@0
  1124
       
sl@0
  1125
@note  If the class methods leave, any reference argument is not guaranteed to be valid.
sl@0
  1126
sl@0
  1127
@note  Clients must implement an MCaptureVideoObserver in order to use this CCameraVideoCaptureControl API. 
sl@0
  1128
	   MCameraObserver2::VideoBufferReady will not be used with this class.
sl@0
  1129
sl@0
  1130
@publishedPartner
sl@0
  1131
@prototype
sl@0
  1132
*/
sl@0
  1133
class CCamera::CCameraVideoCaptureControl : public CBase
sl@0
  1134
	{
sl@0
  1135
	/* so can use internal factory functions etc. */
sl@0
  1136
	friend class CCamera;
sl@0
  1137
	
sl@0
  1138
public:
sl@0
  1139
	
sl@0
  1140
	/** 
sl@0
  1141
	Specifies video capture state. 
sl@0
  1142
	The enumeration list may be extended in future.
sl@0
  1143
	*/ 
sl@0
  1144
	enum TVideoCaptureState
sl@0
  1145
		{
sl@0
  1146
		/** Video Capture has been prepared but not yet started */  
sl@0
  1147
		EVideoCapturePrepared, 	 
sl@0
  1148
		/** Video Capture has been started and is running */
sl@0
  1149
		EVideoCaptureActive,	 
sl@0
  1150
		/** Video Capture has been started and is paused */
sl@0
  1151
		EVideoCapturePaused,
sl@0
  1152
		/** Video Capture has been stopped or not yet prepared */
sl@0
  1153
		EVideoCaptureInActive
sl@0
  1154
		};
sl@0
  1155
	
sl@0
  1156
	/** 
sl@0
  1157
	Specifies the various embedded still capture support. 
sl@0
  1158
	The enumeration list may be extended in future.
sl@0
  1159
	*/	
sl@0
  1160
	enum TEmbeddedStillCaptureTypes
sl@0
  1161
		{
sl@0
  1162
		/** Embedded still capture not supported */
sl@0
  1163
		EEmbeddedStillCaptureNotSupported = 0x00,
sl@0
  1164
		/** Embedded still capture supported */
sl@0
  1165
		EEmbeddedStillCaptureSupported	= 0x01
sl@0
  1166
		};
sl@0
  1167
		
sl@0
  1168
	/** 
sl@0
  1169
	Specifies the various video capture types. 
sl@0
  1170
	The enumeration list may be extended in future.
sl@0
  1171
	*/	
sl@0
  1172
	enum TVideoCaptureType
sl@0
  1173
		{
sl@0
  1174
		/** Video capture not supported. */
sl@0
  1175
		EVideoCaptureNotSupported = 0x00,
sl@0
  1176
		/** Client video capture - Client video capture is a concept under which
sl@0
  1177
		video buffers will be available to the clients of ECam through the 
sl@0
  1178
		dedicated observer MCaptureVideoObserver::VideoBufferReady(). Video frame 
sl@0
  1179
		formats used under this client video capture can be either compressed video 
sl@0
  1180
		frames or uncompressed video frames which are available through CCamera::TFormat. */
sl@0
  1181
		EClientVideoCapture = 0x01,
sl@0
  1182
		/** Direct video capture - Direct video capture is a concept under which
sl@0
  1183
		video buffers will not be available to the clients of ECam through the dedicated observers. Video frames will be used
sl@0
  1184
		by the ECam adaptation and could be passed internally to other components. Video frame formats used under this direct
sl@0
  1185
		video capture can be either compressed video frames or uncompressed video frames which are available through 
sl@0
  1186
		CCamera::TFormat. */
sl@0
  1187
		EDirectVideoCapture = 0x02
sl@0
  1188
		};
sl@0
  1189
		
sl@0
  1190
	/** 
sl@0
  1191
	Specifies the fading effect for video captured frames. 
sl@0
  1192
	The enumeration list may be extended in future.
sl@0
  1193
	
sl@0
  1194
	@internalTechnology
sl@0
  1195
	*/
sl@0
  1196
	enum TFadingEffectState
sl@0
  1197
		{
sl@0
  1198
		/** The fading effect will be visible on video captured frames as well, 
sl@0
  1199
		whenever the viewfinder fading is enabled */
sl@0
  1200
		EFadingEffectEnabled,
sl@0
  1201
		/** The fading effect will not be visible on video captured frames, 
sl@0
  1202
		whenever the viewfinder fading is enabled */
sl@0
  1203
		EFadingEffectDisabled
sl@0
  1204
		};
sl@0
  1205
		
sl@0
  1206
	/** 
sl@0
  1207
	Provides information regarding parameters needed to prepare for video capture. 
sl@0
  1208
	*/
sl@0
  1209
	class TPrepareVideoParameters
sl@0
  1210
		{
sl@0
  1211
	public:
sl@0
  1212
		IMPORT_C TPrepareVideoParameters(); 
sl@0
  1213
		
sl@0
  1214
		IMPORT_C TUint Size() const;
sl@0
  1215
		IMPORT_C TUint Version() const;
sl@0
  1216
		
sl@0
  1217
		IMPORT_C TBool IsEmbeddedStillCaptureEnabled() const;
sl@0
  1218
		IMPORT_C void  SetEmbeddedStillCaptureState(TBool aIsEmbeddedStillCaptureEnabled);
sl@0
  1219
		
sl@0
  1220
		IMPORT_C CCamera::CCameraVideoCaptureControl::TVideoCaptureType VideoCaptureType() const;
sl@0
  1221
		IMPORT_C void SetVideoCaptureType(CCamera::CCameraVideoCaptureControl::TVideoCaptureType aVideoCaptureType);
sl@0
  1222
					
sl@0
  1223
	private:
sl@0
  1224
		//for future expansion
sl@0
  1225
		TUint iSize:24;
sl@0
  1226
		TUint iVersion:8; 
sl@0
  1227
		
sl@0
  1228
		//for future use
sl@0
  1229
		TInt iReserved1;
sl@0
  1230
		TInt iReserved2;
sl@0
  1231
		TInt iReserved3;
sl@0
  1232
	
sl@0
  1233
		TUint iReservedBits:26;
sl@0
  1234
		
sl@0
  1235
		TUint iVideoCaptureType:3;
sl@0
  1236
		
sl@0
  1237
		TUint iReservedBits2:2;
sl@0
  1238
				
sl@0
  1239
		/** Indicates whether the embedded still capture is enabled. 
sl@0
  1240
		One bit is enough to provide such information */
sl@0
  1241
		TUint iIsEmbeddedStillCaptureEnabled:1;
sl@0
  1242
sl@0
  1243
	public:
sl@0
  1244
		/** Format must be one of the video frame formats supported (see TCameraInfo::iVideoFrameFormatsSupported). */
sl@0
  1245
		CCamera::TFormat iFormat;
sl@0
  1246
		
sl@0
  1247
		/** Pixel aspect ratio to be used for the image. */
sl@0
  1248
		CCamera::CCameraAdvancedSettings::TPixelAspectRatio iPixelAspectRatio;
sl@0
  1249
		
sl@0
  1250
		/** Size index must be in the range 0 to TCameraInfo::iNumVideoFrameSizesSupported-1 inclusive. */
sl@0
  1251
		TInt iSizeIndex;
sl@0
  1252
		
sl@0
  1253
		/** The rate must be in the range 0 to TCameraInfo::iNumVideoFrameRatesSupported-1 inclusive. */
sl@0
  1254
		TInt iRateIndex;
sl@0
  1255
		
sl@0
  1256
		/** The number of discrete buffers to use. */
sl@0
  1257
		TInt iBuffersToUse;
sl@0
  1258
		
sl@0
  1259
		/** This indirectly indicates how large the buffers are to be. Number of frames per buffer must be less than or 
sl@0
  1260
		equal to TCameraInfo::iMaxFramesPerBufferSupported. One buffer is returned to MCaptureVideoObserver::
sl@0
  1261
		VideoBufferReady() at a time. */
sl@0
  1262
		TInt iFramesPerBuffer;
sl@0
  1263
		
sl@0
  1264
		/** Identifies the rectangle to which the video frame has to be clipped.
sl@0
  1265
		If no specifc clipping rectangle desired by the client, the clipping region can be given by 
sl@0
  1266
		origin as the top-left corner and size as given by iSizeIndex. */
sl@0
  1267
		TRect iClipRect;
sl@0
  1268
		};
sl@0
  1269
		
sl@0
  1270
public:
sl@0
  1271
	
sl@0
  1272
    IMPORT_C static CCameraVideoCaptureControl* NewL(CCamera& aCamera, MCaptureVideoObserver& aCaptureVideoObserver);
sl@0
  1273
    
sl@0
  1274
    IMPORT_C CCamera::CCameraV2Histogram* CreateHistogramHandleL() const;
sl@0
  1275
    
sl@0
  1276
    IMPORT_C CCamera::CCameraSnapshot* GetSnapshotHandleL(TInt aClientViewFinderId) const;
sl@0
  1277
    
sl@0
  1278
    IMPORT_C CCamera::CCameraImageProcessing* GetTransformationHandleL() const;
sl@0
  1279
    
sl@0
  1280
    IMPORT_C void GetVideoFormatsSupportedL(TUint& aVideoFormatsSupported, const TSize& aSize) const;
sl@0
  1281
	
sl@0
  1282
	IMPORT_C void GetPixelAspectsSupportedL(TUint& aPixelAspectsSupported, CCamera::TFormat aVideoFormat, const TSize& aSize) const;
sl@0
  1283
	
sl@0
  1284
	IMPORT_C void GetEmbeddedStillCaptureSupportInfoL(TInt& aSupportedEmbeddedStillCaptureTypes) const;
sl@0
  1285
	
sl@0
  1286
    IMPORT_C void PrepareVideoCapture(const TPrepareVideoParameters& aPrepareVideoParameters);
sl@0
  1287
	
sl@0
  1288
	IMPORT_C void GetRangeAffectedSettingsL(RArray<TUid>& aRangeAffectedSettings) const;
sl@0
  1289
	
sl@0
  1290
	IMPORT_C void GetValueAffectedSettingsL(RArray<TUid>& aValueAffectedSettings) const;
sl@0
  1291
	
sl@0
  1292
	IMPORT_C void GetDisabledSettingsL(RArray<TUid>& aDisabledSettings) const;
sl@0
  1293
	
sl@0
  1294
	IMPORT_C void ReleaseVideoResource();
sl@0
  1295
	
sl@0
  1296
	IMPORT_C void StartVideoCaptureL();												
sl@0
  1297
	
sl@0
  1298
	IMPORT_C void StopVideoCapture();
sl@0
  1299
	
sl@0
  1300
	IMPORT_C void PauseVideoCapture();
sl@0
  1301
	
sl@0
  1302
	IMPORT_C void ResumeVideoCaptureL();
sl@0
  1303
	
sl@0
  1304
	IMPORT_C void GetFadingEffectStateL(TFadingEffectState& aFadingEffectState) const;
sl@0
  1305
	
sl@0
  1306
	IMPORT_C void SetFadingEffectState(TFadingEffectState aFadingEffectState);
sl@0
  1307
	
sl@0
  1308
	IMPORT_C void GetVideoCaptureStateL(TVideoCaptureState& aVideoCaptureState) const;
sl@0
  1309
    
sl@0
  1310
    IMPORT_C ~CCameraVideoCaptureControl();
sl@0
  1311
    
sl@0
  1312
    IMPORT_C void GetVideoCaptureSupportInfoL(TInt& aSupportedVideoCaptureTypes) const;
sl@0
  1313
    
sl@0
  1314
    IMPORT_C void GetPrepareVideoParametersL(TPrepareVideoParameters& aPrepareVideoParameters) const;
sl@0
  1315
    
sl@0
  1316
private:
sl@0
  1317
	CCameraVideoCaptureControl(CCamera& aOwner);
sl@0
  1318
	void ConstructL(MCaptureVideoObserver& aCaptureVideoObserver);
sl@0
  1319
	
sl@0
  1320
private:
sl@0
  1321
	void GetSupportedConversionCoefficientsL(TUint& aSupportedConversionCoefficients) const;
sl@0
  1322
    void GetConversionCoefficientL(TYuvCoefficients& aConversionCoefficients) const;
sl@0
  1323
    void SetConversionCoefficient(TYuvCoefficients aConversionCoefficients);
sl@0
  1324
 	
sl@0
  1325
private:
sl@0
  1326
	CCamera& iOwner;
sl@0
  1327
	MCameraVideoCaptureControl* iImpl;  // not owned
sl@0
  1328
	};
sl@0
  1329
	
sl@0
  1330
#endif //ECAMCAPTURECONTROL_H