From ccfaa53fb26fb12430be1bce6b57fbcfaca11364 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 29 Apr 2011 10:50:17 +0200 Subject: [PATCH] query: fix parsing of the ALLOCATION query Add methods for parsing the caps and the need_pool boolean. --- gst/gstquery.c | 27 +++++++++++++++++++-------- gst/gstquery.h | 5 +++-- win32/common/libgstreamer.def | 3 ++- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/gst/gstquery.c b/gst/gstquery.c index aeca7c0f2d..9d79f85eb9 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -1498,19 +1498,30 @@ gst_query_new_allocation (GstCaps * caps, gboolean need_pool) return query; } +void +gst_query_parse_allocation (GstQuery * query, GstCaps ** caps, + gboolean * need_pool) +{ + g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION); + + gst_structure_id_get (query->structure, + GST_QUARK (CAPS), GST_TYPE_CAPS, caps, + GST_QUARK (NEED_POOL), G_TYPE_BOOLEAN, need_pool, NULL); +} + /** - * gst_query_set_allocation + * gst_query_set_allocation_params * @query: A valid #GstQuery of type GST_QUERY_ALLOCATION. * @alignment: the alignment * @prefix: the prefix * @size: the size * @pool: the #GstBufferPool * - * Set the allocation properties in @query. + * Set the allocation parameters in @query. */ void -gst_query_set_allocation (GstQuery * query, guint alignment, guint prefix, - guint size, GstBufferPool * pool) +gst_query_set_allocation_params (GstQuery * query, guint alignment, + guint prefix, guint size, GstBufferPool * pool) { g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION); @@ -1522,18 +1533,18 @@ gst_query_set_allocation (GstQuery * query, guint alignment, guint prefix, } /** - * gst_query_parse_allocation + * gst_query_parse_allocation_params * @query: A valid #GstQuery of type GST_QUERY_ALLOCATION. * @alignment: the alignment * @prefix: the prefix * @size: the size * @pool: the #GstBufferPool * - * Get the allocation properties in @query. + * Get the allocation parameters in @query. */ void -gst_query_parse_allocation (GstQuery * query, guint * alignment, guint * prefix, - guint * size, GstBufferPool ** pool) +gst_query_parse_allocation_params (GstQuery * query, guint * alignment, + guint * prefix, guint * size, GstBufferPool ** pool) { g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION); diff --git a/gst/gstquery.h b/gst/gstquery.h index b7d67cd693..e6feb66308 100644 --- a/gst/gstquery.h +++ b/gst/gstquery.h @@ -330,10 +330,11 @@ void gst_query_set_uri (GstQuery *query, const gchar /* allocation query */ GstQuery * gst_query_new_allocation (GstCaps *caps, gboolean need_pool); +void gst_query_parse_allocation (GstQuery *query, GstCaps **caps, gboolean *need_pool); -void gst_query_set_allocation (GstQuery *query, guint alignment, guint prefix, +void gst_query_set_allocation_params (GstQuery *query, guint alignment, guint prefix, guint size, GstBufferPool *pool); -void gst_query_parse_allocation (GstQuery *query, guint *alignment, guint *prefix, +void gst_query_parse_allocation_params (GstQuery *query, guint *alignment, guint *prefix, guint *size, GstBufferPool **pool); void gst_query_add_allocation_meta (GstQuery *query, const gchar *api); diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 1e753a62eb..efd9bdc22f 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -846,6 +846,7 @@ EXPORTS gst_query_new_uri gst_query_parse_allocation gst_query_parse_allocation_meta + gst_query_parse_allocation_params gst_query_parse_buffering_percent gst_query_parse_buffering_range gst_query_parse_buffering_stats @@ -859,7 +860,7 @@ EXPORTS gst_query_parse_seeking gst_query_parse_segment gst_query_parse_uri - gst_query_set_allocation + gst_query_set_allocation_params gst_query_set_buffering_percent gst_query_set_buffering_range gst_query_set_buffering_stats