summaryrefslogtreecommitdiff
path: root/sources/generated/Gst.Video/VideoAggregator.cs
blob: d2bea063e209f282ecdec6de15f5d01244b81f2e (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.Video {

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

#region Autogenerated code
	public partial class VideoAggregator : Gst.Base.Aggregator {

		protected VideoAggregator (IntPtr raw) : base(raw) {}

		protected VideoAggregator() : base(IntPtr.Zero)
		{
			CreateNativeObject (new string [0], new GLib.Value [0]);
		}

		public Gst.Video.VideoInfo Info {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("info"));
					return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Video.VideoInfo) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Video.VideoInfo), false);
				}
			}
		}

		static UpdateCapsNativeDelegate UpdateCaps_cb_delegate;
		static UpdateCapsNativeDelegate UpdateCapsVMCallback {
			get {
				if (UpdateCaps_cb_delegate == null)
					UpdateCaps_cb_delegate = new UpdateCapsNativeDelegate (UpdateCaps_cb);
				return UpdateCaps_cb_delegate;
			}
		}

		static void OverrideUpdateCaps (GLib.GType gtype)
		{
			OverrideUpdateCaps (gtype, UpdateCapsVMCallback);
		}

		static void OverrideUpdateCaps (GLib.GType gtype, UpdateCapsNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("update_caps"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr UpdateCapsNativeDelegate (IntPtr inst, IntPtr caps);

		static IntPtr UpdateCaps_cb (IntPtr inst, IntPtr caps)
		{
			try {
				VideoAggregator __obj = GLib.Object.GetObject (inst, false) as VideoAggregator;
				Gst.Caps __result;
				__result = __obj.OnUpdateCaps (caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (caps, typeof (Gst.Caps), false));
				return __result == null ? IntPtr.Zero : __result.OwnedCopy;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.Video.VideoAggregator), ConnectionMethod="OverrideUpdateCaps")]
		protected virtual Gst.Caps OnUpdateCaps (Gst.Caps caps)
		{
			return InternalUpdateCaps (caps);
		}

		private Gst.Caps InternalUpdateCaps (Gst.Caps caps)
		{
			UpdateCapsNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("update_caps"));
				unmanaged = (UpdateCapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(UpdateCapsNativeDelegate));
			}
			if (unmanaged == null) return null;

			IntPtr __result = unmanaged (this.Handle, caps == null ? IntPtr.Zero : caps.Handle);
			return __result == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (__result, typeof (Gst.Caps), true);
		}

		static AggregateFramesNativeDelegate AggregateFrames_cb_delegate;
		static AggregateFramesNativeDelegate AggregateFramesVMCallback {
			get {
				if (AggregateFrames_cb_delegate == null)
					AggregateFrames_cb_delegate = new AggregateFramesNativeDelegate (AggregateFrames_cb);
				return AggregateFrames_cb_delegate;
			}
		}

		static void OverrideAggregateFrames (GLib.GType gtype)
		{
			OverrideAggregateFrames (gtype, AggregateFramesVMCallback);
		}

		static void OverrideAggregateFrames (GLib.GType gtype, AggregateFramesNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("aggregate_frames"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int AggregateFramesNativeDelegate (IntPtr inst, IntPtr outbuffer);

		static int AggregateFrames_cb (IntPtr inst, IntPtr outbuffer)
		{
			try {
				VideoAggregator __obj = GLib.Object.GetObject (inst, false) as VideoAggregator;
				Gst.FlowReturn __result;
				__result = __obj.OnAggregateFrames (outbuffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (outbuffer, typeof (Gst.Buffer), false));
				return (int) __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.Video.VideoAggregator), ConnectionMethod="OverrideAggregateFrames")]
		protected virtual Gst.FlowReturn OnAggregateFrames (Gst.Buffer outbuffer)
		{
			return InternalAggregateFrames (outbuffer);
		}

		private Gst.FlowReturn InternalAggregateFrames (Gst.Buffer outbuffer)
		{
			AggregateFramesNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("aggregate_frames"));
				unmanaged = (AggregateFramesNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AggregateFramesNativeDelegate));
			}
			if (unmanaged == null) return (Gst.FlowReturn) 0;

			int __result = unmanaged (this.Handle, outbuffer == null ? IntPtr.Zero : outbuffer.Handle);
			return (Gst.FlowReturn) __result;
		}

		static CreateOutputBufferNativeDelegate CreateOutputBuffer_cb_delegate;
		static CreateOutputBufferNativeDelegate CreateOutputBufferVMCallback {
			get {
				if (CreateOutputBuffer_cb_delegate == null)
					CreateOutputBuffer_cb_delegate = new CreateOutputBufferNativeDelegate (CreateOutputBuffer_cb);
				return CreateOutputBuffer_cb_delegate;
			}
		}

		static void OverrideCreateOutputBuffer (GLib.GType gtype)
		{
			OverrideCreateOutputBuffer (gtype, CreateOutputBufferVMCallback);
		}

		static void OverrideCreateOutputBuffer (GLib.GType gtype, CreateOutputBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("create_output_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int CreateOutputBufferNativeDelegate (IntPtr inst, IntPtr outbuffer);

		static int CreateOutputBuffer_cb (IntPtr inst, IntPtr outbuffer)
		{
			try {
				VideoAggregator __obj = GLib.Object.GetObject (inst, false) as VideoAggregator;
				Gst.FlowReturn __result;
				__result = __obj.OnCreateOutputBuffer (outbuffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (outbuffer, typeof (Gst.Buffer), false));
				return (int) __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.Video.VideoAggregator), ConnectionMethod="OverrideCreateOutputBuffer")]
		protected virtual Gst.FlowReturn OnCreateOutputBuffer (Gst.Buffer outbuffer)
		{
			return InternalCreateOutputBuffer (outbuffer);
		}

		private Gst.FlowReturn InternalCreateOutputBuffer (Gst.Buffer outbuffer)
		{
			CreateOutputBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("create_output_buffer"));
				unmanaged = (CreateOutputBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CreateOutputBufferNativeDelegate));
			}
			if (unmanaged == null) return (Gst.FlowReturn) 0;

			int __result = unmanaged (this.Handle, outbuffer == null ? IntPtr.Zero : outbuffer.Handle);
			return (Gst.FlowReturn) __result;
		}

		static FindBestFormatNativeDelegate FindBestFormat_cb_delegate;
		static FindBestFormatNativeDelegate FindBestFormatVMCallback {
			get {
				if (FindBestFormat_cb_delegate == null)
					FindBestFormat_cb_delegate = new FindBestFormatNativeDelegate (FindBestFormat_cb);
				return FindBestFormat_cb_delegate;
			}
		}

		static void OverrideFindBestFormat (GLib.GType gtype)
		{
			OverrideFindBestFormat (gtype, FindBestFormatVMCallback);
		}

		static void OverrideFindBestFormat (GLib.GType gtype, FindBestFormatNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("find_best_format"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FindBestFormatNativeDelegate (IntPtr inst, IntPtr downstream_caps, IntPtr best_info, bool at_least_one_alpha);

		static void FindBestFormat_cb (IntPtr inst, IntPtr downstream_caps, IntPtr best_info, bool at_least_one_alpha)
		{
			try {
				VideoAggregator __obj = GLib.Object.GetObject (inst, false) as VideoAggregator;
				__obj.OnFindBestFormat (downstream_caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (downstream_caps, typeof (Gst.Caps), false), best_info == IntPtr.Zero ? null : (Gst.Video.VideoInfo) GLib.Opaque.GetOpaque (best_info, typeof (Gst.Video.VideoInfo), false), at_least_one_alpha);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.Video.VideoAggregator), ConnectionMethod="OverrideFindBestFormat")]
		protected virtual void OnFindBestFormat (Gst.Caps downstream_caps, Gst.Video.VideoInfo best_info, bool at_least_one_alpha)
		{
			InternalFindBestFormat (downstream_caps, best_info, at_least_one_alpha);
		}

		private void InternalFindBestFormat (Gst.Caps downstream_caps, Gst.Video.VideoInfo best_info, bool at_least_one_alpha)
		{
			FindBestFormatNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("find_best_format"));
				unmanaged = (FindBestFormatNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FindBestFormatNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, downstream_caps == null ? IntPtr.Zero : downstream_caps.Handle, best_info == null ? IntPtr.Zero : best_info.Handle, at_least_one_alpha);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("update_caps"
							, Gst.Base.Aggregator.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // update_caps
							, null
							, "aggregate_frames"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("aggregate_frames"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // aggregate_frames
							, "update_caps"
							, "create_output_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("create_output_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // create_output_buffer
							, "aggregate_frames"
							, "find_best_format"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("find_best_format"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // find_best_format
							, "create_output_buffer"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
							, "find_best_format"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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


		static VideoAggregator ()
		{
			GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
		}

		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("info"
							, Gst.Base.Aggregator.abi_info.Fields
							, Gst.Video.VideoInfo.abi_info.Size // info
							, null
							, "priv"
							, Gst.Video.VideoInfo.abi_info.Align
							, 0
							),
						new GLib.AbiField("priv"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, "info"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 20 // _gst_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}