Fix Gst.Structure bindings

This commit is contained in:
Sebastian Dröge 2009-04-11 20:07:03 +02:00
parent 8bd2b114b8
commit 8076872e0e
3 changed files with 106 additions and 1 deletions

View file

@ -294,6 +294,45 @@
<attr path="/api/namespace/boxed[@name='Structure']/field[@name='ParentRefcount']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@name='SetParentRefcount']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_valist']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_name_id']" name="hidden">1</attr>
<change-node-type path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_empty_new']">constructor</change-node-type>
<remove-attr path="/api/namespace/boxed[@name='Structure']/constructor[@cname='gst_structure_empty_new']" name="name" />
<remove-attr path="/api/namespace/boxed[@name='Structure']/constructor[@cname='gst_structure_empty_new']" name="shared" />
<attr path="/api/namespace/boxed[@name='Structure']/field[@cname='type']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_id_empty_new']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/constructor[@cname='gst_structure_new_valist']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_copy']" name="owned">true</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_value']" name="name">SetValue</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_value']" name="name">GetValue</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_id_get_value']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_id_set_value']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_id_set']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_id_set_valist']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_set_valist']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_remove_fields']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_remove_fields_valist']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_n_fields']" name="name">GetCount</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_boolean']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_int']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_uint']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_fourcc']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_double']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_string']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_date']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_clock_time']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_enum']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_fraction']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_foreach']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_map_in_place']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_from_string']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_has_name']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_get_field_type']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='Structure']/method[@cname='gst_structure_nth_field_name']" name="accessibility">private</attr>
<attr path="/api/namespace/callback[@name='StructureForeachFunc']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@name='StructureMapFunc']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Task']/field[@name='Func']" name="hidden">1</attr>

View file

@ -64,7 +64,8 @@ customs = \
Parse.custom \
Object.custom \
MiniObject.custom \
Registry.custom
Registry.custom \
Structure.custom

View file

@ -0,0 +1,65 @@
public Structure (string name, params object[] fields) : this (name)
{
Set (fields);
}
public object Get (string field) {
GLib.Value v;
v = GetValue (field);
return Gst.Value.GetValue (v);
}
public void Set (string field, object value) {
SetValue (field, Gst.Value.CreateValue (value));
}
public void Set (params object[] fields) {
int i, length = fields.Length;
if (length % 2 != 0)
throw new ArgumentException ();
for (i = 0; i < length; i += 2) {
SetValue (fields[i] as string, Gst.Value.CreateValue (fields[i+1]));
}
}
public object this [string field] {
set {
GLib.Value v;
if (field == null)
throw new ArgumentNullException ();
v = Gst.Value.CreateValue (value);
Set (field, value);
}
get {
if (field == null)
throw new ArgumentNullException ();
return Get (field);
}
}
public IEnumerable Fields {
get {
ArrayList fields = new ArrayList ();
for (uint i = 0; i < Count; i++)
fields.Add (NthFieldName (i));
return fields;
}
}
public static Structure NewFromString (string structure) {
IntPtr raw_ret = gst_structure_from_string (structure, IntPtr.Zero);
Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), false);
return ret;
}
[DllImport ("gstreamer-0.10.dll") ]
private static extern IntPtr gst_structure_from_string (string structure, IntPtr end);