query: Add new API to remove allocation params and pools from the allocation query

This commit is contained in:
Sebastian Dröge 2013-02-25 13:57:43 +01:00
parent e460be622d
commit 008b35f6ae
4 changed files with 56 additions and 0 deletions

View 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

View 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;
@ -1940,6 +1965,31 @@ gst_query_set_nth_allocation_param (GstQuery * query, guint index,
g_array_index (array, AllocationParam, index) = ap;
}
/**
* 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:
*

View 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);

View 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