epoc32/include/drivers/camerasc.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of the License "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
// e32\include\drivers\camerasc.h
williamr@4
    15
// 
williamr@4
    16
//
williamr@4
    17
williamr@4
    18
/**
williamr@4
    19
 @file
williamr@4
    20
 @internalAll
williamr@4
    21
 @prototype
williamr@4
    22
*/
williamr@4
    23
williamr@4
    24
#ifndef __CAMERASC_H__
williamr@4
    25
#define __CAMERASC_H__
williamr@4
    26
williamr@4
    27
#include <d32camerasc.h>
williamr@4
    28
#include <platform.h>
williamr@4
    29
#include <kernel/kpower.h>
williamr@4
    30
#include <e32ver.h>
williamr@4
    31
williamr@4
    32
/** The default number of buffers available to the client. */
williamr@4
    33
const TInt KDefaultNumClientBuffers=6;
williamr@4
    34
williamr@4
    35
/** The maximum number of client capture requests which may be outstanding at any time. */
williamr@4
    36
const TInt KMaxCamScRequestsPending=8;
williamr@4
    37
williamr@4
    38
/**
williamr@4
    39
@internalAll
williamr@4
    40
@prototype
williamr@4
    41
*/
williamr@4
    42
struct SBufSpecList
williamr@4
    43
	{
williamr@4
    44
	/** The first entry of the buffer offset list. This list holds the offset from the start of the chunk
williamr@4
    45
	for each buffer. This list is only valid if the flag KScFlagBufOffsetListInUse is set in
williamr@4
    46
	TSharedChunkBufConfigBase::iFlags. */
williamr@4
    47
	TInt iBufferOffset;
williamr@4
    48
	TInt iBufferId;
williamr@4
    49
	};
williamr@4
    50
williamr@4
    51
/**
williamr@4
    52
@internalAll
williamr@4
    53
@prototype
williamr@4
    54
*/
williamr@4
    55
class TCameraSharedChunkBufConfig : public TSharedChunkBufConfigBase
williamr@4
    56
	{
williamr@4
    57
public:
williamr@4
    58
 	struct SBufSpecList iSpec;
williamr@4
    59
	};
williamr@4
    60
williamr@4
    61
// Forward declarations
williamr@4
    62
class TImageBuffer;
williamr@4
    63
class DCameraScLdd;
williamr@4
    64
class DBufferManager;
williamr@4
    65
williamr@4
    66
/**
williamr@4
    67
The physical device driver (PDD) base class for the camera driver.
williamr@4
    68
@internalAll
williamr@4
    69
@prototype
williamr@4
    70
*/
williamr@4
    71
class DCameraScPdd : public DBase
williamr@4
    72
	{
williamr@4
    73
public:
williamr@4
    74
	/**
williamr@4
    75
    Return the DFC queue to be used by this device.
williamr@4
    76
    @param aUnit The unit number for which to get the DFC queue.
williamr@4
    77
    @return The DFC queue to use.
williamr@4
    78
    */
williamr@4
    79
	virtual TDfcQue* DfcQ(TInt aUnit)=0;
williamr@4
    80
williamr@4
    81
	/**
williamr@4
    82
	Return the capabilities of this camera device.
williamr@4
    83
	@param aCapsBuf A packaged TCameraCapsV02 object to be filled with the capabilities of the
williamr@4
    84
		device. This descriptor is in kernel memory and can be accessed directly.
williamr@4
    85
	@see TCameraCapsV02.
williamr@4
    86
	*/
williamr@4
    87
	virtual void Caps(TDes8& aCapsBuf) const=0;
williamr@4
    88
williamr@4
    89
	/**
williamr@4
    90
	Return data format information for a custom camera data format setting. Only required where support is
williamr@4
    91
	required for a data format that isn't supported by the LDD. Platforms which don't require support
williamr@4
    92
	for custom data settings need not implement this method.
williamr@4
    93
	@param aConfigBuf A packaged TCameraConfigV02 object containing the current camera driver configuration
williamr@4
    94
		(including an identifier for the custom setting required). This configuration object should be
williamr@4
    95
		updated by the PDD with the appropriate settings for the data format concerned. This descriptor
williamr@4
    96
		is in kernel memory and can be accessed directly.
williamr@4
    97
	@return KErrNone if successful, otherwise one of the other system wide error codes.
williamr@4
    98
	*/
williamr@4
    99
	virtual TInt SpecifyCustomConfig(TDes8& aConfigBuf);
williamr@4
   100
williamr@4
   101
	/**
williamr@4
   102
	Return the shared chunk create information to be used by this device.
williamr@4
   103
	@param aChunkCreateInfo A chunk create info. object to be to be filled with the settings
williamr@4
   104
							required for this device.
williamr@4
   105
	*/
williamr@4
   106
	virtual void GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo)=0;
