GNOME Bugzilla – Bug 361718
[basetransform] needs API to force renegotiation
Last modified: 2008-08-20 11:38:53 UTC
Basetransform should have API for sub-classes to force caps renegotiation. This is necessary if caps depend on properties and those properties are changed while the pipeline is running. Examples: - videocrop / videobox - capsfilter
Created attachment 74583 [details] [review] first attempt, adds gst_base_transform_clear_negotiated_caps() First attempt at a patch, not entirely sure about the locking order though.
The patch doesn't really solve the problem though, which is that there's raciness going on between upstream doing pad_alloc_buffer(), doing something with the buffer and pushing the buffer downstream. If in between these things a property is changed (from the main thread), upstream might get a not-negotiated and the pipeline errors out. So, dunno what to do. I somehow feel the application shouldn't need to worry about things like this. (removing block on videocrop bug since this has nothing to do with videocrop in particular and applies to videobox and capsfilter as well).
I wonder which flowresult the upstream element is getting in this case and if we could not make it be GST_FLOW_RESEND. This need that gst_pad_push sort of knows about the caps change. RESEND is also not alays easy to do. In my case there are audioconvert elements which could renegotiate and reconvert the current buffer. But its probably easier to drop the buffer and send flag the next DISCONT.
*** Bug 535035 has been marked as a duplicate of this bug. ***
new basetransform has suggest_caps() for triggering an upstream renegotiation.
Support for both renegotiation methods is added now. * docs/libs/gstreamer-libs-sections.txt: * libs/gst/base/gstbasetransform.c: (gst_base_transform_handle_buffer), (gst_base_transform_getrange), (gst_base_transform_chain), (gst_base_transform_suggest), (gst_base_transform_reconfigure): * libs/gst/base/gstbasetransform.h: Implement method for reconfiguring basetransform. API: GstBaseTransform::gst_base_transform_reconfigure()