#include <gst/gst.h>
#include <stdio.h>
+#include <gst/base/gstqueuearray.h>
G_BEGIN_DECLS
GstClockTime sinktime, srctime;
/* TRUE if either position needs to be recalculated */
gboolean sink_tainted, src_tainted;
+ /* Bitrates taken from tags */
+ guint sink_tags_bitrate;
+ guint src_tags_bitrate;
/* flowreturn when srcpad is paused */
GstFlowReturn srcresult;
gboolean unexpected;
/* the queue of data we're keeping our hands on */
- GQueue queue;
+ GstQueueArray *queue;
GCond query_handled;
gboolean last_query; /* result of last serialized query */
+ GstQuery *last_handled_query;
GstQueue2Size cur_level; /* currently in the queue */
GstQueue2Size max_level; /* max. amount of data allowed in the queue */
gboolean use_buffering;
+ gboolean use_tags_bitrate;
+ gboolean use_bitrate_query;
gboolean use_rate_estimate;
GstClockTime buffering_interval;
- gint low_percent; /* low/high watermarks for buffering */
- gint high_percent;
+ guint downstream_bitrate; /* the bitrate reported by downstream */
+
+ /* low/high watermarks for buffering */
+ gint low_watermark;
+ gint high_watermark;
/* current buffering state */
gboolean is_buffering;
gint buffering_percent;
+ gint last_posted_buffering_percent;
/* for measuring input/output rates */
GTimer *in_timer;
gboolean in_timer_started;
+ gdouble last_update_in_rates_elapsed;
gdouble last_in_elapsed;
guint64 bytes_in;
gdouble byte_in_rate;
guint8 * ring_buffer;
volatile gint downstream_may_block;
+
+ GstBufferingMode mode;
+ gint64 buffering_left;
+ gint avg_in;
+ gint avg_out;
+ gboolean percent_changed;
+ GMutex buffering_post_lock; /* assures only one posted at a time */
};
struct _GstQueue2Class