baseport/syborg/webcamera/webcamera_driver.h
changeset 124 606eafc6d6a8
parent 52 0dfaca43d90e
--- a/baseport/syborg/webcamera/webcamera_driver.h	Wed Mar 24 13:46:59 2010 +0900
+++ b/baseport/syborg/webcamera/webcamera_driver.h	Mon Oct 18 19:39:25 2010 +0900
@@ -18,125 +18,186 @@
 #define __deviceIF_H__
 
 #include <e32cmn.h>
-#include <e32ver.h>
+#ifndef __KERNEL_MODE__
+#include <e32std.h>
+#endif
 
-#define BUFSIZE  (100*1024)
+#define BUFSIZE  (600*1024)
+#define BITMAPBUFSIZE  (900 * 1024)
 
 /**
 User interface for 'WebcameraDevice'
 Define of the RBusLogicalChannel that is used in the application
 */
 class RWebcameraDevice : public RBusLogicalChannel
-    {
+	{
+public:
+	/**
+	Structure for holding driver capabilities information
+	*/
+	class TCaps
+		{
+	public:
+		TVersion iVersion;
+		};
+
+	/**
+	Structure for holding driver configuration data
+	*/
+	class TConfig
+		{
+	public:
+		TInt iPddBufferSize;        /**< Size of the PDD's data buffer (not modifiable) */
+		//RArray<TSize> iImageSizes /**< size the PDD support*/ //TODO:implement
+		};
+	typedef TPckgBuf<TConfig> TConfigBuf;
+
+	/**
+	Structure for holding driver chuck information
+	*/
+	class TChunkInfo
+		{
+	public:
+		TInt iChunkHandle;
+		TInt iChunkMaxSize;
+		TInt iChunkRemSize;
+		};
 public:
-    /**
-    Structure for holding driver capabilities information
-    */
-    class TCaps
-        {
-    public:
-        TVersion iVersion;
-        };
-    /**
-    Structure for holding driver configuration data
-    */
-    class TConfig
-        {
-    public:
-        TInt iPddBufferSize;        /**< Size of the PDD's data buffer (not modifiable) */
-       //RArray<TSize> iImageSizes /**< size the PDD support*/ //TODO:implement
-        };
-    typedef TPckgBuf<TConfig> TConfigBuf;
+	/**
+	Opens a logical channel to the driver
+	@return One of the system wide error codes.
+	*/
+	inline TInt Open();
+
+	/**
+	Gets the current configuration settings.
+
+	@param aConfig A structure which will be filled with the configuration settings.
+
+	@return KErrNone
+	*/
+	inline TInt GetConfig(TConfigBuf& aConfig);
+
+	/**
+	Sets the current configuration settings.
+
+	@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 SetConfig(const TConfigBuf& aConfig);
+
+	/**
+	Power on Camera Device.
+	*/
+	inline void PowerOn(TRequestStatus& aStatus);
+
+	/**
+	Power off Camera Device.
+	*/
+	inline void PowerOff(TRequestStatus& aStatus);
+
+	/** 
+	Init ViewFinder.
+	*/
+	inline TInt InitViewFinder();
+
+	/**
+	Request data from device.
+	Only one send request may be pending at any time.
+
+	@param aStatus	The request to be signalled when the data has been sent.
+					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 containing the data to send.
+	*/
+	inline void StartViewFinder(TRequestStatus& aStatus,TInt& aChunkLen);
+
+	/**
+	Cancels a previous getdata request.
+	*/
+	inline void StartViewFinderCancel();
+
+	/**
+	Cancels a previous getdata request and notice device not to send data
+	*/
+	inline void StopViewFinder();
+
+	/**
+	Request data(Capture data) from device.
+	Only one send request may be pending at any time.
+
+	@param aStatus	The request to be signalled when the data has been sent.
+					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 containing the data to send.
+	*/
+	inline void Capture(TRequestStatus& aStatus,TInt& aChunkLen);
+
+	/**
+	Cancels a previous getCapturedata request.
+	*/
+	inline void CaptureCancel();
+
+	/**
+	Returns the driver's name
+	*/
+	inline static const TDesC& Name();
+
+	/**
+	Returns the version number of the driver
+	*/
+	inline static TVersion VersionRequired();
+
+	/**
+	Opens a shared chunk on kernel side and makes a handle to the kernel chunk object
+	@param aChunk		The object to which the handle will refer
+	@param aChunkInfo	information of the created chunk.
+	*/
+#ifndef __KERNEL_MODE__
+	inline TInt OpenSharedChunks(RChunk& aChunk,TChunkInfo& aChunkInfo);
+
+	/**
+	Closes ashared chunk
+	@param aChunk 	The object to which the handle will refer
+	@param aStatus	The request to be signalled when the data has been sent.
+					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 TInt CloseSharedChunks(TRequestStatus& aStatus,RChunk& aChunk);
+#endif
 
 public:
-    /**
-      Opens a logical channel to the driver
-
-      @return One of the system wide error codes.
-    */
-    inline TInt Open();
-    /**
-      Gets the current configuration settings.
-
-      @param aConfig A structure which will be filled with the configuration settings.
-
-      @return KErrNone
-    */
-    inline TInt GetConfig(TConfigBuf& aConfig);
-    /**
-      Sets the current configuration settings.
-
-      @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 SetConfig(const TConfigBuf& aConfig);
-    /**
-      Request data from device.
-      Only one send request may be pending at any time.
+	/**
+	Enumeration of Control messages.
+	*/
+	enum TControl
+		{
+		EGetConfig,
+		ESetConfig,
+		EInitViewFinder,
+		EOpenSharedChunck
+		};
+	/**
+	Enumeration of Request messages.
+	*/
+	enum TRequest
+		{
+		EPowerOff,
+		EPowerOn,
+		EStart,
+		ETransferData,
+		ECapture,
+		ECloseSharedChunck,
+		ENumRequests,
+		EAllRequests = (1<<ENumRequests)-1
+		};
 
-      @param aStatus The request to be signalled when the data has been sent.
-                     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 containing the data to send.
-    */
-    inline void StartViewFinder(TRequestStatus& aStatus,TDes8& aBuffer);
-    /**
-      Cancels a previous getdata request.
-    */
-    inline void StartViewFinderCancel();
-    /**
-      Cancels a previous getdata request and notice device not to send data       
-    */
-    inline void StopViewFinder();
-    /**
-      Request data(Capture data) from device.
-      Only one send request may be pending at any time.
-
-      @param aStatus The request to be signalled when the data has been sent.
-                     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 containing the data to send.
-    */
-    inline void Capture(TRequestStatus& aStatus,TDes8& aBuffer);
-    /**
-      Cancels a previous getCapturedata request.     
-    */
-	inline void CaptureCancel();
-	/**
-	  Returns the driver's name
-	*/
-    inline static const TDesC& Name();
-    /**
-      Returns the version number of the driver
-    */
-    inline static TVersion VersionRequired();
-    
-public:
-    /**
-    Enumeration of Control messages.
-    */
-    enum TControl
-        {
-        EGetConfig,
-        ESetConfig
-        };
-    /**
-    Enumeration of Request messages.
-    */
-    enum TRequest
-        {
-        EStart,
-        ECapture,
-        ENumRequests,
-        EAllRequests = (1<<ENumRequests)-1
-        };
-
-    // Kernel side LDD channel is a friend
-    friend class DDriver1Channel;
-    };
+	// Kernel side LDD channel is a friend
+	friend class DWebcameraLogicalChannel;
+	};
 
 // Inline functions
 #include <webcamera_driver.inl>