I'm a big fanboy of GTK+ and Python and all this GI stuff is right up my alley.
The GI stands for "Gobject Introspection". C programmers writing various libraries based on GObject (such as GStreamer) adhere to a set of conventions and annotations within the comments that, during the build process, create a special file describing the API in an XML format. Any language (like Python) can then use that XML file to dynamically call any of those API libraries installed on the system without the need for a separately maintained "language binding". In a nutshell, you're calling C functions from Python through a dynamically introspected wrapper. The 'gi.repository' package is that dynamic namespace. from gi.repository import Gst So that 'Gst' module is only going to be available in 'gi.repository' if you have the GStreamer C libraries installed on your system. A lot of other projects are also available from 'gi.repository'--anything based on GObject. from gi.repository import GObject, GLib, Gio, Gedit, Gtk, Pango Since these are all C libraries underneath the hood, the C documentation is usually the best source. Don't worry, it's not too hard. See my answer on stack overflow for an explanation on that: http://stackoverflow.com/questions/11586396/pygobject-gtk-3-documentation/11589779#11589779 So you'll be working GStreamer. The C docs at http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/ should give you what you need. The naming convention should be easy to pick up... Python C --------------------------------------------------------- Gst.init() gst_init() Gst.Buffer GstBuffer Gst.Buffer() gst_buffer_new() Gst.Buffer().get_size() gst_buffer_get_size() Gst.BufferFlags.DECODE_ONLY GST_BUFFER_FLAG_DECODE_ONLY So, as for a "Hello World" for PyGI (may be referred to as PyGObject or GObject Introspection)--it doesn't quite apply since it's not a library per say, but a way of accessing C libraries. So if your application is command-line, then you just need to start using the Gst library. But if it's a GUI application using GTK+, you can start with the tutorial at http://python-gtk-3-tutorial.readthedocs.org/en/latest/ Then this GTK+/Gst video player may be of use: http://bazaar.launchpad.net/~jderose/+junk/gst-examples/view/head:/video-player-1.0 Cheers, - Micah On Mon, Feb 18, 2013 at 3:52 PM, Richard C. Steffens <[email protected]>wrote: > On 02/18/2013 03:14 PM, Kevin Turner wrote: > >> On Mon, Feb 18, 2013, at 01:31 PM, Richard C. Steffens wrote: >> >>> I took a look at: >>> >>> https://wiki.ubuntu.com/**Novacut/GStreamer1.0<https://wiki.ubuntu.com/Novacut/GStreamer1.0> >>> >>> and discovered that I need to know about PyGL instead of PyGST, and that >>> I should be using GStreamer1.0 instead of GStreamer0.10. >>> >> That page doesn't say anything about PyGL, but does mention PyGI >> (GObject-Introspection). >> > > Ah, the disadvantages of sans serif fonts. Thanks for pointing that out. > > > According to https://live.gnome.org/PyGI , >> that's been merged into PyGObject. >> >> This has a "Hello World" for PyGI: >> >> https://live.gnome.org/**PyGObject/**IntrospectionPorting#How_does_** >> PyGI_work.3F<https://live.gnome.org/PyGObject/IntrospectionPorting#How_does_PyGI_work.3F> >> > > Thanks. That looks quite instructive. > > > ...looks like things have changed since I last did any work with Python >> and Gtk+. >> > > The last OO programming I did was over 10 years ago. This will be an > interesting refresher. > > Thanks, again. > > -- > Regards, > > Dick Steffens > > > ______________________________**_________________ > Portland mailing list > [email protected] > http://mail.python.org/**mailman/listinfo/portland<http://mail.python.org/mailman/listinfo/portland> > -- - Micah Carrick <[email protected]> Software Developer *Quixotix LLC* * *Portland, OR http://quixotix.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/portland/attachments/20130218/b7aa622f/attachment.html> _______________________________________________ Portland mailing list [email protected] http://mail.python.org/mailman/listinfo/portland
