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 775786 - gst_structure_is_subset() conflicts with the design docs
gst_structure_is_subset() conflicts with the design docs
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: documentation
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-08 03:09 UTC by Matthew Waters (ystreet00)
Modified: 2016-12-08 09:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Waters (ystreet00) 2016-12-08 03:09:01 UTC
The design docs say that the superset can contain extra fields that are not in the subset (which makes sense from a mathematics point of view).  The API docs and implementation don't allow this.

i.e.

gst_structure_is_subset (SUBSET: "test/test, channels=(int)1",
    SUPERSET: "test/test, channels=(int)1, rate=(int)1")
returns FALSE.

The implementation also allows the subset to contain extra fields not in the superset.

gst_structure_is_subset (SUBSET: "test/test, channels=(int)1, rate=(int)1",
    SUPERSET: "test/test, channels=(int)1")
returns TRUE.

The only condition I could think of where this makes sense is that no field means any value rather than no value in which case the design docs need updating.
Comment 1 Olivier Crête 2016-12-08 03:22:59 UTC
The code is right, the design docs are wrong. You have to think of it in terms of what caps the structure defines. (so A=channels=1,rate=1 is a subset of B=channels=1 because the B is also compatible with C=channels=1,rate=2 while A isn't).
Comment 2 Matthew Waters (ystreet00) 2016-12-08 04:22:21 UTC
Right, so the no field = ANY case above.
Comment 3 Sebastian Dröge (slomo) 2016-12-08 05:54:54 UTC
Yes, a missing field is as if the field exists and has every possible value. With the difference that no field is fixed, while an e.g. array or range is not.

Can you fix up the design docs?
Comment 4 Matthew Waters (ystreet00) 2016-12-08 09:26:25 UTC
commit a3fe9f6a7df6a870a6f7bf94a94631a28b3d9d00
Author: Matthew Waters <matthew@centricular.com>
Date:   Thu Dec 8 20:22:53 2016 +1100

    design/caps: fix and clarify subset operations with empty fields
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775786