GNOME Bugzilla – Bug 693005
capssetter: do not return a copy of sink caps upstream
Last modified: 2013-04-15 06:23:41 UTC
Created attachment 234980 [details] [review] proposed patch when capssetter is followed by a capsfilter some element that wants to do upstream caps negotiation, capssetter just passes the sink peer caps upstream, which is definitely not correct. These 2 test scenarios clarify the issue (both of which should work). # Convert bayer pattern format ## worked gst-launch-1.0 --gst-debug=capssetter:5 videotestsrc ! video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! capssetter join=false caps="video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1" replace=true ! bayer2rgb ! videoconvert ! xvimagesink # Convert bayer pattern format, with additional capsfilter (that is identical to the capssetter's output caps) ## did not work gst-launch-1.0 --gst-debug=capssetter:5 videotestsrc ! video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! capssetter join=false caps="video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1" replace=true ! video/x-bayer,format=gbrg,width=640,height=480,framerate=10/1 ! bayer2rgb ! videoconvert ! xvimagesink A possible solution is to report any caps upstream (as included in the patch). In my opinion, this is the clearest. I am not sure if this should be restricted further. I think it definitely should return 'any' in case of replace=true, yet for join=true, it might indeed make sense to return a copy of the sink peer caps upstream. And without making it too complex, I can not immediately see a solution for the case of join=false and replace=true, so my suggestion is to always return 'any' upstream regardless of join/replace (it's a debug tool, so capsfilters will work as well).
Created attachment 237995 [details] [review] pass filter caps This patch will pass the filter caps (if available), instead of always any. This way, caps are always a subset of filter caps.
commit 56062768afeba3e94d9f5e4133cf81e8642654a9 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Mar 25 10:12:03 2013 +0100 capssetter: Prevent unneeded caps copying and allocation commit 766c5b22edd13defab4c48df7a3f03b6b4abcf81 Author: Dirk Van Haerenborgh <vhdirk@gmail.com> Date: Fri Feb 1 14:33:41 2013 +0100 capssetter: Pass any or filter caps upstream capsetter accepts anything and just forwards different caps, as such it should return ANY caps on the sinkpad. https://bugzilla.gnome.org/show_bug.cgi?id=693005