예제 #1
0
 public MetaFreeFunctionWrapper(Gst.MetaFreeFunction managed)
 {
     this.managed = managed;
     if (managed != null)
     {
         NativeDelegate = new MetaFreeFunctionNative(NativeCallback);
     }
 }
예제 #2
0
        public static Gst.MetaInfo Register(GLib.GType api, string impl, ulong size, Gst.MetaInitFunction init_func, Gst.MetaFreeFunction free_func, Gst.MetaTransformFunction transform_func)
        {
            IntPtr native_impl = GLib.Marshaller.StringToPtrGStrdup(impl);

            GstSharp.MetaInitFunctionWrapper init_func_wrapper = new GstSharp.MetaInitFunctionWrapper(init_func);
            init_func_wrapper.PersistUntilCalled();
            GstSharp.MetaFreeFunctionWrapper free_func_wrapper = new GstSharp.MetaFreeFunctionWrapper(free_func);
            free_func_wrapper.PersistUntilCalled();
            GstSharp.MetaTransformFunctionWrapper transform_func_wrapper = new GstSharp.MetaTransformFunctionWrapper(transform_func);
            transform_func_wrapper.PersistUntilCalled();
            IntPtr raw_ret = gst_meta_register(api.Val, native_impl, new UIntPtr(size), init_func_wrapper.NativeDelegate, free_func_wrapper.NativeDelegate, transform_func_wrapper.NativeDelegate);

            Gst.MetaInfo ret = Gst.MetaInfo.New(raw_ret);
            GLib.Marshaller.Free(native_impl);
            return(ret);
        }