+2008-04-08 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * docs/design/part-buffering.txt:
+ * gst/gstquark.c:
+ * gst/gstquark.h:
+ * gst/gstquery.c: (gst_query_parse_latency),
+ (gst_query_new_buffering), (gst_query_set_buffering_percent),
+ (gst_query_parse_buffering_percent):
+ * gst/gstquery.h:
+ Add busy field and quark for the buffering query so that the app can
+ only use the query to see if buffering is in progress.
+
2008-04-08 Wim Taymans <wim.taymans@collabora.co.uk>
* docs/gst/gstreamer-sections.txt:
"avg-in-rate", "avg-out-rate", "buffering-left",
"estimated-total", "old-state", "new-state", "pending-state",
"clock", "ready", "position", "new-base-time", "live", "min-latency",
- "max-latency"
+ "max-latency", "busy"
};
GQuark _priv_gst_quark_table[GST_QUARK_MAX];
GstStructure *structure;
structure = gst_structure_empty_new ("GstQueryBuffering");
+ /* by default, we configure the answer as no buffering with a 100% buffering
+ * progress */
gst_structure_id_set (structure,
- GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, -1,
+ GST_QUARK (BUSY), G_TYPE_BOOLEAN, FALSE,
+ GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, 100,
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
GST_QUARK (AVG_OUT_RATE), G_TYPE_INT, -1,
/**
* gst_query_set_buffering_percent
* @query: A valid #GstQuery of type GST_QUERY_BUFFERING.
+ * @busy: if buffering is busy
* @percent: a buffering percent
*
* Set the percentage of buffered data. This is a value between 0 and 100.
+ * The @busy indicator is %TRUE when the buffering is in progress.
*
* Since: 0.10.20
*/
void
-gst_query_set_buffering_percent (GstQuery * query, gint percent)
+gst_query_set_buffering_percent (GstQuery * query, gboolean busy, gint percent)
{
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_BUFFERING);
g_return_if_fail (percent >= 0 && percent <= 100);
gst_structure_id_set (query->structure,
+ GST_QUARK (BUSY), G_TYPE_BOOLEAN, busy,
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent, NULL);
}
/**
* gst_query_parse_buffering_percent
* @query: A valid #GstQuery of type GST_QUERY_BUFFERING.
+ * @busy: if buffering is busy
* @percent: a buffering percent
*
* Get the percentage of buffered data. This is a value between 0 and 100.
+ * The @busy indicator is %TRUE when the buffering is in progress.
*
* Since: 0.10.20
*/
void
-gst_query_parse_buffering_percent (GstQuery * query, gint * percent)
+gst_query_parse_buffering_percent (GstQuery * query, gboolean * busy,
+ gint * percent)
{
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_BUFFERING);
+ if (busy)
+ *busy = g_value_get_boolean (gst_structure_id_get_value (query->structure,
+ GST_QUARK (BUSY)));
if (percent)
*percent = g_value_get_int (gst_structure_id_get_value (query->structure,
GST_QUARK (BUFFER_PERCENT)));
/* buffering query */
GstQuery* gst_query_new_buffering (GstFormat format);
-void gst_query_set_buffering_percent (GstQuery *query, gint percent);
-void gst_query_parse_buffering_percent (GstQuery *query, gint *percent);
+void gst_query_set_buffering_percent (GstQuery *query, gboolean busy, gint percent);
+void gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent);
void gst_query_set_buffering_stats (GstQuery *query, GstBufferingMode mode,
gint avg_in, gint avg_out,