mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 22:16:22 +00:00
query: make find_allocation_meta method
Make gst_query_find_allocation_meta() that also return the index of the metadata and replaces gst_query_has_allocation_meta().
This commit is contained in:
parent
8173622844
commit
8bca7537e6
3 changed files with 12 additions and 6 deletions
|
@ -2245,7 +2245,7 @@ gst_query_add_allocation_meta
|
|||
gst_query_get_n_allocation_metas
|
||||
gst_query_parse_nth_allocation_meta
|
||||
gst_query_remove_nth_allocation_meta
|
||||
gst_query_has_allocation_meta
|
||||
gst_query_find_allocation_meta
|
||||
|
||||
GstSchedulingFlags
|
||||
gst_query_new_scheduling
|
||||
|
|
|
@ -1777,16 +1777,19 @@ gst_query_remove_nth_allocation_meta (GstQuery * query, guint index)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_query_has_allocation_meta:
|
||||
* gst_query_find_allocation_meta:
|
||||
* @query: a GST_QUERY_ALLOCATION type query #GstQuery
|
||||
* @api: the metadata API
|
||||
* @index: (out) (allow-none): the index
|
||||
*
|
||||
* Check if @query has metadata @api set.
|
||||
* Check if @query has metadata @api set. When this function returns TRUE,
|
||||
* @index will contain the index where the requested API and the flags can be
|
||||
* found.
|
||||
*
|
||||
* Returns: TRUE when @api is in the list of metadata.
|
||||
*/
|
||||
gboolean
|
||||
gst_query_has_allocation_meta (GstQuery * query, GType api)
|
||||
gst_query_find_allocation_meta (GstQuery * query, GType api, guint * index)
|
||||
{
|
||||
GArray *array;
|
||||
GstStructure *structure;
|
||||
|
@ -1802,9 +1805,12 @@ gst_query_has_allocation_meta (GstQuery * query, GType api)
|
|||
len = array->len;
|
||||
for (i = 0; i < len; i++) {
|
||||
AllocationMeta *am = &g_array_index (array, AllocationMeta, i);
|
||||
if (am->api == api)
|
||||
if (am->api == api) {
|
||||
if (index)
|
||||
*index = i;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ void gst_query_add_allocation_meta (GstQuery *query, GType api
|
|||
guint gst_query_get_n_allocation_metas (GstQuery *query);
|
||||
GType gst_query_parse_nth_allocation_meta (GstQuery *query, guint index, guint *flags);
|
||||
void gst_query_remove_nth_allocation_meta (GstQuery *query, guint index);
|
||||
gboolean gst_query_has_allocation_meta (GstQuery *query, GType api);
|
||||
gboolean gst_query_find_allocation_meta (GstQuery *query, GType api, guint *index);
|
||||
|
||||
|
||||
/* scheduling query */
|
||||
|
|
Loading…
Reference in a new issue