mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
basetransform: activate the bufferpool
always activate the bufferpool, even if we get it from the allocation query.
This commit is contained in:
parent
fc5b0b09da
commit
69409f1ec8
1 changed files with 18 additions and 14 deletions
|
@ -710,7 +710,7 @@ done:
|
|||
return caps;
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
gst_base_transform_set_allocation (GstBaseTransform * trans,
|
||||
GstBufferPool * pool, const GstMemoryAllocator * allocator, guint prefix,
|
||||
guint alignment)
|
||||
|
@ -718,6 +718,12 @@ gst_base_transform_set_allocation (GstBaseTransform * trans,
|
|||
GstBufferPool *oldpool;
|
||||
GstBaseTransformPrivate *priv = trans->priv;
|
||||
|
||||
/* activate */
|
||||
if (pool) {
|
||||
if (!gst_buffer_pool_set_active (pool, TRUE))
|
||||
goto activate_failed;
|
||||
}
|
||||
|
||||
GST_OBJECT_LOCK (trans);
|
||||
oldpool = priv->pool;
|
||||
priv->pool = pool;
|
||||
|
@ -730,6 +736,14 @@ gst_base_transform_set_allocation (GstBaseTransform * trans,
|
|||
gst_buffer_pool_set_active (oldpool, FALSE);
|
||||
gst_object_unref (oldpool);
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
/* ERRORS */
|
||||
activate_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (trans, "failed to activate bufferpool.");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -801,24 +815,14 @@ gst_base_transform_do_bufferpool (GstBaseTransform * trans, GstCaps * outcaps)
|
|||
gst_buffer_pool_config_set (config, outcaps, size, min, max, prefix,
|
||||
alignment);
|
||||
gst_buffer_pool_set_config (pool, config);
|
||||
|
||||
/* activate */
|
||||
if (!gst_buffer_pool_set_active (pool, TRUE))
|
||||
goto activate_failed;
|
||||
}
|
||||
|
||||
/* and store */
|
||||
gst_base_transform_set_allocation (trans, pool, allocator, prefix, alignment);
|
||||
result =
|
||||
gst_base_transform_set_allocation (trans, pool, allocator, prefix,
|
||||
alignment);
|
||||
|
||||
return result;
|
||||
|
||||
/* ERRORS */
|
||||
activate_failed:
|
||||
{
|
||||
GST_ERROR_OBJECT (trans, "failed to activate bufferpool.");
|
||||
gst_object_unref (pool);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* function triggered when the in and out caps are negotiated and need
|
||||
|
|
Loading…
Reference in a new issue