summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-04-30 13:13:31 (GMT)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-04-30 13:13:31 (GMT)
commita92f4036a6a6055b72a3380eb49ae9a62fda329a (patch)
treed1881f821f4cb55a43b72edfb9ededbd88c1899f
parentd627d1580c159351eaa86a8380c744af05e0477e (diff)
Fix the Gst.Index* bindings
-rw-r--r--gstreamer-sharp/Gstreamer.metadata34
-rw-r--r--gstreamer-sharp/Index.custom12
-rw-r--r--gstreamer-sharp/IndexEntry.custom157
-rw-r--r--gstreamer-sharp/Makefile.am2
-rw-r--r--gstreamer-sharp/glue/Makefile.am3
-rw-r--r--gstreamer-sharp/glue/indexentry.c55
6 files changed, 257 insertions, 6 deletions
diff --git a/gstreamer-sharp/Gstreamer.metadata b/gstreamer-sharp/Gstreamer.metadata
index 987283b..458fe9f 100644
--- a/gstreamer-sharp/Gstreamer.metadata
+++ b/gstreamer-sharp/Gstreamer.metadata
@@ -374,23 +374,47 @@
<!-- TODO: Might still contain something -->
<attr path="/api/namespace/class[@name='Global']" name="hidden">1</attr>
- <attr path="/api/namespace/object[@name='Index']/field[@cname='resolver']" name="hidden">1</attr>
- <attr path="/api/namespace/object[@name='Index']/property[@cname='resolver']" name="hidden">1</attr>
<!-- FIXME: Bug https://bugzilla.novell.com/show_bug.cgi?id=323372 -->
- <attr path="/api/namespace/object[@name='Index']/field[@name='Filter']" name="hidden">1</attr>
-
- <attr path="/api/namespace/class[@name='Iterator']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@name='Index']/field" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@name='Index']/virtual_method[@cname='get_assoc_entry']/parameters/parameter[@name='func']" name="type">gpointer</attr>
+ <attr path="/api/namespace/object[@name='Index']/property[@cname='resolver']" name="name">Method</attr>
+ <attr path="/api/namespace/object[@name='Index']/property[@cname='resolver']" name="type">GstIndexResolverMethod</attr>
+ <attr path="/api/namespace/object[@name='Index']/constructor[@cname='gst_index_new_group']" name="hidden">1</attr>
+ <add-node path="/api/namespace/object[@name='Index']">
+ <method name="NewGroup" cname="gst_index_new_group">
+ <return-type type="gint" />
+ </method>
+ </add-node>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_set_filter']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_set_filter_full']" name="name">SetFilter</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_set_resolver']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_set_resolver_full']" name="name">SetResolver</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_add_associationv']" name="name">AddAssociation</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_add_associationv']/parameters/parameter[@name='list']" name="null_term_array">true</attr>
+ <attr path="/api/namespace/object[@name='Index']/method[@cname='gst_index_add_object']/parameters/parameter[@name='object']" name="type">GObject*</attr>
+
+ <attr path="/api/namespace/boxed[@name='IndexEntry']" name="opaque">true</attr>
+ <attr path="/api/namespace/boxed[@name='IndexEntry']/field[@name='Type']" name="access">public</attr>
+ <attr path="/api/namespace/boxed[@name='IndexEntry']/field[@name='Id']" name="access">public</attr>
<attr path="/api/namespace/object[@name='IndexFactory']/method[@cname='gst_index_factory_destroy']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='IndexFactory']/method[@cname='gst_index_factory_find']/return-type" name="owned">true</attr>
<attr path="/api/namespace/object[@name='IndexFactory']/method[@cname='gst_index_factory_create']/return-type" name="owned">true</attr>
<attr path="/api/namespace/object[@name='IndexFactory']/method[@cname='gst_index_factory_make']/return-type" name="owned">true</attr>
+ <attr path="/api/namespace/callback[@name='IndexFilter']/parameters/parameter[@name='entry']" name="owned">true</attr>
+
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_FLAG_LAST']" name="name">Last</attr>
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_WRITABLE']" name="value">ObjectFlags.Last &lt;&lt; 0</attr>
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_READABLE']" name="value">ObjectFlags.Last &lt;&lt; 1</attr>
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_FLAG_LAST']" name="value">ObjectFlags.Last &lt;&lt; 8</attr>
+ <attr path="/api/namespace/struct[@name='IndexGroup']" name="hidden">1</attr>
+
+ <attr path="/api/namespace/callback[@name='IndexResolver']/parameters/parameter[@name='writer_string']" name="pass_as">out</attr>
+
+ <attr path="/api/namespace/class[@name='Iterator']" name="hidden">1</attr>
+
<remove-node path="/api/namespace/class[@name='Init']" />
<change-node-type path="/api/namespace/object[@name='Message']">boxed</change-node-type>
diff --git a/gstreamer-sharp/Index.custom b/gstreamer-sharp/Index.custom
new file mode 100644
index 0000000..60b3529
--- /dev/null
+++ b/gstreamer-sharp/Index.custom
@@ -0,0 +1,12 @@
+
+public bool IsReadable {
+ get {
+ return ( ( (uint) Flags) & ( (uint) Gst.IndexFlags.Readable)) != 0;
+ }
+}
+
+public bool IsWritable {
+ get {
+ return ( ( (uint) Flags) & ( (uint) Gst.IndexFlags.Writable)) != 0;
+ }
+}
diff --git a/gstreamer-sharp/IndexEntry.custom b/gstreamer-sharp/IndexEntry.custom
new file mode 100644
index 0000000..5775347
--- /dev/null
+++ b/gstreamer-sharp/IndexEntry.custom
@@ -0,0 +1,157 @@
+protected virtual GLib.Opaque Copy (IntPtr raw)
+{
+ return GLib.Opaque.GetOpaque (raw, typeof (Gst.IndexEntry), true);
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_id_description_offset ();
+
+static uint id_description_offset = gstsharp_gst_index_entry_get_id_description_offset ();
+public string IdDescription {
+ get {
+ if (Type != Gst.IndexEntryType.Id)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + id_description_offset);
+ return GLib.Marshaller.Utf8PtrToString (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_assoc_nassocs_offset ();
+
+static uint assoc_nassocs_offset = gstsharp_gst_index_entry_get_assoc_nassocs_offset ();
+public int AssocNAssocs {
+ get {
+ if (Type != Gst.IndexEntryType.Association)
+ throw new Exception ();
+
+ unsafe {
+ int* raw_ptr = (int*) ( ( (byte*) Handle) + assoc_nassocs_offset);
+ return (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_assoc_assocs_offset ();
+
+static uint assoc_assocs_offset = gstsharp_gst_index_entry_get_assoc_assocs_offset ();
+public Gst.IndexAssociation[] AssocAssocs {
+ get {
+ if (Type != Gst.IndexEntryType.Association)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + assoc_assocs_offset);
+ Gst.IndexAssociation[] ret = new Gst.IndexAssociation[AssocNAssocs];
+ if (AssocNAssocs == 0)
+ return ret;
+
+ int unmanaged_struct_size = Marshal.SizeOf (typeof (Gst.IndexAssociation));
+
+ for (int i = 0; i < AssocNAssocs; i++)
+ ret[i] = Gst.IndexAssociation.New (new IntPtr ( (*raw_ptr).ToInt64() + i * unmanaged_struct_size));
+ return ret;
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_assoc_flags_offset ();
+
+static uint assoc_flags_offset = gstsharp_gst_index_entry_get_assoc_flags_offset ();
+public Gst.AssocFlags AssocFlags {
+ get {
+ if (Type != Gst.IndexEntryType.Association)
+ throw new Exception ();
+
+ unsafe {
+ int* raw_ptr = (int*) ( ( (byte*) Handle) + assoc_flags_offset);
+ return (Gst.AssocFlags) (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_object_key_offset ();
+
+static uint object_key_offset = gstsharp_gst_index_entry_get_object_key_offset ();
+public string ObjectKey {
+ get {
+ if (Type != Gst.IndexEntryType.Object)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + object_key_offset);
+ return GLib.Marshaller.Utf8PtrToString (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_object_type_offset ();
+
+static uint object_type_offset = gstsharp_gst_index_entry_get_object_type_offset ();
+public GLib.GType ObjectGType {
+ get {
+ if (Type != Gst.IndexEntryType.Object)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + object_type_offset);
+ return new GLib.GType (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_object_object_offset ();
+
+static uint object_object_offset = gstsharp_gst_index_entry_get_object_object_offset ();
+public object ObjectObject {
+ get {
+ if (Type != Gst.IndexEntryType.Object)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + object_object_offset);
+ return GLib.Object.GetObject (*raw_ptr, false);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_format_format_offset ();
+
+static uint format_format_offset = gstsharp_gst_index_entry_get_format_format_offset ();
+public Gst.Format FormatFormat {
+ get {
+ if (Type != Gst.IndexEntryType.Format)
+ throw new Exception ();
+
+ unsafe {
+ int* raw_ptr = (int*) ( ( (byte*) Handle) + format_format_offset);
+ return (Gst.Format) (*raw_ptr);
+ }
+ }
+}
+
+[DllImport ("gstreamersharpglue-0.10") ]
+extern static uint gstsharp_gst_index_entry_get_format_key_offset ();
+
+static uint format_key_offset = gstsharp_gst_index_entry_get_format_key_offset ();
+public string FormatKey {
+ get {
+ if (Type != Gst.IndexEntryType.Format)
+ throw new Exception ();
+
+ unsafe {
+ IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + format_key_offset);
+ return GLib.Marshaller.Utf8PtrToString (*raw_ptr);
+ }
+ }
+}
+
diff --git a/gstreamer-sharp/Makefile.am b/gstreamer-sharp/Makefile.am
index 4307a0e..072fe65 100644
--- a/gstreamer-sharp/Makefile.am
+++ b/gstreamer-sharp/Makefile.am
@@ -71,6 +71,8 @@ customs = \
Plugin.custom \
Task.custom \
MiniObject.custom \
+ IndexEntry.custom \
+ Index.custom \
Registry.custom \
Query.custom \
Structure.custom \
diff --git a/gstreamer-sharp/glue/Makefile.am b/gstreamer-sharp/glue/Makefile.am
index f5779d9..c8d4a59 100644
--- a/gstreamer-sharp/glue/Makefile.am
+++ b/gstreamer-sharp/glue/Makefile.am
@@ -14,7 +14,8 @@ libgstreamersharpglue_0_10_la_SOURCES = \
object.c \
pad.c \
gobject.c \
- typefind.c
+ typefind.c \
+ indexentry.c
nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c
diff --git a/gstreamer-sharp/glue/indexentry.c b/gstreamer-sharp/glue/indexentry.c
new file mode 100644
index 0000000..7c02a30
--- /dev/null
+++ b/gstreamer-sharp/glue/indexentry.c
@@ -0,0 +1,55 @@
+#include <gst/gst.h>
+
+uint
+gstsharp_gst_index_entry_get_id_description_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.id.description);
+}
+
+uint
+gstsharp_gst_index_entry_get_assoc_nassocs_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.assoc.nassocs);
+}
+
+uint
+gstsharp_gst_index_entry_get_assoc_assocs_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.assoc.assocs);
+}
+
+uint
+gstsharp_gst_index_entry_get_assoc_flags_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.assoc.flags);
+}
+
+uint
+gstsharp_gst_index_entry_get_object_key_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.object.key);
+}
+
+uint
+gstsharp_gst_index_entry_get_object_type_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.object.type);
+}
+
+uint
+gstsharp_gst_index_entry_get_object_object_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.object.object);
+}
+
+uint
+gstsharp_gst_index_entry_get_format_format_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.format.format);
+}
+
+uint
+gstsharp_gst_index_entry_get_format_key_offset (void)
+{
+ return (uint) G_STRUCT_OFFSET (GstIndexEntry, data.format.key);
+}