summaryrefslogtreecommitdiff
path: root/sources/generated/Gst.Net/Global.cs
blob: 231d3810b0b9c9a09dee4d7e6f024f59cc109398 (plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.Net {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public partial class Global {

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_buffer_add_net_address_meta(IntPtr buffer, IntPtr addr);

		public static Gst.Net.NetAddressMeta BufferAddNetAddressMeta(Gst.Buffer buffer, GLib.SocketAddress addr) {
			IntPtr raw_ret = gst_buffer_add_net_address_meta(buffer == null ? IntPtr.Zero : buffer.Handle, addr == null ? IntPtr.Zero : addr.Handle);
			Gst.Net.NetAddressMeta ret = Gst.Net.NetAddressMeta.New (raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_buffer_add_net_control_message_meta(IntPtr buffer, IntPtr message);

		public static Gst.Net.NetControlMessageMeta BufferAddNetControlMessageMeta(Gst.Buffer buffer, GLib.SocketControlMessage message) {
			IntPtr raw_ret = gst_buffer_add_net_control_message_meta(buffer == null ? IntPtr.Zero : buffer.Handle, message == null ? IntPtr.Zero : message.Handle);
			Gst.Net.NetControlMessageMeta ret = Gst.Net.NetControlMessageMeta.New (raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_buffer_get_net_address_meta(IntPtr buffer);

		public static Gst.Net.NetAddressMeta BufferGetNetAddressMeta(Gst.Buffer buffer) {
			IntPtr raw_ret = gst_buffer_get_net_address_meta(buffer == null ? IntPtr.Zero : buffer.Handle);
			Gst.Net.NetAddressMeta ret = Gst.Net.NetAddressMeta.New (raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_net_address_meta_api_get_type();

		public static GLib.GType NetAddressMetaApiGetType() {
			IntPtr raw_ret = gst_net_address_meta_api_get_type();
			GLib.GType ret = new GLib.GType(raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_net_address_meta_get_info();

		public static Gst.MetaInfo NetAddressMetaGetInfo() {
			IntPtr raw_ret = gst_net_address_meta_get_info();
			Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_net_control_message_meta_api_get_type();

		public static GLib.GType NetControlMessageMetaApiGetType() {
			IntPtr raw_ret = gst_net_control_message_meta_api_get_type();
			GLib.GType ret = new GLib.GType(raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_net_control_message_meta_get_info();

		public static Gst.MetaInfo NetControlMessageMetaGetInfo() {
			IntPtr raw_ret = gst_net_control_message_meta_get_info();
			Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern unsafe IntPtr gst_net_time_packet_receive(IntPtr socket, out IntPtr src_address, out IntPtr error);

		public static unsafe Gst.Net.NetTimePacket NetTimePacketReceive(GLib.Socket socket, out GLib.SocketAddress src_address) {
			IntPtr native_src_address;
			IntPtr error = IntPtr.Zero;
			IntPtr raw_ret = gst_net_time_packet_receive(socket == null ? IntPtr.Zero : socket.Handle, out native_src_address, out error);
			Gst.Net.NetTimePacket ret = Gst.Net.NetTimePacket.New (raw_ret);
			src_address = GLib.Object.GetObject(native_src_address, true) as GLib.SocketAddress;
			if (error != IntPtr.Zero) throw new GLib.GException (error);
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_ptp_deinit();

		public static void PtpDeinit() {
			gst_ptp_deinit();
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_ptp_init(ulong clock_id, IntPtr[] interfaces);

		public static bool PtpInit(ulong clock_id, string[] interfaces) {
			int cnt_interfaces = interfaces == null ? 0 : interfaces.Length;
			IntPtr[] native_interfaces = new IntPtr [cnt_interfaces + 1];
			for (int i = 0; i < cnt_interfaces; i++)
				native_interfaces [i] = GLib.Marshaller.StringToPtrGStrdup (interfaces[i]);
			native_interfaces [cnt_interfaces] = IntPtr.Zero;
			bool raw_ret = gst_ptp_init(clock_id, native_interfaces);
			bool ret = raw_ret;
			for (int i = 0; i < native_interfaces.Length - 1; i++) {
				interfaces [i] = GLib.Marshaller.Utf8PtrToString (native_interfaces[i]);
				GLib.Marshaller.Free (native_interfaces[i]);
			}
			return ret;
		}

		public static bool PtpInit(ulong clock_id) {
			return PtpInit (clock_id, null);
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_ptp_is_initialized();

		public static bool PtpIsInitialized() {
			bool raw_ret = gst_ptp_is_initialized();
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_ptp_is_supported();

		public static bool PtpIsSupported() {
			bool raw_ret = gst_ptp_is_supported();
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern UIntPtr gst_ptp_statistics_callback_add(Gst.NetSharp.PtpStatisticsCallbackNative cb, IntPtr user_data, GLib.DestroyNotify destroy_data);

		public static ulong PtpStatisticsCallbackAdd(Gst.Net.PtpStatisticsCallback cb) {
			Gst.NetSharp.PtpStatisticsCallbackWrapper cb_wrapper = new Gst.NetSharp.PtpStatisticsCallbackWrapper (cb);
			IntPtr user_data;
			GLib.DestroyNotify destroy_data;
			if (cb == null) {
				user_data = IntPtr.Zero;
				destroy_data = null;
			} else {
				user_data = (IntPtr) GCHandle.Alloc (cb_wrapper);
				destroy_data = GLib.DestroyHelper.NotifyHandler;
			}
			UIntPtr raw_ret = gst_ptp_statistics_callback_add(cb_wrapper.NativeDelegate, user_data, destroy_data);
			ulong ret = (ulong) raw_ret;
			return ret;
		}

		[DllImport("libgstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_ptp_statistics_callback_remove(UIntPtr id);

		public static void PtpStatisticsCallbackRemove(ulong id) {
			gst_ptp_statistics_callback_remove(new UIntPtr (id));
		}

#endregion
	}
}