diff options
Diffstat (limited to 'sources/generated/Gst/Meta.cs')
-rw-r--r-- | sources/generated/Gst/Meta.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sources/generated/Gst/Meta.cs b/sources/generated/Gst/Meta.cs index 10dee14..ac19a72 100644 --- a/sources/generated/Gst/Meta.cs +++ b/sources/generated/Gst/Meta.cs @@ -110,6 +110,36 @@ namespace Gst { return ret; } + [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern IntPtr gst_meta_register_custom(IntPtr name, IntPtr[] tags, GstSharp.CustomMetaTransformFunctionNative transform_func, IntPtr user_data, GLib.DestroyNotify destroy_data); + + public static Gst.MetaInfo RegisterCustom(string name, string[] tags, Gst.CustomMetaTransformFunction transform_func) { + IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name); + int cnt_tags = tags == null ? 0 : tags.Length; + IntPtr[] native_tags = new IntPtr [cnt_tags + 1]; + for (int i = 0; i < cnt_tags; i++) + native_tags [i] = GLib.Marshaller.StringToPtrGStrdup(tags[i]); + native_tags [cnt_tags] = IntPtr.Zero; + GstSharp.CustomMetaTransformFunctionWrapper transform_func_wrapper = new GstSharp.CustomMetaTransformFunctionWrapper (transform_func); + IntPtr user_data; + GLib.DestroyNotify destroy_data; + if (transform_func == null) { + user_data = IntPtr.Zero; + destroy_data = null; + } else { + user_data = (IntPtr) GCHandle.Alloc (transform_func_wrapper); + destroy_data = GLib.DestroyHelper.NotifyHandler; + } + IntPtr raw_ret = gst_meta_register_custom(native_name, native_tags, transform_func_wrapper.NativeDelegate, user_data, destroy_data); + Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret); + GLib.Marshaller.Free (native_name); + return ret; + } + + public static Gst.MetaInfo RegisterCustom(string name, string[] tags) { + return RegisterCustom (name, tags, null); + } + static void ReadNative (IntPtr native, ref Gst.Meta target) { target = New (native); |