By using pad buffer allocs, one element can ask downstream if it wants a new caps, but it can't tell upstream to pick a new caps. This would help in dynamic pipelines and applications that do element hot-swapping, which might happen on camerabin(2).
So I started a first attempt at creating a new upstream event to make the pipeline (or a part of it) do a new caps negotiation, trying to pick optimal caps.
I had 2 basic use cases in mind:
- videotestsrc ! capsfilter name=cf ! fakesink
- videotestsrc ! capsfilter caps="
" ! ffmpegcolorspace ! videoscale ! capsfilter name=cf ! fakesink
The resulting patches were really simple and I only modified basetransform and basesrc (other than adding the new event to core). Keep in mind that I'm still experimenting and we should search for regressions that this might cause. Next I'd like to go for a scenario with elements with multiple src/sink pads (demuxer/tee/selector).
The patches are on a gstreamer branch here and the test cases were added on a branch on my -base clone.