From: <wt...@ke...> - 2008-04-08 20:18:08
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wtay Date: Tue Apr 08 2008 20:18:03 UTC Log message: * 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. Modified files: . : ChangeLog docs/design : part-buffering.txt gst : gstquark.c gstquark.h gstquery.c gstquery.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.3755&r2=1.3756 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/design/part-buffering.txt.diff?r1=1.7&r2=1.8 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquark.c.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquark.h.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquery.c.diff?r1=1.42&r2=1.43 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquery.h.diff?r1=1.37&r2=1.38 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.3755 retrieving revision 1.3756 diff -u -d -r1.3755 -r1.3756 --- ChangeLog 8 Apr 2008 19:59:03 -0000 1.3755 +++ ChangeLog 8 Apr 2008 20:17:47 -0000 1.3756 @@ -1,5 +1,17 @@ 2008-04-08 Wim Taymans <wim...@co...> + * 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...@co...> * docs/gst/gstreamer-sections.txt: * gst/gstmessage.c: (gst_message_set_buffering_stats), (gst_message_parse_buffering_stats): Index: part-buffering.txt RCS file: /cvs/gstreamer/gstreamer/docs/design/part-buffering.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- part-buffering.txt 8 Apr 2008 19:14:49 -0000 1.7 +++ part-buffering.txt 8 Apr 2008 20:17:48 -0000 1.8 @@ -191,6 +191,10 @@ query contains the following field, which indicate the available downloaded range in a specific format and the estimated time to complete: + "busy", G_TYPE_BOOLEAN + - if buffering was busy. This flag allows the application to pause the + pipeline by using the query only. "format", GST_TYPE_FORMAT - the format of the "start" and "stop" values below Index: gstquark.c RCS file: /cvs/gstreamer/gstreamer/gst/gstquark.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gstquark.c 8 Apr 2008 19:39:28 -0000 1.2 +++ gstquark.c 8 Apr 2008 20:17:49 -0000 1.3 @@ -34,7 +34,7 @@ "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]; Index: gstquark.h RCS file: /cvs/gstreamer/gstreamer/gst/gstquark.h,v --- gstquark.h 8 Apr 2008 19:39:28 -0000 1.2 +++ gstquark.h 8 Apr 2008 20:17:49 -0000 1.3 @@ -59,8 +59,9 @@ GST_QUARK_LIVE = 30, GST_QUARK_MIN_LATENCY = 31, GST_QUARK_MAX_LATENCY = 32, + GST_QUARK_BUSY = 33, - GST_QUARK_MAX = 33 + GST_QUARK_MAX = 34 } GstQuarkId; extern GQuark _priv_gst_quark_table[GST_QUARK_MAX]; Index: gstquery.c RCS file: /cvs/gstreamer/gstreamer/gst/gstquery.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- gstquery.c 8 Apr 2008 19:59:06 -0000 1.42 +++ gstquery.c 8 Apr 2008 20:17:49 -0000 1.43 @@ -1118,8 +1118,11 @@ 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, @@ -1137,36 +1140,45 @@ /** * 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 * Get the percentage of buffered data. This is a value between 0 and 100. -gst_query_parse_buffering_percent (GstQuery * query, gint * percent) +gst_query_parse_buffering_percent (GstQuery * query, gboolean * busy, + gint * percent) + 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))); Index: gstquery.h RCS file: /cvs/gstreamer/gstreamer/gst/gstquery.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- gstquery.h 8 Apr 2008 19:59:06 -0000 1.37 +++ gstquery.h 8 Apr 2008 20:17:49 -0000 1.38 @@ -266,8 +266,8 @@ /* 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, |