Example #1
0
        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);

            GstSharp.TypeFindFunctionWrapper func_wrapper = new GstSharp.TypeFindFunctionWrapper(func);
            IntPtr data;

            GLib.DestroyNotify data_notify;
            if (func == null)
            {
                data        = IntPtr.Zero;
                data_notify = null;
            }
            else
            {
                data        = (IntPtr)GCHandle.Alloc(func_wrapper);
                data_notify = GLib.DestroyHelper.NotifyHandler;
            }
            IntPtr native_extensions = GLib.Marshaller.StringToPtrGStrdup(extensions);
            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, data_notify);
            bool   ret = raw_ret;

            GLib.Marshaller.Free(native_name);
            GLib.Marshaller.Free(native_extensions);
            return(ret);
        }
 public TypeFindFunctionWrapper(Gst.TypeFindFunction managed)
 {
     this.managed = managed;
     if (managed != null)
     {
         NativeDelegate = new TypeFindFunctionNative(NativeCallback);
     }
 }
Example #3
0
 public static bool Register(string name, uint rank, Gst.TypeFindFunction func, Gst.Caps possible_caps)
 {
     return(Register(null, name, rank, func, null, possible_caps));
 }
		public TypeFindFunctionWrapper (Gst.TypeFindFunction managed)
		{
			this.managed = managed;
			if (managed != null)
				NativeDelegate = new TypeFindFunctionNative (NativeCallback);
		}
Example #5
0
 public static bool Register(string name, uint rank, Gst.TypeFindFunction func)
 {
     return(Register(null, name, rank, func, null, null));
 }