williamr@4
   107
williamr@4
   108
	/**
williamr@4
   109
	Configure or reconfigure the device using the the configuration supplied.
williamr@4
   110
	@param aConfigBuf A packaged TCameraConfigV02 object which contains the new configuration settings.
williamr@4
   111
		This descriptor is in kernel memory and can be accessed directly.
williamr@4
   112
	@return KErrNone if successful, otherwise one of the other system wide error codes.
williamr@4
   113
	@see TCameraConfigV02.
williamr@4
   114
	*/
williamr@4
   115
	virtual TInt SetConfig(const TDesC8& aConfigBuf)=0;
williamr@4
   116
williamr@4
   117
	/**
williamr@4
   118
    Start the camera - start pixel sourcing.
williamr@4
   119
    @param aCaptureMode The capture mode to start. @see TDevCamCaptureMode.
williamr@4
   120
    @param aLinAddr The linear address of the start of the first buffer to use for image capture.
williamr@4
   121
	@param aPhysAddr The physical address that corresponds to the linear address: aLinAddr.
williamr@4
   122
    @return KErrNone if successful;
williamr@4
   123
    		otherwise one of the other system wide error codes.
williamr@4
   124
    */
williamr@4
   125
	virtual TInt Start(TDevCamCaptureMode aCaptureMode,TLinAddr aLinAddr,TPhysAddr aPhysAddr)=0;
williamr@4
   126
williamr@4
   127
	/**
williamr@4
   128
	Sets the address of the buffer into which the next image will be captured.
williamr@4
   129
    @param aLinAddr The linear address of the start of the buffer to use to capture the image frame.
williamr@4
   130
	@param aPhysAddr The physical address that corresponds to the linear address: aLinAddr.
williamr@4
   131
    @return KErrNone if the capture has been initiated successfully;
williamr@4
   132
  			KErrNotReady if the device is unable to accept the request for the moment;
williamr@4
   133
		  	otherwise one of the other system-wide error codes.
williamr@4
   134
    */
williamr@4
   135
	virtual TInt CaptureNextImage(TLinAddr aLinAddr,TPhysAddr aPhysAddr)=0;
williamr@4
   136
williamr@4
   137
	/**
williamr@4
   138
    Stop the camera - stop pixel sourcing.
williamr@4
   139
    @return KErrNone if successful, otherwise one of the other system wide error codes.
williamr@4
   140
    */
williamr@4
   141
	virtual TInt Stop()=0;
williamr@4
   142
williamr@4
   143
	/**
williamr@4
   144
	Power down the camera.
williamr@4
   145
	*/
williamr@4
   146
	virtual void PowerDown()=0;
williamr@4
   147
williamr@4
   148
	/**
williamr@4
   149
	Queries the driver for the size of the structure to be passed to RDevCameraSc::Caps().
williamr@4
   150
	*/
williamr@4
   151
	virtual TInt CapsSize()=0;
williamr@4
   152
williamr@4
   153
	/**
williamr@4
   154
	Returns the supported frame sizes that correspond to the desired capture mode and pixel format passed in.
williamr@4
   155
	@param aCaptureMode The capture mode for which to obtain the information.
williamr@4
   156
	@param aUidPixelFormat The pixel format for which to obtain the information.
williamr@4
   157
	@param aFrameSizeCapsBuf An appropriately sized buffer to be filled with the supported frame sizes.
williamr@4
   158
	@return KErrNone, if successful,
williamr@4
   159
			KErrArgument, if an invalid capture mode or pixel format is specified, or if aFrameSizeCapsBuf is too small;
williamr@4
   160
			otherwise one of the other system-wide error codes.
williamr@4
   161
	@see SDevCamFrameSize
williamr@4
   162
	*/
williamr@4
   163
	virtual TInt FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf)=0;
williamr@4
   164
williamr@4
   165
	/**
williamr@4
   166
	Sets the sensor brightness to the desired setting.
williamr@4
   167
williamr@4
   168
	@param aValue A verified brightness setting.
williamr@4
   169
	@return KErrNone if successful, KErrNotSupported if not supported.
williamr@4
   170
	*/
