gstreamer/subprojects/gstreamer-sharp/sources/generated/Gst.Rtsp/Gst.RtspSharp.RTSPConnectionAcceptCertificateFuncNative.cs

96 lines
3 KiB
C#

// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.
namespace Gst.RtspSharp {
using System;
using System.Runtime.InteropServices;
#region Autogenerated code
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
internal delegate bool RTSPConnectionAcceptCertificateFuncNative(IntPtr conn, IntPtr peer_cert, int errors, IntPtr user_data);
internal class RTSPConnectionAcceptCertificateFuncInvoker {
RTSPConnectionAcceptCertificateFuncNative native_cb;
IntPtr __data;
GLib.DestroyNotify __notify;
~RTSPConnectionAcceptCertificateFuncInvoker ()
{
if (__notify == null)
return;
__notify (__data);
}
internal RTSPConnectionAcceptCertificateFuncInvoker (RTSPConnectionAcceptCertificateFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
internal RTSPConnectionAcceptCertificateFuncInvoker (RTSPConnectionAcceptCertificateFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
internal RTSPConnectionAcceptCertificateFuncInvoker (RTSPConnectionAcceptCertificateFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
{
this.native_cb = native_cb;
__data = data;
__notify = notify;
}
internal Gst.Rtsp.RTSPConnectionAcceptCertificateFunc Handler {
get {
return new Gst.Rtsp.RTSPConnectionAcceptCertificateFunc(InvokeNative);
}
}
bool InvokeNative (GLib.TlsConnection conn, GLib.TlsCertificate peer_cert, GLib.TlsCertificateFlags errors)
{
bool __result = native_cb (conn == null ? IntPtr.Zero : conn.Handle, peer_cert == null ? IntPtr.Zero : peer_cert.Handle, (int) errors, __data);
return __result;
}
}
internal class RTSPConnectionAcceptCertificateFuncWrapper {
public bool NativeCallback (IntPtr conn, IntPtr peer_cert, int errors, IntPtr user_data)
{
try {
bool __ret = managed (GLib.Object.GetObject(conn) as GLib.TlsConnection, GLib.Object.GetObject(peer_cert) as GLib.TlsCertificate, (GLib.TlsCertificateFlags) errors);
if (release_on_call)
gch.Free ();
return __ret;
} catch (Exception e) {
GLib.ExceptionManager.RaiseUnhandledException (e, false);
return false;
}
}
bool release_on_call = false;
GCHandle gch;
public void PersistUntilCalled ()
{
release_on_call = true;
gch = GCHandle.Alloc (this);
}
internal RTSPConnectionAcceptCertificateFuncNative NativeDelegate;
Gst.Rtsp.RTSPConnectionAcceptCertificateFunc managed;
public RTSPConnectionAcceptCertificateFuncWrapper (Gst.Rtsp.RTSPConnectionAcceptCertificateFunc managed)
{
this.managed = managed;
if (managed != null)
NativeDelegate = new RTSPConnectionAcceptCertificateFuncNative (NativeCallback);
}
public static Gst.Rtsp.RTSPConnectionAcceptCertificateFunc GetManagedDelegate (RTSPConnectionAcceptCertificateFuncNative native)
{
if (native == null)
return null;
RTSPConnectionAcceptCertificateFuncWrapper wrapper = (RTSPConnectionAcceptCertificateFuncWrapper) native.Target;
if (wrapper == null)
return null;
return wrapper.managed;
}
}
#endregion
}