State of bindings



Hi friends!

I am currently working on that caps and options branch you probably have
heard of (I promise, it will be there soon!), and since I am a lazy boy,
I decided to write tests for it in python, which means less code to
write to test more ;).  Doing this allowed me to get a good idea of the
current limitations of our bindings (most of this would also apply to
javascript or vala) and compiled a quick list for you:

1/ Things that would require fixing in Grilo

 - lack of support for the life length of our callbacks and associated
user data: right now, only works properly if a reference is kept on the
python/js/whatever side, to ensure it isn't destroyed. This might need a
change on our async API (see "Scope types"[1]).
 - things would be more pythonic if "properties" were available as
instance properties instead of through getters/setters. I'm not sure yet
of how to do this, but I suspect that having all these implemented as
proper GObject properties could do it. Need investigating to make sure
of that.
 - I don't think we can write (and load) a source in python or
javascript.  There's probably not much to do for that to work in python,
since pygobject allows you to subclass GObjects in python. What's
missing is a way to load python sources and a lot of testing. To load
the sources, we could do something like GStreamer's python plugin[2]. It
basically looks for gstreamer elements in predetermined paths, and make
them available like any C element to applications.

2/ Things that would require fixing in GObject-Introspection and/or
pygobject

 - Constructors: need to call SomeClass.new(<args>) instead of
SomeClass(<args>); see [3]
 - DateTime not supported ->
https://bugzilla.gnome.org/show_bug.cgi?id=647250 and
https://bugzilla.gnome.org/show_bug.cgi?id=647249
 - Support for optional arguments/default values (need to do Grl.init(0,
null) in js, Grl.init([]) in python) -> file bug?
 - no documentation of bindings; fixing that is already in the goals of
the Berlin hackfest[4]
 - async functions and their callbacks require the user_data parameter;
should work like signals do (a variable number of args are passed to
connect(), and then forwarded to the callback) ->
https://bugzilla.gnome.org/show_bug.cgi?id=652136


[1] https://live.gnome.org/GObjectIntrospection/Annotations#line-76
[2] http://cgit.freedesktop.org/gstreamer/gst-python/tree/plugin
[3] https://live.gnome.org/GObjectIntrospection/Annotations#line-309
[4] https://live.gnome.org/Hackfests/Introspection2011

If you noticed something that I forgot, or if you know more about how
these things would apply to bindings other than python, please reply!

Cheers,

Guij


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