mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
4be602a137
Update to C# bindings to use a more recent version of GtkSharp and regenerate the bindings with that version Fix #1718
94 lines
2.5 KiB
C#
94 lines
2.5 KiB
C#
// This file was generated by the Gtk# code generator.
|
|
// Any changes made will be lost if regenerated.
|
|
|
|
namespace Gst.AudioSharp {
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
#region Autogenerated code
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
internal delegate void AudioFormatPackNative(IntPtr info, int flags, byte[] src, byte[] data, int n_length);
|
|
|
|
internal class AudioFormatPackInvoker {
|
|
|
|
AudioFormatPackNative native_cb;
|
|
IntPtr __data;
|
|
GLib.DestroyNotify __notify;
|
|
|
|
~AudioFormatPackInvoker ()
|
|
{
|
|
if (__notify == null)
|
|
return;
|
|
__notify (__data);
|
|
}
|
|
|
|
internal AudioFormatPackInvoker (AudioFormatPackNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
|
|
|
|
internal AudioFormatPackInvoker (AudioFormatPackNative native_cb, IntPtr data) : this (native_cb, data, null) {}
|
|
|
|
internal AudioFormatPackInvoker (AudioFormatPackNative native_cb, IntPtr data, GLib.DestroyNotify notify)
|
|
{
|
|
this.native_cb = native_cb;
|
|
__data = data;
|
|
__notify = notify;
|
|
}
|
|
|
|
internal Gst.Audio.AudioFormatPack Handler {
|
|
get {
|
|
return new Gst.Audio.AudioFormatPack(InvokeNative);
|
|
}
|
|
}
|
|
|
|
void InvokeNative (Gst.Audio.AudioFormatInfo info, Gst.Audio.AudioPackFlags flags, byte[] src, byte[] data, int n_length)
|
|
{
|
|
IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
|
|
native_cb (native_info, (int) flags, src, data, n_length);
|
|
Marshal.FreeHGlobal (native_info);
|
|
}
|
|
}
|
|
|
|
internal class AudioFormatPackWrapper {
|
|
|
|
public void NativeCallback (IntPtr info, int flags, byte[] src, byte[] data, int n_length)
|
|
{
|
|
try {
|
|
managed (Gst.Audio.AudioFormatInfo.New (info), (Gst.Audio.AudioPackFlags) flags, src, data, n_length);
|
|
if (release_on_call)
|
|
gch.Free ();
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
}
|
|
}
|
|
|
|
bool release_on_call = false;
|
|
GCHandle gch;
|
|
|
|
public void PersistUntilCalled ()
|
|
{
|
|
release_on_call = true;
|
|
gch = GCHandle.Alloc (this);
|
|
}
|
|
|
|
internal AudioFormatPackNative NativeDelegate;
|
|
Gst.Audio.AudioFormatPack managed;
|
|
|
|
public AudioFormatPackWrapper (Gst.Audio.AudioFormatPack managed)
|
|
{
|
|
this.managed = managed;
|
|
if (managed != null)
|
|
NativeDelegate = new AudioFormatPackNative (NativeCallback);
|
|
}
|
|
|
|
public static Gst.Audio.AudioFormatPack GetManagedDelegate (AudioFormatPackNative native)
|
|
{
|
|
if (native == null)
|
|
return null;
|
|
AudioFormatPackWrapper wrapper = (AudioFormatPackWrapper) native.Target;
|
|
if (wrapper == null)
|
|
return null;
|
|
return wrapper.managed;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|