[gst-devel] Cleaning up gst-python/examples
David I. Lehn
dlehn at vt.edu
Tue Oct 17 20:41:26 CEST 2006
* Jason Gerard DeRose <jderose at jasonderose.org> [2006-10-12T18:00:31-0400]:
> I've been looking through the gst-python/examples, and I'd really like
> to see the depreciated examples removed (the ones that haven't been
> ported to gstreamer0.10). They are:
>
> audioconcat.py
> cp.py
> gst123
> vorbisplay.py
>
> I'll gladly write equivalent examples for each of these, but I first
> wanted to get some feedback on what others feel should be included.
>
IIRC, cp.py might have been the first gst-python code ever to execute
properly. Seemed like the simplest possible thing I could get to work
at the time. It's changed since the first version. Some of these
examples now use this fancy launch syntax now instead of being hardcore
and building pipelines by hand. ;) The orginial point was to test that
building by hand worked. It might be more useful to have such examples
as part of a tutorial where you can show hand built pipeline code vs
launch syntax code.
Trivial little examples like that have their use. If it's easy to
update them and document that they are just meant as simple toys then
maybe worth keeping them around. Adding them to a test suite would of
course be nice in order to keep them up to date.
> Personally, I prefer examples that cleanly illustrate specific aspects
> of the gst-python API over more 'mini-application' type examples. I
> don't find examples like gst123 as useful because too high a percentage
> of the code has to do with its mini-application aspect and not gstreamer.
>
> Anyway, I've attached an example that I'd like to see replace gst123.
> It's a simple autuplugging example using decodebin.
>
A well written gst123 that is a drop-in replacement for mpg123 would be
nice if anyone wanted to take on that project. I think there's a use
for both simpler feature explanation examples as well as one or two
mini-apps that show how to tie all the features together into something
useful. If someone wants to maintain such things it's nice for new
developers to be able to just grab that code and start hacking on it.
It's nice to have something between simple examples and full huge apps
that you don't know where to begin hacking.
> Lastly, what is the preferred license for these examples? I stuck an
> LGPL disclaimer on it, but this is such a tiny piece of code that maybe
> it should just be public domain.
>
If history can be followed back through CVS file moves and such then
anything I wrote was probably LGPL. But these days I'd prefer BSD, MIT,
public domain, or similar. Any code I wrote is mostly totally replaced
by many other fine developers by now so maybe the decision is in their
hands.
> class Decodebin:
> def __init__(self, location):
> # The pipeline
> self.pipeline = gst.Pipeline()
...
Use PEP 8 advice of 4 space indents vs tabs. The rest of the examples
do (or should).
-dave
More information about the gstreamer-devel
mailing list