File: XnClientUSBInDataEndpoint.h

package info (click to toggle)
openni2 2.2.0.33%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 22,216 kB
  • sloc: cpp: 111,197; ansic: 35,511; sh: 10,542; python: 1,313; java: 952; makefile: 575; xml: 12
file content (57 lines) | stat: -rw-r--r-- 1,576 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __XNUSBINDATAENDPOINT_H__
#define __XNUSBINDATAENDPOINT_H__

#include "IAsyncInputConnection.h"
#include <XnUSB.h>

struct XnUSBDeviceHandle;
struct XnUSBEndPointHandle;

typedef XnUSBDeviceHandle*  XN_USB_DEV_HANDLE;
typedef XnUSBEndPointHandle* XN_USB_EP_HANDLE;

namespace xn
{

class ClientUSBInDataEndpoint : virtual public IAsyncInputConnection
{
public:
	ClientUSBInDataEndpoint();

	virtual ~ClientUSBInDataEndpoint();

	virtual XnStatus Init(XN_USB_DEV_HANDLE hUSBDevice, XnUInt16 nEndpointID);
	virtual void Shutdown();
	virtual XnStatus Connect();
	virtual void Disconnect();
	virtual XnBool IsConnected() const;
	virtual XnUInt16 GetMaxPacketSize() const;
	virtual XnStatus SetDataDestination(IDataDestination* pDataDestination);

	inline XnUSBEndPointType GetEndpointType() const { return m_endpointType; }

private:
	static XnBool XN_CALLBACK_TYPE ReadThreadCallback(XnUChar* pBuffer, XnUInt32 nBufferSize, void* pCallbackData);

	static const XnUInt32 READ_THREAD_BUFFER_NUM_PACKETS_ISO;
	static const XnUInt32 READ_THREAD_NUM_BUFFERS_ISO;
	static const XnUInt32 READ_THREAD_TIMEOUT_ISO;
	static const XnUInt32 READ_THREAD_BUFFER_NUM_PACKETS_BULK;
	static const XnUInt32 READ_THREAD_NUM_BUFFERS_BULK;
	static const XnUInt32 READ_THREAD_TIMEOUT_BULK;

	static const XnUInt32 BASE_INPUT_ENDPOINT;

	XnUSBEndPointType m_endpointType;
	XN_USB_EP_HANDLE m_hEndpoint;
	XN_USB_DEV_HANDLE m_hUSBDevice;
	XnUInt16 m_nEndpointID;
	XnUInt16 m_nMaxPacketSize;	
	IDataDestination* m_pDataDestination;
	XnBool m_bConnected;

};

}

#endif // __XNUSBINDATAENDPOINT_H__