After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693005 - capssetter: do not return a copy of sink caps upstream
capssetter: do not return a copy of sink caps upstream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 1.0.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-01 13:53 UTC by Dirk Van Haerenborgh
Modified: 2013-04-15 06:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.00 KB, patch)
2013-02-01 13:53 UTC, Dirk Van Haerenborgh
none Details | Review
pass filter caps (1.52 KB, patch)
2013-03-04 15:12 UTC, Dirk Van Haerenborgh
committed Details | Review

Description Dirk Van Haerenborgh 2013-02-01 13:53:37 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).
Comment 1 Dirk Van Haerenborgh 2013-03-04 15:12:28 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2013-03-25 09:12:37 UTC
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