1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class Global {
14 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
15 static extern IntPtr gst_buffer_add_net_address_meta(IntPtr buffer, IntPtr addr);
17 public static Gst.Net.NetAddressMeta BufferAddNetAddressMeta(Gst.Buffer buffer, GLib.SocketAddress addr) {
18 IntPtr raw_ret = gst_buffer_add_net_address_meta(buffer == null ? IntPtr.Zero : buffer.Handle, addr == null ? IntPtr.Zero : addr.Handle);
19 Gst.Net.NetAddressMeta ret = Gst.Net.NetAddressMeta.New (raw_ret);
23 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
24 static extern IntPtr gst_buffer_add_net_control_message_meta(IntPtr buffer, IntPtr message);
26 public static Gst.Net.NetControlMessageMeta BufferAddNetControlMessageMeta(Gst.Buffer buffer, GLib.SocketControlMessage message) {
27 IntPtr raw_ret = gst_buffer_add_net_control_message_meta(buffer == null ? IntPtr.Zero : buffer.Handle, message == null ? IntPtr.Zero : message.Handle);
28 Gst.Net.NetControlMessageMeta ret = Gst.Net.NetControlMessageMeta.New (raw_ret);
32 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
33 static extern IntPtr gst_buffer_get_net_address_meta(IntPtr buffer);
35 public static Gst.Net.NetAddressMeta BufferGetNetAddressMeta(Gst.Buffer buffer) {
36 IntPtr raw_ret = gst_buffer_get_net_address_meta(buffer == null ? IntPtr.Zero : buffer.Handle);
37 Gst.Net.NetAddressMeta ret = Gst.Net.NetAddressMeta.New (raw_ret);
41 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
42 static extern IntPtr gst_net_address_meta_api_get_type();
44 public static GLib.GType NetAddressMetaApiGetType() {
45 IntPtr raw_ret = gst_net_address_meta_api_get_type();
46 GLib.GType ret = new GLib.GType(raw_ret);
50 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
51 static extern IntPtr gst_net_address_meta_get_info();
53 public static Gst.MetaInfo NetAddressMetaGetInfo() {
54 IntPtr raw_ret = gst_net_address_meta_get_info();
55 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
59 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
60 static extern IntPtr gst_net_control_message_meta_api_get_type();
62 public static GLib.GType NetControlMessageMetaApiGetType() {
63 IntPtr raw_ret = gst_net_control_message_meta_api_get_type();
64 GLib.GType ret = new GLib.GType(raw_ret);
68 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
69 static extern IntPtr gst_net_control_message_meta_get_info();
71 public static Gst.MetaInfo NetControlMessageMetaGetInfo() {
72 IntPtr raw_ret = gst_net_control_message_meta_get_info();
73 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
77 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
78 static extern unsafe IntPtr gst_net_time_packet_receive(IntPtr socket, out IntPtr src_address, out IntPtr error);
80 public static unsafe Gst.Net.NetTimePacket NetTimePacketReceive(GLib.Socket socket, out GLib.SocketAddress src_address) {
81 IntPtr native_src_address;
82 IntPtr error = IntPtr.Zero;
83 IntPtr raw_ret = gst_net_time_packet_receive(socket == null ? IntPtr.Zero : socket.Handle, out native_src_address, out error);
84 Gst.Net.NetTimePacket ret = Gst.Net.NetTimePacket.New (raw_ret);
85 src_address = GLib.Object.GetObject(native_src_address, true) as GLib.SocketAddress;
86 if (error != IntPtr.Zero) throw new GLib.GException (error);
90 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
91 static extern bool gst_net_utils_set_socket_tos(IntPtr socket, int qos_dscp);
93 public static bool NetUtilsSetSocketTos(GLib.Socket socket, int qos_dscp) {
94 bool raw_ret = gst_net_utils_set_socket_tos(socket == null ? IntPtr.Zero : socket.Handle, qos_dscp);
99 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
100 static extern void gst_ptp_deinit();
102 public static void PtpDeinit() {
106 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
107 static extern bool gst_ptp_init(ulong clock_id, IntPtr[] interfaces);
109 public static bool PtpInit(ulong clock_id, string[] interfaces) {
110 int cnt_interfaces = interfaces == null ? 0 : interfaces.Length;
111 IntPtr[] native_interfaces = new IntPtr [cnt_interfaces + 1];
112 for (int i = 0; i < cnt_interfaces; i++)
113 native_interfaces [i] = GLib.Marshaller.StringToPtrGStrdup (interfaces[i]);
114 native_interfaces [cnt_interfaces] = IntPtr.Zero;
115 bool raw_ret = gst_ptp_init(clock_id, native_interfaces);
117 for (int i = 0; i < native_interfaces.Length - 1; i++) {
118 interfaces [i] = GLib.Marshaller.Utf8PtrToString (native_interfaces[i]);
119 GLib.Marshaller.Free (native_interfaces[i]);
124 public static bool PtpInit(ulong clock_id) {
125 return PtpInit (clock_id, null);
128 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
129 static extern bool gst_ptp_is_initialized();
131 public static bool PtpIsInitialized() {
132 bool raw_ret = gst_ptp_is_initialized();
137 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
138 static extern bool gst_ptp_is_supported();
140 public static bool PtpIsSupported() {
141 bool raw_ret = gst_ptp_is_supported();
146 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
147 static extern UIntPtr gst_ptp_statistics_callback_add(Gst.NetSharp.PtpStatisticsCallbackNative cb, IntPtr user_data, GLib.DestroyNotify destroy_data);
149 public static ulong PtpStatisticsCallbackAdd(Gst.Net.PtpStatisticsCallback cb) {
150 Gst.NetSharp.PtpStatisticsCallbackWrapper cb_wrapper = new Gst.NetSharp.PtpStatisticsCallbackWrapper (cb);
152 GLib.DestroyNotify destroy_data;
154 user_data = IntPtr.Zero;
157 user_data = (IntPtr) GCHandle.Alloc (cb_wrapper);
158 destroy_data = GLib.DestroyHelper.NotifyHandler;
160 UIntPtr raw_ret = gst_ptp_statistics_callback_add(cb_wrapper.NativeDelegate, user_data, destroy_data);
161 ulong ret = (ulong) raw_ret;
165 [DllImport("gstnet-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
166 static extern void gst_ptp_statistics_callback_remove(UIntPtr id);
168 public static void PtpStatisticsCallbackRemove(ulong id) {
169 gst_ptp_statistics_callback_remove(new UIntPtr (id));