GNOME Bugzilla – Bug 749445
[patchset] Fix capabilities verification and unit tests as result
Last modified: 2015-05-15 22:08:26 UTC
Created attachment 303437 [details] Patch-set and unit tests results Hello, I'm a new in GStreamer, so sorry if my patch-set is because of my wrong understanding of ideas. During integration GS into some custom embedded system I observe some pipelines are not working for me. After some investigation I realized 'caps' comparison is not always success. I observe 'is_subset()' procedure is not working well (if I understood main idea correctly). I fixed it and this led to some unit tests ware failed. I fixed them as well since (i think) they were wrong as well. Please check the patches and let me know your comments. Sincerely, Volodymyr.
Created attachment 303438 [details] [review] 0001-Fix-condition-verification-for-subset-check.patch
Created attachment 303439 [details] [review] 0002-structure-Improve-fix-is_subset-verification.patch
Created attachment 303441 [details] [review] 0003-tests-caps-Add-check-for-basic-gst_caps_is_subset-ca.patch
Created attachment 303442 [details] [review] 0004-tests-caps-Fix-test_subset-case.patch
Created attachment 303443 [details] [review] 0005-tests-caps-Fix-test_merge_subset-case.patch
Created attachment 303444 [details] [review] 0006-tests-caps-Fix-test_merge_subset-case.patch
Created attachment 303445 [details] [review] 0007-tests-elementfactory-Fix-test_can_sink_all_caps-case.patch
Created attachment 303446 [details] [review] 0008-caps-Simple-improvement-in-search-precedure.patch
Created attachment 303447 [details] Unit tests results
Review of attachment 303438 [details] [review]: ::: gst/gststructure.c @@ +3339,3 @@ { if ((superset->name != subset->name) || + (gst_structure_n_fields (superset) < gst_structure_n_fields (subset))) This change is not correct. The superset has to contain less or equal fields than the subset. This is because if a field is missing, it is assumed that any possible value for that field would be possible. So for every field that is in the (potential) subset and not in the superset, the subset check would succeed.
Review of attachment 303441 [details] [review]: ::: tests/check/gst/gstcaps.c @@ +295,3 @@ + c2 = gst_caps_from_string ("video/x-raw, format=(string)YUY2"); + fail_unless (gst_caps_is_subset (c2, c1)); + fail_if (gst_caps_is_subset (c1, c2)); And this here is exactly such an example: c1 is a subset of c2, but c2 is not a subset of c1. c2 has no alignment field, which means that the alignment field can have any possible value and thus covers *more* possible caps than c1, which only allows a single value for the alignment field.
Thanks for your patches and the analysis, but I think this is a misunderstanding of how caps work. If you can give some further details about how this causes problems for you, we should be able to give you some ideas how to solve your use cases :)
See also http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-caps.txt for details about how the caps operations are defined