context: // This file was generated by the Gtk# code generator.
  // Any changes made will be lost if regenerated.
  
  namespace Gst.Base {
  
  	using System;
  	using System.Collections;
  	using System.Collections.Generic;
  	using System.Runtime.InteropServices;
  
  #region Autogenerated code
  	public partial class BaseTransform : Gst.Element {
  
  		protected BaseTransform (IntPtr raw) : base(raw) {}
  
  		protected BaseTransform() : base(IntPtr.Zero)
  		{
  			CreateNativeObject (new string [0], new GLib.Value [0]);
  		}
  
  		[GLib.Property ("qos")]
  		public bool Qos {
  			get {
  				GLib.Value val = GetProperty ("qos");
  				bool ret = (bool) val;
  				val.Dispose ();
  				return ret;
  			}
  			set {
  				GLib.Value val = new GLib.Value(value);
  				SetProperty("qos", val);
  				val.Dispose ();
  			}
  		}
  
  		public Gst.Pad Sinkpad {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("sinkpad"));
  					return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
  				}
  			}
  		}
  
  		public Gst.Pad Srcpad {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("srcpad"));
  					return GLib.Object.GetObject((*raw_ptr)) as Gst.Pad;
  				}
  			}
  		}
  
  		public bool HaveSegment {
  			get {
  				unsafe {
  					bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("have_segment"));
  					return (*raw_ptr);
  				}
  			}
  		}
  
  		public Gst.Segment Segment {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("segment"));
  					return Gst.Segment.New ((*raw_ptr));
  				}
  			}
  		}
  
  		public Gst.Buffer QueuedBuf {
  			get {
  				unsafe {
  					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("queued_buf"));
  					return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Buffer), false);
  				}
  			}
  		}
  
  		static TransformCapsNativeDelegate TransformCaps_cb_delegate;
  		static TransformCapsNativeDelegate TransformCapsVMCallback {
  			get {
  				if (TransformCaps_cb_delegate == null)
  					TransformCaps_cb_delegate = new TransformCapsNativeDelegate (TransformCaps_cb);
  				return TransformCaps_cb_delegate;
  			}
  		}
  
  		static void OverrideTransformCaps (GLib.GType gtype)
  		{
  			OverrideTransformCaps (gtype, TransformCapsVMCallback);
  		}
  
  		static void OverrideTransformCaps (GLib.GType gtype, TransformCapsNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("transform_caps"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate IntPtr TransformCapsNativeDelegate (IntPtr inst, int direction, IntPtr caps, IntPtr filter);
  
  		static IntPtr TransformCaps_cb (IntPtr inst, int direction, IntPtr caps, IntPtr filter)
  		{
  			try {
  				BaseTransform __obj = GLib.Object.GetObject (inst, false) as BaseTransform;
  				Gst.Caps __result;
  				__result = __obj.OnTransformCaps ((Gst.PadDirection) direction, caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (caps, typeof (Gst.Caps), false), filter == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (filter, 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.Base.BaseTransform), ConnectionMethod="OverrideTransformCaps")]
  		protected virtual Gst.Caps OnTransformCaps (Gst.PadDirection direction, Gst.Caps caps, Gst.Caps filter)
  		{
  			return InternalTransformCaps (direction, caps, filter);
  		}
  
  		private Gst.Caps InternalTransformCaps (Gst.PadDirection direction, Gst.Caps caps, Gst.Caps filter)
  		{
  			TransformCapsNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("transform_caps"));
  				unmanaged = (TransformCapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(TransformCapsNativeDelegate));
  			}
  			if (unmanaged == null) return null;
  
  			IntPtr __result = unmanaged (this.Handle, (int) direction, caps == null ? IntPtr.Zero : caps.Handle, filter == null ? IntPtr.Zero : filter.Handle);
  			return __result == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (__result, typeof (Gst.Caps), true);
  		}
  
  		static FixateCapsNativeDelegate FixateCaps_cb_delegate;
  		static FixateCapsNativeDelegate FixateCapsVMCallback {
  			get {
  				if (FixateCaps_cb_delegate == null)
  					FixateCaps_cb_delegate = new FixateCapsNativeDelegate (FixateCaps_cb);
  				return FixateCaps_cb_delegate;
  			}
  		}
  
  		static void OverrideFixateCaps (GLib.GType gtype)
  		{
  			OverrideFixateCaps (gtype, FixateCapsVMCallback);
  		}
  
  		static void OverrideFixateCaps (GLib.GType gtype, FixateCapsNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("fixate_caps"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate IntPtr FixateCapsNativeDelegate (IntPtr inst, int direction, IntPtr caps, IntPtr othercaps);
  
  		static IntPtr FixateCaps_cb (IntPtr inst, int direction, IntPtr caps, IntPtr othercaps)
  		{
  			try {
  				BaseTransform __obj = GLib.Object.GetObject (inst, false) as BaseTransform;
  				Gst.Caps __result;
  				__result = __obj.OnFixateCaps ((Gst.PadDirection) direction, caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (caps, typeof (Gst.Caps), false), othercaps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (othercaps, 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.Base.BaseTransform), ConnectionMethod="OverrideFixateCaps")]
  		protected virtual Gst.Caps OnFixateCaps (Gst.PadDirection direction, Gst.Caps caps, Gst.Caps othercaps)
  		{
  			return InternalFixateCaps (direction, caps, othercaps);
  		}
  
  		private Gst.Caps InternalFixateCaps (Gst.PadDirection direction, Gst.Caps caps, Gst.Caps othercaps)
  		{
  			FixateCapsNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("fixate_caps"));
  				unmanaged = (FixateCapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FixateCapsNativeDelegate));
  			}
  			if (unmanaged == null) return null;
  
  			IntPtr __result = unmanaged (this.Handle, (int) direction, caps == null ? IntPtr.Zero : caps.Handle, othercaps == null ? IntPtr.Zero : othercaps.Handle);
  			return __result == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (__result, typeof (Gst.Caps), true);
  		}
  
  		static AcceptCapsNativeDelegate AcceptCaps_cb_delegate;
  		static AcceptCapsNativeDelegate AcceptCapsVMCallback {
  			get {
  				if (AcceptCaps_cb_delegate == null)
  					AcceptCaps_cb_delegate = new AcceptCapsNativeDelegate (AcceptCaps_cb);
  				return AcceptCaps_cb_delegate;
  			}
  		}
  
  		static void OverrideAcceptCaps (GLib.GType gtype)
  		{
  			OverrideAcceptCaps (gtype, AcceptCapsVMCallback);
  		}
  
  		static void OverrideAcceptCaps (GLib.GType gtype, AcceptCapsNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("accept_caps"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate bool AcceptCapsNativeDelegate (IntPtr inst, int direction, IntPtr caps);
  
  		static bool AcceptCaps_cb (IntPtr inst, int direction, IntPtr caps)
  		{
  			try {
  				BaseTransform __obj = GLib.Object.GetObject (inst, false) as BaseTransform;
  				bool __result;
  				__result = __obj.OnAcceptCaps ((Gst.PadDirection) direction, caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (caps, typeof (Gst.Caps), false));
  				return __result;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gst.Base.BaseTransform), ConnectionMethod="OverrideAcceptCaps")]
  		protected virtual bool OnAcceptCaps (Gst.PadDirection direction, Gst.Caps caps)
  		{
  			return InternalAcceptCaps (direction, caps);
  		}
  
  		private bool InternalAcceptCaps (Gst.PadDirection direction, Gst.Caps caps)
  		{
  			AcceptCapsNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("accept_caps"));
  				unmanaged = (AcceptCapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcceptCapsNativeDelegate));
  			}
  			if (unmanaged == null) return false;
  
  			bool __result = unmanaged (this.Handle, (int) direction, caps == null ? IntPtr.Zero : caps.Handle);
  			return __result;
  		}
  
  		static SetCapsNativeDelegate SetCaps_cb_delegate;
  		static SetCapsNativeDelegate SetCapsVMCallback {
  			get {
  				if (SetCaps_cb_delegate == null)
  					SetCaps_cb_delegate = new SetCapsNativeDelegate (SetCaps_cb);
  				return SetCaps_cb_delegate;
  			}
  		}
  
  		static void OverrideSetCaps (GLib.GType gtype)
  		{
  			OverrideSetCaps (gtype, SetCapsVMCallback);
  		}
  
  		static void OverrideSetCaps (GLib.GType gtype, SetCapsNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_caps"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate bool SetCapsNativeDelegate (IntPtr inst, IntPtr incaps, IntPtr outcaps);
  
  		static bool SetCaps_cb (IntPtr inst, IntPtr incaps, IntPtr outcaps)
  		{
  			try {
  				BaseTransform __obj = GLib.Object.GetObject (inst, false) as BaseTransform;
  				bool __result;
  				__result = __obj.OnSetCaps (incaps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (incaps, typeof (Gst.Caps), false), outcaps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (outcaps, typeof (Gst.Caps), false));
  				return __result;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gst.Base.BaseTransform), ConnectionMethod="OverrideSetCaps")]
  		protected virtual bool OnSetCaps (Gst.Caps incaps, Gst.Caps outcaps)
  		{
  			return InternalSetCaps (incaps, outcaps);
  		}
  
  		private bool InternalSetCaps (Gst.Caps incaps, Gst.Caps outcaps)
  		{
  			SetCapsNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_caps"));
  				unmanaged = (SetCapsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetCapsNativeDelegate));
  			}
  
gt: 			if (unmanaged == null) return false;