Decoder behaviour model

Wim Taymans wim.taymans at gmail.com
Thu Nov 10 02:09:29 PST 2011


On 11/10/2011 10:47 AM, Siber wrote:
>     Hello everybody!
> I'm trying to understand what should my component do in following cases. If
> I made any mistakes in following explanation, please let me know.
>     1. I have a pipeline: filesrc ->  mydecoder ->  sink. Filesrc is working in
> push mode. What should my decoder do if it get more than one encoded frame?
> Whether I should parse the whole buffer received from filesrc and then while
> I have frames I should call method gst_pad_push (mydecoder->srcpad,
> new_frame_buf); to let frames "go further"?
You should parse the whole buffer and push as many frames as you can decode.
>     2. And what should I do if I get not enough data for decoding only one
> frame?
You keep the data you received around, don't push anything, return from 
the chain
function and try to decode again the next time the chain function is 
called with more
data.
>     3. Whether I have to implement pull mode in my decoder?
>     Thank you!
I would not do that.

What you usually do is rely on a parser to properly frame that data for 
your decoder. A
usually also implements seeking and pull mode (when possible). Parser 
make your decoder
easier to write.

Wim
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Decoder-behaviour-model-tp4022986p4022986.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list