mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static gboolean
|
||||||
gst_base_transform_set_allocation (GstBaseTransform * trans,
|
gst_base_transform_set_allocation (GstBaseTransform * trans,
|
||||||
GstBufferPool * pool, const GstMemoryAllocator * allocator, guint prefix,
|
GstBufferPool * pool, const GstMemoryAllocator * allocator, guint prefix,
|
||||||
guint alignment)
|
guint alignment)
|
||||||
|
@ -718,6 +718,12 @@ gst_base_transform_set_allocation (GstBaseTransform * trans,
|
||||||
GstBufferPool *oldpool;
|
GstBufferPool *oldpool;
|
||||||
GstBaseTransformPrivate *priv = trans->priv;
|
GstBaseTransformPrivate *priv = trans->priv;
|
||||||
|
|
||||||
|
/* activate */
|
||||||
|
if (pool) {
|
||||||
|
if (!gst_buffer_pool_set_active (pool, TRUE))
|
||||||
|
goto activate_failed;
|
||||||
|
}
|
||||||
|
|
||||||
GST_OBJECT_LOCK (trans);
|
GST_OBJECT_LOCK (trans);
|
||||||
oldpool = priv->pool;
|
oldpool = priv->pool;
|
||||||
priv->pool = pool;
|
priv->pool = pool;
|
||||||
|
@ -730,6 +736,14 @@ gst_base_transform_set_allocation (GstBaseTransform * trans,
|
||||||
gst_buffer_pool_set_active (oldpool, FALSE);
|
gst_buffer_pool_set_active (oldpool, FALSE);
|
||||||
gst_object_unref (oldpool);
|
gst_object_unref (oldpool);
|
||||||
}
|
}
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
|
activate_failed:
|
||||||
|
{
|
||||||
|
GST_ERROR_OBJECT (trans, "failed to activate bufferpool.");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
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,
|
gst_buffer_pool_config_set (config, outcaps, size, min, max, prefix,
|
||||||
alignment);
|
alignment);
|
||||||
gst_buffer_pool_set_config (pool, config);
|
gst_buffer_pool_set_config (pool, config);
|
||||||
|
|
||||||
/* activate */
|
|
||||||
if (!gst_buffer_pool_set_active (pool, TRUE))
|
|
||||||
goto activate_failed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* and store */
|
/* 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;
|
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
|
/* function triggered when the in and out caps are negotiated and need
|
||||||
|
|
Loading…
Reference in a new issue