baseport/syborg/webcamera/webcamera_pdd.h
changeset 124 606eafc6d6a8
parent 52 0dfaca43d90e
--- a/baseport/syborg/webcamera/webcamera_pdd.h	Wed Mar 24 13:46:59 2010 +0900
+++ b/baseport/syborg/webcamera/webcamera_pdd.h	Mon Oct 18 19:39:25 2010 +0900
@@ -18,103 +18,153 @@
 #ifndef __devicePDD_H__
 #define __devicePDD_H__
 
+#ifndef __deviceIF_H__
+#include <webcamera_driver.h>
+#endif
 #include <comm.h>
 #include <e32hal.h>
 #include "system.h"
+#ifndef __deviceBASE_H
 #include "webcamera_device.h"
+#endif
+#ifndef WEBCAMERA_UVC_H_
+#include "webcamera_uvc.h"
+#endif
 
-const TInt KMinimumLddMajorVersion=1;
-const TInt KMinimumLddMinorVersion=1;
-const TInt KMinimumLddBuild=0;
-const TInt EIrqWebamera=0xb;
+const TInt KMinimumLddMajorVersion = 1;
+const TInt KMinimumLddMinorVersion = 1;
+const TInt KMinimumLddBuild = 0;
+const TInt EIrqWebamera = 0xb;
 
 class DWebcameraPddFactory : public DPhysicalDevice
-{
+	{
 public:
 	/**
-	  Constructor
+	Constructor
 	*/
 	DWebcameraPddFactory();
-	
+
 	virtual TInt Install();
 	virtual void GetCaps(TDes8 &aDes) const;
 	virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
 	virtual TInt Validate(TInt aUnit, const TDesC8* anInfo, const TVersion &aVer);
-};
-
+	};
 
 class DWebcameraDriver : public DWebcameraDriverBase
-{
+	{
 public:
 	/**
-	  Constructor
+	Chunk index.
+	*/
+	enum TWebcameraIndex
+		{
+		EWEBCAMERAINDEXHAHEADERBUF,
+		EWEBCAMERAINDEXADATABUF,
+		EWEBCAMERAINDEXMAX
+		};
+
+	/**
+	Constructor
 	*/
 	DWebcameraDriver();
+
 	/**
-	  Destructor
+	Destructor
 	*/
 	~DWebcameraDriver();
-    /**
-      Second stage constructor called by the kernel's device driver framework.
-      This is called in the context of the user thread (client) which requested the creation of a Logical Channel
-      The thread is in a critical section.
+
+	/**
+	Second stage constructor called by the kernel's device driver framework.
+	This is called in the context of the user thread (client) which requested the creation of a Logical Channel
+	The thread is in a critical section.
 
-      @param aUnit The unit argument supplied by the client
-      @param aInfo The info argument supplied by the client
+	@param aUnit The unit argument supplied by the client
+	@param aInfo The info argument supplied by the client
+	@return KErrNone if successful, otherwise one of the other system wide error codes.
+	*/
+	TInt DoCreate(TInt aUnit, const TDesC8* anInfo);
 
-      @return KErrNone if successful, otherwise one of the other system wide error codes.
-    */
-	TInt DoCreate(TInt aUnit, const TDesC8* anInfo);
-    /**
-      Request data from device.
-      Only one send request may be pending at any time.
+	/**
+	Power on Camera Device.
+	*/
+	virtual TInt PowerOn(TAny* aHeaderPtr);
+
+	/**
+	Init ViewFinder.
+	*/
+	virtual TInt InitViewFinder();
 
-      @param  aBuffer physical adress
-      @param aData   size of buffer.
-    */
-	virtual TInt StartViewerFinder(TUint aBuffer,TInt aSize);
-    /**
-      Request data from device.
-      Only one send request may be pending at any time.
+	/**
+	Request data from device.
+	Only one send request may be pending at any time.
+
+	@param  aBuffer physical adress
+	@param aData   size of buffer.
+	*/
+	virtual TInt StartViewerFinder(TAny* aDataPtr, TInt aSize);
+
+	/**
+	Request device not to send data.
+	Only one send request may be pending at any time.
 
-      @param  aBuffer physical adress
-      @param aData   size of buffer.
-    */
-	virtual TInt StartCapture(TUint aBuffer,TInt aSize);
-    /**
-      Request device not to send data.
-      Only one send request may be pending at any time.
+	@param  aMode stop mode
+	*/
+	virtual void Stop(TUSBStopMode aMode);
 
-      @param  aMode stop mode
-    */
-	virtual void Stop(TUSBStopMode aMode);
+	/**
+	Disconnect on Camera Device.
+	*/
+	virtual void Disconnect();
+
 //	virtual void Caps(TDes8 &aCaps) const;
+
 	/**
-	  Called by ISR to indicate that interrupt occurs.
+	Called by ISR to indicate that interrupt occurs.
 	*/
 	static void Isr(TAny* aPtr);
-    /**
-      Called from a Isr after the Peripheral has signalled that getting oneflame completed.
-    */
+
+	/**
+	Called from a Isr after the Peripheral has signalled that getting oneflame completed.
+	*/
 	void receivedatacallback();
 
+	/**
+	Chunk Create (Local use).
+	*/
+	TInt CreateChunk(TInt aSize, TWebcameraIndex aIndex);
+
+	/**
+	Chunk Close (Local use).
+	*/
+	void CloseChunk(TWebcameraIndex aIndex);
+
 public:
-	  /**
-	  Enumeration of register types.
-	  */
-  enum {
-		WEBCAMERA_REG_ID           = 0,
-		WEBCAMERA_REG_INT_ENABLE   = 1,
-		WEBCAMERA_REG_DATA_TYPE    = 2,
-		WEBCAMERA_REG_DMA_ADDR     = 3,
-		WEBCAMERA_REG_DMA_SIZE     = 4
-	    };
+	/**
+	Enumeration of register types.
+	*/
+	enum
+		{
+		WEBCAMERA_REG_ID				= 0,
+		WEBCAMERA_REG_INT_ENABLE		= 1,
+		WEBCAMERA_REG_DATA_TYPE			= 2,
+		WEBCAMERA_REG_DMA_ADDR			= 3,
+		WEBCAMERA_REG_DMA_SIZE			= 4,
+		WEBCAMERA_REG_DMA_INFO			= 5,
+		WEBCAMERA_REG_DMA_INFOSIZE		= 6,
+		WEBCAMERA_REG_DMA_CONNECT		= 7,
+		WEBCAMERA_REG_DMA_DISCONNECT	= 8
+		};
 
 private:
-    /**
-    operation types.
-    */
+	/**
+	operation types.
+	*/
 	TInt iType;
-};
+	TWebcameraDataInfo	iDataInfo;
+	DChunk*				iChunk[EWEBCAMERAINDEXMAX];				///< For Chunk process.
+	DThread* 			iClient;
+	TUint32				iPhysAddr[EWEBCAMERAINDEXMAX];
+	TWebcameraUVC		iUvcData;
+	};
 
 #endif