// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst.RtspServer {

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

#region Autogenerated code
	public partial class RTSPOnvifMediaFactory : Gst.RtspServer.RTSPMediaFactory {

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

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

		public RTSPOnvifMediaFactory () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (RTSPOnvifMediaFactory)) {
				CreateNativeObject (new string [0], new GLib.Value[0]);
				return;
			}
			Raw = gst_rtsp_onvif_media_factory_new();
		}

		static HasBackchannelSupportNativeDelegate HasBackchannelSupport_cb_delegate;
		static HasBackchannelSupportNativeDelegate HasBackchannelSupportVMCallback {
			get {
				if (HasBackchannelSupport_cb_delegate == null)
					HasBackchannelSupport_cb_delegate = new HasBackchannelSupportNativeDelegate (HasBackchannelSupport_cb);
				return HasBackchannelSupport_cb_delegate;
			}
		}

		static void OverrideHasBackchannelSupport (GLib.GType gtype)
		{
			OverrideHasBackchannelSupport (gtype, HasBackchannelSupportVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool HasBackchannelSupportNativeDelegate (IntPtr inst);

		static bool HasBackchannelSupport_cb (IntPtr inst)
		{
			try {
				RTSPOnvifMediaFactory __obj = GLib.Object.GetObject (inst, false) as RTSPOnvifMediaFactory;
				bool __result;
				__result = __obj.OnHasBackchannelSupport ();
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.RtspServer.RTSPOnvifMediaFactory), ConnectionMethod="OverrideHasBackchannelSupport")]
		protected virtual bool OnHasBackchannelSupport ()
		{
			return InternalHasBackchannelSupport ();
		}

		private bool InternalHasBackchannelSupport ()
		{
			HasBackchannelSupportNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("has_backchannel_support"));
				unmanaged = (HasBackchannelSupportNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(HasBackchannelSupportNativeDelegate));
			}
			if (unmanaged == null) return false;

			bool __result = unmanaged (this.Handle);
			return __result;
		}

		static CreateBackchannelStreamNativeDelegate CreateBackchannelStream_cb_delegate;
		static CreateBackchannelStreamNativeDelegate CreateBackchannelStreamVMCallback {
			get {
				if (CreateBackchannelStream_cb_delegate == null)
					CreateBackchannelStream_cb_delegate = new CreateBackchannelStreamNativeDelegate (CreateBackchannelStream_cb);
				return CreateBackchannelStream_cb_delegate;
			}
		}

		static void OverrideCreateBackchannelStream (GLib.GType gtype)
		{
			OverrideCreateBackchannelStream (gtype, CreateBackchannelStreamVMCallback);
		}

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

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool CreateBackchannelStreamNativeDelegate (IntPtr inst, IntPtr media, IntPtr ctx);

		static bool CreateBackchannelStream_cb (IntPtr inst, IntPtr media, IntPtr ctx)
		{
			try {
				RTSPOnvifMediaFactory __obj = GLib.Object.GetObject (inst, false) as RTSPOnvifMediaFactory;
				bool __result;
				__result = __obj.OnCreateBackchannelStream (GLib.Object.GetObject(media) as Gst.RtspServer.RTSPOnvifMedia, Gst.RtspServer.RTSPContext.New (ctx));
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.RtspServer.RTSPOnvifMediaFactory), ConnectionMethod="OverrideCreateBackchannelStream")]
		protected virtual bool OnCreateBackchannelStream (Gst.RtspServer.RTSPOnvifMedia media, Gst.RtspServer.RTSPContext ctx)
		{
			return InternalCreateBackchannelStream (media, ctx);
		}

		private bool InternalCreateBackchannelStream (Gst.RtspServer.RTSPOnvifMedia media, Gst.RtspServer.RTSPContext ctx)
		{
			CreateBackchannelStreamNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("create_backchannel_stream"));
				unmanaged = (CreateBackchannelStreamNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CreateBackchannelStreamNativeDelegate));
			}
			if (unmanaged == null) return false;

			IntPtr native_ctx = GLib.Marshaller.StructureToPtrAlloc (ctx);
			bool __result = unmanaged (this.Handle, media == null ? IntPtr.Zero : media.Handle, native_ctx);
			Marshal.FreeHGlobal (native_ctx);
			return __result;
		}


		// 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("has_backchannel_support"
							, Gst.RtspServer.RTSPMediaFactory.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // has_backchannel_support
							, null
							, "create_backchannel_stream"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("create_backchannel_stream"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // create_backchannel_stream
							, "has_backchannel_support"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 19 // _gst_reserved
							, "create_backchannel_stream"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_rtsp_onvif_media_factory_requires_backchannel(IntPtr factory, IntPtr ctx);

		public static bool RequiresBackchannel(Gst.RtspServer.RTSPMediaFactory factory, Gst.RtspServer.RTSPContext ctx) {
			IntPtr native_ctx = GLib.Marshaller.StructureToPtrAlloc (ctx);
			bool raw_ret = gst_rtsp_onvif_media_factory_requires_backchannel(factory == null ? IntPtr.Zero : factory.Handle, native_ctx);
			bool ret = raw_ret;
			Marshal.FreeHGlobal (native_ctx);
			return ret;
		}

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

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_onvif_media_factory_set_backchannel_bandwidth(IntPtr raw, uint bandwidth);

		public uint BackchannelBandwidth { 
			get {
				uint raw_ret = gst_rtsp_onvif_media_factory_get_backchannel_bandwidth(Handle);
				uint ret = raw_ret;
				return ret;
			}
			set {
				gst_rtsp_onvif_media_factory_set_backchannel_bandwidth(Handle, value);
			}
		}

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

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

		public string BackchannelLaunch { 
			get {
				IntPtr raw_ret = gst_rtsp_onvif_media_factory_get_backchannel_launch(Handle);
				string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
				return ret;
			}
			set {
				IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
				gst_rtsp_onvif_media_factory_set_backchannel_launch(Handle, native_value);
				GLib.Marshaller.Free (native_value);
			}
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_rtsp_onvif_media_factory_has_backchannel_support(IntPtr raw);

		public bool HasBackchannelSupport { 
			get {
				bool raw_ret = gst_rtsp_onvif_media_factory_has_backchannel_support(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_rtsp_onvif_media_factory_has_replay_support(IntPtr raw);

		public bool HasReplaySupport { 
			get {
				bool raw_ret = gst_rtsp_onvif_media_factory_has_replay_support(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[DllImport("gstrtspserver-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_rtsp_onvif_media_factory_set_replay_support(IntPtr raw, bool has_replay_support);

		public bool ReplaySupport { 
			set {
				gst_rtsp_onvif_media_factory_set_replay_support(Handle, value);
			}
		}


		static RTSPOnvifMediaFactory ()
		{
			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("priv"
							, Gst.RtspServer.RTSPMediaFactory.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, null
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}


		// End of the ABI representation.

#endregion
	}
}
