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 BufferPool : Gst.Object {
14 public BufferPool (IntPtr raw) : base(raw) {}
16 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
17 static extern IntPtr gst_buffer_pool_new();
19 public BufferPool () : base (IntPtr.Zero)
21 if (GetType () != typeof (BufferPool)) {
22 CreateNativeObject (new string [0], new GLib.Value[0]);
25 Raw = gst_buffer_pool_new();
28 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
29 static extern void gst_buffer_pool_set_flushing(IntPtr raw, bool flushing);
31 public bool Flushing {
34 bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("flushing"));
39 gst_buffer_pool_set_flushing(Handle, value);
43 static GetOptionsNativeDelegate GetOptions_cb_delegate;
44 static GetOptionsNativeDelegate GetOptionsVMCallback {
46 if (GetOptions_cb_delegate == null)
47 GetOptions_cb_delegate = new GetOptionsNativeDelegate (GetOptions_cb);
48 return GetOptions_cb_delegate;
52 static void OverrideGetOptions (GLib.GType gtype)
54 OverrideGetOptions (gtype, GetOptionsVMCallback);
57 static void OverrideGetOptions (GLib.GType gtype, GetOptionsNativeDelegate callback)
60 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_options"));
61 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
65 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
66 delegate IntPtr GetOptionsNativeDelegate (IntPtr inst);
68 static IntPtr GetOptions_cb (IntPtr inst)
71 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
73 __result = __obj.OnGetOptions ();
74 return GLib.Marshaller.StringArrayToNullTermStrvPointer (__result);
75 } catch (Exception e) {
76 GLib.ExceptionManager.RaiseUnhandledException (e, true);
77 // NOTREACHED: above call does not return.
82 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideGetOptions")]
83 protected virtual string[] OnGetOptions ()
85 return InternalGetOptions ();
88 private string[] InternalGetOptions ()
90 GetOptionsNativeDelegate unmanaged = null;
92 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("get_options"));
93 unmanaged = (GetOptionsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetOptionsNativeDelegate));
95 if (unmanaged == null) return null;
97 IntPtr __result = unmanaged (this.Handle);
98 return GLib.Marshaller.NullTermPtrToStringArray (__result, false);
101 static SetConfigNativeDelegate SetConfig_cb_delegate;
102 static SetConfigNativeDelegate SetConfigVMCallback {
104 if (SetConfig_cb_delegate == null)
105 SetConfig_cb_delegate = new SetConfigNativeDelegate (SetConfig_cb);
106 return SetConfig_cb_delegate;
110 static void OverrideSetConfig (GLib.GType gtype)
112 OverrideSetConfig (gtype, SetConfigVMCallback);
115 static void OverrideSetConfig (GLib.GType gtype, SetConfigNativeDelegate callback)
118 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_config"));
119 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
123 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
124 delegate bool SetConfigNativeDelegate (IntPtr inst, IntPtr config);
126 static bool SetConfig_cb (IntPtr inst, IntPtr config)
129 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
131 __result = __obj.OnSetConfig (config == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (config, typeof (Gst.Structure), true));
133 } catch (Exception e) {
134 GLib.ExceptionManager.RaiseUnhandledException (e, true);
135 // NOTREACHED: above call does not return.
140 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideSetConfig")]
141 protected virtual bool OnSetConfig (Gst.Structure config)
143 return InternalSetConfig (config);
146 private bool InternalSetConfig (Gst.Structure config)
148 SetConfigNativeDelegate unmanaged = null;
150 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_config"));
151 unmanaged = (SetConfigNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetConfigNativeDelegate));
153 if (unmanaged == null) return false;
155 config.Owned = false;
156 bool __result = unmanaged (this.Handle, config == null ? IntPtr.Zero : config.Handle);
160 static StartNativeDelegate Start_cb_delegate;
161 static StartNativeDelegate StartVMCallback {
163 if (Start_cb_delegate == null)
164 Start_cb_delegate = new StartNativeDelegate (Start_cb);
165 return Start_cb_delegate;
169 static void OverrideStart (GLib.GType gtype)
171 OverrideStart (gtype, StartVMCallback);
174 static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
177 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
178 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
182 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
183 delegate bool StartNativeDelegate (IntPtr inst);
185 static bool Start_cb (IntPtr inst)
188 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
190 __result = __obj.OnStart ();
192 } catch (Exception e) {
193 GLib.ExceptionManager.RaiseUnhandledException (e, true);
194 // NOTREACHED: above call does not return.
199 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideStart")]
200 protected virtual bool OnStart ()
202 return InternalStart ();
205 private bool InternalStart ()
207 StartNativeDelegate unmanaged = null;
209 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
210 unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
212 if (unmanaged == null) return false;
214 bool __result = unmanaged (this.Handle);
218 static StopNativeDelegate Stop_cb_delegate;
219 static StopNativeDelegate StopVMCallback {
221 if (Stop_cb_delegate == null)
222 Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
223 return Stop_cb_delegate;
227 static void OverrideStop (GLib.GType gtype)
229 OverrideStop (gtype, StopVMCallback);
232 static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
235 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
236 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
240 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
241 delegate bool StopNativeDelegate (IntPtr inst);
243 static bool Stop_cb (IntPtr inst)
246 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
248 __result = __obj.OnStop ();
250 } catch (Exception e) {
251 GLib.ExceptionManager.RaiseUnhandledException (e, true);
252 // NOTREACHED: above call does not return.
257 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideStop")]
258 protected virtual bool OnStop ()
260 return InternalStop ();
263 private bool InternalStop ()
265 StopNativeDelegate unmanaged = null;
267 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
268 unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
270 if (unmanaged == null) return false;
272 bool __result = unmanaged (this.Handle);
276 static AcquireBufferNativeDelegate AcquireBuffer_cb_delegate;
277 static AcquireBufferNativeDelegate AcquireBufferVMCallback {
279 if (AcquireBuffer_cb_delegate == null)
280 AcquireBuffer_cb_delegate = new AcquireBufferNativeDelegate (AcquireBuffer_cb);
281 return AcquireBuffer_cb_delegate;
285 static void OverrideAcquireBuffer (GLib.GType gtype)
287 OverrideAcquireBuffer (gtype, AcquireBufferVMCallback);
290 static void OverrideAcquireBuffer (GLib.GType gtype, AcquireBufferNativeDelegate callback)
293 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire_buffer"));
294 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
298 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
299 delegate int AcquireBufferNativeDelegate (IntPtr inst, out IntPtr buffer, IntPtr parms);
301 static int AcquireBuffer_cb (IntPtr inst, out IntPtr buffer, IntPtr parms)
304 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
305 Gst.FlowReturn __result;
307 __result = __obj.OnAcquireBuffer (out mybuffer, Gst.BufferPoolAcquireParams.New (parms));
308 buffer = mybuffer == null ? IntPtr.Zero : mybuffer.Handle;
309 return (int) __result;
310 } catch (Exception e) {
311 GLib.ExceptionManager.RaiseUnhandledException (e, true);
312 // NOTREACHED: above call does not return.
317 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideAcquireBuffer")]
318 protected virtual Gst.FlowReturn OnAcquireBuffer (out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
320 return InternalAcquireBuffer (out buffer, parms);
323 private Gst.FlowReturn InternalAcquireBuffer (out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
325 AcquireBufferNativeDelegate unmanaged = null;
327 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire_buffer"));
328 unmanaged = (AcquireBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireBufferNativeDelegate));
330 if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
332 IntPtr native_buffer;
333 IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
334 int __result = unmanaged (this.Handle, out native_buffer, native_parms);
335 buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
336 Marshal.FreeHGlobal (native_parms);
337 return (Gst.FlowReturn) __result;
340 static AllocBufferNativeDelegate AllocBuffer_cb_delegate;
341 static AllocBufferNativeDelegate AllocBufferVMCallback {
343 if (AllocBuffer_cb_delegate == null)
344 AllocBuffer_cb_delegate = new AllocBufferNativeDelegate (AllocBuffer_cb);
345 return AllocBuffer_cb_delegate;
349 static void OverrideAllocBuffer (GLib.GType gtype)
351 OverrideAllocBuffer (gtype, AllocBufferVMCallback);
354 static void OverrideAllocBuffer (GLib.GType gtype, AllocBufferNativeDelegate callback)
357 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("alloc_buffer"));
358 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
362 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
363 delegate int AllocBufferNativeDelegate (IntPtr inst, IntPtr buffer, IntPtr parms);
365 static int AllocBuffer_cb (IntPtr inst, IntPtr buffer, IntPtr parms)
368 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
369 Gst.FlowReturn __result;
370 __result = __obj.OnAllocBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false), Gst.BufferPoolAcquireParams.New (parms));
371 return (int) __result;
372 } catch (Exception e) {
373 GLib.ExceptionManager.RaiseUnhandledException (e, true);
374 // NOTREACHED: above call does not return.
379 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideAllocBuffer")]
380 protected virtual Gst.FlowReturn OnAllocBuffer (Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
382 return InternalAllocBuffer (buffer, parms);
385 private Gst.FlowReturn InternalAllocBuffer (Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
387 AllocBufferNativeDelegate unmanaged = null;
389 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("alloc_buffer"));
390 unmanaged = (AllocBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AllocBufferNativeDelegate));
392 if (unmanaged == null) return (Gst.FlowReturn) 0;
394 IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
395 int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle, native_parms);
396 Marshal.FreeHGlobal (native_parms);
397 return (Gst.FlowReturn) __result;
400 static ResetBufferNativeDelegate ResetBuffer_cb_delegate;
401 static ResetBufferNativeDelegate ResetBufferVMCallback {
403 if (ResetBuffer_cb_delegate == null)
404 ResetBuffer_cb_delegate = new ResetBufferNativeDelegate (ResetBuffer_cb);
405 return ResetBuffer_cb_delegate;
409 static void OverrideResetBuffer (GLib.GType gtype)
411 OverrideResetBuffer (gtype, ResetBufferVMCallback);
414 static void OverrideResetBuffer (GLib.GType gtype, ResetBufferNativeDelegate callback)
417 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("reset_buffer"));
418 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
422 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
423 delegate void ResetBufferNativeDelegate (IntPtr inst, IntPtr buffer);
425 static void ResetBuffer_cb (IntPtr inst, IntPtr buffer)
428 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
429 __obj.OnResetBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
430 } catch (Exception e) {
431 GLib.ExceptionManager.RaiseUnhandledException (e, false);
435 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideResetBuffer")]
436 protected virtual void OnResetBuffer (Gst.Buffer buffer)
438 InternalResetBuffer (buffer);
441 private void InternalResetBuffer (Gst.Buffer buffer)
443 ResetBufferNativeDelegate unmanaged = null;
445 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("reset_buffer"));
446 unmanaged = (ResetBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ResetBufferNativeDelegate));
448 if (unmanaged == null) return;
450 unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
453 static ReleaseBufferNativeDelegate ReleaseBuffer_cb_delegate;
454 static ReleaseBufferNativeDelegate ReleaseBufferVMCallback {
456 if (ReleaseBuffer_cb_delegate == null)
457 ReleaseBuffer_cb_delegate = new ReleaseBufferNativeDelegate (ReleaseBuffer_cb);
458 return ReleaseBuffer_cb_delegate;
462 static void OverrideReleaseBuffer (GLib.GType gtype)
464 OverrideReleaseBuffer (gtype, ReleaseBufferVMCallback);
467 static void OverrideReleaseBuffer (GLib.GType gtype, ReleaseBufferNativeDelegate callback)
470 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release_buffer"));
471 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
475 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
476 delegate void ReleaseBufferNativeDelegate (IntPtr inst, IntPtr buffer);
478 static void ReleaseBuffer_cb (IntPtr inst, IntPtr buffer)
481 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
482 __obj.OnReleaseBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), true));
483 } catch (Exception e) {
484 GLib.ExceptionManager.RaiseUnhandledException (e, false);
488 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideReleaseBuffer")]
489 protected virtual void OnReleaseBuffer (Gst.Buffer buffer)
491 InternalReleaseBuffer (buffer);
494 private void InternalReleaseBuffer (Gst.Buffer buffer)
496 ReleaseBufferNativeDelegate unmanaged = null;
498 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release_buffer"));
499 unmanaged = (ReleaseBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleaseBufferNativeDelegate));
501 if (unmanaged == null) return;
503 buffer.Owned = false;
504 unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
507 static FreeBufferNativeDelegate FreeBuffer_cb_delegate;
508 static FreeBufferNativeDelegate FreeBufferVMCallback {
510 if (FreeBuffer_cb_delegate == null)
511 FreeBuffer_cb_delegate = new FreeBufferNativeDelegate (FreeBuffer_cb);
512 return FreeBuffer_cb_delegate;
516 static void OverrideFreeBuffer (GLib.GType gtype)
518 OverrideFreeBuffer (gtype, FreeBufferVMCallback);
521 static void OverrideFreeBuffer (GLib.GType gtype, FreeBufferNativeDelegate callback)
524 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("free_buffer"));
525 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
529 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
530 delegate void FreeBufferNativeDelegate (IntPtr inst, IntPtr buffer);
532 static void FreeBuffer_cb (IntPtr inst, IntPtr buffer)
535 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
536 __obj.OnFreeBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
537 } catch (Exception e) {
538 GLib.ExceptionManager.RaiseUnhandledException (e, false);
542 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFreeBuffer")]
543 protected virtual void OnFreeBuffer (Gst.Buffer buffer)
545 InternalFreeBuffer (buffer);
548 private void InternalFreeBuffer (Gst.Buffer buffer)
550 FreeBufferNativeDelegate unmanaged = null;
552 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("free_buffer"));
553 unmanaged = (FreeBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FreeBufferNativeDelegate));
555 if (unmanaged == null) return;
557 unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
560 static FlushStartNativeDelegate FlushStart_cb_delegate;
561 static FlushStartNativeDelegate FlushStartVMCallback {
563 if (FlushStart_cb_delegate == null)
564 FlushStart_cb_delegate = new FlushStartNativeDelegate (FlushStart_cb);
565 return FlushStart_cb_delegate;
569 static void OverrideFlushStart (GLib.GType gtype)
571 OverrideFlushStart (gtype, FlushStartVMCallback);
574 static void OverrideFlushStart (GLib.GType gtype, FlushStartNativeDelegate callback)
577 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_start"));
578 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
582 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
583 delegate void FlushStartNativeDelegate (IntPtr inst);
585 static void FlushStart_cb (IntPtr inst)
588 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
589 __obj.OnFlushStart ();
590 } catch (Exception e) {
591 GLib.ExceptionManager.RaiseUnhandledException (e, false);
595 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFlushStart")]
596 protected virtual void OnFlushStart ()
598 InternalFlushStart ();
601 private void InternalFlushStart ()
603 FlushStartNativeDelegate unmanaged = null;
605 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_start"));
606 unmanaged = (FlushStartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushStartNativeDelegate));
608 if (unmanaged == null) return;
610 unmanaged (this.Handle);
613 static FlushStopNativeDelegate FlushStop_cb_delegate;
614 static FlushStopNativeDelegate FlushStopVMCallback {
616 if (FlushStop_cb_delegate == null)
617 FlushStop_cb_delegate = new FlushStopNativeDelegate (FlushStop_cb);
618 return FlushStop_cb_delegate;
622 static void OverrideFlushStop (GLib.GType gtype)
624 OverrideFlushStop (gtype, FlushStopVMCallback);
627 static void OverrideFlushStop (GLib.GType gtype, FlushStopNativeDelegate callback)
630 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_stop"));
631 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
635 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
636 delegate void FlushStopNativeDelegate (IntPtr inst);
638 static void FlushStop_cb (IntPtr inst)
641 BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
642 __obj.OnFlushStop ();
643 } catch (Exception e) {
644 GLib.ExceptionManager.RaiseUnhandledException (e, false);
648 [GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFlushStop")]
649 protected virtual void OnFlushStop ()
651 InternalFlushStop ();
654 private void InternalFlushStop ()
656 FlushStopNativeDelegate unmanaged = null;
658 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_stop"));
659 unmanaged = (FlushStopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushStopNativeDelegate));
661 if (unmanaged == null) return;
663 unmanaged (this.Handle);
667 // Internal representation of the wrapped structure ABI.
668 static GLib.AbiStruct _class_abi = null;
669 static public new GLib.AbiStruct class_abi {
671 if (_class_abi == null)
672 _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{
673 new GLib.AbiField("get_options"
674 , Gst.Object.class_abi.Fields
675 , (uint) Marshal.SizeOf(typeof(IntPtr)) // get_options
678 , (uint) Marshal.SizeOf(typeof(IntPtr))
681 new GLib.AbiField("set_config"
683 , (uint) Marshal.SizeOf(typeof(IntPtr)) // set_config
686 , (uint) Marshal.SizeOf(typeof(IntPtr))
689 new GLib.AbiField("start"
691 , (uint) Marshal.SizeOf(typeof(IntPtr)) // start
694 , (uint) Marshal.SizeOf(typeof(IntPtr))
697 new GLib.AbiField("stop"
699 , (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
702 , (uint) Marshal.SizeOf(typeof(IntPtr))
705 new GLib.AbiField("acquire_buffer"
707 , (uint) Marshal.SizeOf(typeof(IntPtr)) // acquire_buffer
710 , (uint) Marshal.SizeOf(typeof(IntPtr))
713 new GLib.AbiField("alloc_buffer"
715 , (uint) Marshal.SizeOf(typeof(IntPtr)) // alloc_buffer
718 , (uint) Marshal.SizeOf(typeof(IntPtr))
721 new GLib.AbiField("reset_buffer"
723 , (uint) Marshal.SizeOf(typeof(IntPtr)) // reset_buffer
726 , (uint) Marshal.SizeOf(typeof(IntPtr))
729 new GLib.AbiField("release_buffer"
731 , (uint) Marshal.SizeOf(typeof(IntPtr)) // release_buffer
734 , (uint) Marshal.SizeOf(typeof(IntPtr))
737 new GLib.AbiField("free_buffer"
739 , (uint) Marshal.SizeOf(typeof(IntPtr)) // free_buffer
742 , (uint) Marshal.SizeOf(typeof(IntPtr))
745 new GLib.AbiField("flush_start"
747 , (uint) Marshal.SizeOf(typeof(IntPtr)) // flush_start
750 , (uint) Marshal.SizeOf(typeof(IntPtr))
753 new GLib.AbiField("flush_stop"
755 , (uint) Marshal.SizeOf(typeof(IntPtr)) // flush_stop
758 , (uint) Marshal.SizeOf(typeof(IntPtr))
761 new GLib.AbiField("_gst_reserved"
763 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 2 // _gst_reserved
766 , (uint) Marshal.SizeOf(typeof(IntPtr))
776 // End of the ABI representation.
778 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
779 static extern IntPtr gst_buffer_pool_get_type();
781 public static new GLib.GType GType {
783 IntPtr raw_ret = gst_buffer_pool_get_type();
784 GLib.GType ret = new GLib.GType(raw_ret);
789 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
790 static extern void gst_buffer_pool_config_add_option(IntPtr config, IntPtr option);
792 public static void ConfigAddOption(Gst.Structure config, string option) {
793 IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
794 gst_buffer_pool_config_add_option(config == null ? IntPtr.Zero : config.Handle, native_option);
795 GLib.Marshaller.Free (native_option);
798 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
799 static extern bool gst_buffer_pool_config_get_allocator(IntPtr config, out IntPtr allocator, IntPtr parms);
801 public static bool ConfigGetAllocator(Gst.Structure config, out Gst.Allocator allocator, out Gst.AllocationParams parms) {
802 IntPtr native_allocator;
803 IntPtr native_parms = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.AllocationParams)));
804 bool raw_ret = gst_buffer_pool_config_get_allocator(config == null ? IntPtr.Zero : config.Handle, out native_allocator, native_parms);
806 allocator = GLib.Object.GetObject(native_allocator) as Gst.Allocator;
807 parms = Gst.AllocationParams.New (native_parms);
808 Marshal.FreeHGlobal (native_parms);
812 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
813 static extern IntPtr gst_buffer_pool_config_get_option(IntPtr config, uint index);
815 public static string ConfigGetOption(Gst.Structure config, uint index) {
816 IntPtr raw_ret = gst_buffer_pool_config_get_option(config == null ? IntPtr.Zero : config.Handle, index);
817 string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
821 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
822 static extern bool gst_buffer_pool_config_get_params(IntPtr config, out IntPtr caps, out uint size, out uint min_buffers, out uint max_buffers);
824 public static bool ConfigGetParams(Gst.Structure config, out Gst.Caps caps, out uint size, out uint min_buffers, out uint max_buffers) {
826 bool raw_ret = gst_buffer_pool_config_get_params(config == null ? IntPtr.Zero : config.Handle, out native_caps, out size, out min_buffers, out max_buffers);
828 caps = native_caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (native_caps, typeof (Gst.Caps), false);
832 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
833 static extern bool gst_buffer_pool_config_has_option(IntPtr config, IntPtr option);
835 public static bool ConfigHasOption(Gst.Structure config, string option) {
836 IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
837 bool raw_ret = gst_buffer_pool_config_has_option(config == null ? IntPtr.Zero : config.Handle, native_option);
839 GLib.Marshaller.Free (native_option);
843 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
844 static extern uint gst_buffer_pool_config_n_options(IntPtr config);
846 public static uint ConfigNOptions(Gst.Structure config) {
847 uint raw_ret = gst_buffer_pool_config_n_options(config == null ? IntPtr.Zero : config.Handle);
852 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
853 static extern void gst_buffer_pool_config_set_allocator(IntPtr config, IntPtr allocator, IntPtr parms);
855 public static void ConfigSetAllocator(Gst.Structure config, Gst.Allocator allocator, Gst.AllocationParams parms) {
856 IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
857 gst_buffer_pool_config_set_allocator(config == null ? IntPtr.Zero : config.Handle, allocator == null ? IntPtr.Zero : allocator.Handle, native_parms);
858 Marshal.FreeHGlobal (native_parms);
861 public static void ConfigSetAllocator(Gst.Structure config) {
862 ConfigSetAllocator (config, null, Gst.AllocationParams.Zero);
865 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
866 static extern void gst_buffer_pool_config_set_params(IntPtr config, IntPtr caps, uint size, uint min_buffers, uint max_buffers);
868 public static void ConfigSetParams(Gst.Structure config, Gst.Caps caps, uint size, uint min_buffers, uint max_buffers) {
869 gst_buffer_pool_config_set_params(config == null ? IntPtr.Zero : config.Handle, caps == null ? IntPtr.Zero : caps.Handle, size, min_buffers, max_buffers);
872 public static void ConfigSetParams(Gst.Structure config, uint size, uint min_buffers, uint max_buffers) {
873 ConfigSetParams (config, null, size, min_buffers, max_buffers);
876 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
877 static extern bool gst_buffer_pool_config_validate_params(IntPtr config, IntPtr caps, uint size, uint min_buffers, uint max_buffers);
879 public static bool ConfigValidateParams(Gst.Structure config, Gst.Caps caps, uint size, uint min_buffers, uint max_buffers) {
880 bool raw_ret = gst_buffer_pool_config_validate_params(config == null ? IntPtr.Zero : config.Handle, caps == null ? IntPtr.Zero : caps.Handle, size, min_buffers, max_buffers);
885 public static bool ConfigValidateParams(Gst.Structure config, uint size, uint min_buffers, uint max_buffers) {
886 return ConfigValidateParams (config, null, size, min_buffers, max_buffers);
889 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
890 static extern int gst_buffer_pool_acquire_buffer(IntPtr raw, out IntPtr buffer, IntPtr parms);
892 public Gst.FlowReturn AcquireBuffer(out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms) {
893 IntPtr native_buffer;
894 IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
895 int raw_ret = gst_buffer_pool_acquire_buffer(Handle, out native_buffer, native_parms);
896 Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
897 buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
898 Marshal.FreeHGlobal (native_parms);
902 public Gst.FlowReturn AcquireBuffer(out Gst.Buffer buffer) {
903 return AcquireBuffer (out buffer, Gst.BufferPoolAcquireParams.Zero);
906 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
907 static extern IntPtr gst_buffer_pool_get_config(IntPtr raw);
909 public Gst.Structure Config {
911 IntPtr raw_ret = gst_buffer_pool_get_config(Handle);
912 Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
917 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
918 static extern IntPtr gst_buffer_pool_get_options(IntPtr raw);
920 public string[] Options {
922 IntPtr raw_ret = gst_buffer_pool_get_options(Handle);
923 string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, false);
928 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
929 static extern bool gst_buffer_pool_has_option(IntPtr raw, IntPtr option);
931 public bool HasOption(string option) {
932 IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
933 bool raw_ret = gst_buffer_pool_has_option(Handle, native_option);
935 GLib.Marshaller.Free (native_option);
939 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
940 static extern bool gst_buffer_pool_is_active(IntPtr raw);
942 public bool IsActive {
944 bool raw_ret = gst_buffer_pool_is_active(Handle);
950 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
951 static extern void gst_buffer_pool_release_buffer(IntPtr raw, IntPtr buffer);
953 public void ReleaseBuffer(Gst.Buffer buffer) {
954 buffer.Owned = false;
955 gst_buffer_pool_release_buffer(Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
958 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
959 static extern bool gst_buffer_pool_set_active(IntPtr raw, bool active);
961 public bool SetActive(bool active) {
962 bool raw_ret = gst_buffer_pool_set_active(Handle, active);
967 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
968 static extern bool gst_buffer_pool_set_config(IntPtr raw, IntPtr config);
970 public bool SetConfig(Gst.Structure config) {
971 config.Owned = false;
972 bool raw_ret = gst_buffer_pool_set_config(Handle, config == null ? IntPtr.Zero : config.Handle);
978 // Internal representation of the wrapped structure ABI.
979 static GLib.AbiStruct _abi_info = null;
980 static public new GLib.AbiStruct abi_info {
982 if (_abi_info == null)
983 _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{
984 new GLib.AbiField("flushing"
985 , Gst.Object.abi_info.Fields
986 , (uint) Marshal.SizeOf(typeof(bool)) // flushing
989 , (long) Marshal.OffsetOf(typeof(GstBufferPool_flushingAlign), "flushing")
992 new GLib.AbiField("priv"
994 , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
997 , (uint) Marshal.SizeOf(typeof(IntPtr))
1000 new GLib.AbiField("_gst_reserved"
1002 , (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
1005 , (uint) Marshal.SizeOf(typeof(IntPtr))
1014 [StructLayout(LayoutKind.Sequential)]
1015 public struct GstBufferPool_flushingAlign
1018 private bool flushing;
1022 // End of the ABI representation.