static IntPtr GetProperties_cb (IntPtr inst) { try { PropertyProbeImplementor __obj = Gst.GLib.Object.GetObject (inst, false) as PropertyProbeImplementor; string[] properties = __obj.Properties; Gst.GLib.List properties_list = new Gst.GLib.List (typeof (IntPtr)); IntPtr gclass = Marshal.ReadIntPtr (inst); foreach (string prop in properties) { IntPtr name = Gst.GLib.Marshaller.StringToPtrGStrdup (prop); IntPtr pspec = g_object_class_find_property (gclass, name); Gst.GLib.Marshaller.Free (name); if (pspec != IntPtr.Zero) properties_list.Prepend (pspec); } /* FIXME: We leak the list! */ return properties_list.Handle; } catch (Exception e) { Gst.GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw e; } }
public static Array ListPtrToArray (IntPtr list_ptr, Type list_type, bool owned, bool elements_owned, Type elem_type) { Type array_type = elem_type == typeof (ListBase.FilenameString) ? typeof (string) : elem_type; ListBase list; if (list_type == typeof(Gst.GLib.List)) list = new Gst.GLib.List (list_ptr, elem_type, owned, elements_owned); else list = new Gst.GLib.SList (list_ptr, elem_type, owned, elements_owned); using (list) return ListToArray (list, array_type); }
public static bool CheckUniqueness (Gst.Object[] objects, string name) { Gst.GLib.List list = new Gst.GLib.List (objects, typeof (Gst.Object), false, false); IntPtr native_name = Gst.GLib.Marshaller.StringToPtrGStrdup (name); bool raw_ret = gst_object_check_uniqueness (list.Handle, native_name); bool ret = raw_ret; Gst.GLib.Marshaller.Free (native_name); return ret; }