public InstallPluginsResultFuncWrapper(Gst.PbUtils.InstallPluginsResultFunc managed)
 {
     this.managed = managed;
     if (managed != null)
     {
         NativeDelegate = new InstallPluginsResultFuncNative(NativeCallback);
     }
 }
Ejemplo n.º 2
0
 public static Gst.PbUtils.InstallPluginsReturn InstallPluginsAsync(string[] details, Gst.PbUtils.InstallPluginsResultFunc func)
 {
     return(InstallPluginsAsync(details, Gst.PbUtils.InstallPluginsContext.Zero, func));
 }
Ejemplo n.º 3
0
        public static Gst.PbUtils.InstallPluginsReturn InstallPluginsAsync(string[] details, Gst.PbUtils.InstallPluginsContext ctx, Gst.PbUtils.InstallPluginsResultFunc func)
        {
            int cnt_details = details == null ? 0 : details.Length;

            IntPtr[] native_details = new IntPtr [cnt_details + 1];
            for (int i = 0; i < cnt_details; i++)
            {
                native_details [i] = GLib.Marshaller.StringToPtrGStrdup(details[i]);
            }
            native_details [cnt_details] = IntPtr.Zero;
            IntPtr native_ctx = GLib.Marshaller.StructureToPtrAlloc(ctx);

            Gst.PbUtilsSharp.InstallPluginsResultFuncWrapper func_wrapper = new Gst.PbUtilsSharp.InstallPluginsResultFuncWrapper(func);
            func_wrapper.PersistUntilCalled();
            int raw_ret = gst_install_plugins_async(native_details, native_ctx, func_wrapper.NativeDelegate, IntPtr.Zero);

            Gst.PbUtils.InstallPluginsReturn ret = (Gst.PbUtils.InstallPluginsReturn)raw_ret;
            for (int i = 0; i < native_details.Length - 1; i++)
            {
                details [i] = GLib.Marshaller.Utf8PtrToString(native_details[i]);
                GLib.Marshaller.Free(native_details[i]);
            }
            Marshal.FreeHGlobal(native_ctx);
            return(ret);
        }
		public InstallPluginsResultFuncWrapper (Gst.PbUtils.InstallPluginsResultFunc managed)
		{
			this.managed = managed;
			if (managed != null)
				NativeDelegate = new InstallPluginsResultFuncNative (NativeCallback);
		}