-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIGXStream.h
111 lines (100 loc) · 4.62 KB
/
IGXStream.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//------------------------------------------------------------------------
/**
\file IGXStream.h
\brief Definition of the IGXDevice interface
\Date 2016-9-19
\Version 1.1.1609.9191
*/
//------------------------------------------------------------------------
#pragma once
#include "GXIAPIBase.h"
#include "GXSmartPtr.h"
#include "IGXFeatureControl.h"
#include "IImageData.h"
#include "ICaptureEventHandler.h"
class GXIAPICPP_API IGXStream
{
public:
//---------------------------------------------------------
/**
\brief Destructor
*/
//---------------------------------------------------------
virtual ~IGXStream(){};
//----------------------------------------------------------------------------------
/**
\brief Start the grab thread, and allocate resource for grab.
\return void
*/
//----------------------------------------------------------------------------------
virtual void StartGrab() = 0;
//----------------------------------------------------------------------------------
/**
\brief Stop the grab thread, and release the resource for grab.
\return void
*/
//----------------------------------------------------------------------------------
virtual void StopGrab() = 0;
//----------------------------------------------------------------------------------
/**
\brief Register capture call back for a new buffer event.
When a buffer is filled, the grab thread will call the ICaptureEventHandler* , pointed to the user method, registered by user.
Only very short processing tasks can be performed in this function. Otherwise, the event notification will block the
receiving of images.
\param pUserParam[in] The user param
\param pEventHandler[in] The call back handler pointer; ; that must be inherited from ICaptureEventHandler
\return void
*/
//----------------------------------------------------------------------------------
virtual void RegisterCaptureCallback(ICaptureEventHandler* pEventHandler, void *pUserParam) = 0;
//----------------------------------------------------------------------------------
/**
\brief Unregister capture call back
\return void
*/
//----------------------------------------------------------------------------------
virtual void UnregisterCaptureCallback() = 0;
//----------------------------------------------------------------------------------
/**
\brief Get one image. Different from the call back way, User can call this function to get one image at one time.
If you have registered capture call back, you can't use GetImage at the same time.
\param nTimeout[in] The timeout waits in ms.
\return A smart pointer object CImageDataPointer
*/
//----------------------------------------------------------------------------------
virtual CImageDataPointer GetImage(uint32_t nTimeout) = 0;
//----------------------------------------------------------------------------------
/**
\brief Returns the set of camera related stream parameters.
\return A CGXFeatureControlPointer object to a feature control.
*/
//----------------------------------------------------------------------------------
virtual CGXFeatureControlPointer GetFeatureControl() = 0;
//----------------------------------------------------------------------------------
/**
\brief when underlying thread receives data from a device, it will fill a buffer from the receiving buffer pool.
when a buffer is filled it is removed from the pool and if successfully filled, it is put into the output buffer queue.
The upper thread get a buffer from the output buffer queue and call user method back,
after the user method returned, the upper thread queue the buffer back to the receiving buffer pool.
Flush queue means to flush the output buffer queue.
\return void
*/
//----------------------------------------------------------------------------------
virtual void FlushQueue() = 0;
//----------------------------------------------------------------------------------
/**
\brief Close stream
\return void
*/
//----------------------------------------------------------------------------------
virtual void Close() = 0;
//----------------------------------------------------------------------------------
/**
\brief Set Acqusition Buffer Number
\return void
*/
//----------------------------------------------------------------------------------
virtual void SetAcqusitionBufferNumber(uint64_t nBufferNum) = 0;
};
template class GXIAPICPP_API GXSmartPtr<IGXStream>;
typedef GXSmartPtr<IGXStream> CGXStreamPointer;