[Vala] GStreamer binding problems



Hello,

I'm currently playing with Gtk, GStreamer and vala and I found some issues (I think) in the binding:

For example, considering these two methods:
http://valadoc.org/?pkg=gstreamer-0.10&element=Gst.XML.get_element
http://valadoc.org/?pkg=gstreamer-0.10&element=Gst.XML.parse_file

They take a uchar[] as parameter, but this is wrong as these parameters should be strings and it makes the vapi difficult to use as the user should create a uchar array, place the string into it and pass the array to the method.

I understand why the uchar type is used: even the C API is wrong: they use guchar* instead of gchar*:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstXML.html
this is probably an error according to this comment in the source code:
http://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gstxml.c?id=RELEASE-0_10_22#n395 (line 395)

Now my question is: how can I do to fix the vapi file. To my understanding, I should modify the vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata file, but I don't know if there is an instruction to tell valac to generate such a code:
gst_xml_parse_file(xml, (guchar*) filename, (guchar*) root);
when the api in the vapi is:
Gst.Xml.parse_file(string filename, string root);
In other words, is there a way to tell valac to cast the parameters in the generated C code?

If this is not possible, another solution would be to stick to the official GStreamer api and use uchar pointers:
Gst.Xml.parse_file(uchar* filename, uchar* root);
instead of the current
Gst.Xml.parse_file(uchar[] filename, uchar[] root);
And to do this, I need to add this line to vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata:
gst_xml_parse_file.fname name="uchar*"
gst_xml_parse_file.root name="uchar*"
Is this right?

And last question: I was not able to regenerate the vapi file. I compiled vala-gen-introspect but when I run it I just get a lot of errors. What should the command line be to regenerate a vapi file ?

Thanks & regards,

Eric


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]