mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-12 09:15:29 +00:00
basesrc: Improve logging
Log when things fail. Fix a query leak.
This commit is contained in:
parent
9177367984
commit
9c67925fb7
1 changed files with 15 additions and 2 deletions
|
@ -2658,13 +2658,17 @@ gst_base_src_prepare_allocation (GstBaseSrc * basesrc, GstCaps * caps)
|
||||||
* not, if it failed, the allocation query would contain defaults and the
|
* not, if it failed, the allocation query would contain defaults and the
|
||||||
* subclass would then set better values if needed */
|
* subclass would then set better values if needed */
|
||||||
query = gst_query_new_allocation (caps, TRUE);
|
query = gst_query_new_allocation (caps, TRUE);
|
||||||
gst_pad_peer_query (basesrc->srcpad, query);
|
if (!gst_pad_peer_query (basesrc->srcpad, query)) {
|
||||||
|
/* not a problem, just debug a little */
|
||||||
|
GST_DEBUG_OBJECT (basesrc, "peer ALLOCATION query failed");
|
||||||
|
}
|
||||||
|
|
||||||
if (G_LIKELY (bclass->setup_allocation))
|
if (G_LIKELY (bclass->setup_allocation))
|
||||||
result = bclass->setup_allocation (basesrc, query);
|
result = bclass->setup_allocation (basesrc, query);
|
||||||
|
|
||||||
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
|
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
|
||||||
&alignment, &pool);
|
&alignment, &pool);
|
||||||
|
gst_query_unref (query);
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
const gchar *mem = NULL;
|
const gchar *mem = NULL;
|
||||||
|
@ -2686,12 +2690,21 @@ gst_base_src_prepare_allocation (GstBaseSrc * basesrc, GstCaps * caps)
|
||||||
alignment);
|
alignment);
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
|
|
||||||
gst_buffer_pool_set_active (pool, TRUE);
|
if (!gst_buffer_pool_set_active (pool, TRUE))
|
||||||
|
goto activate_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_base_src_set_allocation (basesrc, pool, allocator, prefix, alignment);
|
gst_base_src_set_allocation (basesrc, pool, allocator, prefix, alignment);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
activate_failed:
|
||||||
|
{
|
||||||
|
GST_ERROR_OBJECT (basesrc, "failed to activate bufferpool.");
|
||||||
|
gst_object_unref (pool);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* default negotiation code.
|
/* default negotiation code.
|
||||||
|
|
Loading…
Reference in a new issue