williamr@4
   171
	virtual TInt SetBrightness(TUint aValue) = 0;
williamr@4
   172
williamr@4
   173
	// SYM_BRANCH: Add support for setting of Dynamic Attributes. Contrast.
williamr@4
   174
	/**
williamr@4
   175
	Sets the sensor contrast to the desired setting.
williamr@4
   176
williamr@4
   177
	@param aValue A verified contrast setting.
williamr@4
   178
	@return KErrNone if successful, KErrNotSupported if not supported.
williamr@4
   179
	*/
williamr@4
   180
	virtual TInt SetContrast(TUint aValue) = 0;
williamr@4
   181
williamr@4
   182
	// SYM_BRANCH: Add support for setting of Dynamic Attributes. Colour Effect.
williamr@4
   183
	/**
williamr@4
   184
	Sets the sensor color effect to the desired setting.
williamr@4
   185
williamr@4
   186
	@param aValue A verified color effect setting.
williamr@4
   187
	@return KErrNone if successful, KErrNotSupported if not supported.
williamr@4
   188
	*/
williamr@4
   189
	virtual TInt SetColorEffect(TUint aValue) = 0;
williamr@4
   190
williamr@4
   191
public:
williamr@4
   192
	DCameraScLdd* iLdd;
williamr@4
   193
	};
williamr@4
   194
williamr@4
   195
/**
williamr@4
   196
The logical device (factory class) for the camera driver.
williamr@4
   197
*/
williamr@4
   198
class DCameraScLddFactory : public DLogicalDevice
williamr@4
   199
	{
williamr@4
   200
public:
williamr@4
   201
	DCameraScLddFactory();
williamr@4
   202
	virtual TInt Install();
williamr@4
   203
	virtual void GetCaps(TDes8 &aDes) const;
williamr@4
   204
	virtual TInt Create(DLogicalChannelBase*& aChannel);
williamr@4
   205
	TBool IsUnitOpen(TInt aUnit);
williamr@4
   206
	TInt SetUnitOpen(TInt aUnit,TBool aIsOpenSetting);
williamr@4
   207
private:
williamr@4
   208
	/** Mask to keep track of which units have a channel open on them. */
williamr@4
   209
	TUint iUnitsOpenMask;
williamr@4
   210
	/** A mutex to protect access to the unit info. mask. */
williamr@4
   211
	NFastMutex iUnitInfoMutex;
williamr@4
   212
	};
williamr@4
   213
williamr@4
   214
/**
williamr@4
   215
The class representing a single image buffer.
williamr@4
   216
*/
williamr@4
   217
class TImageBuffer : public SDblQueLink
williamr@4
   218
	{
williamr@4
   219
public:
williamr@4
   220
	TImageBuffer();
williamr@4
   221
	~TImageBuffer();
williamr@4
   222
	TInt Create(DChunk* aChunk,TInt aOffset,TInt aSize,TInt aId,TBool aIsContiguous);
williamr@4
   223
	void SyncMemoryBeforeDmaRead();
williamr@4
   224
	void SyncMemoryAfterDmaRead();
williamr@4
   225
public:
williamr@4
   226
	/** The buffer id */
williamr@4
   227
	TInt iId;
williamr@4
   228
	/** The chunk used for this buffer */
williamr@4
   229
	DChunk* iChunk;
williamr@4
   230
	/** The offset, in bytes, of the start of the buffer within the chunk. */
williamr@4
   231
	TInt iChunkOffset;
williamr@4
   232
	/** The size of the buffer in bytes. */
williamr@4
   233
	TInt iSize;
williamr@4
   234
	/** The virtual address of buffer. */
williamr@4
   235
	TLinAddr iLinearAddress;
williamr@4
   236
	/** The physical address of buffer. KPhysAddrInvalid if the buffer is not physically contiguous. */
williamr@4
   237
	TPhysAddr iPhysicalAddress;
williamr@4
   238
	/** A list of physical addresses for buffer pages. 0 if the buffer is physically contiguous. */
williamr@4
   239
	TPhysAddr* iPhysicalPages;
williamr@4
   240
	/** This is the result of the transfer into this buffer. */
williamr@4
   241
	TInt iResult;
williamr@4
   242
	};
williamr@4
   243
williamr@4
   244
/**
williamr@4
   245
An object encapsulating an image capture request from the client.
williamr@4
   246
*/
williamr@4
   247
