--- a/baseport/syborg/webcamera/webcamera_ldd.h Wed Mar 24 13:46:59 2010 +0900
+++ b/baseport/syborg/webcamera/webcamera_ldd.h Mon Oct 18 19:39:25 2010 +0900
@@ -19,224 +19,299 @@
#include <kernel.h>
#include "webcamera_device.h"
-
-#define BUFSIZE (100*1024)
+#include <webcamera_driver.h>
+#ifndef WEBCAMERA_UVC_H_
+#include "webcamera_uvc.h"
+#endif
+#ifndef WEBCAMERACONVERT_H__
+#include "webcamer_convert.h"
+#endif
/**
- *Logical channel class
- *
- */
+Logical channel class
+*/
class DWebcameraLogicalDevice : public DLogicalDevice
{
public:
DWebcameraLogicalDevice();
~DWebcameraLogicalDevice();
- /**
- Second stage constructor for DDriver1Factory.
- This must at least set a name for the driver object.
+ /**
+ Second stage constructor for DDriver1Factory.
+ This must at least set a name for the driver object.
- @return KErrNone if successful, otherwise one of the other system wide error codes.
- */
- virtual TInt Install();
- /**
- Return the drivers capabilities.
- Called in the response to an RDevice::GetCaps() request.
+ @return KErrNone if successful, otherwise one of the other system wide error codes.
+ */
+ virtual TInt Install();
+
+ /**
+ Return the drivers capabilities.
+ Called in the response to an RDevice::GetCaps() request.
- @param aDes User-side descriptor to write capabilities information into
- */
- virtual void GetCaps(TDes8& aDes) const;
- /**
- Called by the kernel's device driver framework to create a Logical Channel.
- This is called in the context of the user thread (client) which requested the creation of a Logical Channel
- (E.g. through a call to RBusLogicalChannel::DoCreate)
- The thread is in a critical section.
+ @param aDes User-side descriptor to write capabilities information into
+ */
+ virtual void GetCaps(TDes8& aDes) const;
- @param aChannel Set to point to the created Logical Channel
+ /**
+ Called by the kernel's device driver framework to create a Logical Channel.
+ This is called in the context of the user thread (client) which requested the creation of a Logical Channel
+ (E.g. through a call to RBusLogicalChannel::DoCreate)
+ The thread is in a critical section.
- @return KErrNone if successful, otherwise one of the other system wide error codes.
- */
- virtual TInt Create(DLogicalChannelBase*& aChannel);
+ @param aChannel Set to point to the created Logical Channel
+ @return KErrNone if successful, otherwise one of the other system wide error codes.
+ */
+ virtual TInt Create(DLogicalChannelBase*& aChannel);
};
/**
- *
- * 論理チャネルベースクラス
- *
- * 本クラスは、論理チャネル機能を提供する。
- *
- * @
- * @
- *
- */
+Logical channel base-class.
+
+This class provides functions of Logical Channel.
+*/
class DWebcameraLogicalChannel : public DWebcameraLogicalChannelBase
{
public:
/**
- Constructor
+ Constructor
*/
DWebcameraLogicalChannel();
+
/**
- Destructor
+ Destructor
*/
~DWebcameraLogicalChannel();
+
/**
- Called when a user thread requests a handle to this channel.
+ Called when a user thread requests a handle to this channel.
*/
- virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
- /**
- 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.
+ virtual TInt RequestUserHandle(DThread* aThread, TOwnerType aType);
- @param aUnit The unit argument supplied by the client
- @param aInfo The info argument supplied by the client
- @param aVer The version argument supplied by the client
+ /**
+ 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.
- @return KErrNone if successful, otherwise one of the other system wide error codes.
- */
+ @param aUnit The unit argument supplied by the client
+ @param aInfo The info argument supplied by the client
+ @param aVer The version argument supplied by the client
+ @return KErrNone if successful, otherwise one of the other system wide error codes.
+ */
virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
- /**
- Process a message for this logical channel.
- This function is called in the context of a DFC thread.
- @param aMessage The message to process.
- The iValue member of this distinguishes the message type:
- iValue==ECloseMsg, channel close message
- iValue==KMaxTInt, a 'DoCancel' message
- iValue>=0, a 'DoControl' message with function number equal to iValue
- iValue<0, a 'DoRequest' message with function number equal to ~iValue
+ /**
+ Process a message for this logical channel.
+ This function is called in the context of a DFC thread.
+
+ @param aMessage The message to process.
+ The iValue member of this distinguishes the message type:
+ iValue==ECloseMsg, channel close message
+ iValue==KMaxTInt, a 'DoCancel' message
+ iValue>=0, a 'DoControl' message with function number equal to iValue
+ iValue<0, a 'DoRequest' message with function number equal to ~iValue
*/
virtual void HandleMsg(TMessageBase* aMsg);
+
/**
- Process synchronous 'control' requests
+ Process synchronous 'control' requests
*/
virtual TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
+
/**
- Process asynchronous requests.
+ Process asynchronous requests.
*/
virtual TInt DoRequest(TInt aReqNo, TRequestStatus* aStatus, TAny* a1, TAny* a2);
+
/**
- Process cancelling of asynchronous requests.
+ Process cancelling of asynchronous requests.
*/
virtual void DoCancel(TUint aMask);
+
/**
- Called by PDD from ISR to indicate that a get oneflame operation has completed.
+ Called by PDD from ISR to indicate that a get oneflame operation has completed.
+ */
+ virtual void GetOneFlameComplete(TInt aResult);
+
+ /**
+ Called by PDD from ISR to indicate that a get capture image operation has completed.
+ */
+// virtual void CaptureComplete(TInt aResult);
+
+ /**
+ DFC Callback which gets triggered after the PDD has signalled that get oneflame completed.
+ This just casts aPtr and calls DoGetOneFlameComplete().
*/
- virtual void GetOneFlameComplete(TInt aResult);
- /**
- Called by PDD from ISR to indicate that a get capture image operation has completed.
- */
- virtual void CaptureComplete(TInt aResult);
- /**
- DFC Callback which gets triggered after the PDD has signalled that get oneflame completed.
- This just casts aPtr and calls DoGetOneFlameComplete().
- */
- static void GetOneFlameDfc(TAny* aPtr);
+ static void GetFlameDfc(TAny* aPtr);
+
/**
- DFC Callback which gets triggered after the PDD has signalled that getting Capture image completed.
- This just casts aPtr and calls DoCaptureComplete().
+ DFC Callback which gets triggered after the PDD has signalled that getting Capture image completed.
+ This just casts aPtr and calls DoCaptureComplete().
*/
- static void CaptureDfc(TAny* aPtr);
- /**
- Called from a DFC after the PDD has signalled that getting oneflame completed.
- */
+ static void CaptureDfc(TAny* aPtr);
+
+ virtual void DoStartViewFinder();
+ /**
+ Called from a DFC after the PDD has signalled that getting oneflame completed.
+ */
virtual void DoGetOneFlameComplete();
+
/**
- Called from a DFC after the PDD has signalled that getting Capture image completed.
+ Called from a DFC after the PDD has signalled that getting Capture image completed.
*/
virtual void DoCaptureComplete();
-
+
+ /**
+ Process a GetConfig control message. This writes the current driver configuration to a
+ RWebcameraDevice::TConfigBuf supplied by the client.
+ */
+ TInt GetConfig(TDes8* aConfigBuf);
+
/**
- Process a GetConfig control message. This writes the current driver configuration to a
- RWebcameraDevice::TConfigBuf supplied by the client.
+ Process a SetConfig control message. This sets the driver configuration using a
+ RWebcameraDevice::TConfigBuf supplied by the client.
+ */
+ TInt SetConfig(const TDesC8* aConfigBuf);
+
+// void CurrentConfig(RWebcameraDevice::TConfig& aConfig);
+
+ /**
+ Get the point to Physical channel.
*/
- TInt GetConfig(TDes8* aConfigBuf);
- /**
- Process a SetConfig control message. This sets the driver configuration using a
- RWebcameraDevice::TConfigBuf supplied by the client.
- */
- TInt SetConfig(const TDesC8* aConfigBuf);
-// void CurrentConfig(RWebcameraDevice::TConfig& aConfig);
- /**
- *Get the point to Physical channel.
- */
- DWebcameraDriverBase* Pdd();
-
+ DWebcameraDriverBase* Pdd();
+
+ /**
+ Create shared chunk.
+ */
+ TInt CreatSharedChunks();
+
+ /**
+ Open shared chunk that exists.
+ */
+ TInt OpenSharedChunks(RWebcameraDevice::TChunkInfo* aChunkHandle);
+
+ /**
+ Dchunk call it when Shared chunk is destroyed.
+ */
+ void ChunkDestroyed();
+
+ /**
+ Close shared chunk.
+ */
+ void CloseSharedChunks();
+
private:
- /**
- *point to description sent by user-side.
- */
- TDes8* iReceiveDataDescriptor;
- /**
- *buffer for one flame.
- */
- HBuf8* iReceiveDataBuffer;
- /**
- *the status getting one flame.
- */
+ /**
+ point to description sent by user-side.
+ */
+ TInt* iReceiveDataDescriptor;
+
+ /**
+ power on state.
+ */
+ TBool iPowerOn;
+
+ /**
+ the status getting one flame.
+ */
TRequestStatus* iReceiveDataStatus;
- /**
- *DFC for getting one flame.
- */
+
+ /**
+ DFC for getting one flame.
+ */
TDfc iReceiveDataDfc;
- /**
- *the result of the get oneflame operation.
- */
+
+ /**
+ the result of the get oneflame operation.
+ */
TInt iReceiveDataResult;
- /**
- */
+
+ /**
+ the status running view finder.
+ */
TBool iReceiving;
- /**
- *point to description sent by user-side.
- */
- TDes8* iCaptureDescriptor;
- /**
- *buffer for capture image.
- */
- HBuf8* iCaptureBuffer;
- /**
- *the status getting capture image.
- */
+
+ /**
+ point to description sent by user-side.
+ */
+ TInt* iCaptureDescriptor;
+
+ /**
+ the status getting capture image.
+ */
TRequestStatus* iCaptureStatus;
- /**
- *DFC of capture.
- */
+
+ /**
+ DFC of capture.
+ */
TDfc iCaptureDfc;
- /**
- *the result of the capture operation.
- */
+
+ /**
+ the result of the capture operation.
+ */
TInt iCaptureResult;
- /**
- *the status getting capture image.
- */
+
+ /**
+ the status getting capture image.
+ */
TBool iCaptureing;
- /**
- *the status of request.
- */
+
+ /**
+ the status of request.
+ */
TBool iRequesting;
- /**
- *point to memory used to save one frame or capture image.
- */
- HBuf8* iComm;
- /**
- *Physical adress of contiguous memory.
- */
+
+ /**
+ Physical adress of contiguous memory.
+ */
TUint32 iPhysAddr;
- /**
- *the size of buffer used to save one frame or capture image.
- */
+
+ /**
+ the size of buffer used to save one frame or capture image.
+ */
TInt iSize;
- /**
- *chunck.
- */
- DPlatChunkHw* iChunk;
- /**
- *Linear adress of chunck.
- */
- TUint8* iLAdr;
- /**
- *the size of received data.
- */
+
+ /**
+ the size of received data.
+ */
TInt iSaveSize;
+
+ /**
+ point to the created chunk object.
+ */
+ DChunk* iChunk;
+
+ /**
+ he mmu mapping attributes used for the chunk.
+ */
+ TUint32 iChunkMappingAttr;
+
+ /**
+ the linear address in the kernel process where the chunk's memory starts.
+ */
+ TLinAddr iChunkLinAddr;
+
+ /**
+ camera status.
+ */
+ TInt iWebCameraState;
+
+ /**
+ point to usb header info.
+ */
+ TAny* iHeaderPtr;
+
+ /**
+ point to description sent to PDD.
+ */
+ TAny* iDataPtr;
+
+ /**
+ point of convertion object.
+ */
+ DWebCameraConvert* iConvert;
+
+ /**
+ Bitmap data pointer.
+ */
+ TUint8* iBmpBuf;
};
#endif