From aac5185f3eed9d5f7df0b95e93875dad18de8667 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Jun 2007 10:21:19 +0000 Subject: [PATCH] gst/playback/gstplaybasebin.c: Small debug improvement. Original commit message from CVS: * gst/playback/gstplaybasebin.c: (make_decoder), (setup_source): Small debug improvement. * gst/playback/gstqueue2.c: (apply_segment), (update_buffering), (plugin_init): Tweak the rate estimation period. When calculating the buffer filledness in rate estimation mode, don't mix it with other metrics. --- ChangeLog | 11 +++++++++++ gst/playback/gstplaybasebin.c | 6 +++++- gst/playback/gstqueue2.c | 29 +++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5940ab..06e9ec3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2007-06-28 Wim Taymans + * gst/playback/gstplaybasebin.c: (make_decoder), (setup_source): + Small debug improvement. + + * gst/playback/gstqueue2.c: (apply_segment), (update_buffering), + (plugin_init): + Tweak the rate estimation period. + When calculating the buffer filledness in rate estimation mode, don't + mix it with other metrics. + +2007-06-28 Wim Taymans + * gst/playback/gstdecodebin2.c: (gst_decode_group_new), (gst_decode_group_expose), (gst_decode_group_free), (add_fakesink): When creating the groups, allow for a 5 second, unlimited buffers diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index bcb7fc8..0a8998c 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -1899,6 +1899,9 @@ make_decoder (GstPlayBaseBin * play_base_bin) g_object_set_data (G_OBJECT (decoder), "pending", "1"); play_base_bin->pending++; + GST_DEBUG_OBJECT (play_base_bin, "created decodebin, %d pending", + play_base_bin->pending); + play_base_bin->decoders = g_slist_prepend (play_base_bin->decoders, decoder); return decoder; @@ -2080,7 +2083,6 @@ setup_source (GstPlayBaseBin * play_base_bin) return TRUE; } if (is_dynamic) { - GST_DEBUG_OBJECT (play_base_bin, "Source has dynamic output pads"); /* connect a handler for the new-pad signal */ play_base_bin->src_np_sig_id = g_signal_connect (G_OBJECT (play_base_bin->source), "pad-added", @@ -2090,6 +2092,8 @@ setup_source (GstPlayBaseBin * play_base_bin) G_CALLBACK (source_no_more_pads), play_base_bin); g_object_set_data (G_OBJECT (play_base_bin->source), "pending", "1"); play_base_bin->pending++; + GST_DEBUG_OBJECT (play_base_bin, + "Source has dynamic output pads, %d pending", play_base_bin->pending); } else { GstElement *decoder; diff --git a/gst/playback/gstqueue2.c b/gst/playback/gstqueue2.c index 285decc..1bbe495 100644 --- a/gst/playback/gstqueue2.c +++ b/gst/playback/gstqueue2.c @@ -588,6 +588,16 @@ apply_segment (GstQueue * queue, GstEvent * event, GstSegment * segment) gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format, &start, &stop, &time); + GST_DEBUG_OBJECT (queue, + "received NEWSEGMENT update %d, rate %lf, applied rate %lf, " + "format %d, " + "%" G_GINT64_FORMAT " -- %" G_GINT64_FORMAT ", time %" + G_GINT64_FORMAT ", accum %" G_GINT64_FORMAT, update, rate, arate, + format, start, stop, time); + + if (format == GST_FORMAT_BYTES) { + } + /* now configure the values, we use these to track timestamps on the * sinkpad. */ if (format != GST_FORMAT_TIME) { @@ -654,11 +664,13 @@ update_buffering (GstQueue * queue) percent = 100; } else { /* figure out the percent we are filled, we take the max of all formats. */ - percent = GET_PERCENT (bytes); - percent = MAX (percent, GET_PERCENT (time)); - percent = MAX (percent, GET_PERCENT (buffers)); - if (queue->use_rate_estimate) - percent = MAX (percent, GET_PERCENT (rate_time)); + if (queue->use_rate_estimate) { + percent = GET_PERCENT (rate_time); + } else { + percent = GET_PERCENT (bytes); + percent = MAX (percent, GET_PERCENT (time)); + percent = MAX (percent, GET_PERCENT (buffers)); + } } if (queue->is_buffering) { @@ -702,11 +714,12 @@ reset_rate_timer (GstQueue * queue) queue->timer_started = FALSE; } +/* the interval in seconds to recalculate the rate */ +#define RATE_INTERVAL 0.2 /* Tuning for rate estimation. We use a large window for the input rate because * it should be stable when connected to a network. The output rate is less * stable (the elements preroll, queues behind a demuxer fill, ...) and should * therefore adapt more quickly. */ -#define RATE_INTERVAL 0.5 #define AVG_IN(avg,val) ((avg) * 15.0 + (val)) / 16.0 #define AVG_OUT(avg,val) ((avg) * 3.0 + (val)) / 4.0 @@ -1825,8 +1838,8 @@ gst_queue_get_property (GObject * object, static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (queue_debug, "queue", 0, "queue element"); - GST_DEBUG_CATEGORY_INIT (queue_dataflow, "queue_dataflow", 0, + GST_DEBUG_CATEGORY_INIT (queue_debug, "queue2", 0, "queue element"); + GST_DEBUG_CATEGORY_INIT (queue_dataflow, "queue2_dataflow", 0, "dataflow inside the queue element"); #ifdef ENABLE_NLS -- 2.7.4