class TCameraScRequest : public SDblQueLink
williamr@4
   248
	{
williamr@4
   249
public:
williamr@4
   250
	inline TCameraScRequest()
williamr@4
   251
		{}
williamr@4
   252
public:
williamr@4
   253
	/** The request status associated with the request - used to signal completion of the request and pass back a
williamr@4
   254
	completion code. */
williamr@4
   255
	TRequestStatus* iStatus;
williamr@4
   256
	};
williamr@4
   257
williamr@4
   258
/**
williamr@4
   259
An object encapsulating a queue of image capture requests from the client.
williamr@4
   260
*/
williamr@4
   261
class TCameraScRequestQueue
williamr@4
   262
	{
williamr@4
   263
public:
williamr@4
   264
	TCameraScRequestQueue(NFastMutex* aMutexPtr);
williamr@4
   265
	~TCameraScRequestQueue();
williamr@4
   266
	TInt Create(DThread* anOwningThread);
williamr@4
   267
	TInt Add(TRequestStatus* aStatus);
williamr@4
   268
	TRequestStatus* Remove();
williamr@4
   269
	void Cancel(TRequestStatus* aStatus);
williamr@4
   270
	void CancelAll();
williamr@4
   271
	inline TBool IsEmpty();
williamr@4
   272
private:
williamr@4
   273
	/** The queue of pending capture requests. */
williamr@4
   274
	SDblQue iPendRequestQ;
williamr@4
   275
	/** The queue of unused capture requests. */
williamr@4
   276
	SDblQue iUnusedRequestQ;
williamr@4
   277
	/** The actual array of request objects. */
williamr@4
   278
	TCameraScRequest* iRequest[KMaxCamScRequestsPending];
williamr@4
   279
	NFastMutex* iMutexPtr;
williamr@4
   280
	DThread* iOwningThread;
williamr@4
   281
	};
williamr@4
   282
williamr@4
   283
/**
williamr@4
   284
The buffer manager base class.
williamr@4
   285
*/
williamr@4
   286
class DBufferManager : public DBase
williamr@4
   287
	{
williamr@4
   288
public:
williamr@4
   289
	DBufferManager(DCameraScLdd* aLdd);
williamr@4
   290
	~DBufferManager();
williamr@4
   291
	TInt Create(TInt aNumBuffers,TInt aBufferSize);
williamr@4
   292
	TInt Create(TCameraSharedChunkBufConfig& aBufConfig,TInt aChunkHandle,DThread* anOwningThread);
williamr@4
   293
	void GetBufConfig(TCameraSharedChunkBufConfig& aBufConfig);
williamr@4
   294
	void Reset();
williamr@4
   295
	void Purge(TImageBuffer* aBuffer);
williamr@4
   296
	TImageBuffer* GetImageForClient(TBool aRemoveLast);
williamr@4
   297
	TImageBuffer* SetImageCaptured(TInt aResult);
williamr@4
   298
	TInt ReleaseImage(TInt aChunkOffset);
williamr@4
   299
	TImageBuffer* NextAvailableForCapture();
williamr@4
   300
	TImageBuffer* FindInUseImage(TInt aChunkOffset);
williamr@4
   301
protected:
williamr@4
   302
	TInt CreateBufferLists(TInt aNumBuffers);
williamr@4
   303
	TInt CommitMemoryForBuffer(TInt aChunkOffset,TInt aSize,TBool& aIsContiguous);
williamr@4
   304
protected:
williamr@4
   305
	/** The owning LDD object. */
williamr@4
   306
	DCameraScLdd* iLdd;
williamr@4
   307
	/** The chunk which contains the buffers. */
williamr@4
   308
	DChunk* iChunk;
williamr@4
   309
	/** The linear address in kernel process for the start of the chunk. */
williamr@4
   310
	TLinAddr iChunkBase;
williamr@4
   311
	/**< MMU mapping attributes that the chunk has actually been mapped with. */
williamr@4
   312
	TUint32 iChunkMapAttr;
williamr@4
   313
	/** The number of buffers. */
williamr@4
   314
	TInt iNumBuffers;
williamr@4
   315
	/** The actual array of buffer objects. */
williamr@4
   316
	TImageBuffer* iImageBuffer;
williamr@4
   317
	/** The buffer currently being filled by image capture. (Not in any list). */
williamr@4
   318
	TImageBuffer* iCurrentBuffer;
williamr@4
   319
	/** The next buffer to use for image capture. (Not in any list). */
williamr@4
   320
	TImageBuffer* iNextBuffer;
williamr@4
   321
	/** A queue of those buffers which are currently free. */
williamr@4
   322
	SDblQue iFreeBufferQ;
williamr@4
   323
	/** A queue of those buffers which currently contain captured images (and which aren't being used by the client). */
williamr@4
   324
	SDblQue iCompletedBufferQ;
williamr@4
   325
	/** A queue of those buffers which are currently being used by the client. */
williamr@4
   326
	SDblQue iInUseBufferQ;
williamr@4
   327
private:
williamr@4
   328
	friend class DCameraScLdd;
williamr@4
   329
	};
