[gst-devel] new plugin: fakefilter

Jason Toffaletti jason at subterrific.net
Mon Oct 18 17:48:01 CEST 2004

I've created a new Gstreamer plugin that I call fakefilter. Right now it
just passes all data through it unmodified, but it emits signals inside
the chain and change state callbacks.

My purpose for developing this plugin is that I need a way to get access
to data at certain points during a pipeline. My application is so
specialized that developing custom plugins doesn't make sense because it
wouldn't be something any other application would use. So I created this
"pure-virtual" plugin that allows me to implement a plugin at an
application level.

Here is a short example of what I need:

filesrc location=test.mp3 ! id3demux ! fakefilter ! mad ! fakefilter

At fakefilter0 I need the mpeg frames stripped of id3tags.
At fakefilter1 I need the raw pcm.

I tried a few different methods before arriving at this solution. At
first I tried using tee's to split the pipeline and then connect a
fakesink with a hand-off signal to access the data. This had problems
because it would "see" seeking from demux plugins, making it difficult
to use the data serially. I was able to successfully hack around this
using buffer timestamps and/or positions, depending on the pipeline, but
it didn't seem like a very clean solution. I briefly tried to implement
a "static" GstElement inside my application and use g_object_new() to
create it, but I'm using gst_parse_launch() to create my pipelines, so I
needed a registered plugin and it doesn't look like there is anyway to
register a GstElement without there being an actual plugin.

I'd like to contribute this plugin to Gstreamer because I think it will
be useful to others besides myself. I know of at least one other person
doing similar things from my two weeks spent on #gstreamer. I also see
the potential for fakefilter to replace fakesink and fakesrc, but I
imagine there is a good argument to the contrary?

Does this sound like something Gstreamer is interested in?

- Jason Toffaletti

More information about the gstreamer-devel mailing list