[gst-devel] 0.9 proposals

Owen Fraser-Green owen at discobabe.net
Sun Dec 5 11:45:02 CET 2004


On Sat, 2004-12-04 at 15:38 -0800, David Schleef wrote:
> On Sat, Dec 04, 2004 at 02:22:13PM +0100, Ronald S. Bultje wrote:
> > So basically, we're pretty screwed here. Writing chain-based demuxers
> > (or state machines, as Dave calls them) is not all that good of an
> > option. Seriously, Dave and Benjamin, you're not gonna write all those
> > elements.
> 
> a) It's not that hard.
> b) demuxers will all share similar or identical states, and thus
>    could have the same structure or even share code.

Another alternative that occurred to me while I was writing the
asfdemuxer a couple of years ago was to use meta-programming to describe
plugins. Of course you can implement demuxers as state machines but to
do so in C, even if you are able to factor out a lot of code re-use,
still leaves source code which is fairly opaque to the observer. My idea
was to make an XML-based language for describing plugins and let a
generator make the C code. It would also save a lot of copy-and-paste
work for all the boiler-plate code that often constitutes the majority
of a plugin (and when there's some architectural change in gstreamer
which necessitates a change in every single plugin then one just has to
change the generator and re-run).

In addition to a language to describe plugins I also coined a language
to describe binary formats which the plugin descriptions could
reference, thus completing the auto-generated state machine plugin
puzzle.

Anyway, the good news is that I spent a few weeks writing code a couple
of years ago and had some shaky first attempts running. The bad news is
that I got distracted with a hundred other things and abandoned it.
Actually, I tried to demonstrate it to Wim at the last GUADEC but, to my
embarrassment, so many cobwebs had gathered on it that it wouldn't even
run any more.

It's just a shot in the dark but I thought if anyone was seriously
considering re-writing a lot of plugins - especially as state machines -
it was worth a mention because it would probably only take a few weeks
hard coding to get it usable and could save many weeks more. (I've
attached an example XML file which generated an a working audio adder
plugin for the more screenshot-inclined among you)

Cheers,
Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: adder.xml
Type: text/xml
Size: 950 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20041205/9b630e08/attachment.bin>


More information about the gstreamer-devel mailing list