williamr@4
   330
williamr@4
   331
/**
williamr@4
   332
The configuration class that is specific for each capture mode. This allows the driver to maintain different configurations,
williamr@4
   333
one for each capture mode, and make switching between capture modes faster.
williamr@4
   334
*/
williamr@4
   335
class TCaptureModeConfig
williamr@4
   336
	{
williamr@4
   337
	private:
williamr@4
   338
		/** The handle to the chunk that is returned to the user side code. */
williamr@4
   339
		TInt iChunkHandle;
williamr@4
   340
		/** The current configuration of the capture mode */
williamr@4
   341
		TCameraConfigV02 iCamConfig;
williamr@4
   342
		/** The current configuration of the chunk. */
williamr@4
   343
		TCameraSharedChunkBufConfig* iBufConfig;
williamr@4
   344
		/** The size in bytes of the chunk configuration info. structure. */
williamr@4
   345
		TInt iBufConfigSize;
williamr@4
   346
		/** The current frame height. */
williamr@4
   347
		TInt iFrameHeight;
williamr@4
   348
		/** The current frame width. */
williamr@4
   349
		TInt iFrameWidth;
williamr@4
   350
		/** The buffer manager. */
williamr@4
   351
		DBufferManager* iBufManager;
williamr@4
   352
	private:
williamr@4
   353
		friend class DCameraScLdd;
williamr@4
   354
	};
williamr@4
   355
williamr@4
   356
/**
williamr@4
   357
The camera driver power handler class.
williamr@4
   358
*/
williamr@4
   359
class DCameraScPowerHandler : public DPowerHandler
williamr@4
   360
	{
williamr@4
   361
public:
williamr@4
   362
	DCameraScPowerHandler(DCameraScLdd* aChannel);
williamr@4
   363
	// Inherited from DPowerHandler
williamr@4
   364
	void PowerUp();
williamr@4
   365
	void PowerDown(TPowerState aPowerState);
williamr@4
   366
private:
williamr@4
   367
	DCameraScLdd* iChannel;
williamr@4
   368
	};
williamr@4
   369
williamr@4
   370
/**
williamr@4
   371
The logical channel class for the camera driver.
williamr@4
   372
*/
williamr@4
   373
class DCameraScLdd : public DLogicalChannel
williamr@4
   374
	{
williamr@4
   375
public:
williamr@4
   376
	enum TState
williamr@4
   377
		{
williamr@4
   378
		/** Channel open - but not configured. */
williamr@4
   379
		EOpen,
williamr@4
   380
		/** Channel configured - but inactive. */
williamr@4
   381
		EConfigured,
williamr@4
   382
		/** Channel is active - capturing images. */
williamr@4
   383
		ECapturing
williamr@4
   384
		};
williamr@4
   385
public:
williamr@4
   386
	DCameraScLdd();
williamr@4
   387
	virtual ~DCameraScLdd();
williamr@4
   388
	// Inherited from DLogicalChannel
williamr@4
   389
	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
williamr@4
   390
	virtual TInt Request(TInt aReqNo, TAny* a1, TAny* a2);
williamr@4
   391
	virtual void HandleMsg(TMessageBase* aMsg);
williamr@4
   392
	virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
williamr@4
   393
	inline DThread* OwningThread();
williamr@4
   394
	inline TInt CurrentFrameHeight();
williamr@4
   395
	inline TInt CurrentFrameWidth();
williamr@4
   396
	void Shutdown();
williamr@4
   397
	virtual TInt ImageCaptureCallback(TDevCamCaptureMode aCaptureMode,TInt aResult,TLinAddr* aLinAddr,TPhysAddr* aPhysAddr);
williamr@4
   398
	virtual void PanicClientThread(TInt aReason);
williamr@4
   399
private:
williamr@4
   400
	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
williamr@4
   401
	TInt DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2);
