summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-02-28 16:35:48 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-02-28 16:35:48 +0000
commit05cf4d83c34dab94185b8eddc61994293b8ab611 (patch)
treec8ddd6ff431c86ec968cdf65836343dffef7b093 /gst
parent7d42056b8ea1714fbaf1e101a6bd2edeb0acd443 (diff)
gst/gstbin.c: Also report the live parameter of a latency query.
Original commit message from CVS: * gst/gstbin.c: (bin_query_min_max_init), (bin_query_latency_fold), (bin_query_latency_done): Also report the live parameter of a latency query.
Diffstat (limited to 'gst')
-rw-r--r--gst/gstbin.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gst/gstbin.c b/gst/gstbin.c
index 659fd1994..e02d42a0a 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -2330,6 +2330,7 @@ typedef struct
GstQuery *query;
gint64 min;
gint64 max;
+ gboolean live;
} QueryFold;
typedef void (*QueryInitFunction) (GstBin * bin, QueryFold * fold);
@@ -2342,6 +2343,7 @@ bin_query_min_max_init (GstBin * bin, QueryFold * fold)
{
fold->min = 0;
fold->max = -1;
+ fold->live = FALSE;
}
static gboolean
@@ -2419,14 +2421,15 @@ bin_query_latency_fold (GstElement * item, GValue * ret, QueryFold * fold)
{
if (gst_element_query (item, fold->query)) {
GstClockTime min, max;
+ gboolean live;
g_value_set_boolean (ret, TRUE);
- gst_query_parse_latency (fold->query, NULL, &min, &max);
+ gst_query_parse_latency (fold->query, &live, &min, &max);
GST_DEBUG_OBJECT (item,
- "got latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT,
- GST_TIME_ARGS (min), GST_TIME_ARGS (max));
+ "got latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT
+ ", live %d", GST_TIME_ARGS (min), GST_TIME_ARGS (max), live);
/* for the combined latency we collect the MAX of all min latencies and
* the MIN of all max latencies */
@@ -2436,6 +2439,8 @@ bin_query_latency_fold (GstElement * item, GValue * ret, QueryFold * fold)
fold->max = max;
else if (max < fold->max)
fold->max = max;
+ if (fold->live == FALSE)
+ fold->live = live;
}
gst_object_unref (item);
@@ -2445,11 +2450,12 @@ static void
bin_query_latency_done (GstBin * bin, QueryFold * fold)
{
/* store max in query result */
- gst_query_set_latency (fold->query, TRUE, fold->min, fold->max);
+ gst_query_set_latency (fold->query, fold->live, fold->min, fold->max);
GST_DEBUG_OBJECT (bin,
- "latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT,
- GST_TIME_ARGS (fold->min), GST_TIME_ARGS (fold->max));
+ "latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT
+ ", live %d", GST_TIME_ARGS (fold->min), GST_TIME_ARGS (fold->max),
+ fold->live);
}