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 Aggregator : Gst.Element {
  
  		protected Aggregator (IntPtr raw) : base(raw) {}
  
  		protected Aggregator() : base(IntPtr.Zero)
  		{
  			CreateNativeObject (new string [0], new GLib.Value [0]);
  		}
  
  		[DllImport("libgstbase-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
  		static extern ulong gst_aggregator_get_latency(IntPtr raw);
  
  		[GLib.Property ("latency")]
  		public ulong Latency {
  			get  {
  				ulong raw_ret = gst_aggregator_get_latency(Handle);
  				ulong ret = raw_ret;
  				return ret;
  			}
  			set {
  				GLib.Value val = new GLib.Value(value);
  				SetProperty("latency", val);
  				val.Dispose ();
  			}
  		}
  
  		[GLib.Property ("min-upstream-latency")]
  		public ulong MinUpstreamLatency {
  			get {
  				GLib.Value val = GetProperty ("min-upstream-latency");
  				ulong ret = (ulong) val;
  				val.Dispose ();
  				return ret;
  			}
  			set {
  				GLib.Value val = new GLib.Value(value);
  				SetProperty("min-upstream-latency", val);
  				val.Dispose ();
  			}
  		}
  
  		[GLib.Property ("start-time")]
  		public ulong StartTime {
  			get {
  				GLib.Value val = GetProperty ("start-time");
  				ulong ret = (ulong) val;
  				val.Dispose ();
  				return ret;
  			}
  			set {
  				GLib.Value val = new GLib.Value(value);
  				SetProperty("start-time", val);
  				val.Dispose ();
  			}
  		}
  
  		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;
  				}
  			}
  		}
  
  		static FlushNativeDelegate Flush_cb_delegate;
  		static FlushNativeDelegate FlushVMCallback {
  			get {
  				if (Flush_cb_delegate == null)
  					Flush_cb_delegate = new FlushNativeDelegate (Flush_cb);
  				return Flush_cb_delegate;
  			}
  		}
  
  		static void OverrideFlush (GLib.GType gtype)
  		{
  			OverrideFlush (gtype, FlushVMCallback);
  		}
  
  		static void OverrideFlush (GLib.GType gtype, FlushNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate int FlushNativeDelegate (IntPtr inst);
  
  		static int Flush_cb (IntPtr inst)
  		{
  			try {
  				Aggregator __obj = GLib.Object.GetObject (inst, false) as Aggregator;
  				Gst.FlowReturn __result;
  				__result = __obj.OnFlush ();
  				return (int) __result;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gst.Base.Aggregator), ConnectionMethod="OverrideFlush")]
  		protected virtual Gst.FlowReturn OnFlush ()
  		{
  			return InternalFlush ();
  		}
  
  		private Gst.FlowReturn InternalFlush ()
  		{
  			FlushNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush"));
  				unmanaged = (FlushNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushNativeDelegate));
  			}
  			if (unmanaged == null) return (Gst.FlowReturn) 0;
  
  			int __result = unmanaged (this.Handle);
  			return (Gst.FlowReturn) __result;
  		}
  
  		static ClipNativeDelegate Clip_cb_delegate;
  		static ClipNativeDelegate ClipVMCallback {
  			get {
  				if (Clip_cb_delegate == null)
  					Clip_cb_delegate = new ClipNativeDelegate (Clip_cb);
  				return Clip_cb_delegate;
  			}
  		}
  
  		static void OverrideClip (GLib.GType gtype)
  		{
  			OverrideClip (gtype, ClipVMCallback);
  		}
  
  		static void OverrideClip (GLib.GType gtype, ClipNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("clip"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate IntPtr ClipNativeDelegate (IntPtr inst, IntPtr aggregator_pad, IntPtr buf);
  
  		static IntPtr Clip_cb (IntPtr inst, IntPtr aggregator_pad, IntPtr buf)
  		{
  			try {
  				Aggregator __obj = GLib.Object.GetObject (inst, false) as Aggregator;
  				Gst.Buffer __result;
  				__result = __obj.OnClip (GLib.Object.GetObject(aggregator_pad) as Gst.Base.AggregatorPad, buf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buf, typeof (Gst.Buffer), 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.Aggregator), ConnectionMethod="OverrideClip")]
  		protected virtual Gst.Buffer OnClip (Gst.Base.AggregatorPad aggregator_pad, Gst.Buffer buf)
  		{
  			return InternalClip (aggregator_pad, buf);
  		}
  
  		private Gst.Buffer InternalClip (Gst.Base.AggregatorPad aggregator_pad, Gst.Buffer buf)
  		{
  			ClipNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("clip"));
  				unmanaged = (ClipNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ClipNativeDelegate));
  			}
  			if (unmanaged == null) return null;
  
  			IntPtr __result = unmanaged (this.Handle, aggregator_pad == null ? IntPtr.Zero : aggregator_pad.Handle, buf == null ? IntPtr.Zero : buf.Handle);
  			return __result == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (__result, typeof (Gst.Buffer), true);
  		}
  
  		static FinishBufferNativeDelegate FinishBuffer_cb_delegate;
  		static FinishBufferNativeDelegate FinishBufferVMCallback {
  			get {
  				if (FinishBuffer_cb_delegate == null)
  					FinishBuffer_cb_delegate = new FinishBufferNativeDelegate (FinishBuffer_cb);
  				return FinishBuffer_cb_delegate;
  			}
  		}
  
  		static void OverrideFinishBuffer (GLib.GType gtype)
  		{
  			OverrideFinishBuffer (gtype, FinishBufferVMCallback);
  		}
  
  		static void OverrideFinishBuffer (GLib.GType gtype, FinishBufferNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("finish_buffer"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate int FinishBufferNativeDelegate (IntPtr inst, IntPtr buffer);
  
  		static int FinishBuffer_cb (IntPtr inst, IntPtr buffer)
  		{
  			try {
  				Aggregator __obj = GLib.Object.GetObject (inst, false) as Aggregator;
  				Gst.FlowReturn __result;
  				__result = __obj.OnFinishBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), true));
  				return (int) __result;
  			} catch (Exception e) {
  				GLib.ExceptionManager.RaiseUnhandledException (e, true);
  				// NOTREACHED: above call does not return.
  				throw e;
  			}
  		}
  
  		[GLib.DefaultSignalHandler(Type=typeof(Gst.Base.Aggregator), ConnectionMethod="OverrideFinishBuffer")]
  		protected virtual Gst.FlowReturn OnFinishBuffer (Gst.Buffer buffer)
  		{
  			return InternalFinishBuffer (buffer);
  		}
  
  		private Gst.FlowReturn InternalFinishBuffer (Gst.Buffer buffer)
  		{
  			FinishBufferNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("finish_buffer"));
  				unmanaged = (FinishBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FinishBufferNativeDelegate));
  			}
  			if (unmanaged == null) return (Gst.FlowReturn) 0;
  
  			buffer.Owned = false;
  			int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
  			return (Gst.FlowReturn) __result;
  		}
  
  		static SinkEventNativeDelegate SinkEvent_cb_delegate;
  		static SinkEventNativeDelegate SinkEventVMCallback {
  			get {
  				if (SinkEvent_cb_delegate == null)
  					SinkEvent_cb_delegate = new SinkEventNativeDelegate (SinkEvent_cb);
  				return SinkEvent_cb_delegate;
  			}
  		}
  
  		static void OverrideSinkEvent (GLib.GType gtype)
  		{
  			OverrideSinkEvent (gtype, SinkEventVMCallback);
  		}
  
  		static void OverrideSinkEvent (GLib.GType gtype, SinkEventNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_event"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate bool SinkEventNativeDelegate (IntPtr inst, IntPtr aggregator_pad, IntPtr evnt);
  
  		static bool SinkEvent_cb (IntPtr inst, IntPtr aggregator_pad, IntPtr evnt)
  		{
  			try {
  				Aggregator __obj = GLib.Object.GetObject (inst, false) as Aggregator;
  				bool __result;
  				__result = __obj.OnSinkEvent (GLib.Object.GetObject(aggregator_pad) as Gst.Base.AggregatorPad, evnt == IntPtr.Zero ? null : (Gst.Event) GLib.Opaque.GetOpaque (evnt, typeof (Gst.Event), 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.Aggregator), ConnectionMethod="OverrideSinkEvent")]
  		protected virtual bool OnSinkEvent (Gst.Base.AggregatorPad aggregator_pad, Gst.Event evnt)
  		{
  			return InternalSinkEvent (aggregator_pad, evnt);
  		}
  
  		private bool InternalSinkEvent (Gst.Base.AggregatorPad aggregator_pad, Gst.Event evnt)
  		{
  			SinkEventNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_event"));
  				unmanaged = (SinkEventNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SinkEventNativeDelegate));
  			}
  			if (unmanaged == null) return false;
  
  			bool __result = unmanaged (this.Handle, aggregator_pad == null ? IntPtr.Zero : aggregator_pad.Handle, evnt == null ? IntPtr.Zero : evnt.Handle);
  			return __result;
  		}
  
  		static SinkQueryNativeDelegate SinkQuery_cb_delegate;
  		static SinkQueryNativeDelegate SinkQueryVMCallback {
  			get {
  				if (SinkQuery_cb_delegate == null)
  					SinkQuery_cb_delegate = new SinkQueryNativeDelegate (SinkQuery_cb);
  				return SinkQuery_cb_delegate;
  			}
  		}
  
  		static void OverrideSinkQuery (GLib.GType gtype)
  		{
  			OverrideSinkQuery (gtype, SinkQueryVMCallback);
  		}
  
  		static void OverrideSinkQuery (GLib.GType gtype, SinkQueryNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_query"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  		delegate bool SinkQueryNativeDelegate (IntPtr inst, IntPtr aggregator_pad, IntPtr query);
  
  		static bool SinkQuery_cb (IntPtr inst, IntPtr aggregator_pad, IntPtr query)
  		{
  			try {
  				Aggregator __obj = GLib.Object.GetObject (inst, false) as Aggregator;
  				bool __result;
  				__result = __obj.OnSinkQuery (GLib.Object.GetObject(aggregator_pad) as Gst.Base.AggregatorPad, query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), 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.Aggregator), ConnectionMethod="OverrideSinkQuery")]
  		protected virtual bool OnSinkQuery (Gst.Base.AggregatorPad aggregator_pad, Gst.Query query)
  		{
  			return InternalSinkQuery (aggregator_pad, query);
  		}
  
  		private bool InternalSinkQuery (Gst.Base.AggregatorPad aggregator_pad, Gst.Query query)
  		{
  			SinkQueryNativeDelegate unmanaged = null;
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("sink_query"));
  				unmanaged = (SinkQueryNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SinkQueryNativeDelegate));
  			}
  			if (unmanaged == null) return false;
  
  			bool __result = unmanaged (this.Handle, aggregator_pad == null ? IntPtr.Zero : aggregator_pad.Handle, query == null ? IntPtr.Zero : query.Handle);
  			return __result;
  		}
  
  		static SrcEventNativeDelegate SrcEvent_cb_delegate;
  		static SrcEventNativeDelegate SrcEventVMCallback {
  			get {
  				if (SrcEvent_cb_delegate == null)
  					SrcEvent_cb_delegate = new SrcEventNativeDelegate (SrcEvent_cb);
  				return SrcEvent_cb_delegate;
  			}
  		}
  
  		static void OverrideSrcEvent (GLib.GType gtype)
  		{
  			OverrideSrcEvent (gtype, SrcEventVMCallback);
  		}
  
  		static void OverrideSrcEvent (GLib.GType gtype, SrcEventNativeDelegate callback)
  		{
  			unsafe {
  				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("src_event"));
  				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
  			}
  		}
  
  		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
  
gt: 		delegate bool SrcEventNativeDelegate (IntPtr inst, IntPtr evnt);