[gst-devel] how do experts customize filesrc

Michael Smith msmith at xiph.org
Mon Mar 22 19:10:01 CET 2010


On Mon, Mar 22, 2010 at 9:20 AM, ericcardmanNo3 <daniel.kuhne at yahoo.de> wrote:
>
> hello,
>
> i have a h264 decoder. It comes with an API to decode single h264 frames. It
> also comes with
> an API for frame extraction. This frame extraction code need a file
> descriptor of the h264 source file.
>
> What i want to do is:
>
> [A]
> my customized filesrc (frame extraction) ----> my decoder plugin (h264
> decoding) ----> fbdevsink
>
> The decoder plugin part is ok for me. What i do not understand is how to
> write an own filesrc. I can not find any template.

'Experts' don't do it that way - a good quality gstreamer plugin will
work directly with a normal source element, not need customisation.

In this case, you've got a (presumably working) decoder - that's
great. So you just need to feed it h.264 frames. Rather than using the
code you have, that hardcodes a particular type of source (a file),
why wouldn't you just use GStreamer's existing elements to parse
files? e.g. if your file is a raw h.264 bitstream, use h264parse. If
it's an mp4 file, use qtdemux.


>
> One important basic question:
>
> in the above pipline- when is a buffer pushed by the filesrc? i.e when i use
> gst-launch videotestsrc ! ffmpegcolorspace ! fbdevsink

Here, there's no filesrc: but in this case the videotestsrc will start
a thread, and that thread will loop, pushing a buffer with every loop
iteration. So the _transform function in ffmpegcolorspace will be
called from that streaming thread.

Mike




More information about the gstreamer-devel mailing list