Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- /home/forage/Projects/gstreamer-sharp/gstreamer-sharp/GstSharp.PadQueryTypeFunctionNative.cs
- +++ /home/forage/Projects/gstreamer-sharp/gstreamer-sharp/generated/GstSharp.PadQueryTypeFunctionNative.cs
- @@ -5,11 +5,10 @@
- using System;
- using System.Runtime.InteropServices;
- - using System.Collections;
- #region Autogenerated code
- [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
- - internal delegate IntPtr PadQueryTypeFunctionNative (IntPtr pad);
- + internal delegate int PadQueryTypeFunctionNative(IntPtr pad);
- internal class PadQueryTypeFunctionInvoker {
- @@ -41,47 +40,22 @@
- }
- }
- - Gst.QueryType[] InvokeNative (Gst.Pad pad)
- + Gst.QueryType InvokeNative (Gst.Pad pad)
- {
- - IntPtr raw_ret = native_cb (pad == null ? IntPtr.Zero : pad.Handle);
- - if (raw_ret == IntPtr.Zero)
- - return new Gst.QueryType[] {};
- -
- - ArrayList result = new ArrayList ();
- - bool term = false;
- - int ofs = 0;
- - while (!term) {
- - Gst.QueryType t = (Gst.QueryType) Marshal.ReadInt32 (raw_ret, ofs);
- - if (t == Gst.QueryType.None) {
- - term = true;
- - } else {
- - result.Add (t);
- - ofs += 4;
- - }
- - }
- -
- - return (Gst.QueryType[]) result.ToArray (typeof (Gst.QueryType));
- + Gst.QueryType __result = (Gst.QueryType) native_cb (pad == null ? IntPtr.Zero : pad.Handle);
- + return __result;
- }
- }
- internal class PadQueryTypeFunctionWrapper {
- - IntPtr raw_ret = IntPtr.Zero;
- - public IntPtr NativeCallback (IntPtr pad)
- + public int NativeCallback (IntPtr pad)
- {
- try {
- - if (raw_ret != IntPtr.Zero)
- - return raw_ret;
- -
- - Gst.QueryType[] __ret = managed (GLib.Object.GetObject (pad) as Gst.Pad);
- + Gst.QueryType __ret = managed (GLib.Object.GetObject(pad) as Gst.Pad);
- if (release_on_call)
- gch.Free ();
- - raw_ret = Marshal.AllocHGlobal (4 * __ret.Length + 4);
- - for (int i = 0; i < __ret.Length; i++)
- - Marshal.WriteInt32 (raw_ret, i * 4, (int) __ret[i]);
- - Marshal.WriteInt32 (raw_ret, __ret.Length * 4, 0);
- -
- - return raw_ret;
- + return (int) __ret;
- } catch (Exception e) {
- GLib.ExceptionManager.RaiseUnhandledException (e, true);
- // NOTREACHED: Above call does not return.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement