GstClockTime position_out;
GstBufferPool *pool;
+ gboolean pool_active;
GstAllocator *allocator;
guint prefix;
guint alignment;
GstQuery *oldquery;
GstBaseTransformPrivate *priv = trans->priv;
- /* activate */
- if (pool) {
- GST_DEBUG_OBJECT (trans, "setting pool %p active", pool);
- if (!gst_buffer_pool_set_active (pool, TRUE))
- goto activate_failed;
- }
-
GST_OBJECT_LOCK (trans);
oldpool = priv->pool;
priv->pool = pool;
+ priv->pool_active = FALSE;
oldalloc = priv->allocator;
priv->allocator = allocator;
oldquery = priv->query;
}
return TRUE;
- /* ERRORS */
-activate_failed:
- {
- GST_ERROR_OBJECT (trans, "failed to activate bufferpool.");
- return FALSE;
- }
}
static gboolean
/* we can't reuse the input buffer */
if (priv->pool) {
+ if (!priv->pool_active) {
+ GST_DEBUG_OBJECT (trans, "setting pool %p active", priv->pool);
+ if (!gst_buffer_pool_set_active (priv->pool, TRUE))
+ goto activate_failed;
+ priv->pool_active = TRUE;
+ }
GST_DEBUG_OBJECT (trans, "using pool alloc");
ret = gst_buffer_pool_acquire_buffer (priv->pool, outbuf, NULL);
goto copy_meta;
return ret;
/* ERRORS */
+ /* ERRORS */
+activate_failed:
+ {
+ GST_ELEMENT_ERROR (trans, RESOURCE, SETTINGS,
+ ("failed to activate bufferpool"), ("failed to activate bufferpool"));
+ return GST_FLOW_ERROR;
+ }
unknown_size:
{
GST_ERROR_OBJECT (trans, "unknown output size");
{
gst_buffer_unref (inbuf);
*outbuf = NULL;
- GST_ELEMENT_ERROR (trans, STREAM, NOT_IMPLEMENTED,
+ GST_ELEMENT_ERROR (trans, STREAM, FORMAT,
("not negotiated"), ("not negotiated"));
return GST_FLOW_NOT_NEGOTIATED;
}