[gst-devel] [RFC] invalid buffers

Xavier Bestel xavier.bestel at free.fr
Fri Jun 14 06:06:03 CEST 2002


Sometimes a plugin can send an invalid buffer, e.g. after seeking in an
mpeg video stream at a non-keyframe position, there will be garbage in
the buffer until a keyframe (I-frame in mpeg language) is met.

I see 3 solutions to this:

- Make sure all plugins seek only to keyframes (e.g. find the keyframe
just before the seek point). The problem is that it may not be possible
when data comes streamed from somewhere (e.g. mpegs have to be analyzed
first).

- Make sure all plugins don't spit out invalid buffers. Maybe this can
cause timing issues if a sink waits for a timed buffer which will never
come, I dunno.

- Mark all invalid buffers as such, with something like this:

--- gstreamer/gst/gstbuffer.h	2 Jun 2002 21:45:16 -0000	1.37
+++ gstreamer/gst/gstbuffer.h	14 Jun 2002 12:31:45 -0000
@@ -87,6 +87,7 @@
   GST_BUFFER_DISCONTINOUS,
   GST_BUFFER_KEY_UNIT,
   GST_BUFFER_PREROLL,
+  GST_BUFFER_INVALID,
 } GstBufferFlag;

This is simpler to implement (IMHO) but puts the burden on the sinks to
actually filter what they want, an can involve unnecessary
computing/data passing (not worst than what we have today).

What do you think ?





More information about the gstreamer-devel mailing list