query: Add new API to remove allocation params and pools from the allocation query
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 25 Feb 2013 12:57:43 +0000 (13:57 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 25 Feb 2013 12:57:43 +0000 (13:57 +0100)
docs/gst/gstreamer-sections.txt
gst/gstquery.c
gst/gstquery.h
win32/common/libgstreamer.def

index 3c40c24..0ae71d0 100644 (file)
@@ -2252,11 +2252,13 @@ gst_query_add_allocation_pool
 gst_query_get_n_allocation_pools
 gst_query_parse_nth_allocation_pool
 gst_query_set_nth_allocation_pool
+gst_query_remove_nth_allocation_pool
 
 gst_query_add_allocation_param
 gst_query_get_n_allocation_params
 gst_query_parse_nth_allocation_param
 gst_query_set_nth_allocation_param
+gst_query_remove_nth_allocation_param
 
 gst_query_add_allocation_meta
 gst_query_get_n_allocation_metas
index 533b8b3..a288c49 100644 (file)
@@ -1623,6 +1623,31 @@ gst_query_set_nth_allocation_pool (GstQuery * query, guint index,
   g_array_index (array, AllocationPool, index) = ap;
 }
 
+/**
+ * gst_query_remove_nth_allocation_pool:
+ * @query: a GST_QUERY_ALLOCATION type query #GstQuery
+ * @index: position in the allocation pool array to remove
+ *
+ * Remove the allocation pool at @index of the allocation pool array.
+ */
+void
+gst_query_remove_nth_allocation_pool (GstQuery * query, guint index)
+{
+  GArray *array;
+  GstStructure *structure;
+
+  g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION);
+  g_return_if_fail (gst_query_is_writable (query));
+
+  structure = GST_QUERY_STRUCTURE (query);
+  array =
+      ensure_array (structure, GST_QUARK (POOL), sizeof (AllocationPool),
+      (GDestroyNotify) allocation_pool_free);
+  g_return_if_fail (index < array->len);
+
+  g_array_remove_index (array, index);
+}
+
 typedef struct
 {
   GType api;
@@ -1941,6 +1966,31 @@ gst_query_set_nth_allocation_param (GstQuery * query, guint index,
 }
 
 /**
+ * gst_query_remove_nth_allocation_param:
+ * @query: a GST_QUERY_ALLOCATION type query #GstQuery
+ * @index: position in the allocation param array to remove
+ *
+ * Remove the allocation param at @index of the allocation param array.
+ */
+void
+gst_query_remove_nth_allocation_param (GstQuery * query, guint index)
+{
+  GArray *array;
+  GstStructure *structure;
+
+  g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION);
+  g_return_if_fail (gst_query_is_writable (query));
+
+  structure = GST_QUERY_STRUCTURE (query);
+  array =
+      ensure_array (structure, GST_QUARK (ALLOCATOR), sizeof (AllocationParam),
+      (GDestroyNotify) allocation_param_free);
+  g_return_if_fail (index < array->len);
+
+  g_array_remove_index (array, index);
+}
+
+/**
  * gst_query_new_scheduling:
  *
  * Constructs a new query object for querying the scheduling properties.
index 8abd6f7..1f16e30 100644 (file)
@@ -411,6 +411,7 @@ void            gst_query_set_nth_allocation_pool    (GstQuery *query, guint ind
                                                       GstBufferPool *pool,
                                                       guint size, guint min_buffers,
                                                       guint max_buffers);
+void            gst_query_remove_nth_allocation_pool (GstQuery *query, guint index);
 
 /* allocators */
 void            gst_query_add_allocation_param       (GstQuery *query, GstAllocator *allocator,
@@ -422,6 +423,7 @@ void            gst_query_parse_nth_allocation_param (GstQuery *query, guint ind
 void            gst_query_set_nth_allocation_param   (GstQuery *query, guint index,
                                                       GstAllocator *allocator,
                                                       const GstAllocationParams *params);
+void            gst_query_remove_nth_allocation_param (GstQuery *query, guint index);
 
 /* metadata */
 void            gst_query_add_allocation_meta        (GstQuery *query, GType api, const GstStructure *params);
index 5582376..bb018ee 100644 (file)
@@ -908,6 +908,8 @@ EXPORTS
        gst_query_parse_segment
        gst_query_parse_uri
        gst_query_remove_nth_allocation_meta
+       gst_query_remove_nth_allocation_param
+       gst_query_remove_nth_allocation_pool
        gst_query_set_accept_caps_result
        gst_query_set_buffering_percent
        gst_query_set_buffering_range