-
Notifications
You must be signed in to change notification settings - Fork 0
/
avicaps32.lua
69 lines (57 loc) · 1.12 KB
/
avicaps32.lua
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
-- avicaps32.lua
require "Win32Types"
local ffi = require "ffi"
local C = ffi.C
ffi.cdef[[
typedef struct mmtime_tag {
UINT wType;
union {
DWORD ms;
DWORD sample;
DWORD cb;
DWORD ticks;
struct {
BYTE hour;
BYTE min;
BYTE sec;
BYTE frame;
BYTE fps;
BYTE dummy;
BYTE pad[2]
} smpte;
struct {
DWORD songptrpos;
} midi;
} u;
} MMTIME;
typedef struct {
UINT wPeriodMin;
UINT wPeriodMax;
} TIMECAPS;
typedef struct videohdr_tag {
LPBYTE lpData;
DWORD dwBufferLength;
DWORD dwBytesUsed;
DWORD dwTimeCaptured;
DWORD_PTR dwUser;
DWORD dwFlags;
DWORD_PTR dwReserved[4];
} VIDEOHDR, *PVIDEOHDR, *LPVIDEOHDR;
]]
ffi.cdef[[
BOOL capGetDriverDescriptionA(WORD wDriverIndex,
LPSTR lpszName,
INT cbName,
LPSTR lpszVer,
INT cbVer);
HWND capCreateCaptureWindowA(LPCSTR lpszWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWnd,
int nID);
]]
avicaps32 = ffi.load("avicaps32")
return avicaps32