williamr@4
   402
	TInt DoCancel(TUint aMask);
williamr@4
   403
	TInt SetCaptureMode(TInt aCaptureMode);
williamr@4
   404
	TInt SetCamConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf);
williamr@4
   405
	TInt SetBufConfig(TInt aCaptureMode, const TDesC8* aBufferConfigBuf,TInt aChunkHandle);
williamr@4
   406
	TInt SetBufConfig(TInt aCaptureMode, TInt aNumBuffers);
williamr@4
   407
	TInt ChunkClose(TInt aCaptureMode);
williamr@4
   408
	TInt Start();
williamr@4
   409
	TInt NotifyNewImage(TRequestStatus* aStatus);
williamr@4
   410
	TInt ReleaseBuffer(TInt aChunkOffset);
williamr@4
   411
	TInt DoSetConfig(TInt aCaptureMode, const TDesC8* aCamConfigBuf);
williamr@4
   412
	TInt ValidateConfig(TInt aCaptureMode, TCameraConfigV02 &aConfig);
williamr@4
   413
	TInt DoValidateConfig(TCameraCapsV02* aCamCaps, TInt &aCaptureMode, TCameraConfigV02 &aConfig);
williamr@4
   414
	TInt DoStart();
williamr@4
   415
	TInt ReAllocBufferConfigInfo(TInt aCaptureMode, TInt aNumBuffers);
williamr@4
   416
	TInt ReAllocBufferConfigInfo(TInt aNumBuffers);
williamr@4
   417
	TInt GetSensorCaps(TAny* a1);
williamr@4
   418
	TInt GetFrameSizeCaps(TAny* a1, TAny* a2);
williamr@4
   419
	TInt GetDynamicAttribute(TInt aAttribute, TUint& aValue);
williamr@4
   420
	TInt SetDynamicAttribute(TInt aAttribute, TUint aValue);
williamr@4
   421
	inline DCameraScPdd* Pdd();
williamr@4
   422
	static void RestartDfc(TAny* aChannel);
williamr@4
   423
	static void PowerUpDfc(TAny* aPtr);
williamr@4
   424
	static void PowerDownDfc(TAny* aPtr);
williamr@4
   425
private:
williamr@4
   426
	/** An array of configurations for each capture mode. */
williamr@4
   427
	TCaptureModeConfig* iCaptureModeConfig;
williamr@4
   428
	/** The unit number of this channel. */
williamr@4
   429
	TInt iUnit;
williamr@4
   430
	/** The operating state of the channel. */
williamr@4
   431
	TState iState;
williamr@4
   432
	/** A pointer to the owning client thread. */
williamr@4
   433
	DThread* iOwningThread;
williamr@4
   434
	/** The current capture mode of the camera. */
williamr@4
   435
	TDevCamCaptureMode iCaptureMode;
williamr@4
   436
	/** The pending request queue. */
williamr@4
   437
	TCameraScRequestQueue iRequestQueue;
williamr@4
   438
	/** A mutex to protect access to the buffer lists and the pending request list. */
williamr@4
   439
	NFastMutex iMutex;
williamr@4
   440
	/** The camera driver power handler. */
williamr@4
   441
	DCameraScPowerHandler* iPowerHandler;
williamr@4
   442
	/** DFC used to re-start the PDD following a data capture error. */
williamr@4
   443
	TDfc iRestartDfc;
williamr@4
   444
	/** DFC used to handle power down requests from the power manager before a transition into system shutdown/standby. */
williamr@4
   445
	TDfc iPowerDownDfc;
williamr@4
   446
	/** DFC used to handle power up requests from the power manager following a transition out of system standby. */
williamr@4
   447
	TDfc iPowerUpDfc;
williamr@4
   448
	
williamr@4
   449
	// Used as a cache for values successfully set by SetDynamicAttribute().
williamr@4
   450
	TUint iBrightnessValue;
williamr@4
   451
	TUint iContrastValue;
williamr@4
   452
	TUint iColorEffectValue;
williamr@4
   453
	
williamr@4
   454
	friend class DCameraScPowerHandler;
williamr@4
   455
	friend class DBufferManager;
williamr@4
   456
	};
williamr@4
   457
williamr@4
   458
#include <drivers/camerasc.inl>
williamr@4
   459
williamr@4
   460
#endif	// __CAMERASC_H__