mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-11 10:56:38 +00:00
Fix registration of new Typefinders
This commit is contained in:
parent
7eb6f09f76
commit
c42ef5f916
1 changed files with 5 additions and 3 deletions
|
@ -1,12 +1,14 @@
|
||||||
[DllImport ("gstreamer-0.10.dll") ]
|
[DllImport ("gstreamer-0.10.dll") ]
|
||||||
static extern bool gst_type_find_register (IntPtr plugin, IntPtr name, uint rank, GstSharp.TypeFindFunctionNative func, IntPtr extensions, IntPtr possible_caps, IntPtr data, IntPtr data_notify);
|
static extern bool gst_type_find_register (IntPtr plugin, IntPtr name, uint rank, GstSharp.TypeFindFunctionNative func, IntPtr[] extensions, IntPtr possible_caps, IntPtr data, IntPtr data_notify);
|
||||||
|
|
||||||
public static bool Register (Gst.Plugin plugin, string name, uint rank, Gst.TypeFindFunction func, string extensions, Gst.Caps possible_caps) {
|
public static bool Register (Gst.Plugin plugin, string name, uint rank, Gst.TypeFindFunction func, string[] extensions, Gst.Caps possible_caps) {
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
|
IntPtr[] native_extensions = GLib.Marshaller.StringArrayToNullTermPointer (extensions);
|
||||||
GstSharp.TypeFindFunctionWrapper func_wrapper = new GstSharp.TypeFindFunctionWrapper (func);
|
GstSharp.TypeFindFunctionWrapper func_wrapper = new GstSharp.TypeFindFunctionWrapper (func);
|
||||||
bool raw_ret = gst_type_find_register (plugin == null ? IntPtr.Zero : plugin.Handle, native_name, rank, func_wrapper.NativeDelegate, GLib.Marshaller.StringToPtrGStrdup (extensions), possible_caps == null ? IntPtr.Zero : possible_caps.Handle, IntPtr.Zero, IntPtr.Zero);
|
bool raw_ret = gst_type_find_register (plugin == null ? IntPtr.Zero : plugin.Handle, native_name, rank, func_wrapper.NativeDelegate, native_extensions, possible_caps == null ? IntPtr.Zero : possible_caps.Handle, IntPtr.Zero, IntPtr.Zero);
|
||||||
bool ret = raw_ret;
|
bool ret = raw_ret;
|
||||||
GLib.Marshaller.Free (native_name);
|
GLib.Marshaller.Free (native_name);
|
||||||
|
GLib.Marshaller.Free (native_extensions);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue