query: fix parsing of the ALLOCATION query
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 29 Apr 2011 08:50:17 +0000 (10:50 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 29 Apr 2011 08:50:17 +0000 (10:50 +0200)
Add methods for parsing the caps and the need_pool boolean.

gst/gstquery.c
gst/gstquery.h
win32/common/libgstreamer.def

index aeca7c0..9d79f85 100644 (file)
@@ -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);
 
index b7d67cd..e6feb66 100644 (file)
@@ -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);
index 1e753a6..efd9bdc 100644 (file)
@@ -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