Commit d3393980 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/playback/gstqueue2.c: Tweak the buffering thresholds a little.

Original commit message from CVS:
* gst/playback/gstqueue2.c: (update_rates):
Tweak the buffering thresholds a little.
Update the buffer size with the previously calculate rate instead of
only when we calculate a new rate so that we get smoother buffering
updates.
* gst/playback/Makefile.am:
* gst/playback/gsturidecodebin.c: (gst_uri_decode_bin_base_init),
(gst_uri_decode_bin_class_init), (gst_uri_decode_bin_init),
(gst_uri_decode_bin_finalize), (gst_uri_decode_bin_set_property),
(gst_uri_decode_bin_get_property), (unknown_type),
(add_element_stream), (no_more_pads_full), (no_more_pads),
(source_no_more_pads), (new_decoded_pad), (array_has_value),
(gen_source_element), (has_all_raw_caps), (analyse_source),
(remove_decoders), (make_decoder), (remove_source),
(source_new_pad), (setup_source), (decoder_query_init),
(decoder_query_duration_fold), (decoder_query_duration_done),
(decoder_query_position_fold), (decoder_query_position_done),
(decoder_query_latency_fold), (decoder_query_latency_done),
(decoder_query_seeking_fold), (decoder_query_seeking_done),
(decoder_query_generic_fold), (gst_uri_decode_bin_query),
(gst_uri_decode_bin_change_state), (plugin_init):
New element that intergrates a source, optional buffering element and
decodebin.
parent 23396338
2007-05-17 Wim Taymans <wim@fluendo.com>
* gst/playback/gstqueue2.c: (update_rates):
Tweak the buffering thresholds a little.
Update the buffer size with the previously calculate rate instead of
only when we calculate a new rate so that we get smoother buffering
updates.
* gst/playback/Makefile.am:
* gst/playback/gsturidecodebin.c: (gst_uri_decode_bin_base_init),
(gst_uri_decode_bin_class_init), (gst_uri_decode_bin_init),
(gst_uri_decode_bin_finalize), (gst_uri_decode_bin_set_property),
(gst_uri_decode_bin_get_property), (unknown_type),
(add_element_stream), (no_more_pads_full), (no_more_pads),
(source_no_more_pads), (new_decoded_pad), (array_has_value),
(gen_source_element), (has_all_raw_caps), (analyse_source),
(remove_decoders), (make_decoder), (remove_source),
(source_new_pad), (setup_source), (decoder_query_init),
(decoder_query_duration_fold), (decoder_query_duration_done),
(decoder_query_position_fold), (decoder_query_position_done),
(decoder_query_latency_fold), (decoder_query_latency_done),
(decoder_query_seeking_fold), (decoder_query_seeking_done),
(decoder_query_generic_fold), (gst_uri_decode_bin_query),
(gst_uri_decode_bin_change_state), (plugin_init):
New element that intergrates a source, optional buffering element and
decodebin.
2007-05-17 Tim-Philipp Müller <tim at centricular dot net>
 
* configure.ac:
......@@ -7,7 +7,8 @@ built_headers = gstplay-marshal.h
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstplaybin.la libgstdecodebin.la libgstdecodebin2.la libgstqueue2.la
plugin_LTLIBRARIES = libgstplaybin.la libgstdecodebin.la libgstdecodebin2.la libgstqueue2.la \
libgsturidecodebin.la
libgstplaybin_la_SOURCES = \
gstplaybin.c \
......@@ -44,6 +45,14 @@ libgstqueue2_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstqueue2_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstqueue2_la_LIBADD = $(GST_LIBS)
libgsturidecodebin_la_SOURCES = gsturidecodebin.c
nodist_libgsturidecodebin_la_SOURCES = $(built_sources)
libgsturidecodebin_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgsturidecodebin_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsturidecodebin_la_LIBADD = \
$(top_builddir)/gst-libs/gst/pbutils/libgstpbutils-@GST_MAJORMINOR@.la \
$(GST_LIBS)
noinst_HEADERS = \
gstplaybasebin.h \
gststreaminfo.h \
......
......@@ -80,8 +80,8 @@ enum
#define DEFAULT_MAX_SIZE_TIME 2 * GST_SECOND /* 2 seconds */
#define DEFAULT_USE_BUFFERING FALSE
#define DEFAULT_USE_RATE_ESTIMATE TRUE
#define DEFAULT_LOW_PERCENT 15
#define DEFAULT_HIGH_PERCENT 95
#define DEFAULT_LOW_PERCENT 10
#define DEFAULT_HIGH_PERCENT 99
enum
{
......@@ -683,39 +683,40 @@ update_rates (GstQueue * queue)
elapsed = g_timer_elapsed (queue->timer, NULL);
/* recalc after each interval. */
if (queue->last_elapsed + RATE_INTERVAL >= elapsed)
return;
period = elapsed - queue->last_elapsed;
GST_DEBUG_OBJECT (queue,
"rates: period %f, in %" G_GUINT64_FORMAT ", out %" G_GUINT64_FORMAT,
period, queue->bytes_in, queue->bytes_out);
byte_in_rate = queue->bytes_in / period;
byte_out_rate = queue->bytes_out / period;
if (queue->byte_in_rate == 0.0)
queue->byte_in_rate = byte_in_rate;
else
queue->byte_in_rate = AVG_IN (queue->byte_in_rate, byte_in_rate);
if (queue->byte_out_rate == 0.0)
queue->byte_out_rate = byte_out_rate;
else
queue->byte_out_rate = AVG_OUT (queue->byte_out_rate, byte_out_rate);
if (queue->last_elapsed + RATE_INTERVAL < elapsed) {
period = elapsed - queue->last_elapsed;
GST_DEBUG_OBJECT (queue,
"rates: period %f, in %" G_GUINT64_FORMAT ", out %" G_GUINT64_FORMAT,
period, queue->bytes_in, queue->bytes_out);
byte_in_rate = queue->bytes_in / period;
byte_out_rate = queue->bytes_out / period;
if (queue->byte_in_rate == 0.0)
queue->byte_in_rate = byte_in_rate;
else
queue->byte_in_rate = AVG_IN (queue->byte_in_rate, byte_in_rate);
if (queue->byte_out_rate == 0.0)
queue->byte_out_rate = byte_out_rate;
else
queue->byte_out_rate = AVG_OUT (queue->byte_out_rate, byte_out_rate);
/* reset the values to calculate rate over the next interval */
queue->last_elapsed = elapsed;
queue->bytes_in = 0;
queue->bytes_out = 0;
}
queue->cur_level.rate_time =
queue->cur_level.bytes / queue->byte_in_rate * GST_SECOND;
if (queue->byte_in_rate > 0.0) {
queue->cur_level.rate_time =
queue->cur_level.bytes / queue->byte_in_rate * GST_SECOND;
}
GST_DEBUG_OBJECT (queue, "rates: in %f, out %f, time %" GST_TIME_FORMAT,
queue->byte_in_rate, queue->byte_out_rate,
GST_TIME_ARGS (queue->cur_level.rate_time));
/* reset the values to calculate rate over the next interval */
queue->last_elapsed = elapsed;
queue->bytes_in = 0;
queue->bytes_out = 0;
}
static void
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment