Commit b56bef14 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

basetransform: Always call ::propose_allocation vfunc

And only forward the allocation query if we're working in
passthrough mode if no ::propose_allocation is implemented.
In place buffer transformations will change the buffer
content and require explicit handling of all metas.
parent 0d2adf5a
...@@ -1317,19 +1317,18 @@ gst_base_transform_default_query (GstBaseTransform * trans, ...@@ -1317,19 +1317,18 @@ gst_base_transform_default_query (GstBaseTransform * trans,
goto done; goto done;
GST_BASE_TRANSFORM_LOCK (trans); GST_BASE_TRANSFORM_LOCK (trans);
passthrough = trans->passthrough || trans->always_in_place; passthrough = trans->passthrough;
GST_BASE_TRANSFORM_UNLOCK (trans); GST_BASE_TRANSFORM_UNLOCK (trans);
if (passthrough) { GST_DEBUG_OBJECT (trans, "propose allocation values");
/* pass the query to the propose_allocation vmethod if any */
if (G_LIKELY (klass->propose_allocation)) {
ret = klass->propose_allocation (trans, query);
} else if (passthrough) {
GST_DEBUG_OBJECT (trans, "doing passthrough query"); GST_DEBUG_OBJECT (trans, "doing passthrough query");
ret = gst_pad_peer_query (otherpad, query); ret = gst_pad_peer_query (otherpad, query);
} else { } else {
GST_DEBUG_OBJECT (trans, "propose allocation values"); ret = FALSE;
/* pass the query to the propose_allocation vmethod if any */
if (G_LIKELY (klass->propose_allocation))
ret = klass->propose_allocation (trans, query);
else
ret = FALSE;
} }
GST_DEBUG_OBJECT (trans, "ALLOCATION ret %d, %" GST_PTR_FORMAT, ret, GST_DEBUG_OBJECT (trans, "ALLOCATION ret %d, %" GST_PTR_FORMAT, ret,
query); query);
......
...@@ -159,8 +159,8 @@ struct _GstBaseTransform { ...@@ -159,8 +159,8 @@ struct _GstBaseTransform {
* should must chain up to the parent if they didn't handle the * should must chain up to the parent if they didn't handle the
* query * query
* @propose_allocation: Propose buffer allocation parameters for upstream elements. * @propose_allocation: Propose buffer allocation parameters for upstream elements.
* This function is only called when not operating in * This function must be implemented if the element reads or
* passthrough mode. The default implementation is NULL. * writes the buffer content. The default implementation is NULL.
* @decide_allocation: Setup the allocation parameters for allocating output * @decide_allocation: Setup the allocation parameters for allocating output
* buffers. The passed in query contains the result of the * buffers. The passed in query contains the result of the
* downstream allocation query. This function is only called * downstream allocation query. This function is only called
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment