Esempio n. 1
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);
        }
Esempio n. 2
0
        public static string InstallPluginsReturnGetName(Gst.PbUtils.InstallPluginsReturn _ret)
        {
            IntPtr raw_ret = gst_install_plugins_return_get_name((int)_ret);
            string ret     = GLib.Marshaller.Utf8PtrToString(raw_ret);

            return(ret);
        }
Esempio n. 3
0
        public static Gst.PbUtils.InstallPluginsReturn InstallPluginsSync(string[] details, Gst.PbUtils.InstallPluginsContext ctx)
        {
            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);
            int    raw_ret    = gst_install_plugins_sync(native_details, native_ctx);

            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);
        }
 void InvokeNative(Gst.PbUtils.InstallPluginsReturn _result)
 {
     native_cb((int)_result, __data);
 }