summaryrefslogtreecommitdiff
path: root/sources/generated/Gst.Rtsp/RTSPWatch.cs
blob: c7ca8af0434f967790baa6b7208fdc4ddd8fe3cf (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
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.Rtsp {

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

#region Autogenerated code
	public partial class RTSPWatch : GLib.Opaque {

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern uint gst_rtsp_watch_attach(IntPtr raw, IntPtr context);

		public uint Attach(GLib.MainContext context) {
			uint raw_ret = gst_rtsp_watch_attach(Handle, context == null ? IntPtr.Zero : context.Handle);
			uint ret = raw_ret;
			return ret;
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_watch_get_send_backlog(IntPtr raw, out UIntPtr bytes, out uint messages);

		public void GetSendBacklog(out ulong bytes, out uint messages) {
			UIntPtr native_bytes;
			gst_rtsp_watch_get_send_backlog(Handle, out native_bytes, out messages);
			bytes = (ulong) native_bytes;
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_watch_reset(IntPtr raw);

		public void Reset() {
			gst_rtsp_watch_reset(Handle);
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_rtsp_watch_send_message(IntPtr raw, IntPtr message, out uint id);

		public Gst.Rtsp.RTSPResult SendMessage(Gst.Rtsp.RTSPMessage message, out uint id) {
			IntPtr native_message = GLib.Marshaller.StructureToPtrAlloc (message);
			int raw_ret = gst_rtsp_watch_send_message(Handle, native_message, out id);
			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
			Marshal.FreeHGlobal (native_message);
			return ret;
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_rtsp_watch_send_messages(IntPtr raw, Gst.Rtsp.RTSPMessage[] messages, uint n_messages, out uint id);

		public Gst.Rtsp.RTSPResult SendMessages(Gst.Rtsp.RTSPMessage[] messages, out uint id) {
			int raw_ret = gst_rtsp_watch_send_messages(Handle, messages, (uint) (messages == null ? 0 : messages.Length), out id);
			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
			return ret;
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_watch_set_flushing(IntPtr raw, bool flushing);

		public bool Flushing { 
			set {
				gst_rtsp_watch_set_flushing(Handle, value);
			}
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_watch_set_send_backlog(IntPtr raw, UIntPtr bytes, uint messages);

		public void SetSendBacklog(ulong bytes, uint messages) {
			gst_rtsp_watch_set_send_backlog(Handle, new UIntPtr (bytes), messages);
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_rtsp_watch_wait_backlog(IntPtr raw, IntPtr timeout);

		public Gst.Rtsp.RTSPResult WaitBacklog(IntPtr timeout) {
			int raw_ret = gst_rtsp_watch_wait_backlog(Handle, timeout);
			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
			return ret;
		}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_rtsp_watch_write_data(IntPtr raw, byte[] data, uint size, out uint id);

		public Gst.Rtsp.RTSPResult WriteData(byte[] data, uint size, out uint id) {
			int raw_ret = gst_rtsp_watch_write_data(Handle, data, size, out id);
			Gst.Rtsp.RTSPResult ret = (Gst.Rtsp.RTSPResult) raw_ret;
			return ret;
		}

		public RTSPWatch(IntPtr raw) : base(raw) {}

		[DllImport("libgstrtsp-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_watch_unref(IntPtr raw);

		protected override void Unref (IntPtr raw)
		{
			if (Owned) {
				gst_rtsp_watch_unref (raw);
				Owned = false;
			}
		}

		class FinalizerInfo {
			IntPtr handle;

			public FinalizerInfo (IntPtr handle)
			{
				this.handle = handle;
			}

			public bool Handler ()
			{
				gst_rtsp_watch_unref (handle);
				return false;
			}
		}

		~RTSPWatch ()
		{
			if (!Owned)
				return;
			FinalizerInfo info = new FinalizerInfo (Handle);
			GLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}