[gst-devel] gst-guile
Andy Wingo
wingo at pobox.com
Sat May 24 05:54:02 CEST 2003
Hey kids,
The new gst-guile bindings are now in CVS (thanks a million, thomasvs)
and should work with the latest guile-gobject[1]. You should, in theory,
just be able to check out gst-guile, ./autogen.sh, and there you are.
You might want to set the --prefix to be the same as your guile
installation.
Their status is... well you can connect and run pipelines. I've put in
manual wrappers for gst_pad_set_chainfunc and _linkfunc, but there's
some more manual wrapping to do until we're at the level of taaz's
bindings. I haven't tested threads yet, that promises to be a mess. They
will probably work if you don't attach handlers to signals from threaded
elements. In theory guile will at some point switch to POSIX threads as
their underlying thread implementation, for now they are user-space.
Here's a trimmed-down example of playing a vorbis file (more comments on
this in examples/gstreamer/vorbisplay.scm, essentially a translation of
the file from gst-python):
#! /usr/bin/guile -s
!#
(use-modules (gnome gstreamer))
(if (not (eq? (length (program-arguments)) 2))
(begin (format #t "usage: ~A VORBISFILE" (car (program-arguments)))
(exit 1)))
(let ((pipeline (make "pipeline"))
(filesrc (make "filesrc"))
(vorbisfile (make "vorbisfile"))
(osssink (make "osssink")))
(add-many pipeline filesrc vorbisfile osssink)
(link-many filesrc vorbisfile osssink)
(set filesrc 'location (cadr (program-arguments)))
(connect osssink 'eos (lambda (p)
(display "osssink: EOS event received\n")
(gst-main-quit)))
(set-state pipeline 'playing)
(g-idle-add (lambda () (gst-bin-iterate pipeline)))
(gst-main))
Pretty simple stuff. I hope to get this in a nice state, I'm tired of
writing apps in C.
[1] guile-gobject-0.5.0 has not been widely released -- it's looking for
a home -- but for now it's at
http://ambient.2y.net/wingo/tmp/guile-gobject-0.5.0.tar.gz.
More information about the gstreamer-devel
mailing list