bsptemplate/asspandvariant/template_variant/camerasc/camerasc.cpp
changeset 0 a41df078684a
child 31 56f325a607ea
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // template\template_variant\camerasc\camerasc.cpp
       
    15 // Implementation of the template shared chunk camera physical device driver (PDD).
       
    16 // This file is part of the Template Base port
       
    17 // 
       
    18 //
       
    19 
       
    20 #include "camerasc_plat.h"
       
    21 
       
    22 _LIT(KCameraScPddName, "CameraSc.TE");
       
    23 _LIT(KCameraScDfcQueueName, "CameraSc.TE.DfcQ");
       
    24 
       
    25 /**
       
    26 Standard export function for PDD factories.  This creates a DPhysicalDevice derived object, in this case,
       
    27 DTemplateCameraScPddFactory.
       
    28 */
       
    29 DECLARE_STANDARD_PDD()
       
    30 	{
       
    31 	return new DTemplateCameraScPddFactory;
       
    32 	}
       
    33 
       
    34 /**
       
    35 Constructor for the shared chunk camera PDD factory class.
       
    36 */
       
    37 DTemplateCameraScPddFactory::DTemplateCameraScPddFactory()
       
    38 	{
       
    39 	// We currently support only unit 0
       
    40 	iUnitsMask = 0x01;
       
    41 
       
    42 	// Set the version number for this device.  This is used to allow code to specify that it requires a
       
    43 	// minimum version of the device in order to operate.  If the version requested is less than this then
       
    44 	// the device is safe to be used
       
    45 	iVersion = RDevCameraSc::VersionRequired();
       
    46 	}
       
    47 
       
    48 /**
       
    49 Destructor for the shared chunk camera PDD factory class.
       
    50 */
       
    51 DTemplateCameraScPddFactory::~DTemplateCameraScPddFactory()
       
    52 	{
       
    53 	}
       
    54 
       
    55 /**
       
    56 Second stage constructor for the shared chunk camera PDD factory class.  This must at least set a name for
       
    57 the driver object.
       
    58 @return KErrNone if successful, otherwise one of the system wide error codes.
       
    59 */
       
    60 TInt DTemplateCameraScPddFactory::Install()
       
    61 	{
       
    62 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPddFactory::Install()"));
       
    63 
       
    64 	TInt r;
       
    65 
       
    66 	// Create a DFC queue so that handling of both camera hardware callbacks and requests made to the LDD from
       
    67 	// user mode can be processed in the same thread, to avoid the use of semaphores
       
    68 	if ((r = Kern::DynamicDfcQCreate(iDfcQ, 26, KCameraScDfcQueueName)) == KErrNone)
       
    69 		{
       
    70 		// All PDD factories must have a unique name
       
    71 		r = SetName(&KCameraScPddName);
       
    72 		}
       
    73 
       
    74 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPddFactory::Install() => Returning %d", r));
       
    75 
       
    76 	return r;
       
    77 	}
       
    78 
       
    79 /**
       
    80 Returns the PDD's capabilities.  This is not used by the Symbian OS device driver framework
       
    81 or by the LDD but is here as some LDDs will make use of it.
       
    82 @param aDes	A descriptor into which to write capability information.
       
    83 */
       
    84 void DTemplateCameraScPddFactory::GetCaps(TDes8& /*aDes*/) const
       
    85 	{
       
    86 	}
       
    87 
       
    88 /**
       
    89 Called by the kernel's device driver framework to check if this PDD is suitable for use
       
    90 with a logical channel.  This is called in the context of the client thread which requested
       
    91 the creation of a logical channel, through a call to RBusLogicalChannel::DoCreate().  The
       
    92 thread is in a critical section.
       
    93 @param aUnit	The unit argument supplied by the client to RBusLogicalChannel::DoCreate()
       
    94 				This is used to determine which sensor to use.
       
    95 @param aInfo	The info argument supplied by the client to RBusLogicalChannel::DoCreate().
       
    96 @param aVer		The version number of the logical channel which will use this physical channel.
       
    97 @return KErrNone if successful, otherwise one of the system wide error codes.
       
    98 */
       
    99 TInt DTemplateCameraScPddFactory::Validate(TInt aUnit, const TDesC8* /*aInfo*/, const TVersion& aVer)
       
   100 	{
       
   101 	// Check that the version requested is less than or equal to the version of this PDD
       
   102 	if (!Kern::QueryVersionSupported(RDevCameraSc::VersionRequired(), aVer))
       
   103 		{
       
   104 		return KErrNotSupported;
       
   105 		}
       
   106 
       
   107 	// Check that the unit number specifies the available sensor
       
   108 	if ((aUnit < 0) || (aUnit > 0))
       
   109 		{
       
   110 		return KErrNotSupported;
       
   111 		}
       
   112 
       
   113 	return KErrNone;
       
   114 	}
       
   115 
       
   116 /**
       
   117 Called by the kernel's device driver framework to create a physical channel object.  This
       
   118 is called in the context of the client thread which requested the creation of a logical
       
   119 channel, through a call to RBusLogicalChannel::DoCreate().  The thread is in a critical section.
       
   120 @param aChannel	Set by this function to point to the created physical channel object.
       
   121 @param aUnit	The unit argument supplied by the client to RBusLogicalChannel::DoCreate().
       
   122 @param aInfo	The info argument supplied by the client to RBusLogicalChannel::DoCreate().
       
   123 @param aVer		The version number of the logical channel which will use this physical channel.
       
   124 @return KErrNone if successful, otherwise one of the other system wide error codes.
       
   125 */
       
   126 TInt DTemplateCameraScPddFactory::Create(DBase*& aChannel, TInt aUnit, const TDesC8* /*anInfo*/, const TVersion& /*aVer*/)
       
   127 	{
       
   128 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPddFactory::Create()"));
       
   129 
       
   130 	// Create an instance of the PDD channel object that will work with the Template sensor
       
   131 	DTemplateCameraScPdd* pD = new DTemplateCameraScPdd;
       
   132 
       
   133 	aChannel = pD;
       
   134 	TInt r = KErrNoMemory;
       
   135 
       
   136 	if (pD)
       
   137 		{
       
   138 		r = pD->DoCreate(this, aUnit);
       
   139 		}
       
   140 
       
   141 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPddFactory::Create() => Returning %d", r));
       
   142 
       
   143 	return r;
       
   144 	}
       
   145 
       
   146 /**
       
   147 Called by SetUnitOpen() to see if a particular unit is open.  When called, the
       
   148 iUnitInfoMutex fast mutex will be taken, ensuring safe access to iUnitsOpenMask.
       
   149 @param aUnit	The unit number to be checked for being open.
       
   150 @return ETrue if the unit specified by aUnit is already open, otherwise EFalse.
       
   151 */
       
   152 TBool DTemplateCameraScPddFactory::IsUnitOpen(TInt aUnit)
       
   153 	{
       
   154 	return (iUnitsOpenMask & (1 << aUnit));
       
   155 	}
       
   156 
       
   157 /**
       
   158 Attempt to change the state of the unit open state for a particular unit.
       
   159 @param aUnit	The unit number to be set to open or closed state.
       
   160 @param aIsOpen	The required new state for the unit;  either ETrue to set the state
       
   161 				to open or EFalse to set the state to closed.
       
   162 @return KErrNone if the state was updated successfully, otherwise KErrInUse if an attempt
       
   163 		was made to set the unit status to open while it is already open.
       
   164 */
       
   165 TInt DTemplateCameraScPddFactory::SetUnitOpen(TInt aUnit, TBool aIsOpen)
       
   166 	{
       
   167 	// Wait until it is safe to access the unit state mask
       
   168 	NKern::FMWait(&iUnitInfoMutex);
       
   169 
       
   170 	// Fail a request to open a unit that is already open
       
   171 	if (aIsOpen && IsUnitOpen(aUnit))
       
   172 		{
       
   173 		__KTRACE_CAM(Kern::Printf("+ DTemplateCameraScPddFactory::SetUnitOpen() => Unit %d is already in use", aUnit));
       
   174 
       
   175 		// Release the unit state mask mutex
       
   176 		NKern::FMSignal(&iUnitInfoMutex);
       
   177 
       
   178 		return KErrInUse;
       
   179 		}
       
   180 
       
   181 	// Set or clear the unit's open status bit as required
       
   182 	if (aIsOpen)
       
   183 		{
       
   184 		iUnitsOpenMask |= (1 << aUnit);
       
   185 		}
       
   186 	else
       
   187 		{
       
   188 		iUnitsOpenMask &= ~(1 << aUnit);
       
   189 		}
       
   190 
       
   191 	// Release the unit state mask mutex
       
   192 	NKern::FMSignal(&iUnitInfoMutex);
       
   193 
       
   194 	return KErrNone;
       
   195 	}
       
   196 
       
   197 /**
       
   198 Constructor for the shared chunk camera PDD class.
       
   199 */
       
   200 DTemplateCameraScPdd::DTemplateCameraScPdd()
       
   201 	{
       
   202 	// Set the unit number to -1 to indicate that this channel has never been registered
       
   203 	// with the PDD factory
       
   204 	iUnit = -1;
       
   205 
       
   206 	// The channel has been created but not yet configured */
       
   207 	iState = EUnconfigured;
       
   208 	}
       
   209 
       
   210 /**
       
   211 Destructor for the shared chunk camera PDD class.  This is called in the context of the client thread
       
   212 once an 'ECloseMsg' message has been sent to the device driver DFC thread.
       
   213 */
       
   214 DTemplateCameraScPdd::~DTemplateCameraScPdd()
       
   215 	{
       
   216 	delete [] iCapsBuffer;
       
   217 	delete iSensor;
       
   218 
       
   219 	// Indicate that a physical channel is no longer open on this unit
       
   220 	if (iUnit >= 0)
       
   221 		{
       
   222 		iPhysicalDevice->SetUnitOpen(iUnit, EFalse);
       
   223 		}
       
   224 	}
       
   225 
       
   226 /**
       
   227 Second stage constructor for the H4 camera PDD.
       
   228 @param aPhysicalDevice	A pointer to the factory class that is creating this PDD
       
   229 @param aUnit			The unit argument supplied by the client to RBusLogicalChannel::DoCreate().
       
   230 @return KErrNone if successful, otherwise one of the other system wide error codes.
       
   231 */
       
   232 TInt DTemplateCameraScPdd::DoCreate(DTemplateCameraScPddFactory* aPhysicalDevice, TInt aUnit)
       
   233 	{
       
   234 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::DoCreate()"));
       
   235 
       
   236 	TInt r;
       
   237 
       
   238 	iPhysicalDevice = aPhysicalDevice;
       
   239 
       
   240 	// Check that a physical channel hasn't already been opened on this unit
       
   241 	if ((r = iPhysicalDevice->SetUnitOpen(aUnit, ETrue)) == KErrNone)
       
   242 		{
       
   243 		iUnit = aUnit;
       
   244 
       
   245 		// Create an abstracted sensor interface
       
   246 		if ((iSensor = new DTemplateSensorIf(*this, DfcQ(aUnit))) != NULL)
       
   247 			{
       
   248 			if ((r = iSensor->DoCreate()) == KErrNone)
       
   249 				{
       
   250 				// Setup the capabilities of this device for later reference
       
   251 				if ((r = iSensor->GetCaps(iCaps)) > 0)
       
   252 					{
       
   253 					// And save the size as returned from the sensor
       
   254 					iCapsSize = r;
       
   255 
       
   256 					// Although iCaps now points to a TCameraCapsV02 structure, it is actually a variable
       
   257 					// sized structure that was allocated as an array of TUint8 so save it to a TUint8
       
   258 					// ptr so that it can be deleted properly
       
   259 					iCapsBuffer = (TUint8*) iCaps;
       
   260 
       
   261 					// Enable the clocks needed by the camera subsystem and power up the sensor
       
   262 					r = iSensor->RequestPower();
       
   263 
       
   264 					// Some sensors power themselves up automatically in their DoCreate() function,
       
   265 					// so take this into account here
       
   266 					if (r == KErrAlreadyExists)
       
   267 						{
       
   268 						r = KErrNone;
       
   269 						}
       
   270 					}
       
   271 				}
       
   272 			}
       
   273 		else
       
   274 			{
       
   275 			r = KErrNoMemory;
       
   276 			}
       
   277 		}
       
   278 
       
   279 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::DoCreate() => Returning %d", r));
       
   280 
       
   281 	return r;
       
   282 	}
       
   283 
       
   284 /**
       
   285 An appropriate DFC queue to use for processing client requests (that is, those that won't be processed
       
   286 in the context of the client thread), and also for processing image completion requests from the sensor
       
   287 will have been setup by the PDD factory.  Anything needing to run in this same DFC thread can access the
       
   288 queue via this function.
       
   289 @param	aUnit	The unit number for which to get the DFC queue.
       
   290 @return	The DFC queue to be used.
       
   291 */
       
   292 TDfcQue* DTemplateCameraScPdd::DfcQ(TInt /*aUnit*/)
       
   293 	{
       
   294 	return iPhysicalDevice->iDfcQ;
       
   295 	}
       
   296 
       
   297 /**
       
   298 Called by the LDD in order to query the capabilities of the PDD.
       
   299 @param	aCapsBuf	A reference to a descriptor owned by the LDD, containing a TCameraCapsV02 structure
       
   300 					for the capabilities.
       
   301 */
       
   302 void DTemplateCameraScPdd::Caps(TDes8& aCapsBuf) const
       
   303 	{
       
   304 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Caps()"));
       
   305 
       
   306 	// The iCaps structure will already have been created by a call to iSensor->SetCaps() in DoCreate().
       
   307 	// Simply copy it into the supplied TPckgBuf, taking into account the fact that the TCameraCapsV02
       
   308 	// buffer is of a variable size *and* may be smaller or larger than the iCaps structure
       
   309 	TPtrC8 ptr((const TUint8*) iCaps, iCapsSize);
       
   310 	aCapsBuf.FillZ(aCapsBuf.MaxLength());
       
   311 	aCapsBuf = ptr.Left(Min(ptr.Length(), aCapsBuf.MaxLength()));
       
   312 
       
   313 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Caps()"));
       
   314 	}
       
   315 
       
   316 /**
       
   317 Called by the LDD to setup a new image configuration, including such things as image size, framerate
       
   318 and pixel format.
       
   319 @param	aConfigBuf	A reference to a TPckgBuf containing a TCameraConfigV02 configuration structure.
       
   320 @return KErrNone if successful, otherwise one of the system wide error codes.
       
   321 */
       
   322 TInt DTemplateCameraScPdd::SetConfig(const TDesC8& aConfigBuf)
       
   323 	{
       
   324 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::SetConfig()"));
       
   325 
       
   326 	TInt r;
       
   327 
       
   328 	// It is only legal to call this if image capture is not already underway, so check for this
       
   329 	// before doing anything
       
   330 	if (iState <= EConfigured)
       
   331 		{
       
   332 		// Read the new configuration from the LDD into a local copy of the configuration structure,
       
   333 		// taking into account for compatibility that the TPckgBuf may be smaller or larger than the
       
   334 		// TCameraConfigV02 structure
       
   335 		TCameraConfigV02 config;
       
   336 		TPtr8 ptr((TUint8*) &config, sizeof(config));
       
   337 		Kern::InfoCopy(ptr, aConfigBuf);
       
   338 
       
   339 		// Save the new configuration for later and let the sensor also know about it
       
   340 		iConfig = config;
       
   341 		iSensor->SetConfig(config);
       
   342 
       
   343 		// Signal success and set the channel to the configured state
       
   344 		r = KErrNone;
       
   345 		iState = EConfigured;
       
   346 		}
       
   347 	else
       
   348 		{
       
   349 		r = KErrInUse;
       
   350 		}
       
   351 
       
   352 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::SetConfig() => Returning %d", r));
       
   353 
       
   354 	return r;
       
   355 	}
       
   356 
       
   357 /**
       
   358 Begins capture into the address pointed to by aLinAddr and aPhysAddr.  Both of these addresses point to
       
   359 the same buffer;  The address used by the sensor is hardware dependent.
       
   360 @param	aCaptureMode	Whether to capture in video, viewfinder or single image mode.
       
   361 @param	aLinAddr		The virtual address of the buffer into which to capture the image.
       
   362 @param	aPhysAddr		The physical address of the buffer into which to capture the image.
       
   363 @return	KErrNone if successful, otherwise one of the other system wide error codes.
       
   364 @pre	SetConfig() must first have been called.
       
   365 */
       
   366 TInt DTemplateCameraScPdd::Start(TDevCamCaptureMode aCaptureMode, TLinAddr aLinAddr, TPhysAddr aPhysAddr)
       
   367 	{
       
   368 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Start() => Configuring sensor for %d x %d capture", iConfig.iFrameSize.iWidth, iConfig.iFrameSize.iHeight));
       
   369 
       
   370 	// Ensure the precondition is met
       
   371 	__ASSERT_DEBUG((iState == EConfigured), Kern::Fault("camerasc", ENotConfigured));
       
   372 
       
   373 	// Save the capture mode for use when we call back into the LDD with the captured image
       
   374 	iCaptureMode = aCaptureMode;
       
   375 
       
   376 	// And start the sensor running
       
   377 	TInt r = iSensor->Start(aCaptureMode, aLinAddr, aPhysAddr);
       
   378 
       
   379 	// If everything was ok, set the channel to the capturing state
       
   380 	if (r == KErrNone)
       
   381 		{
       
   382 		iState = ECapturing;
       
   383 		}
       
   384 
       
   385 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Start() => Returning %d", r));
       
   386 
       
   387 	return r;
       
   388 	}
       
   389 
       
   390 /**
       
   391 Sets the address of the buffer info which the next image will be captured.  Called by the LDD for successive
       
   392 images that are requested after the initial call to Start().
       
   393 @param	aLinAddr		The virtual address of the buffer into which to capture the image.
       
   394 @param	aPhysAddr		The physical address of the buffer into which to capture the image.
       
   395 @return	KErrNone if successful, otherwise one of the other system wide error codes.
       
   396 */
       
   397 TInt DTemplateCameraScPdd::CaptureNextImage(TLinAddr aLinAddr, TPhysAddr aPhysAddr)
       
   398 	{
       
   399 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::CaptureNextImage()"));
       
   400 
       
   401 	// Pass the call directly to the sensor abstraction
       
   402 	TInt r = iSensor->CaptureNextImage(aLinAddr, aPhysAddr);
       
   403 
       
   404 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::CaptureNextImage()=> Returning %d", r));
       
   405 
       
   406 	return(r);
       
   407 	}
       
   408 
       
   409 /**
       
   410 Stops any image capturing that is currently underway.  It is safe to call this without having called Start().
       
   411 @return	KErrNone if successful, otherwise one of the other system wide error codes.
       
   412 */
       
   413 TInt DTemplateCameraScPdd::Stop()
       
   414 	{
       
   415 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::Stop()"));
       
   416 
       
   417 	// Pass the call directly to the sensor abstraction
       
   418 	iSensor->Stop();
       
   419 
       
   420 	// Det the channel back to the configured state as it is now safe to call Start() again
       
   421 	iState = EConfigured;
       
   422 
       
   423 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::Stop()"));
       
   424 
       
   425 	return KErrNone;
       
   426 	}
       
   427 
       
   428 /**
       
   429 Power down the camera device.  This is called by the LDD when the driver channel is being closed or
       
   430 when the system is being powered down.  This is always called in the context of the DFC thread.
       
   431 */
       
   432 void DTemplateCameraScPdd::PowerDown()
       
   433 	{
       
   434 
       
   435 #ifdef _DEBUG
       
   436 
       
   437 	// Power off the camera
       
   438 	TInt r = iSensor->RelinquishPower();
       
   439 
       
   440 	// Not being able to power down indicates a serious programming error
       
   441 	__ASSERT_DEBUG((r == KErrNone), Kern::Fault("camerasc", ECannotPowerDown));
       
   442 
       
   443 #else // ! _DEBUG
       
   444 
       
   445 	// Power off the camera
       
   446 	iSensor->RelinquishPower();
       
   447 
       
   448 #endif // ! _DEBUG
       
   449 
       
   450 	}
       
   451 
       
   452 /**
       
   453 Return the shared chunk creation information to be used by this device.
       
   454 @param	aChunkCreateInfo	A structure to be filled with the settings required for this device.
       
   455 */
       
   456 void DTemplateCameraScPdd::GetChunkCreateInfo(TChunkCreateInfo& aChunkCreateInfo)
       
   457 	{
       
   458 	// Can be opened by any number of user side processes
       
   459 	aChunkCreateInfo.iType = TChunkCreateInfo::ESharedKernelMultiple;
       
   460 	// Use both L1 and L2 cache if available.  LDD will take care of pre and post DMA cache handling
       
   461 	aChunkCreateInfo.iMapAttr = EMapAttrCachedMax;
       
   462 	// Chunk owns the memory which will be freed when the chunk is destroyed
       
   463 	aChunkCreateInfo.iOwnsMemory = ETrue;
       
   464 	// Don't queue the chunk's destruction on an DFC
       
   465 	aChunkCreateInfo.iDestroyedDfc = NULL;
       
   466 	}
       
   467 
       
   468 /**
       
   469 Returns the size of the variable sized capabilities structure in bytes.  The buffer passed into
       
   470 DTemplateCameraScPdd::GetCaps() must be at least this large to hold the fixed portion of the TCameraCapsV02
       
   471 structure, as well as the array of SDevCamPixelFormat structures that follows it.
       
   472 @return	The size in bytes of the variable sized capabilities structure.
       
   473 */
       
   474 TInt DTemplateCameraScPdd::CapsSize()
       
   475 	{
       
   476 	return iCapsSize;
       
   477 	}
       
   478 
       
   479 /**
       
   480 Obtains information regarding the frame sizes and frame rates supported for a given combination of capture mode
       
   481 and pixel format.
       
   482 @param	aCaptureMode		The capture mode for which to obtain the information.
       
   483 @param	aUidPixelFormat		The pixel format for which to obtain the information.
       
   484 @param	aFrameSizeCapsBuf	A reference to an array of packaged SDevCamFrameSize structures, owned by the LDD, into
       
   485 							which to place the information.
       
   486 @@return	KErrNone if successful, else one of the other system wide error codes.
       
   487 */
       
   488 TInt DTemplateCameraScPdd::FrameSizeCaps(TDevCamCaptureMode aCaptureMode, TUidPixelFormat aUidPixelFormat, TDes8& aFrameSizeCapsBuf)
       
   489 	{
       
   490 	return iSensor->FrameSizeCaps(aCaptureMode, aUidPixelFormat, aFrameSizeCapsBuf);
       
   491 	}
       
   492 
       
   493 /**
       
   494 Called by the sensor abstraction when an image is available.
       
   495 @param	aResult	KErrNone if successful, otherwise one of the system wide error codes.
       
   496 @param	aLinAddr		The virtual address of the buffer into which to capture the image.
       
   497 @param	aPhysAddr		The physical address of the buffer into which to capture the image.
       
   498 */
       
   499 TInt DTemplateCameraScPdd::NotifyImageCaptureEvent(TInt aResult, TLinAddr& aLinAddr, TPhysAddr& aPhysAddr)
       
   500 	{
       
   501 	__KTRACE_CAM(Kern::Printf("> DTemplateCameraScPdd::NotifyImageCaptureEvent() => aResult = %d", aResult));
       
   502 
       
   503 	// Inform the LDD that a new image has been received
       
   504 	TInt r = iLdd->ImageCaptureCallback(iCaptureMode, aResult, &aLinAddr, &aPhysAddr);
       
   505 
       
   506 	// If the LDD has returned KErrAbort then something has gone wrong, and if it has returned KErrNotReady
       
   507 	// then it has no more frames available, so call Stop()
       
   508 	if (r != KErrNone)
       
   509 		{
       
   510 		Stop();
       
   511 		}
       
   512 
       
   513 	__KTRACE_CAM(Kern::Printf("< DTemplateCameraScPdd::NotifyImageCaptureEvent() => Returning %d", r));
       
   514 
       
   515 	return r;
       
   516 	}
       
   517 
       
   518 
       
   519 TInt DTemplateCameraScPdd::SetBrightness(TUint aValue)
       
   520 	{
       
   521 	return KErrNotSupported;
       
   522 	}
       
   523 
       
   524 TInt DTemplateCameraScPdd::SetContrast(TUint aValue)
       
   525 	{
       
   526 	return KErrNotSupported;
       
   527 	}
       
   528 
       
   529 TInt DTemplateCameraScPdd::SetColorEffect(TUint aValue)
       
   530 	{
       
   531 	return KErrNotSupported;
       
   532 	}