When setting BaseTransform to passthrough mode, and with transform_ip_on_passthrough set, the documentation states:
gboolean transform_ip_on_passthrough;
If set to TRUE, transform_ip will be called in passthrough mode. The passed buffer might not be writable. When FALSE, neither transform nor transform_ip will be called in passthrough mode. Set to TRUE by default.
What would cause a buffer to be not writable in passthrough mode vs when passthrough mode is off? Does gstreamer do anything differently when calling transform_ip when in passthrough mode vs when passthrough mode is off?
I have some custom elements I have written which are not running with passthrough mode on that could be & I am wondering if there are any benefits to fixing them to have it enabled.
Thank you for any insight you might be able to provide.
/* now perform the needed transform */
if (priv->passthrough) {
/* In passthrough mode, give transform_ip a look at the
* buffer, without making it writable, or just push the
* data through */
if (bclass->transform_ip_on_passthrough && bclass->transform_ip) {
GST_DEBUG_OBJECT (trans, "doing passthrough transform_ip");
ret = bclass->transform_ip (trans, *outbuf);
} else {
GST_DEBUG_OBJECT (trans, "element is in passthrough");
}
} else {
want_in_place = (bclass->transform_ip != NULL) && priv->always_in_place;
if (want_in_place) {
GST_DEBUG_OBJECT (trans, "doing inplace transform");
ret = bclass->transform_ip (trans, *outbuf);
} else {
GST_DEBUG_OBJECT (trans, "doing non-inplace transform");
if (bclass->transform)
ret = bclass->transform (trans, inbuf, *outbuf);
else
ret = GST_FLOW_NOT_SUPPORTED;
}
}
As far as I can tell, it does not handle the passthrough transform_ip and non-passthrough transform_ip cases differently. The only thing I don’t totally understand is the comment, as it states:
In passthrough mode, give transform_ip a look at the buffer, without making it writable
But as far as I can tell, we haven’t done anything to make the buffer “writeable” in the case where we are not operating in passthrough mode & are in the want_in_place case.
Is there any the difference in behavior here I am not seeing / understanding?