- Interfaces currently contain things that should only be called by implementors
-- GstMiniObject binding is broken, we need our own codegen and handle it like a GObject without toggle refs, signals and properties
- Check vmethods and write them by hand if there are parameters that should be hidden (Gst.Index!)
- Check ownership of callback parameters and vmethods
- Make sure callbacks are only GC'd when they can be (TagMergeFunc, TypeFind, ..)
MethodBase.cs \
MethodBody.cs \
Method.cs \
+ MiniObjectGen.cs \
ObjectField.cs \
ObjectBase.cs \
ObjectGen.cs \
--- /dev/null
+// GtkSharp.Generation.MiniObjectGen.cs - The Mini Object Generatable.\r
+//\r
+// Author: Mike Kestner <mkestner@ximian.com>\r
+//\r
+// Copyright (c) 2001-2003 Mike Kestner\r
+// Copyright (c) 2003-2004 Novell, Inc.\r
+// Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>.\r
+//\r
+// This program is free software; you can redistribute it and/or\r
+// modify it under the terms of version 2 of the GNU General Public\r
+// License as published by the Free Software Foundation.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public\r
+// License along with this program; if not, write to the\r
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
+// Boston, MA 02111-1307, USA.\r
+\r
+\r
+namespace GtkSharp.Generation {\r
+\r
+ using System;\r
+ using System.Collections;\r
+ using System.IO;\r
+ using System.Text;\r
+ using System.Xml;\r
+\r
+ public class MiniObjectGen : ObjectBase {\r
+\r
+ private ArrayList custom_attrs = new ArrayList();\r
+ private ArrayList strings = new ArrayList();\r
+ private static Hashtable dirs = new Hashtable ();\r
+\r
+ public MiniObjectGen (XmlElement ns, XmlElement elem) : base (ns, elem, false) \r
+ {\r
+ foreach (XmlNode node in elem.ChildNodes) {\r
+ if (!(node is XmlElement)) continue;\r
+ XmlElement member = (XmlElement) node;\r
+ if (member.HasAttribute ("hidden") && member.GetAttribute ("hidden") == "1") continue;\r
+\r
+ switch (node.Name) {\r
+ case "custom-attribute":\r
+ custom_attrs.Add (member.InnerXml);\r
+ break;\r
+\r
+ case "static-string":\r
+ strings.Add (node);\r
+ break;\r
+\r
+ default:\r
+ if (!IsNodeNameHandled (node.Name))\r
+ Console.WriteLine ("Unexpected node " + node.Name + " in " + CName);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ public override bool Validate ()\r
+ {\r
+ ArrayList invalids = new ArrayList ();\r
+\r
+ return base.Validate ();\r
+ }\r
+\r
+ private bool DisableVoidCtor {\r
+ get {\r
+ return Elem.HasAttribute ("disable_void_ctor");\r
+ }\r
+ }\r
+\r
+ private bool DisableGTypeCtor {\r
+ get {\r
+ return Elem.HasAttribute ("disable_gtype_ctor");\r
+ }\r
+ }\r
+\r
+ private class DirectoryInfo {\r
+ public string assembly_name;\r
+ public Hashtable objects;\r
+\r
+ public DirectoryInfo (string assembly_name) {\r
+ this.assembly_name = assembly_name;\r
+ objects = new Hashtable ();\r
+ }\r
+ }\r
+\r
+ private static DirectoryInfo GetDirectoryInfo (string dir, string assembly_name)\r
+ {\r
+ DirectoryInfo result;\r
+\r
+ if (dirs.ContainsKey (dir)) {\r
+ result = dirs [dir] as DirectoryInfo;\r
+ if (result.assembly_name != assembly_name) {\r
+ Console.WriteLine ("Can't put multiple assemblies in one directory.");\r
+ return null;\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ result = new DirectoryInfo (assembly_name);\r
+ dirs.Add (dir, result);\r
+ \r
+ return result;\r
+ }\r
+\r
+ public override void Generate (GenerationInfo gen_info)\r
+ {\r
+ gen_info.CurrentType = Name;\r
+\r
+ string asm_name = gen_info.AssemblyName.Length == 0 ? NS.ToLower () + "-sharp" : gen_info.AssemblyName;\r
+ DirectoryInfo di = GetDirectoryInfo (gen_info.Dir, asm_name);\r
+\r
+ StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name);\r
+\r
+ sw.WriteLine ("namespace " + NS + " {");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\tusing System;");\r
+ sw.WriteLine ("\tusing System.Collections;");\r
+ sw.WriteLine ("\tusing System.Runtime.InteropServices;");\r
+ sw.WriteLine ();\r
+\r
+ SymbolTable table = SymbolTable.Table;\r
+\r
+ sw.WriteLine ("#region Autogenerated code");\r
+ if (IsDeprecated)\r
+ sw.WriteLine ("\t[Obsolete]");\r
+ foreach (string attr in custom_attrs)\r
+ sw.WriteLine ("\t" + attr);\r
+ sw.Write ("\t{0} {1}class " + Name, IsInternal ? "internal" : "public", IsAbstract ? "abstract " : "");\r
+ string cs_parent = table.GetCSType(Elem.GetAttribute("parent"));\r
+ if (cs_parent != "") {\r
+ di.objects.Add (CName, QualifiedName);\r
+ sw.Write (" : " + cs_parent);\r
+ }\r
+ foreach (string iface in managed_interfaces) {\r
+ if (Parent != null && Parent.Implements (iface))\r
+ continue;\r
+ sw.Write (", " + iface);\r
+ }\r
+ sw.WriteLine (" {");\r
+ sw.WriteLine ();\r
+\r
+ GenCtors (gen_info);\r
+ GenFields (gen_info);\r
+ \r
+ GenClassMembers (gen_info, cs_parent);\r
+ GenMethods (gen_info, null, null);\r
+ \r
+ foreach (XmlElement str in strings) {\r
+ sw.Write ("\t\tpublic static string " + str.GetAttribute ("name"));\r
+ sw.WriteLine (" {\n\t\t\t get { return \"" + str.GetAttribute ("value") + "\"; }\n\t\t}");\r
+ }\r
+\r
+ if (cs_parent != String.Empty && GetExpected (CName) != QualifiedName) {\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\t\tstatic " + Name + " ()");\r
+ sw.WriteLine ("\t\t{");\r
+ sw.WriteLine ("\t\t\tGtkSharp." + Studlify (asm_name) + ".ObjectManager.Initialize ();");\r
+ sw.WriteLine ("\t\t}");\r
+ }\r
+\r
+ sw.WriteLine ("#endregion");\r
+ AppendCustom (sw, gen_info.CustomDir);\r
+\r
+ sw.WriteLine ("\t}");\r
+ sw.WriteLine ("}");\r
+\r
+ sw.Close ();\r
+ gen_info.Writer = null;\r
+ Statistics.ObjectCount++;\r
+ }\r
+\r
+ protected override void GenCtors (GenerationInfo gen_info)\r
+ {\r
+ if (!Elem.HasAttribute("parent"))\r
+ return;\r
+\r
+ if (!DisableGTypeCtor) {\r
+ gen_info.Writer.WriteLine("\t\t[Obsolete]");\r
+ gen_info.Writer.WriteLine("\t\tprotected " + Name + "(GLib.GType gtype) : base(gtype) {}");\r
+ }\r
+ gen_info.Writer.WriteLine("\t\tpublic " + Name + "(IntPtr raw) : base(raw) {}");\r
+ if (ctors.Count == 0 && !DisableVoidCtor) {\r
+ gen_info.Writer.WriteLine();\r
+ gen_info.Writer.WriteLine("\t\tprotected " + Name + "() : base(IntPtr.Zero)");\r
+ gen_info.Writer.WriteLine("\t\t{");\r
+ gen_info.Writer.WriteLine("\t\t\tCreateNativeObject ();");\r
+ gen_info.Writer.WriteLine("\t\t}");\r
+ }\r
+ gen_info.Writer.WriteLine();\r
+\r
+ base.GenCtors (gen_info);\r
+ }\r
+\r
+ void GenClassMembers (GenerationInfo gen_info, string cs_parent)\r
+ {\r
+ GenVirtualMethods (gen_info, null);\r
+\r
+ if (class_struct_name == null || !CanGenerateClassStruct) return;\r
+ StreamWriter sw = gen_info.Writer;\r
+ GenerateClassStruct (gen_info);\r
+ if (cs_parent == "")\r
+ sw.WriteLine ("\t\tstatic uint class_offset = 0;");\r
+ else\r
+ sw.WriteLine ("\t\tstatic uint class_offset = ((GLib.GType) typeof ({0})).ClassSize;", cs_parent);\r
+ sw.WriteLine ("\t\tstatic Hashtable class_structs;");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\t\tstatic {0} GetClassStruct (GLib.GType gtype, bool use_cache)", class_struct_name);\r
+ sw.WriteLine ("\t\t{");\r
+ sw.WriteLine ("\t\t\tif (class_structs == null)");\r
+ sw.WriteLine ("\t\t\t\tclass_structs = new Hashtable ();");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\t\t\tif (use_cache && class_structs.Contains (gtype))");\r
+ sw.WriteLine ("\t\t\t\treturn ({0}) class_structs [gtype];", class_struct_name);\r
+ sw.WriteLine ("\t\t\telse {");\r
+ sw.WriteLine ("\t\t\t\tIntPtr class_ptr = new IntPtr (gtype.ClassPtr.ToInt64 () + class_offset);");\r
+ sw.WriteLine ("\t\t\t\t{0} class_struct = ({0}) Marshal.PtrToStructure (class_ptr, typeof ({0}));", class_struct_name);\r
+ sw.WriteLine ("\t\t\t\tif (use_cache)");\r
+ sw.WriteLine ("\t\t\t\t\tclass_structs.Add (gtype, class_struct);");\r
+ sw.WriteLine ("\t\t\t\treturn class_struct;");\r
+ sw.WriteLine ("\t\t\t}");\r
+ sw.WriteLine ("\t\t}");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\t\tstatic void OverrideClassStruct (GLib.GType gtype, {0} class_struct)", class_struct_name);\r
+ sw.WriteLine ("\t\t{");\r
+ sw.WriteLine ("\t\t\tIntPtr class_ptr = new IntPtr (gtype.ClassPtr.ToInt64 () + class_offset);");\r
+ sw.WriteLine ("\t\t\tMarshal.StructureToPtr (class_struct, class_ptr, false);");\r
+ sw.WriteLine ("\t\t}");\r
+ sw.WriteLine ();\r
+ }\r
+\r
+ /* Keep this in sync with the one in glib/GType.cs */\r
+ private static string GetExpected (string cname)\r
+ {\r
+ for (int i = 1; i < cname.Length; i++) {\r
+ if (Char.IsUpper (cname[i])) {\r
+ if (i == 1 && cname[0] == 'G')\r
+ return "GLib." + cname.Substring (1);\r
+ else\r
+ return cname.Substring (0, i) + "." + cname.Substring (i);\r
+ }\r
+ }\r
+\r
+ throw new ArgumentException ("cname doesn't follow the NamespaceType capitalization style: " + cname);\r
+ }\r
+\r
+ private static bool NeedsMap (Hashtable objs, string assembly_name)\r
+ {\r
+ foreach (string key in objs.Keys)\r
+ if (GetExpected (key) != ((string) objs[key]))\r
+ return true;\r
+ \r
+ return false;\r
+ }\r
+\r
+ private static string Studlify (string name)\r
+ {\r
+ string result = "";\r
+\r
+ string[] subs = name.Split ('-');\r
+ foreach (string sub in subs)\r
+ result += Char.ToUpper (sub[0]) + sub.Substring (1);\r
+ \r
+ return result;\r
+ }\r
+ \r
+ public static void GenerateMappers ()\r
+ {\r
+ foreach (string dir in dirs.Keys) {\r
+\r
+ DirectoryInfo di = dirs[dir] as DirectoryInfo;\r
+\r
+ if (!NeedsMap (di.objects, di.assembly_name))\r
+ continue;\r
+ \r
+ GenerationInfo gen_info = new GenerationInfo (dir, di.assembly_name);\r
+\r
+ GenerateMapper (di, gen_info);\r
+ }\r
+ }\r
+\r
+ private static void GenerateMapper (DirectoryInfo dir_info, GenerationInfo gen_info)\r
+ {\r
+ StreamWriter sw = gen_info.OpenStream ("ObjectManager");\r
+\r
+ sw.WriteLine ("namespace GtkSharp." + Studlify (dir_info.assembly_name) + " {");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\tpublic class ObjectManager {");\r
+ sw.WriteLine ();\r
+ sw.WriteLine ("\t\tstatic bool initialized = false;");\r
+ sw.WriteLine ("\t\t// Call this method from the appropriate module init function.");\r
+ sw.WriteLine ("\t\tpublic static void Initialize ()");\r
+ sw.WriteLine ("\t\t{");\r
+ sw.WriteLine ("\t\t\tif (initialized)");\r
+ sw.WriteLine ("\t\t\t\treturn;");\r
+ sw.WriteLine ("");\r
+ sw.WriteLine ("\t\t\tinitialized = true;");\r
+ \r
+ foreach (string key in dir_info.objects.Keys) {\r
+ if (GetExpected(key) != ((string) dir_info.objects[key]))\r
+ sw.WriteLine ("\t\t\tGLib.GType.Register ({0}.GType, typeof ({0}));", dir_info.objects [key]);\r
+ }\r
+ \r
+ sw.WriteLine ("\t\t}");\r
+ sw.WriteLine ("\t}");\r
+ sw.WriteLine ("}");\r
+ sw.Close ();\r
+ }\r
+\r
+ public override string FromNative (string var, bool owned)\r
+ {\r
+ return "Gst.MiniObject.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName;\r
+ }\r
+ }\r
+}\r
+\r
case "object":\r
result.Add (new ObjectGen (ns, elem));\r
break;\r
+ case "mini-object":\r
+ result.Add (new MiniObjectGen (ns, elem));\r
+ break;\r
case "class":\r
result.Add (new ClassGen (ns, elem));\r
break;\r
// manually wrapped types requiring more complex marshaling\r
AddType (new ManualGen ("GInitiallyUnowned", "GLib.InitiallyUnowned", "GLib.Object.GetObject ({0})"));\r
AddType (new ManualGen ("GObject", "GLib.Object", "GLib.Object.GetObject ({0})"));\r
+ AddType (new ManualGen ("GstMiniObject", "Gst.MiniObject", "Gst.MiniObject.GetObject ({0})"));\r
AddType (new ManualGen ("GList", "GLib.List"));\r
AddType (new ManualGen ("GPtrArray", "GLib.PtrArray"));\r
AddType (new ManualGen ("GSList", "GLib.SList"));\r
\r
public bool IsObject(string c_type)\r
{\r
- if (this[c_type] is ObjectGen)\r
+ if ((this[c_type] is ObjectGen) ||\r
+ (this[c_type] is MiniObjectGen))\r
return true;\r
\r
return false;\r
}
}
+[DllImport ("gstreamer-0.10.dll") ]
+static extern void gst_mini_object_unref (IntPtr raw);
+
/* FIXME: This is not optimal */
public void MakeMetadataWritable() {
if (IsMetadataWritable)
return;
- IntPtr sub = gst_buffer_create_sub (Raw, 0, Size);
+ IntPtr old = Handle;
+ IntPtr sub = gst_buffer_create_sub (Handle, 0, Size);
Raw = sub;
- /* ^--- Takes a second ref, not good */
- Unref (Raw);
- /* ^--- Sets Owned = false, wrong! */
- Owned = true;
+ gst_mini_object_unref (old);
}
[DllImport ("gstreamer-0.10.dll") ]
public EnumValue this[int val] {
get {
- foreach (EnumValue v in Values) {
- if (v.value == val)
- return v;
- }
+ foreach (EnumValue v in Values) {
+ if (v.value == val)
+ return v;
+ }
- throw new Exception ();
+ throw new Exception ();
}
}
get {
System.Collections.ArrayList ret = new System.Collections.ArrayList ();
- foreach (FlagsValue v in Values) {
- if (flags == 0 && v.value == 0)
- ret.Add (v);
- else if ((v.value & flags) != 0)
- ret.Add (v);
- }
+ foreach (FlagsValue v in Values) {
+ if (flags == 0 && v.value == 0)
+ ret.Add (v);
+ else if ( (v.value & flags) != 0)
+ ret.Add (v);
+ }
- return (FlagsValue[]) ret.ToArray (typeof (FlagsValue));
+ return (FlagsValue[]) ret.ToArray (typeof (FlagsValue));
}
}
-protected Event () : base () { }
-
public Event (GLib.Value val) : base (val) { }
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gst_event_new_custom (Gst.EventType type, IntPtr structure);
public static Gst.Event NewCustom (Gst.EventType type, Gst.Structure structure) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_custom (type, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_custom (type, (structure != null) ? structure.Handle : IntPtr.Zero), true);
ev.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_event_new_flush_start ();
public static Gst.Event NewFlushStart () {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_flush_start (), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_flush_start (), true);
return ev;
}
static extern IntPtr gst_event_new_flush_stop ();
public static Gst.Event NewFlushStop () {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_flush_stop (), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_flush_stop (), true);
return ev;
}
static extern IntPtr gst_event_new_eos ();
public static Gst.Event NewEos () {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_eos (), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_eos (), true);
return ev;
}
static extern IntPtr gst_event_new_new_segment_full (bool update, double rate, double applied_rate, Gst.Format format, long start, long stop, long position);
public static Gst.Event NewNewSegment (bool update, double rate, double applied_rate, Gst.Format format, long start, long stop, long position) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_new_segment_full (update, rate, applied_rate, format, start, stop, position), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_new_segment_full (update, rate, applied_rate, format, start, stop, position), true);
return ev;
}
static extern IntPtr gst_tag_list_copy (IntPtr raw);
public static Gst.Event NewTag (Gst.TagList tags) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_tag ( (tags != null) ? gst_tag_list_copy (tags.Handle) : IntPtr.Zero), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_tag ( (tags != null) ? gst_tag_list_copy (tags.Handle) : IntPtr.Zero), true);
return ev;
}
static extern IntPtr gst_event_new_buffer_size (Gst.Format format, long min, long max, bool async);
public static Gst.Event NewBufferSize (Gst.Format format, long min, long max, bool async) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_buffer_size (format, min, max, async), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_buffer_size (format, min, max, async), true);
return ev;
}
static extern IntPtr gst_event_new_qos (double proportion, long diff, ulong timestamp);
public static Gst.Event NewQos (double proportion, long diff, ulong timestamp) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_qos (proportion, diff, timestamp), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_qos (proportion, diff, timestamp), true);
return ev;
}
static extern IntPtr gst_event_new_seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, long start, Gst.SeekType stop_type, long stop);
public static Gst.Event NewSeek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, long start, Gst.SeekType stop_type, long stop) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_seek (rate, format, flags, start_type, start, stop_type, stop), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_seek (rate, format, flags, start_type, start, stop_type, stop), true);
return ev;
}
static extern IntPtr gst_event_new_navigation (IntPtr structure);
public static Gst.Event NewNavigation (Gst.Structure structure) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_navigation (structure.Handle), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_navigation (structure.Handle), true);
ev.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_event_new_latency (ulong latency);
public static Gst.Event NewLatency (ulong latency) {
- Gst.Event ev = (Gst.Event) GLib.Opaque.GetOpaque (gst_event_new_latency (latency), typeof (Gst.Event), true);
+ Gst.Event ev = (Gst.Event) Gst.MiniObject.GetObject (gst_event_new_latency (latency), true);
return ev;
}
<?xml version="1.0"?>
<metadata>
<attr path="/api/namespace/object" name="disable_gtype_ctor">1</attr>
+ <attr path="/api/namespace/mini-object" name="disable_gtype_ctor">1</attr>
<attr path="/api/namespace/enum/member[@name='NumErrors']" name="hidden">1</attr>
<attr path="/api/namespace/enum[@name='BinFlags']/member[@cname='GST_BIN_FLAG_LAST']" name="value">ElementFlags.Last << 5</attr>
- <change-node-type path="/api/namespace/object[@name='Buffer']">boxed</change-node-type>
- <attr path="/api/namespace/boxed[@name='Buffer']" name="opaque">true</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_get_type']" name="new_flag">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_get_caps']/return-type" name="owned">true</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='Data']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='Duration']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='MallocData']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='Offset']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='OffsetEnd']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='Timestamp']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='Caps']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/field[@name='FreeFunc']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_get_caps']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_set_caps']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_stamp']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_join']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_make_metadata_writable']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/constructor[@cname='gst_buffer_new_and_alloc']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_try_new_and_alloc']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_create_sub']/return-type" name="owned">true</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_merge']/return-type" name="owned">true</attr>
- <attr path="/api/namespace/boxed[@name='Buffer']/method[@cname='gst_buffer_span']/return-type" name="owned">true</attr>
+ <change-node-type path="/api/namespace/object[@name='Buffer']">mini-object</change-node-type>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_get_type']" name="new_flag">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_get_caps']/return-type" name="owned">true</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='Data']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='Duration']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='MallocData']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='Offset']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='OffsetEnd']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='Timestamp']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='Caps']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/field[@name='FreeFunc']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_get_caps']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_set_caps']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_stamp']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_join']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_make_metadata_writable']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/constructor[@cname='gst_buffer_new_and_alloc']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_try_new_and_alloc']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_create_sub']/return-type" name="owned">true</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_merge']/return-type" name="owned">true</attr>
+ <attr path="/api/namespace/mini-object[@name='Buffer']/method[@cname='gst_buffer_span']/return-type" name="owned">true</attr>
<attr path="/api/namespace/enum[@name='BufferFlag']" name="name">BufferFlags</attr>
<attr path="/api/namespace/enum[@name='BufferFlags']/member[@cname='GST_BUFFER_FLAG_READONLY']" name="value">MiniObjectFlags.Readonly</attr>
<attr path="/api/namespace/enum[@name='ElementFlags']/member[@cname='GST_ELEMENT_UNPARENTING']" name="value">ObjectFlags.Last << 2</attr>
<attr path="/api/namespace/enum[@name='ElementFlags']/member[@cname='GST_ELEMENT_FLAG_LAST']" name="value">ObjectFlags.Last << 16</attr>
- <change-node-type path="/api/namespace/object[@name='Event']">boxed</change-node-type>
- <attr path="/api/namespace/boxed[@name='Event']" name="opaque">true</attr>
- <attr path="/api/namespace/boxed[@name='Event']/method[@cname='gst_event_get_type']" name="new_flag">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/field[@name='Timestamp']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/field[@name='Src']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/field[@name='Structure']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/field[@name='Seqnum']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/constructor" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Event']/method" name="hidden">1</attr>
- <remove-attr path="/api/namespace/boxed[@name='Event']/method[@cname='gst_event_get_type']" name="hidden" />
- <remove-attr path="/api/namespace/boxed[@name='Event']/method[@cname='gst_event_type_get_name']" name="hidden" />
- <attr path="/api/namespace/boxed[@name='Event']/method[@cname='gst_event_type_get_name']" name="name">GetTypeName</attr>
+ <change-node-type path="/api/namespace/object[@name='Event']">mini-object</change-node-type>
+ <attr path="/api/namespace/mini-object[@name='Event']/method[@cname='gst_event_get_type']" name="new_flag">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/field[@name='Timestamp']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/field[@name='Src']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/field[@name='Structure']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/field[@name='Seqnum']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/constructor" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Event']/method" name="hidden">1</attr>
+ <remove-attr path="/api/namespace/mini-object[@name='Event']/method[@cname='gst_event_get_type']" name="hidden" />
+ <remove-attr path="/api/namespace/mini-object[@name='Event']/method[@cname='gst_event_type_get_name']" name="hidden" />
+ <attr path="/api/namespace/mini-object[@name='Event']/method[@cname='gst_event_type_get_name']" name="name">GetTypeName</attr>
<remove-node path="/api/namespace/enum[@name='EventType']/member[@name='0_']" />
<remove-node path="/api/namespace/enum[@name='EventType']/member[@name='Flag']" />
<remove-node path="/api/namespace/class[@name='Init']" />
- <change-node-type path="/api/namespace/object[@name='Message']">boxed</change-node-type>
- <attr path="/api/namespace/boxed[@name='Message']" name="opaque">true</attr>
- <attr path="/api/namespace/boxed[@name='Message']/method[@cname='gst_message_get_type']" name="new_flag">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/field[@name='Timestamp']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/field[@name='Src']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/field[@name='Structure']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/method[@cname='gst_message_type_to_quark']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/method[@cname='gst_message_type_get_name']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/constructor" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Message']/method" name="hidden">1</attr>
- <remove-attr path="/api/namespace/boxed[@name='Message']/method[@cname='gst_message_get_type']" name="hidden" />
+ <change-node-type path="/api/namespace/object[@name='Message']">mini-object</change-node-type>
+ <attr path="/api/namespace/mini-object[@name='Message']/method[@cname='gst_message_get_type']" name="new_flag">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/field[@name='Timestamp']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/field[@name='Src']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/field[@name='Structure']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/method[@cname='gst_message_type_to_quark']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/method[@cname='gst_message_type_get_name']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/constructor" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Message']/method" name="hidden">1</attr>
+ <remove-attr path="/api/namespace/mini-object[@name='Message']/method[@cname='gst_message_get_type']" name="hidden" />
<attr path="/api/namespace/enum[@name='MessageType']" name="parent">uint</attr>
<attr path="/api/namespace/enum[@name='MessageType']/member[@name='Unknown']" name="value">0U</attr>
<attr path="/api/namespace/enum[@name='MessageType']/member[@name='Any']" name="value">0xffffffff</attr>
- <change-node-type path="/api/namespace/object[@name='MiniObject']">boxed</change-node-type>
- <attr path="/api/namespace/boxed[@name='MiniObject']" name="opaque">true</attr>
- <remove-attr path="/api/namespace/boxed[@name='MiniObject']" name="parent" />
- <attr path="/api/namespace/boxed[@name='MiniObject']/field[@name='Flags']" name="writeable">true</attr>
- <attr path="/api/namespace/boxed[@name='MiniObject']/field[@name='Flags']" name="type">GstMiniObjectFlags</attr>
- <attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_copy']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_make_writable']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_replace']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@name='MiniObject']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@name='MiniObjectCopyFunction']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@name='Preset']/method[@cname='gst_preset_get_meta']/parameters/parameter[@name='value']" name="pass_as">out</attr>
<attr path="/api/namespace/interface[@name='Preset']/virtual_method[@cname='get_meta']/parameters/parameter[@name='value']" name="pass_as">out</attr>
- <change-node-type path="/api/namespace/object[@name='Query']">boxed</change-node-type>
- <attr path="/api/namespace/boxed[@name='Query']" name="opaque">true</attr>
- <attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_get_type']" name="new_flag">1</attr>
- <attr path="/api/namespace/boxed[@name='Query']/field[@name='Structure']" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Query']/method" name="hidden">1</attr>
- <attr path="/api/namespace/boxed[@name='Query']/constructor" name="hidden">1</attr>
- <remove-attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_get_type']" name="hidden" />
- <remove-attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_get_by_nick']" name="hidden" />
- <attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_get_by_nick']" name="name">GetTypeByNick</attr>
- <remove-attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_get_name']" name="hidden" />
- <attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_get_name']" name="name">GetTypeName</attr>
- <remove-attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_register']" name="hidden" />
- <attr path="/api/namespace/boxed[@name='Query']/method[@cname='gst_query_type_register']" name="name">RegisterType</attr>
+ <change-node-type path="/api/namespace/object[@name='Query']">mini-object</change-node-type>
+ <attr path="/api/namespace/mini-object[@name='Query']" name="opaque">true</attr>
+ <attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_get_type']" name="new_flag">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Query']/field[@name='Structure']" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Query']/method" name="hidden">1</attr>
+ <attr path="/api/namespace/mini-object[@name='Query']/constructor" name="hidden">1</attr>
+ <remove-attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_get_type']" name="hidden" />
+ <remove-attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_get_by_nick']" name="hidden" />
+ <attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_get_by_nick']" name="name">GetTypeByNick</attr>
+ <remove-attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_get_name']" name="hidden" />
+ <attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_get_name']" name="name">GetTypeName</attr>
+ <remove-attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_register']" name="hidden" />
+ <attr path="/api/namespace/mini-object[@name='Query']/method[@cname='gst_query_type_register']" name="name">RegisterType</attr>
<attr path="/api/namespace/struct[@name='QueryTypeDefinition']" name="hidden">1</attr>
return true;
case 2:
gst_iterator_resync (iterator);
- retry = true;
+ retry = true;
break;
default:
case 3:
PropertyInfo.cs \
EnumInfo.cs \
Iterator.cs \
+ MiniObject.cs \
GstSharp.PadQueryTypeFunctionNative.cs \
PadQueryTypeFunction.cs \
TypeFindDelegates.cs \
PadTemplate.custom \
Plugin.custom \
Task.custom \
- MiniObject.custom \
IndexEntry.custom \
Index.custom \
IndexFactory.custom \
--symbols=$(srcdir)/$(SYMBOLS)
generated-stamp: $(API) $(build_customs) $(overrides)
- $(MONO) $(top_builddir)/generator/gst-gapi_codegen.exe--generate $(API) \
+ $(MONO) $(top_builddir)/generator/gst-gapi_codegen.exe --generate $(API) \
--outdir=generated --customdir=$(srcdir) --assembly-name=$(ASSEMBLY_NAME) \
--gluelib-name=gstreamersharpglue-0.10 --glue-filename=glue/generated.c \
--glue-includes=$(glue_includes) \
-protected Message () : base () { }
-
public Message (GLib.Value val) : base (val) { }
[DllImport ("gstreamersharpglue-0.10") ]
static extern IntPtr gst_message_new_eos (IntPtr src);
public static Message NewEos (Gst.Object src) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_eos (src.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_eos (src.Handle), true);
return msg;
}
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_error (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_error (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_error (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_error (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_error (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_warning (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_warning (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_warning (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_warning (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_warning (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_info (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_info (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_info (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
IntPtr raw_ptr = (debug == null) ? IntPtr.Zero : GLib.Marshaller.StringToPtrGStrdup (debug);
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_info (src.Handle, ref err, raw_ptr), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_info (src.Handle, ref err, raw_ptr), true);
GLib.Marshaller.Free (raw_ptr);
err.Unset ();
static extern IntPtr gst_tag_list_copy (IntPtr handle);
public static Message NewTag (Gst.Object src, TagList tags) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_tag (src.Handle, gst_tag_list_copy (tags.Handle)), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_tag (src.Handle, gst_tag_list_copy (tags.Handle)), true);
return msg;
}
static extern IntPtr gst_message_new_buffering (IntPtr src, int percent);
public static Message NewBuffering (Gst.Object src, int percent) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_buffering (src.Handle, percent), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_buffering (src.Handle, percent), true);
return msg;
}
static extern IntPtr gst_message_new_state_changed (IntPtr src, State oldstate, State newstate, State pendingstate);
public static Message NewStateChanged (Gst.Object src, State oldstate, State newstate, State pendingstate) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_state_changed (src.Handle, oldstate, newstate, pendingstate), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_changed (src.Handle, oldstate, newstate, pendingstate), true);
return msg;
}
static extern IntPtr gst_message_new_state_dirty (IntPtr src);
public static Message NewStateDirty (Gst.Object src) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_state_dirty (src.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_state_dirty (src.Handle), true);
return msg;
}
static extern IntPtr gst_message_new_clock_provide (IntPtr src, IntPtr clock, bool ready);
public static Message NewClockProvide (Gst.Object src, Gst.Clock clock, bool ready) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_clock_provide (src.Handle, clock.Handle, ready), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_provide (src.Handle, clock.Handle, ready), true);
return msg;
}
static extern IntPtr gst_message_new_clock_lost (IntPtr src, IntPtr clock);
public static Message NewClockLost (Gst.Object src, Gst.Clock clock) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_clock_lost (src.Handle, clock.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_clock_lost (src.Handle, clock.Handle), true);
return msg;
}
static extern IntPtr gst_message_new_new_clock (IntPtr src, IntPtr clock);
public static Message NewNewClock (Gst.Object src, Gst.Clock clock) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_new_clock (src.Handle, clock.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_new_clock (src.Handle, clock.Handle), true);
return msg;
}
static extern IntPtr gst_message_new_application (IntPtr src, IntPtr structure);
public static Message NewApplication (Gst.Object src, Gst.Structure structure) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_application (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_application (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
msg.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_message_new_element (IntPtr src, IntPtr structure);
public static Message NewElement (Gst.Object src, Gst.Structure structure) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_element (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_element (src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
msg.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_message_new_custom (Gst.MessageType type, IntPtr src, IntPtr structure);
public static Message NewCustom (Gst.MessageType type, Gst.Object src, Gst.Structure structure) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_custom (type, src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_custom (type, src.Handle, (structure != null) ? structure.Handle : IntPtr.Zero), true);
msg.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_message_new_segment_start (IntPtr src, Gst.Format format, long position);
public static Message NewSegmentStart (Gst.Object src, Gst.Format format, long position) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_segment_start (src.Handle, format, position), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_start (src.Handle, format, position), true);
return msg;
}
static extern IntPtr gst_message_new_segment_done (IntPtr src, Gst.Format format, long position);
public static Message NewSegmentDone (Gst.Object src, Gst.Format format, long position) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_segment_done (src.Handle, format, position), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_segment_done (src.Handle, format, position), true);
return msg;
}
static extern IntPtr gst_message_new_duration (IntPtr src, Gst.Format format, long duration);
public static Message NewDuration (Gst.Object src, Gst.Format format, long duration) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_duration (src.Handle, format, duration), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_duration (src.Handle, format, duration), true);
return msg;
}
static extern IntPtr gst_message_new_latency (IntPtr src);
public static Message NewLatency (Gst.Object src) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_latency (src.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_latency (src.Handle), true);
return msg;
}
static extern IntPtr gst_message_new_async_start (IntPtr src, bool new_base_time);
public static Message NewAsyncStart (Gst.Object src, bool new_base_time) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_async_start (src.Handle, new_base_time), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_start (src.Handle, new_base_time), true);
return msg;
}
static extern IntPtr gst_message_new_async_done (IntPtr src);
public static Message NewAsyncDone (Gst.Object src) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_async_done (src.Handle), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_async_done (src.Handle), true);
return msg;
}
static extern IntPtr gst_message_new_structure_change (IntPtr src, StructureChangeType type, IntPtr owner, bool busy);
public static Message NewStructureChange (Gst.Object src, StructureChangeType type, Gst.Element owner, bool busy) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_message_new_structure_change (src.Handle, type, owner.Handle, busy), typeof (Message), true);
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_message_new_structure_change (src.Handle, type, owner.Handle, busy), true);
return msg;
}
--- /dev/null
+// MiniObject.cs - GstMiniObject class wrapper implementation
+//
+// Authors: Mike Kestner <mkestner@speakeasy.net>
+// Sebastian Dröge <sebastian.droege@collabora.co.uk>
+//
+// Copyright (c) 2001-2003 Mike Kestner
+// Copyright (c) 2004-2005 Novell, Inc.
+// Copyright (c) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+// Based on Object.cs from Gtk# 2.8.3
+
+// TODO: For managed types, install finalizer in ThresholdType
+// and only destroy the managed instance if the native instance
+// gets finalized => move managed instance to managed_tb_destroyed
+// and unref, if finalizer is called remove it completely.
+// For non-managed types handle as is.
+
+namespace Gst {
+
+ using System;
+ using System.Collections;
+ using System.ComponentModel;
+ using System.Reflection;
+ using System.Runtime.InteropServices;
+ using System.Text;
+ using GLib;
+
+ public class MiniObject : IWrapper, IDisposable {
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GTypeClass {
+ public IntPtr gtype;
+ }
+
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GstMiniObjectClass {
+ GTypeClass parent;
+ IntPtr copy;
+ IntPtr finalize;
+ IntPtr reserved;
+ }
+
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GTypeInstance {
+ public IntPtr g_class;
+ }
+
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GstMiniObject {
+ GTypeInstance parent;
+ public int refcount;
+ public Gst.MiniObjectFlags flags;
+ IntPtr reserved;
+ }
+
+ IntPtr handle;
+ bool disposed = false;
+ static Hashtable Objects = new Hashtable();
+ static ArrayList PendingDestroys = new ArrayList ();
+ static bool idle_queued;
+
+ ~MiniObject () {
+ Dispose ();
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern void gst_mini_object_unref (IntPtr raw);
+
+ static bool PerformQueuedUnrefs () {
+ MiniObject [] objects;
+
+ lock (PendingDestroys) {
+ objects = new MiniObject [PendingDestroys.Count];
+ PendingDestroys.CopyTo (objects, 0);
+ PendingDestroys.Clear ();
+ }
+ lock (typeof (MiniObject))
+ idle_queued = false;
+
+ foreach (MiniObject o in objects) {
+ if (o.handle == IntPtr.Zero)
+ continue;
+
+ try {
+ gst_mini_object_unref (o.handle);
+ } catch (Exception e) {
+ Console.WriteLine ("Exception while disposing a " + o + " in Gtk#");
+ throw e;
+ }
+ Objects.Remove (o.handle);
+ o.handle = IntPtr.Zero;
+ }
+ return false;
+ }
+
+ public virtual void Dispose () {
+ if (disposed)
+ return;
+
+ disposed = true;
+ lock (PendingDestroys) {
+ PendingDestroys.Add (this);
+ lock (typeof (MiniObject)) {
+ if (!idle_queued) {
+ Timeout.Add (50, new TimeoutHandler (PerformQueuedUnrefs));
+ idle_queued = true;
+ }
+ }
+ }
+ GC.SuppressFinalize (this);
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern IntPtr gst_mini_object_ref (IntPtr raw);
+
+ public static MiniObject GetObject (IntPtr o, bool owned_ref) {
+ if (o == IntPtr.Zero)
+ return null;
+
+ MiniObject obj = null;
+ WeakReference weak_ref = Objects[o] as WeakReference;
+
+ if (weak_ref != null && weak_ref.IsAlive)
+ obj = weak_ref.Target as MiniObject;
+
+ if (obj == null)
+ obj = Objects[o] as MiniObject;
+
+ if (obj != null && obj.handle == o) {
+ lock (PendingDestroys)
+ PendingDestroys.Remove (obj);
+ if (owned_ref)
+ gst_mini_object_unref (obj.handle);
+ obj.disposed = false;
+ return obj;
+ }
+
+ obj = CreateObject (o);
+ if (obj == null)
+ return null;
+
+ if (!owned_ref)
+ gst_mini_object_ref (obj.Handle);
+ Objects [o] = new WeakReference (obj);
+ return obj;
+ }
+
+ static BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance;
+ private static MiniObject CreateObject (IntPtr raw) {
+ if (raw == IntPtr.Zero)
+ return null;
+
+ Type type = GetTypeOrParent (raw);
+
+ if (type == null)
+ return null;
+
+ MiniObject obj;
+ try {
+ obj = Activator.CreateInstance (type, flags, null, new object[] {raw}, null) as Gst.MiniObject;
+ } catch (MissingMethodException) {
+ throw new GLib.MissingIntPtrCtorException ("Gst.MiniObject subclass " + type + " must provide a protected or public IntPtr ctor to support wrapping of native object handles.");
+ }
+ return obj;
+ }
+
+ [DllImport ("gstreamersharpglue-0.10.dll") ]
+ static extern IntPtr gstsharp_g_type_from_instance (IntPtr inst);
+
+ static Type GetTypeOrParent (IntPtr obj) {
+ IntPtr typeid = gstsharp_g_type_from_instance (obj);
+ if (typeid == GType.Invalid.Val)
+ return null;
+
+ Type result = GType.LookupType (typeid);
+ while (result == null) {
+ typeid = g_type_parent (typeid);
+ if (typeid == IntPtr.Zero)
+ return null;
+ result = GType.LookupType (typeid);
+ }
+ return result;
+ }
+
+ [DllImport ("libgobject-2.0-0.dll") ]
+ static extern IntPtr g_type_parent (IntPtr typ);
+
+ public static MiniObject GetObject (IntPtr o) {
+ return GetObject (o, false);
+ }
+
+ private static void ConnectDefaultHandlers (GType gtype, System.Type t) {
+ foreach (MethodInfo minfo in t.GetMethods (BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly)) {
+ MethodInfo baseinfo = minfo.GetBaseDefinition ();
+ if (baseinfo == minfo)
+ continue;
+
+ foreach (object attr in baseinfo.GetCustomAttributes (typeof (DefaultSignalHandlerAttribute), false)) {
+ DefaultSignalHandlerAttribute sigattr = attr as DefaultSignalHandlerAttribute;
+ MethodInfo connector = sigattr.Type.GetMethod (sigattr.ConnectionMethod, BindingFlags.Static | BindingFlags.NonPublic);
+ object[] parms = new object [1];
+ parms [0] = gtype;
+ connector.Invoke (null, parms);
+ break;
+ }
+ }
+
+ }
+
+ private static void InvokeClassInitializers (GType gtype, System.Type t) {
+ object[] parms = {gtype, t};
+
+ BindingFlags flags = BindingFlags.Static | BindingFlags.NonPublic;
+
+ foreach (TypeInitializerAttribute tia in t.GetCustomAttributes (typeof (TypeInitializerAttribute), true)) {
+ MethodInfo m = tia.Type.GetMethod (tia.MethodName, flags);
+ if (m != null)
+ m.Invoke (null, parms);
+ }
+ }
+
+ static Hashtable class_structs;
+
+ static GstMiniObjectClass GetClassStruct (GLib.GType gtype, bool use_cache) {
+ if (class_structs == null)
+ class_structs = new Hashtable ();
+
+ if (use_cache && class_structs.Contains (gtype))
+ return (GstMiniObjectClass) class_structs [gtype];
+ else {
+ IntPtr class_ptr = gtype.ClassPtr;
+ GstMiniObjectClass class_struct = (GstMiniObjectClass) Marshal.PtrToStructure (class_ptr, typeof (GstMiniObjectClass));
+ if (use_cache)
+ class_structs.Add (gtype, class_struct);
+ return class_struct;
+ }
+ }
+
+ static void OverrideClassStruct (GLib.GType gtype, GstMiniObjectClass class_struct) {
+ IntPtr class_ptr = gtype.ClassPtr;
+ Marshal.StructureToPtr (class_struct, class_ptr, false);
+ }
+
+ static int type_uid;
+ static string BuildEscapedName (System.Type t) {
+ string qn = t.FullName;
+ // Just a random guess
+ StringBuilder sb = new StringBuilder (20 + qn.Length);
+ sb.Append ("__gtksharp_");
+ sb.Append (type_uid++);
+ sb.Append ("_");
+ foreach (char c in qn) {
+ if ( (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
+ sb.Append (c);
+ else if (c == '.')
+ sb.Append ('_');
+ else if ( (uint) c <= byte.MaxValue) {
+ sb.Append ('+');
+ sb.Append ( ( (byte) c).ToString ("x2"));
+ } else {
+ sb.Append ('-');
+ sb.Append ( ( (uint) c).ToString ("x4"));
+ }
+ }
+ return sb.ToString ();
+ }
+
+
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GTypeInfo {
+ public ushort class_size;
+ IntPtr base_init;
+ IntPtr base_finalize;
+ IntPtr class_init;
+ IntPtr class_finalize;
+ IntPtr class_data;
+ public ushort instance_size;
+ ushort n_preallocs;
+ IntPtr instance_init;
+ IntPtr value_table;
+ }
+
+ [StructLayout (LayoutKind.Sequential) ]
+ struct GTypeQuery {
+ public IntPtr type;
+ public IntPtr type_name;
+ public uint class_size;
+ public uint instance_size;
+ }
+
+
+ [DllImport ("libgobject-2.0-0.dll") ]
+ static extern void g_type_query (IntPtr type, out GTypeQuery query);
+
+ [DllImport ("libgobject-2.0-0.dll") ]
+ static extern IntPtr g_type_register_static (IntPtr parent, IntPtr name, ref GTypeInfo info, int flags);
+
+ private static GType RegisterGType (System.Type t) {
+ GType parent_gtype = LookupGType (t.BaseType);
+ string name = BuildEscapedName (t);
+ IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
+ GTypeQuery query;
+ g_type_query (parent_gtype.Val, out query);
+ GTypeInfo info = new GTypeInfo ();
+ info.class_size = (ushort) query.class_size;
+ info.instance_size = (ushort) query.instance_size;
+ GType gtype = new GType (g_type_register_static (parent_gtype.Val, native_name, ref info, 0));
+ GLib.Marshaller.Free (native_name);
+
+ GLib.GType.Register (gtype, t);
+
+ ConnectDefaultHandlers (gtype, t);
+ InvokeClassInitializers (gtype, t);
+ return gtype;
+ }
+
+ [DllImport ("glibsharpglue-2") ]
+ static extern IntPtr gtksharp_register_type (IntPtr name, IntPtr parent_type);
+
+ static Hashtable g_types = new Hashtable ();
+
+ protected GType LookupGType () {
+ if (Handle != IntPtr.Zero) {
+ GTypeInstance obj = (GTypeInstance) Marshal.PtrToStructure (Handle, typeof (GTypeInstance));
+ GTypeClass klass = (GTypeClass) Marshal.PtrToStructure (obj.g_class, typeof (GTypeClass));
+ return new GLib.GType (klass.gtype);
+ } else {
+ return LookupGType (GetType ());
+ }
+ }
+
+ protected internal static GType LookupGType (System.Type t) {
+ if (g_types.Contains (t))
+ return (GType) g_types [t];
+
+ System.Reflection.PropertyInfo pi = t.GetProperty ("GType", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public);
+ if (pi != null)
+ return (GType) pi.GetValue (null, null);
+
+ return RegisterGType (t);
+ }
+
+ protected MiniObject (IntPtr raw) {
+ Raw = raw;
+ }
+
+ protected MiniObject () {
+ CreateNativeObject ();
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern IntPtr gst_mini_object_new (IntPtr gtype);
+
+ protected virtual void CreateNativeObject () {
+ Raw = gst_mini_object_new (LookupGType ().Val);
+ Objects [handle] = this;
+ }
+
+ protected virtual IntPtr Raw {
+ get {
+ return handle;
+ }
+ set {
+ if (handle != IntPtr.Zero)
+ Objects.Remove (handle);
+ handle = value;
+ if (value == IntPtr.Zero)
+ return;
+ Objects [value] = new WeakReference (this);
+ }
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern IntPtr gst_mini_object_get_type();
+
+ public static GLib.GType GType {
+ get {
+ IntPtr raw_ret = gst_mini_object_get_type();
+ GLib.GType ret = new GLib.GType (raw_ret);
+ return ret;
+ }
+ }
+
+ protected string TypeName {
+ get {
+ return NativeType.ToString();
+ }
+ }
+
+ internal GLib.GType NativeType {
+ get {
+ return LookupGType ();
+ }
+ }
+
+ public IntPtr Handle {
+ get {
+ return handle;
+ }
+ }
+
+ public IntPtr OwnedHandle {
+ get {
+ return gst_mini_object_ref (handle);
+ }
+ }
+
+ public override int GetHashCode () {
+ return Handle.GetHashCode ();
+ }
+
+ Hashtable data;
+ public Hashtable Data {
+ get {
+ if (data == null)
+ data = new Hashtable ();
+
+ return data;
+ }
+ }
+
+ Hashtable persistent_data;
+ protected Hashtable PersistentData {
+ get {
+ if (persistent_data == null)
+ persistent_data = new Hashtable ();
+
+ return persistent_data;
+ }
+ }
+
+ [DllImport ("libgobject-2.0-0.dll") ]
+ static extern bool g_type_check_instance_is_a (IntPtr obj, IntPtr gtype);
+
+ internal static bool IsMiniObject (IntPtr obj) {
+ return g_type_check_instance_is_a (obj, MiniObject.GType.Val);
+ }
+
+ internal int Refcount {
+ get {
+ GstMiniObject inst_struct = (GstMiniObject) Marshal.PtrToStructure (Handle, typeof (GstMiniObject));
+ return inst_struct.refcount;
+ }
+ }
+
+ public Gst.MiniObjectFlags Flags {
+ get {
+ GstMiniObject inst_struct = (GstMiniObject) Marshal.PtrToStructure (Handle, typeof (GstMiniObject));
+ return inst_struct.flags;
+ }
+ set {
+ GstMiniObject inst_struct = (GstMiniObject) Marshal.PtrToStructure (Handle, typeof (GstMiniObject));
+ inst_struct.flags = value;
+ }
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern bool gst_mini_object_is_writable (IntPtr raw);
+
+ public bool IsWritable {
+ get {
+ bool raw_ret = gst_mini_object_is_writable (Handle);
+ bool ret = raw_ret;
+ return ret;
+ }
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ private static extern IntPtr gst_value_dup_mini_object (ref GLib.Value v);
+
+ public MiniObject (GLib.Value val) : base () {
+ Raw = gst_value_dup_mini_object (ref val);
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ private static extern void gst_value_set_mini_object (ref GLib.Value v, IntPtr o);
+
+ public static explicit operator GLib.Value (MiniObject o) {
+ GLib.Value val = new GLib.Value (o.LookupGType ());
+
+ gst_value_set_mini_object (ref val, o.Handle);
+
+ return val;
+ }
+
+ public void SetGValue (ref GLib.Value val) {
+ gst_value_set_mini_object (ref val, Handle);
+ }
+
+ /* FIXME: This is not optimal */
+ public void MakeWritable() {
+ if (IsWritable)
+ return;
+
+ IntPtr old = Handle;
+ IntPtr copy = gst_mini_object_copy (Handle);
+ Raw = copy;
+ gst_mini_object_unref (old);
+ }
+
+ [DllImport ("gstreamer-0.10.dll") ]
+ static extern IntPtr gst_mini_object_copy (IntPtr raw);
+
+ public Gst.MiniObject Copy() {
+ IntPtr raw_ret = gst_mini_object_copy (Handle);
+ return GetObject (raw_ret, true);
+ }
+ }
+}
+++ /dev/null
-protected MiniObject () : base ()
-{
-}
-
-public MiniObject (GLib.Value val) : base () {
- Raw = gst_value_dup_mini_object (ref val);
-}
-
-public static explicit operator GLib.Value (MiniObject o) {
- GLib.Value val = new GLib.Value (new GLib.GType (gstsharp_g_type_from_instance (o.Handle)));
-
- gst_value_set_mini_object (ref val, o.Handle);
-
- return val;
-}
-
-public void SetGValue (ref GLib.Value val) {
- gst_value_set_mini_object (ref val, Handle);
-}
-
-[DllImport ("gstreamersharpglue-0.10.dll") ]
-private static extern IntPtr gstsharp_g_type_from_instance (IntPtr o);
-[DllImport ("gstreamer-0.10.dll") ]
-private static extern IntPtr gst_value_dup_mini_object (ref GLib.Value v);
-[DllImport ("gstreamer-0.10.dll") ]
-private static extern void gst_value_set_mini_object (ref GLib.Value v, IntPtr o);
-
-/* FIXME: This is not optimal! */
-public void MakeWritable() {
- if (IsWritable)
- return;
-
- IntPtr copy = gst_mini_object_copy (Raw);
- Raw = copy;
- /* ^--- Takes a second ref, not good */
- Unref (Raw);
- /* ^--- Sets Owned = false, wrong! */
- Owned = true;
-}
-
-[DllImport ("gstreamer-0.10.dll") ]
-static extern IntPtr gst_mini_object_copy (IntPtr raw);
-
-public Gst.MiniObject Copy() {
- IntPtr raw_ret = gst_mini_object_copy (Handle);
- GLib.GType type = new GLib.GType (gstsharp_g_type_from_instance (raw_ret));
-
- Gst.MiniObject ret = raw_ret == IntPtr.Zero ? null : (Gst.MiniObject) GLib.Opaque.GetOpaque (raw_ret, (Type) type, true);
- return ret;
-}
-
namespace Gst.Interfaces {
- using System;
- using System.Runtime.InteropServices;
- using System.Reflection;
- using GLib;
- using Gst;
- using Gst.Interfaces;
+ using System;
+ using System.Runtime.InteropServices;
+ using System.Reflection;
+ using GLib;
+ using Gst;
+ using Gst.Interfaces;
- public static class MixerMessage {
- [DllImport("gstinterfaces-0.10.dll")]
- static extern int gst_mixer_message_get_type(IntPtr message);
+ public static class MixerMessage {
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern int gst_mixer_message_get_type (IntPtr message);
- public static Gst.Interfaces.MixerMessageType MessageGetType(Gst.Message message) {
- int raw_ret = gst_mixer_message_get_type(message == null ? IntPtr.Zero : message.Handle);
- Gst.Interfaces.MixerMessageType ret = (Gst.Interfaces.MixerMessageType) raw_ret;
- return ret;
- }
+ public static Gst.Interfaces.MixerMessageType MessageGetType (Gst.Message message) {
+ int raw_ret = gst_mixer_message_get_type (message == null ? IntPtr.Zero : message.Handle);
+ Gst.Interfaces.MixerMessageType ret = (Gst.Interfaces.MixerMessageType) raw_ret;
+ return ret;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_mixer_message_parse_mute_toggled(IntPtr message, out IntPtr track, out bool mute);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_mixer_message_parse_mute_toggled (IntPtr message, out IntPtr track, out bool mute);
- public static void ParseMuteToggled(Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool mute) {
- IntPtr native_ptr;
+ public static void ParseMuteToggled (Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool mute) {
+ IntPtr native_ptr;
- gst_mixer_message_parse_mute_toggled (message == null ? IntPtr.Zero : message.Handle, out native_ptr, out mute);
+ gst_mixer_message_parse_mute_toggled (message == null ? IntPtr.Zero : message.Handle, out native_ptr, out mute);
- track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
- }
+ track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_mixer_message_parse_option_changed(IntPtr message, out IntPtr options, out IntPtr value);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_mixer_message_parse_option_changed (IntPtr message, out IntPtr options, out IntPtr value);
- public static void ParseOptionChanged(Gst.Message message, out Gst.Interfaces.MixerOptions options, out string value) {
- IntPtr native_value;
- IntPtr native_options;
+ public static void ParseOptionChanged (Gst.Message message, out Gst.Interfaces.MixerOptions options, out string value) {
+ IntPtr native_value;
+ IntPtr native_options;
- gst_mixer_message_parse_option_changed(message == null ? IntPtr.Zero : message.Handle, out native_options, out native_value);
+ gst_mixer_message_parse_option_changed (message == null ? IntPtr.Zero : message.Handle, out native_options, out native_value);
- options = (MixerOptions) GLib.Object.GetObject (native_options, false);
- value = GLib.Marshaller.Utf8PtrToString (native_value);
- }
+ options = (MixerOptions) GLib.Object.GetObject (native_options, false);
+ value = GLib.Marshaller.Utf8PtrToString (native_value);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_mixer_message_parse_record_toggled(IntPtr message, out IntPtr track, out bool record);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_mixer_message_parse_record_toggled (IntPtr message, out IntPtr track, out bool record);
- public static void ParseRecordToggled(Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool record) {
- IntPtr native_ptr;
+ public static void ParseRecordToggled (Gst.Message message, out Gst.Interfaces.MixerTrack track, out bool record) {
+ IntPtr native_ptr;
- gst_mixer_message_parse_record_toggled(message == null ? IntPtr.Zero : message.Handle, out native_ptr, out record);
- track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
- }
+ gst_mixer_message_parse_record_toggled (message == null ? IntPtr.Zero : message.Handle, out native_ptr, out record);
+ track = (MixerTrack) GLib.Object.GetObject (native_ptr, false);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_mixer_message_parse_volume_changed(IntPtr message, out IntPtr track, out IntPtr volumes, out int num_channels);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_mixer_message_parse_volume_changed (IntPtr message, out IntPtr track, out IntPtr volumes, out int num_channels);
- public static void ParseVolumeChanged(Gst.Message message, out Gst.Interfaces.MixerTrack track, out int[] volumes) {
- IntPtr native_track;
- IntPtr native_volumes;
- int n_native_volumes;
+ public static void ParseVolumeChanged (Gst.Message message, out Gst.Interfaces.MixerTrack track, out int[] volumes) {
+ IntPtr native_track;
+ IntPtr native_volumes;
+ int n_native_volumes;
- gst_mixer_message_parse_volume_changed(message == null ? IntPtr.Zero : message.Handle, out native_track, out native_volumes, out n_native_volumes);
+ gst_mixer_message_parse_volume_changed (message == null ? IntPtr.Zero : message.Handle, out native_track, out native_volumes, out n_native_volumes);
- track = (MixerTrack) GLib.Object.GetObject (native_track, false);
- volumes = new int[n_native_volumes];
- for (int i = 0; i < n_native_volumes; i++)
- volumes[i] = Marshal.ReadInt32 (native_volumes, i * 4);
- GLib.Marshaller.Free (native_volumes);
- }
+ track = (MixerTrack) GLib.Object.GetObject (native_track, false);
+ volumes = new int[n_native_volumes];
+ for (int i = 0; i < n_native_volumes; i++)
+ volumes[i] = Marshal.ReadInt32 (native_volumes, i * 4);
+ GLib.Marshaller.Free (native_volumes);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_mixer_message_parse_options_list_changed(IntPtr message, out IntPtr options);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_mixer_message_parse_options_list_changed (IntPtr message, out IntPtr options);
- public static void ParseOptionsListChanged(Gst.Message message, out Gst.Interfaces.MixerOptions options) {
- IntPtr native_options;
+ public static void ParseOptionsListChanged (Gst.Message message, out Gst.Interfaces.MixerOptions options) {
+ IntPtr native_options;
- gst_mixer_message_parse_options_list_changed(message == null ? IntPtr.Zero : message.Handle, out native_options);
- options = (MixerOptions) GLib.Object.GetObject (native_options, false);
- }
- }
+ gst_mixer_message_parse_options_list_changed (message == null ? IntPtr.Zero : message.Handle, out native_options);
+ options = (MixerOptions) GLib.Object.GetObject (native_options, false);
+ }
+ }
}
namespace Gst.Interfaces {
- using System;
- using System.Runtime.InteropServices;
- using System.Reflection;
- using GLib;
- using Gst;
- using Gst.Interfaces;
+ using System;
+ using System.Runtime.InteropServices;
+ using System.Reflection;
+ using GLib;
+ using Gst;
+ using Gst.Interfaces;
- public static class NavigationEvent {
- [DllImport("gstinterfaces-0.10.dll")]
- static extern int gst_navigation_event_get_type(IntPtr evnt);
+ public static class NavigationEvent {
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern int gst_navigation_event_get_type (IntPtr evnt);
- public static Gst.Interfaces.NavigationEventType EventGetType(Gst.Event evnt) {
- int raw_ret = gst_navigation_event_get_type(evnt == null ? IntPtr.Zero : evnt.Handle);
- Gst.Interfaces.NavigationEventType ret = (Gst.Interfaces.NavigationEventType) raw_ret;
- return ret;
- }
+ public static Gst.Interfaces.NavigationEventType EventGetType (Gst.Event evnt) {
+ int raw_ret = gst_navigation_event_get_type (evnt == null ? IntPtr.Zero : evnt.Handle);
+ Gst.Interfaces.NavigationEventType ret = (Gst.Interfaces.NavigationEventType) raw_ret;
+ return ret;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_event_parse_key_event (IntPtr evnt, out IntPtr key);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_event_parse_key_event (IntPtr evnt, out IntPtr key);
- public static bool ParseKeyEvent (Gst.Event evnt, out string key) {
- IntPtr raw_key;
- bool ret = gst_navigation_event_parse_key_event (evnt.Handle, out raw_key);
+ public static bool ParseKeyEvent (Gst.Event evnt, out string key) {
+ IntPtr raw_key;
+ bool ret = gst_navigation_event_parse_key_event (evnt.Handle, out raw_key);
- key = GLib.Marshaller.Utf8PtrToString (raw_key);
+ key = GLib.Marshaller.Utf8PtrToString (raw_key);
- return ret;
- }
+ return ret;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_event_parse_mouse_button_event (IntPtr evnt, out int button, out double x, out double y);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_event_parse_mouse_button_event (IntPtr evnt, out int button, out double x, out double y);
- public static bool ParseMouseButtonEvent (Gst.Event evnt, out int button, out double x, out double y) {
- return gst_navigation_event_parse_mouse_button_event (evnt.Handle, out button, out x, out y);
- }
+ public static bool ParseMouseButtonEvent (Gst.Event evnt, out int button, out double x, out double y) {
+ return gst_navigation_event_parse_mouse_button_event (evnt.Handle, out button, out x, out y);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_event_parse_mouse_move_event (IntPtr evnt, out double x, out double y);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_event_parse_mouse_move_event (IntPtr evnt, out double x, out double y);
- public static bool ParseMouseMoveEvent (Gst.Event evnt, out double x, out double y) {
- return gst_navigation_event_parse_mouse_move_event (evnt.Handle, out x, out y);
- }
+ public static bool ParseMouseMoveEvent (Gst.Event evnt, out double x, out double y) {
+ return gst_navigation_event_parse_mouse_move_event (evnt.Handle, out x, out y);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_event_parse_command (IntPtr evnt, out int command);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_event_parse_command (IntPtr evnt, out int command);
- public static bool ParseCommand (Gst.Event evnt, out Gst.Interfaces.NavigationCommand command) {
- int raw_command;
- bool ret = gst_navigation_event_parse_command (evnt.Handle, out raw_command);
-
- command = (Gst.Interfaces.NavigationCommand) raw_command;
+ public static bool ParseCommand (Gst.Event evnt, out Gst.Interfaces.NavigationCommand command) {
+ int raw_command;
+ bool ret = gst_navigation_event_parse_command (evnt.Handle, out raw_command);
- return ret;
- }
+ command = (Gst.Interfaces.NavigationCommand) raw_command;
- }
+ return ret;
+ }
+
+ }
}
namespace Gst.Interfaces {
- using System;
- using System.Runtime.InteropServices;
- using System.Reflection;
- using GLib;
- using Gst;
- using Gst.Interfaces;
-
- public static class NavigationMessage {
- [DllImport("gstinterfaces-0.10.dll")]
- static extern int gst_navigation_message_get_type(IntPtr message);
-
- public static Gst.Interfaces.NavigationMessageType MessageGetType(Gst.Message message) {
- int raw_ret = gst_navigation_message_get_type(message == null ? IntPtr.Zero : message.Handle);
- Gst.Interfaces.NavigationMessageType ret = (Gst.Interfaces.NavigationMessageType) raw_ret;
- return ret;
- }
-
- [DllImport("gstinterfaces-0.10.dll")]
- static extern IntPtr gst_navigation_message_new_mouse_over (IntPtr src, bool active);
-
- public static Gst.Message NewMouseOver (Gst.Object src, bool active) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_navigation_message_new_mouse_over (src.Handle, active), typeof (Message), true);
- return msg;
- }
-
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_message_parse_mouse_over (IntPtr msg, out bool active);
-
- public static bool ParseMouseOver (Gst.Message msg, out bool active) {
- return gst_navigation_message_parse_mouse_over (msg.Handle, out active);
- }
-
- [DllImport("gstinterfaces-0.10.dll")]
- static extern IntPtr gst_navigation_message_new_angles_changed (IntPtr src, uint cur_angle, uint n_angles);
-
- public static Gst.Message NewAnglesChanged (Gst.Object src, uint cur_angle, uint n_angles) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_navigation_message_new_angles_changed (src.Handle, cur_angle, n_angles), typeof (Message), true);
- return msg;
- }
-
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_message_parse_angles_changed (IntPtr msg, out uint cur_angle, out uint n_angles);
-
- public static bool ParseMouseOver (Gst.Message msg, out uint cur_angle, out uint n_angles) {
- return gst_navigation_message_parse_angles_changed (msg.Handle, out cur_angle, out n_angles);
- }
-
- [DllImport("gstinterfaces-0.10.dll")]
- static extern IntPtr gst_navigation_message_new_commands_changed (IntPtr src);
-
- public static Gst.Message NewCommandsChanged (Gst.Object src) {
- Message msg = (Message) GLib.Opaque.GetOpaque (gst_navigation_message_new_commands_changed (src.Handle), typeof (Message), true);
- return msg;
- }
- }
+ using System;
+ using System.Runtime.InteropServices;
+ using System.Reflection;
+ using GLib;
+ using Gst;
+ using Gst.Interfaces;
+
+ public static class NavigationMessage {
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern int gst_navigation_message_get_type (IntPtr message);
+
+ public static Gst.Interfaces.NavigationMessageType MessageGetType (Gst.Message message) {
+ int raw_ret = gst_navigation_message_get_type (message == null ? IntPtr.Zero : message.Handle);
+ Gst.Interfaces.NavigationMessageType ret = (Gst.Interfaces.NavigationMessageType) raw_ret;
+ return ret;
+ }
+
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern IntPtr gst_navigation_message_new_mouse_over (IntPtr src, bool active);
+
+ public static Gst.Message NewMouseOver (Gst.Object src, bool active) {
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_navigation_message_new_mouse_over (src.Handle, active), true);
+ return msg;
+ }
+
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_message_parse_mouse_over (IntPtr msg, out bool active);
+
+ public static bool ParseMouseOver (Gst.Message msg, out bool active) {
+ return gst_navigation_message_parse_mouse_over (msg.Handle, out active);
+ }
+
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern IntPtr gst_navigation_message_new_angles_changed (IntPtr src, uint cur_angle, uint n_angles);
+
+ public static Gst.Message NewAnglesChanged (Gst.Object src, uint cur_angle, uint n_angles) {
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_navigation_message_new_angles_changed (src.Handle, cur_angle, n_angles), true);
+ return msg;
+ }
+
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_message_parse_angles_changed (IntPtr msg, out uint cur_angle, out uint n_angles);
+
+ public static bool ParseMouseOver (Gst.Message msg, out uint cur_angle, out uint n_angles) {
+ return gst_navigation_message_parse_angles_changed (msg.Handle, out cur_angle, out n_angles);
+ }
+
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern IntPtr gst_navigation_message_new_commands_changed (IntPtr src);
+
+ public static Gst.Message NewCommandsChanged (Gst.Object src) {
+ Message msg = (Message) Gst.MiniObject.GetObject (gst_navigation_message_new_commands_changed (src.Handle), true);
+ return msg;
+ }
+ }
}
namespace Gst.Interfaces {
- using System;
- using System.Runtime.InteropServices;
- using System.Reflection;
- using GLib;
- using Gst;
- using Gst.Interfaces;
+ using System;
+ using System.Runtime.InteropServices;
+ using System.Reflection;
+ using GLib;
+ using Gst;
+ using Gst.Interfaces;
- public static class NavigationQuery {
- [DllImport("gstinterfaces-0.10.dll")]
- static extern int gst_navigation_query_get_type(IntPtr query);
+ public static class NavigationQuery {
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern int gst_navigation_query_get_type (IntPtr query);
- public static Gst.Interfaces.NavigationQueryType QueryGetType(Gst.Query query) {
- int raw_ret = gst_navigation_query_get_type(query == null ? IntPtr.Zero : query.Handle);
- Gst.Interfaces.NavigationQueryType ret = (Gst.Interfaces.NavigationQueryType) raw_ret;
- return ret;
- }
+ public static Gst.Interfaces.NavigationQueryType QueryGetType (Gst.Query query) {
+ int raw_ret = gst_navigation_query_get_type (query == null ? IntPtr.Zero : query.Handle);
+ Gst.Interfaces.NavigationQueryType ret = (Gst.Interfaces.NavigationQueryType) raw_ret;
+ return ret;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern IntPtr gst_navigation_query_new_commands ();
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern IntPtr gst_navigation_query_new_commands ();
- public static Gst.Query NewCommands () {
- Gst.Query query = (Gst.Query) GLib.Opaque.GetOpaque (gst_navigation_query_new_commands (), typeof (Gst.Query), true);
- return query;
- }
+ public static Gst.Query NewCommands () {
+ Gst.Query query = (Gst.Query) Gst.MiniObject.GetObject (gst_navigation_query_new_commands (), true);
+ return query;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_navigation_query_set_commandsv (IntPtr query, uint n_commands, int[] cmds);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_navigation_query_set_commandsv (IntPtr query, uint n_commands, int[] cmds);
- public static void SetCommands (Gst.Query query, Gst.Interfaces.NavigationCommand[] cmds) {
- if (!query.IsWritable)
- throw new ApplicationException ();
+ public static void SetCommands (Gst.Query query, Gst.Interfaces.NavigationCommand[] cmds) {
+ if (!query.IsWritable)
+ throw new ApplicationException ();
- int[] raw_cmds = new int[cmds.Length];
- for (int i = 0; i < cmds.Length; i++)
- raw_cmds[i] = (int) cmds[i];
+ int[] raw_cmds = new int[cmds.Length];
+ for (int i = 0; i < cmds.Length; i++)
+ raw_cmds[i] = (int) cmds[i];
- gst_navigation_query_set_commandsv (query.Handle, (uint) raw_cmds.Length, raw_cmds);
- }
+ gst_navigation_query_set_commandsv (query.Handle, (uint) raw_cmds.Length, raw_cmds);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_query_parse_commands_length (IntPtr query, out uint n_commands);
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_query_parse_commands_nth (IntPtr query, uint nth, out int cmd);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_query_parse_commands_length (IntPtr query, out uint n_commands);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_query_parse_commands_nth (IntPtr query, uint nth, out int cmd);
- public static bool ParseCommands (Gst.Query query, out Gst.Interfaces.NavigationCommand[] cmds) {
- uint len;
+ public static bool ParseCommands (Gst.Query query, out Gst.Interfaces.NavigationCommand[] cmds) {
+ uint len;
- cmds = null;
- if (!gst_navigation_query_parse_commands_length (query.Handle, out len))
- return false;
+ cmds = null;
+ if (!gst_navigation_query_parse_commands_length (query.Handle, out len))
+ return false;
- cmds = new Gst.Interfaces.NavigationCommand[len];
+ cmds = new Gst.Interfaces.NavigationCommand[len];
- for (uint i = 0; i < len; i++) {
- int cmd;
+ for (uint i = 0; i < len; i++) {
+ int cmd;
- if (!gst_navigation_query_parse_commands_nth (query.Handle, i, out cmd))
- return false;
- cmds[i] = (Gst.Interfaces.NavigationCommand) cmd;
- }
+ if (!gst_navigation_query_parse_commands_nth (query.Handle, i, out cmd))
+ return false;
+ cmds[i] = (Gst.Interfaces.NavigationCommand) cmd;
+ }
- return true;
- }
+ return true;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern IntPtr gst_navigation_query_new_angles ();
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern IntPtr gst_navigation_query_new_angles ();
- public static Gst.Query NewAngles () {
- Gst.Query query = (Gst.Query) GLib.Opaque.GetOpaque (gst_navigation_query_new_angles (), typeof (Gst.Query), true);
- return query;
- }
+ public static Gst.Query NewAngles () {
+ Gst.Query query = (Gst.Query) Gst.MiniObject.GetObject (gst_navigation_query_new_angles (), true);
+ return query;
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern void gst_navigation_query_set_angles (IntPtr query, uint cur_angle, uint n_angles);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern void gst_navigation_query_set_angles (IntPtr query, uint cur_angle, uint n_angles);
- public static void SetAngles (Gst.Query query, uint cur_angle, uint n_angles) {
- if (!query.IsWritable)
- throw new ApplicationException ();
+ public static void SetAngles (Gst.Query query, uint cur_angle, uint n_angles) {
+ if (!query.IsWritable)
+ throw new ApplicationException ();
- gst_navigation_query_set_angles (query.Handle, cur_angle, n_angles);
- }
+ gst_navigation_query_set_angles (query.Handle, cur_angle, n_angles);
+ }
- [DllImport("gstinterfaces-0.10.dll")]
- static extern bool gst_navigation_query_parse_angles (IntPtr query, out uint cur_angle, out uint n_angles);
+ [DllImport ("gstinterfaces-0.10.dll") ]
+ static extern bool gst_navigation_query_parse_angles (IntPtr query, out uint cur_angle, out uint n_angles);
- public static bool ParseAngles (Gst.Query query, out uint cur_angle, out uint n_angles) {
- return gst_navigation_query_parse_angles (query.Handle, out cur_angle, out n_angles);
- }
- }
+ public static bool ParseAngles (Gst.Query query, out uint cur_angle, out uint n_angles) {
+ return gst_navigation_query_parse_angles (query.Handle, out cur_angle, out n_angles);
+ }
+ }
}
IntPtr native_buf;
int raw_ret = gst_pad_alloc_buffer (Handle, offset, size, caps == null ? IntPtr.Zero : caps.Handle, out native_buf);
Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
- buf = native_buf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buf, typeof (Gst.Buffer), true);
+ buf = native_buf == IntPtr.Zero ? null : (Gst.Buffer) Gst.MiniObject.GetObject (native_buf, true);
return ret;
}
IntPtr native_buf;
int raw_ret = gst_pad_alloc_buffer_and_set_caps (Handle, offset, size, caps == null ? IntPtr.Zero : caps.Handle, out native_buf);
Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
- buf = native_buf == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buf, typeof (Gst.Buffer), true);
+ buf = native_buf == IntPtr.Zero ? null : (Gst.Buffer) Gst.MiniObject.GetObject (native_buf, true);
return ret;
}
IntPtr native_buffer;
int raw_ret = gst_pad_pull_range (Handle, offset, size, out native_buffer);
Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
- buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
+ buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) Gst.MiniObject.GetObject (native_buffer, true);
return ret;
}
static extern IntPtr gst_query_new_application (QueryType type, IntPtr structure);
public static Query NewApplication (Gst.QueryType type, Structure structure) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_application (type, (structure != null) ? structure.Handle : IntPtr.Zero), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_application (type, (structure != null) ? structure.Handle : IntPtr.Zero), true);
query.cached_structure = structure;
structure.FreeNative = false;
static extern IntPtr gst_query_new_convert (Gst.Format src_format, long value, Gst.Format dest_format);
public static Query NewConvert (Gst.Format src_format, long value, Gst.Format dest_format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_convert (src_format, value, dest_format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_convert (src_format, value, dest_format), true);
return query;
}
static extern IntPtr gst_query_new_position (Gst.Format format);
public static Query NewPosition (Gst.Format format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_position (format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_position (format), true);
return query;
}
static extern IntPtr gst_query_new_duration (Gst.Format format);
public static Query NewDuration (Gst.Format format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_duration (format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_duration (format), true);
return query;
}
static extern IntPtr gst_query_new_latency ();
public static Query NewLatency() {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_latency (), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_latency (), true);
return query;
}
static extern IntPtr gst_query_new_seeking (Gst.Format format);
public static Query NewSeeking (Gst.Format format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_seeking (format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_seeking (format), true);
return query;
}
static extern IntPtr gst_query_new_formats ();
public static Query NewFormats() {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_formats (), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_formats (), true);
return query;
}
static extern IntPtr gst_query_new_segment (Gst.Format format);
public static Query NewSegment (Gst.Format format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_segment (format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_segment (format), true);
return query;
}
static extern IntPtr gst_query_new_buffering (Gst.Format format);
public static Query NewBuffering (Gst.Format format) {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_buffering (format), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_buffering (format), true);
return query;
}
static extern IntPtr gst_query_new_uri ();
public static Query NewUri() {
- Query query = (Query) GLib.Opaque.GetOpaque (gst_query_new_uri (), typeof (Query), true);
+ Query query = (Query) Gst.MiniObject.GetObject (gst_query_new_uri (), true);
return query;
}
- [DllImport ("gstreamersharpglue-0.10")]
- extern static uint gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
- static uint framerate_offset = gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
- public Gst.Fraction Framerate {
- get {
- unsafe {
- IntPtr raw_ptr = (IntPtr)(((byte*)Handle) + framerate_offset);
- GLib.Value v = (GLib.Value) Marshal.PtrToStructure (raw_ptr, typeof (GLib.Value));
- return (Gst.Fraction) v.Val;
- }
- }
- }
+static uint framerate_offset = gst__interfacessharp_gst__interfaces_tunernorm_get_framerate_offset ();
+public Gst.Fraction Framerate {
+ get {
+ unsafe {
+ IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
+ GLib.Value v = (GLib.Value) Marshal.PtrToStructure (raw_ptr, typeof (GLib.Value));
+ return (Gst.Fraction) v.Val;
+ }
+ }
+}
- [DllImport ("gstreamer-0.10.dll") ]
- private static extern void gst_value_set_fraction (IntPtr v, int numerator, int denominator);
+[DllImport ("gstreamer-0.10.dll") ]
+private static extern void gst_value_set_fraction (IntPtr v, int numerator, int denominator);
- public TunerNorm (string label, Gst.Fraction framerate) {
- unsafe {
- IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + label_offset);
- *raw_ptr = GLib.Marshaller.StringToPtrGStrdup (label);
+public TunerNorm (string label, Gst.Fraction framerate) {
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + label_offset);
+ *raw_ptr = GLib.Marshaller.StringToPtrGStrdup (label);
- }
- unsafe {
- IntPtr raw_ptr = (IntPtr)(((byte*)Handle) + framerate_offset);
- gst_value_set_fraction (raw_ptr, framerate.Numerator, framerate.Denominator);
- }
- }
+ }
+ unsafe {
+ IntPtr raw_ptr = (IntPtr) ( ( (byte*) Handle) + framerate_offset);
+ gst_value_set_fraction (raw_ptr, framerate.Numerator, framerate.Denominator);
+ }
+}