[Gstreamer-bugs] [Bug 108268] New - Add min threshold to queue for network streaming apps

bugzilla-daemon at widget.gnome.org bugzilla-daemon at widget.gnome.org
Wed Mar 12 22:05:26 PST 2003


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

http://bugzilla.gnome.org/show_bug.cgi?id=108268

Changed by janzen at pixelmetrix.com.

--- shadow/108268	Thu Mar 13 01:05:26 2003
+++ shadow/108268.tmp.17620	Thu Mar 13 01:05:26 2003
@@ -0,0 +1,72 @@
+Bug#: 108268
+Product: GStreamer
+Version: 0.6.0
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: enhancement
+Priority: Normal
+Component: gstreamer (core)
+AssignedTo: gstreamer-maint at bugzilla.gnome.org                            
+ReportedBy: janzen at pixelmetrix.com               
+QAContact: gstreamer-maint at bugzilla.gnome.org
+TargetMilestone: 0.6.x
+URL: 
+Summary: Add min threshold to queue for network streaming apps
+
+I'm building an MPEG-2 transport stream viewer process, which receives
+input from a UDP source and displays the resulting video on an
+Xv-capable X server.  I have a plugin which extracts a PID from
+the MPEG-2 TS and decodes TS and PES headers, and am creating a
+pipeline equivalent to:
+
+   gst-launch udpsrc port=<port> !
+     queue max-level=<M> leaky=2 min-threshold-bytes=<N> !
+     { mytsdecoder pid=<pid> ! mpeg2dec ! xvideosink xid=<window_id> }
+
+The "min-threshold-bytes" property is an enhancement to the standard
+GStreamer queue.  I've added this so that, when the queue is emptied,
+the reader thread (the "downstream" side of the queue) is not awakened
+by  a "not_empty" signal until the queue has refilled to at least this
+level.
+
+Without this property, the queue level bounces along near the bottom,
+rather than filling to a reasonable level, causing freeze frames and/or
+a "jerky" display:
+
+Before:              After:
+
+                       +--------- block reader thread
+                       |      +-- signal reader thread
+                       |      |              /
+                       v      v             /|
+                                  /   min_threshold_bytes
+                     - - - - -/- /|- - - -/- | - - - - - -
+                             /| / |  /   /   | /  __
+                            / |/  | /|  /    |/| /   etc.
+                           /      |/ | /       |/
+   /   /    ^          /  /          |/
+__/|__/|___/|__      _/|_/
+
+
+A similar threshold could be added easily to block the "upstream"
+writer thread until a full queue drops below a threshold, rather
+than waking it as soon as anything is removed, as at present.
+However, in most network streaming applications it is probably
+sufficient to allow the queue to leak on the downstream side, since
+blocking the incoming network traffic is not possible.
+
+Since max_level is specified in buffers, but min_threshold_bytes is
+in bytes, the queue must also signal the reader thread if the maximum
+number of (presumably smaller than expected) buffers has been enqueued,
+but the threshold has not yet been reached.
+
+The attached patch adds a min_threshold_bytes property to gstqueue.{h,c}.
+Note that it already includes the change from Bugzilla #108236 (a fix
+to a rather unlikely race condition in gst_queue_chain()), and updates
+a number of debugging statements to show the queue level in both
+buffers and bytes.
+
+Please review, and feel free to add to the next GStreamer release!
+Cheers...





More information about the Gstreamer-bugs mailing list