--- a/baseport/syborg/webcamera/webcamera_driver.inl Wed Mar 24 13:46:59 2010 +0900
+++ b/baseport/syborg/webcamera/webcamera_driver.inl Mon Oct 18 19:39:25 2010 +0900
@@ -19,121 +19,165 @@
#define __deviceIFI_H
/**
- Returns the driver's name
+Returns the driver's name
*/
inline const TDesC& RWebcameraDevice::Name()
- {
- _LIT(KDriverName,"WebcameraDevice");
- return KDriverName;
- }
+ {
+ _LIT(KDriverName,"WebcameraDevice");
+ return KDriverName;
+ }
/**
- Returns the version number of the driver
+Returns the version number of the driver
*/
inline TVersion RWebcameraDevice::VersionRequired()
- {
- const TInt KMajorVersionNumber=1;
- const TInt KMinorVersionNumber=1;
- const TInt KBuildVersionNumber=0;
- return TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber);
- }
+ {
+ const TInt KMajorVersionNumber = 1;
+ const TInt KMinorVersionNumber = 1;
+ const TInt KBuildVersionNumber = 0;
+ return TVersion(KMajorVersionNumber, KMinorVersionNumber, KBuildVersionNumber);
+ }
/*
- NOTE: The following member functions would normally be exported from a seperate client DLL
- but are included inline in this header file for convenience.
+NOTE: The following member functions would normally be exported from a seperate client DLL
+but are included inline in this header file for convenience.
*/
#ifndef __KERNEL_MODE__
/**
- Opens a logical channel to the driver
+Opens a logical channel to the driver
- @return One of the system wide error codes.
+@return One of the system wide error codes.
*/
inline TInt RWebcameraDevice::Open()
- {
- return DoCreate(Name(),VersionRequired(),KNullUnit,NULL,NULL,EOwnerThread);
- }
+ {
+ return DoCreate(Name(), VersionRequired(), KNullUnit, NULL, NULL, EOwnerThread);
+ }
/**
- Gets the current configuration settings.
+Gets the current configuration settings.
- @param aConfig A structure which will be filled with the configuration settings.
-
- @return KErrNone
+@param aConfig A structure which will be filled with the configuration settings.
+@return KErrNone
*/
inline TInt RWebcameraDevice::GetConfig(TConfigBuf& aConfig)
- {
- return DoControl(EGetConfig,(TAny*)&aConfig);
- }
+ {
+ return DoControl(EGetConfig, (TAny*)&aConfig);
+ }
/**
- Sets the current configuration settings.
-
- @param aConfig The new configuration settings to be used.
+Sets the current configuration settings.
- @return KErrInUse if there are outstanding data transfer requests.
- KErrArgument if any configuration values are invalid.
- KErrNone otherwise
+@param aConfig The new configuration settings to be used.
+@return KErrInUse if there are outstanding data transfer requests.
+ KErrArgument if any configuration values are invalid.
+ KErrNone otherwise
*/
inline TInt RWebcameraDevice::SetConfig(const TConfigBuf& aConfig)
- {
- return DoControl(ESetConfig,(TAny*)&aConfig);
- }
+ {
+ return DoControl(ESetConfig, (TAny*)&aConfig);
+ }
+
+/**
+Open shared chunks
+*/
+inline TInt RWebcameraDevice::OpenSharedChunks(RChunk& aChunk, TChunkInfo& aChunkInfo)
+ {
+ TInt r = DoControl(EOpenSharedChunck, (TAny*)&aChunkInfo);
+ aChunk.SetHandle(aChunkInfo.iChunkHandle);
+ return r;
+ }
+
+/**
+Close shared chunks
+*/
+inline TInt RWebcameraDevice::CloseSharedChunks(TRequestStatus& aStatus, RChunk& aChunk)
+ {
+ DoRequest(ECloseSharedChunck,aStatus, (TAny*)&aChunk);
+ }
/**
- Receives image from the device.
- Only one receive request may be pending at any time.
+Power on Camera Device.
+@param aStatus The request to be signalled when the data has been received.
+ The result value will be set to KErrNone on success;
+ or set to one of the system wide error codes when an error occurs.
+*/
+inline void RWebcameraDevice::PowerOn(TRequestStatus& aStatus)
+ {
+ DoRequest(EPowerOn, aStatus);
+ }
+
+/**
+Power off Camera Device.
+@param aStatus The request to be signalled when the data has been received.
+ The result value will be set to KErrNone on success;
+ or set to one of the system wide error codes when an error occurs.
+*/
+inline void RWebcameraDevice::PowerOff(TRequestStatus& aStatus)
+ {
+ DoRequest(EPowerOff, aStatus);
+ }
- @param aStatus The request to be signalled when the data has been received.
- The result value will be set to KErrNone on success;
- or set to one of the system wide error codes when an error occurs.
- @param aData A descriptor to which the received data will be written.
+/**
+Init ViewFinder.
*/
-inline void RWebcameraDevice::StartViewFinder(TRequestStatus& aStatus,TDes8& aBuffer)
- {
- TInt length=BUFSIZE;
- DoRequest(EStart,aStatus,(TAny*)&aBuffer,(TAny*)&length);
- }
+inline TInt RWebcameraDevice::InitViewFinder()
+ {
+ return DoControl(EInitViewFinder, NULL);
+ }
+
+/**
+Receives image from the device.
+Only one receive request may be pending at any time.
+
+@param aStatus The request to be signalled when the data has been received.
+ The result value will be set to KErrNone on success;
+ or set to one of the system wide error codes when an error occurs.
+@param aData A descriptor to which the received data will be written.
+*/
+inline void RWebcameraDevice::StartViewFinder(TRequestStatus& aStatus,TInt& aChunkLen)
+ {
+ DoRequest(EStart,aStatus, (TAny*)&aChunkLen);
+ }
/**
- Cancels a previous StartViewFinder request.
+Cancels a previous StartViewFinder request.
*/
inline void RWebcameraDevice::StartViewFinderCancel()
- {
- DoCancel(1<<EStart);
- }
+ {
+ DoCancel(1 << EStart);
+ }
inline void RWebcameraDevice::StopViewFinder()
{
- DoCancel(1<<EStart);
+ DoCancel(1 << EStart);
}
/**
- Capture data from the device.
- Only one Capture request may be pending at any time.
+Capture data from the device.
+Only one Capture request may be pending at any time.
- @param aStatus The request to be signalled when the data has been captureed.
- The result value will be set to KErrNone on success;
- or set to one of the system wide error codes when an error occurs.
- @param aData A descriptor to which the captured data will be written.
+@param aStatus The request to be signalled when the data has been captureed.
+ The result value will be set to KErrNone on success;
+ or set to one of the system wide error codes when an error occurs.
+@param aData A descriptor to which the captured data will be written.
*/
-inline void RWebcameraDevice::Capture(TRequestStatus& aStatus,TDes8& aBuffer)
- {
- TInt length=BUFSIZE;
- DoRequest(ECapture,aStatus,(TAny*)&aBuffer,(TAny*)&length);
- }
+inline void RWebcameraDevice::Capture(TRequestStatus& aStatus,TInt& aChunkLen)
+ {
+ DoRequest(ECapture,aStatus, (TAny*)&aChunkLen);
+ }
/**
- Cancels a previous capture request.
+Cancels a previous capture request.
*/
inline void RWebcameraDevice::CaptureCancel()
- {
- DoCancel(1<<ECapture);
- }
+ {
+ DoCancel(1 << ECapture);
+ }
#endif // !__KERNEL_MODE__
#endif