-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpcome4_overrides.cpp
More file actions
63 lines (51 loc) · 1.95 KB
/
pcome4_overrides.cpp
File metadata and controls
63 lines (51 loc) · 1.95 KB
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
#include "pco/include/me4/defs.h"
#include "pco/include/me4/Cpco_grab_cl_me4.h"
#include <stdio.h>
DWORD CPco_grab_cl_me4::Start_Acquire_NonBlock(int nr_of_ima)
{
if (nr_of_ima < 0)
nr_of_ima = GRAB_INFINITE;
aquire_status = ACQ_STANDARD;
dma_mem *pMem;
if ((buf_manager & PCO_SC2_CL_EXTERNAL_BUFFER) == PCO_SC2_CL_EXTERNAL_BUFFER)
pMem = pMem0;
else if ((buf_manager & PCO_SC2_CL_INTERNAL_BUFFER) == PCO_SC2_CL_INTERNAL_BUFFER)
pMem = pMemInt;
else
return PCO_ERROR_WRONGVALUE | PCO_ERROR_DRIVER | PCO_ERROR_DRIVER_CAMERALINK;
if (Fg_AcquireEx(fg, port, nr_of_ima, aquire_status, pMem) != FG_OK)
return PCO_ERROR_DRIVER_SYSERR | PCO_ERROR_DRIVER_CAMERALINK;
aquire_flag |= PCO_SC2_CL_NON_BLOCKING_BUFFER;
return PCO_NOERROR;
}
DWORD CPco_grab_cl_me4::Wait_For_Next_Image(int *nr_of_pic, int timeout)
{
frameindex_t index = -1;
dma_mem *pMem;
if ((buf_manager & PCO_SC2_CL_EXTERNAL_BUFFER) == PCO_SC2_CL_EXTERNAL_BUFFER)
pMem = pMem0;
else if ((buf_manager & PCO_SC2_CL_INTERNAL_BUFFER) == PCO_SC2_CL_INTERNAL_BUFFER)
pMem = pMemInt;
else
return PCO_ERROR_WRONGVALUE | PCO_ERROR_DRIVER | PCO_ERROR_DRIVER_CAMERALINK;
index = Fg_getLastPicNumberBlockingEx(fg, *nr_of_pic, port, timeout, pMem);
if (index < 0)
{
*nr_of_pic = 0;
return PCO_ERROR_TIMEOUT | PCO_ERROR_DRIVER | PCO_ERROR_DRIVER_CAMERALINK;
}
*nr_of_pic = index;
return PCO_NOERROR;
}
DWORD CPco_grab_cl_me4::Get_Framebuffer_adr(int nr_of_pic, void **adr)
{
dma_mem *pMem;
if ((buf_manager & PCO_SC2_CL_EXTERNAL_BUFFER) == PCO_SC2_CL_EXTERNAL_BUFFER)
pMem = pMem0;
else if ((buf_manager & PCO_SC2_CL_INTERNAL_BUFFER) == PCO_SC2_CL_INTERNAL_BUFFER)
pMem = pMemInt;
else
return PCO_ERROR_WRONGVALUE | PCO_ERROR_DRIVER | PCO_ERROR_DRIVER_CAMERALINK;
*adr = Fg_getImagePtrEx(fg, nr_of_pic, port, pMem);
return PCO_NOERROR;
}