mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
query: copy structure in _add_allocation_meta()
Make gst_query_add_allocation_meta() take a copy of the passed caps instead of taking ownership. This makes it easier for the caller in most cases because it doesn't have to make a copy and deal with NULL values.
This commit is contained in:
parent
77bc2170f8
commit
82eb275ef9
3 changed files with 5 additions and 5 deletions
|
@ -1675,13 +1675,13 @@ allocation_meta_free (AllocationMeta * am)
|
||||||
* gst_query_add_allocation_meta:
|
* gst_query_add_allocation_meta:
|
||||||
* @query: a GST_QUERY_ALLOCATION type query #GstQuery
|
* @query: a GST_QUERY_ALLOCATION type query #GstQuery
|
||||||
* @api: the metadata API
|
* @api: the metadata API
|
||||||
* @params: (transfer full) (allow-none): API specific parameters
|
* @params: (transfer none) (allow-none): API specific parameters
|
||||||
*
|
*
|
||||||
* Add @api with @params as one of the supported metadata API to @query.
|
* Add @api with @params as one of the supported metadata API to @query.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
gst_query_add_allocation_meta (GstQuery * query, GType api,
|
gst_query_add_allocation_meta (GstQuery * query, GType api,
|
||||||
GstStructure * params)
|
const GstStructure * params)
|
||||||
{
|
{
|
||||||
GArray *array;
|
GArray *array;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
@ -1697,7 +1697,7 @@ gst_query_add_allocation_meta (GstQuery * query, GType api,
|
||||||
(GDestroyNotify) allocation_meta_free);
|
(GDestroyNotify) allocation_meta_free);
|
||||||
|
|
||||||
am.api = api;
|
am.api = api;
|
||||||
am.params = params;
|
am.params = (params ? gst_structure_copy (params) : NULL);
|
||||||
|
|
||||||
g_array_append_val (array, am);
|
g_array_append_val (array, am);
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,7 +428,7 @@ void gst_query_set_nth_allocation_param (GstQuery *query, guint ind
|
||||||
const GstAllocationParams *params);
|
const GstAllocationParams *params);
|
||||||
|
|
||||||
/* metadata */
|
/* metadata */
|
||||||
void gst_query_add_allocation_meta (GstQuery *query, GType api, GstStructure *params);
|
void gst_query_add_allocation_meta (GstQuery *query, GType api, const GstStructure *params);
|
||||||
guint gst_query_get_n_allocation_metas (GstQuery *query);
|
guint gst_query_get_n_allocation_metas (GstQuery *query);
|
||||||
GType gst_query_parse_nth_allocation_meta (GstQuery *query, guint index,
|
GType gst_query_parse_nth_allocation_meta (GstQuery *query, guint index,
|
||||||
const GstStructure **params);
|
const GstStructure **params);
|
||||||
|
|
|
@ -1373,7 +1373,7 @@ gst_base_transform_default_propose_allocation (GstBaseTransform * trans,
|
||||||
|
|
||||||
api = gst_query_parse_nth_allocation_meta (decide_query, i, ¶ms);
|
api = gst_query_parse_nth_allocation_meta (decide_query, i, ¶ms);
|
||||||
GST_DEBUG_OBJECT (trans, "proposing metadata %s", g_type_name (api));
|
GST_DEBUG_OBJECT (trans, "proposing metadata %s", g_type_name (api));
|
||||||
gst_query_add_allocation_meta (query, api, gst_structure_copy (params));
|
gst_query_add_allocation_meta (query, api, params);
|
||||||
}
|
}
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue