-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMiSTerCastInterop.cs
69 lines (59 loc) · 2.39 KB
/
MiSTerCastInterop.cs
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
using System;
using System.Runtime.InteropServices;
namespace MiSTerCast
{
class MiSTerCastInterop
{
/*
int ALIGMENT_CENTER = 0;
int ALIGMENT_TOP_LEFT = 1;
int ALIGMENT_TOP = 2;
int ALIGMENT_TOP_RIGHT = 3;
int ALIGMENT_RIGHT = 4;
int ALIGMENT_BOTTOM_RIGHT = 5;
int ALIGMENT_BOTTOM = 6;
int ALIGMENT_BOTTOM_LEFT = 7;
int ALIGMENT_LEFT = 8;
int ROTATE_NONE = 0;
int ROTATE_CCW = 1;
int ROTATE_CW = 2;
int ROTATE_180 = 3;
*/
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void LogDelegate(string message, bool error);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate void CaptureImageDelegate(int width, int height, IntPtr buffer);
[DllImport("MISTERCASTLIB.dll", EntryPoint = "Initialize", CallingConvention = CallingConvention.Cdecl)]
public static extern bool Initialize(LogDelegate logCallback, CaptureImageDelegate captureImageCallback);
[DllImport("MISTERCASTLIB.dll", EntryPoint = "Shutdown", CallingConvention = CallingConvention.Cdecl)]
public static extern bool Shutdown();
[DllImport("MISTERCASTLIB.dll", EntryPoint = "StartStream", CallingConvention = CallingConvention.Cdecl)]
public static extern bool StartStream(string targetIp);
[DllImport("MISTERCASTLIB.dll", EntryPoint = "StopStream", CallingConvention = CallingConvention.Cdecl)]
public static extern bool StopStream();
[DllImport("MISTERCASTLIB.dll", EntryPoint = "SetModeline", CallingConvention = CallingConvention.Cdecl)]
public static extern bool SetModeline(
Double pclock,
UInt16 hactive,
UInt16 hbegin,
UInt16 hend,
UInt16 htotal,
UInt16 vactive,
UInt16 vbegin,
UInt16 vend,
UInt16 vtotal,
bool interlace);
[DllImport("MISTERCASTLIB.dll", EntryPoint = "SetSource", CallingConvention = CallingConvention.Cdecl)]
public static extern bool SetSource(
byte display,
bool audio,
bool preview,
byte alignment,
byte cropmode,
UInt16 width,
UInt16 height,
Int16 xoffset,
Int16 yoffset,
byte rotation);
}
}