mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-09 10:59:39 +00:00
Fix the Gst.Index* bindings
This commit is contained in:
parent
d627d1580c
commit
a92f4036a6
6 changed files with 256 additions and 5 deletions
|
@ -374,23 +374,47 @@
|
||||||
<!-- TODO: Might still contain something -->
|
<!-- TODO: Might still contain something -->
|
||||||
<attr path="/api/namespace/class[@name='Global']" name="hidden">1</attr>
|
<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 -->
|
<!-- 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/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/class[@name='Iterator']" name="hidden">1</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_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_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_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/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_FLAG_LAST']" name="name">Last</attr>
|
||||||
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_WRITABLE']" name="value">ObjectFlags.Last << 0</attr>
|
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_WRITABLE']" name="value">ObjectFlags.Last << 0</attr>
|
||||||
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_READABLE']" name="value">ObjectFlags.Last << 1</attr>
|
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_READABLE']" name="value">ObjectFlags.Last << 1</attr>
|
||||||
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_FLAG_LAST']" name="value">ObjectFlags.Last << 8</attr>
|
<attr path="/api/namespace/enum[@name='IndexFlags']/member[@cname='GST_INDEX_FLAG_LAST']" name="value">ObjectFlags.Last << 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']" />
|
<remove-node path="/api/namespace/class[@name='Init']" />
|
||||||
|
|
||||||
<change-node-type path="/api/namespace/object[@name='Message']">boxed</change-node-type>
|
<change-node-type path="/api/namespace/object[@name='Message']">boxed</change-node-type>
|
||||||
|
|
12
gstreamer-sharp/Index.custom
Normal file
12
gstreamer-sharp/Index.custom
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
157
gstreamer-sharp/IndexEntry.custom
Normal file
157
gstreamer-sharp/IndexEntry.custom
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -71,6 +71,8 @@ customs = \
|
||||||
Plugin.custom \
|
Plugin.custom \
|
||||||
Task.custom \
|
Task.custom \
|
||||||
MiniObject.custom \
|
MiniObject.custom \
|
||||||
|
IndexEntry.custom \
|
||||||
|
Index.custom \
|
||||||
Registry.custom \
|
Registry.custom \
|
||||||
Query.custom \
|
Query.custom \
|
||||||
Structure.custom \
|
Structure.custom \
|
||||||
|
|
|
@ -14,7 +14,8 @@ libgstreamersharpglue_0_10_la_SOURCES = \
|
||||||
object.c \
|
object.c \
|
||||||
pad.c \
|
pad.c \
|
||||||
gobject.c \
|
gobject.c \
|
||||||
typefind.c
|
typefind.c \
|
||||||
|
indexentry.c
|
||||||
|
|
||||||
nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c
|
nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c
|
||||||
|
|
||||||
|
|
55
gstreamer-sharp/glue/indexentry.c
Normal file
55
gstreamer-sharp/glue/indexentry.c
Normal file
|
@ -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);
|
||||||
|
}
|
Loading…
Reference in a new issue