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 751235 - utils: get_compatible_pad does not fully respect filter caps
utils: get_compatible_pad does not fully respect filter caps
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal normal
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-19 19:00 UTC by Thiago Sousa Santos
Modified: 2015-06-22 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: use caps when getting a compatible pad by template (1.25 KB, patch)
2015-06-19 19:01 UTC, Thiago Sousa Santos
accepted-commit_now Details | Review
utils: use caps when getting a compatible pad by template (1.30 KB, patch)
2015-06-22 15:26 UTC, Thiago Sousa Santos
committed Details | Review
tests: gstutils: add tests for gst_element_get_compatible_pad (6.34 KB, patch)
2015-06-22 17:37 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2015-06-19 19:00:51 UTC
When trying to get a compatible pad from an element that has request pads the filter caps is not used when trying to get a pad template to request the pad. In this case it is ignored and might lead to getting a pad that is incompatible with the filter.
Comment 1 Thiago Sousa Santos 2015-06-19 19:01:51 UTC
Created attachment 305712 [details] [review]
utils: use caps when getting a compatible pad by template

Do not ignore the caps argument when requesting a pad by template.

This is particularly harmful when the pad caps query by default
returns ANY so it will match the first template instead of the
one that actually intersects with the caps.
Comment 2 Sebastian Dröge (slomo) 2015-06-22 12:17:41 UTC
Comment on attachment 305712 [details] [review]
utils: use caps when getting a compatible pad by template

That also obsoletes the FIXME then I guess?
Comment 3 Thiago Sousa Santos 2015-06-22 15:26:25 UTC
Created attachment 305836 [details] [review]
utils: use caps when getting a compatible pad by template

Ah, yes. Removed it, thanks.
Comment 4 Thiago Sousa Santos 2015-06-22 17:37:14 UTC
Created attachment 305846 [details] [review]
tests: gstutils: add tests for gst_element_get_compatible_pad

As a bonus, some unit tests
Comment 5 Thiago Sousa Santos 2015-06-22 20:22:32 UTC
Thanks for the reviews. Pushed.

commit c1a9a3424de4e6892db0fa5ff031b93502610dca
Author: Thiago Santos <thiagoss@osg.samsung.com>
Date:   Mon Jun 22 14:30:49 2015 -0300

    tests: gstutils: add tests for gst_element_get_compatible_pad
    
    Adds tests for gst_element_get_compatible_pad for when it has to
    request pads.
    
    Note that these tests don't cover the case when it has to request
    a pad that already exists.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751235

commit 1418e9e85c2a98715132764ce2c34b9e1bf179cf
Author: Thiago Santos <thiagoss@osg.samsung.com>
Date:   Fri Jun 19 15:46:56 2015 -0300

    utils: use caps when getting a compatible pad by template
    
    Do not ignore the caps argument when requesting a pad by template.
    
    This is particularly harmful when the pad caps query by default
    returns ANY so it will match the first template instead of the
    one that actually intersects with the caps.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751235