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 147931 - GstArray subtraction not implemented
GstArray subtraction not implemented
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-07-19 22:20 UTC by David Schleef
Modified: 2018-11-03 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.32 KB, patch)
2004-07-19 22:22 UTC, David Schleef
committed Details | Review
Patch to test substraction of fixed lists (fails) (978 bytes, patch)
2004-07-20 10:41 UTC, Benjamin Otte (Company)
reviewed Details | Review

Description David Schleef 2004-07-19 22:20:26 UTC
test in patch fails.
Comment 1 David Schleef 2004-07-19 22:22:44 UTC
Created attachment 29672 [details] [review]
patch
Comment 2 Benjamin Otte (Company) 2004-07-20 10:25:38 UTC
Hehe, I bet subtractions don't work either.
Nobody bothered to write intersection or subtraction functions for "fixed lists".
So it takes the standard approach of comparing and deciding based on that.

I'm also wondering if gst_caps_is_fixed works correctly for arrays.
Comment 3 Benjamin Otte (Company) 2004-07-20 10:39:54 UTC
After looking at our is_fixed API, it looks like the API is not up to what is
needed in this case, because gst_type_is_fixed (GST_TYPE_FIXED_LIST) cannot be
said to be TRUE or FALSE before looking at the value, since an array is fixed,
when all its entries are fixed and not fixed otherwise.

I'm changing the topic to reflect these other problems.
Comment 4 Benjamin Otte (Company) 2004-07-20 10:41:53 UTC
Created attachment 29686 [details] [review]
Patch to test substraction of fixed lists (fails)
Comment 5 Ronald Bultje 2004-07-20 20:34:36 UTC
Intersection works now. I didn't implement subtraction (minus s, Benjamin ;) ).
Any mathematical mind, feel free to implement that.
Comment 6 Ronald Bultje 2005-03-12 23:28:55 UTC
Also, I implemented the gst_value_is_fixed() function and deprecated
gst_type_is_fixed(). With that, Benjamin's subtraction should be easy to
implement. Changing topic to reflect new situation.
Comment 7 Ronald Bultje 2005-03-25 19:16:45 UTC
Marking patches as they don't address the actual issue.
Comment 8 Andy Wingo 2005-11-14 10:16:07 UTC
Removing [api] from the summary, as no api is actually required.
Comment 9 Andy Wingo 2005-11-14 10:29:50 UTC
GstFixedList -> GstArray
Comment 10 Sebastian Dröge (slomo) 2008-05-17 10:11:41 UTC
Is this still valid?
Comment 11 Sebastian Dröge (slomo) 2008-05-18 12:07:26 UTC
Ok, so this is probably fixed now as the test doesn't fail anymore:

        * tests/check/gst/gstcaps.c: (test_intersect2), (gst_caps_suite):
          Add David's and Benjamin's tests for array subtraction to the
          unit test suite, which suggests that #147931 is fixed these days.


Please reopen otherwise.
Comment 12 Tim-Philipp Müller 2008-05-18 12:11:20 UTC
Actually, the way I read it is that the intersection in the tests works now (it does, I checked), but according to comments 5 through 7 these tests don't cover subtraction, so I guess someone needs to come up with some test cases for subtraction, whatever that means in this case (do we actually need that for anything?)
Comment 13 Tim-Philipp Müller 2008-05-22 08:11:36 UTC
Re-opening, since I don't think it's actually fixed. (We may want to WONTFIX it though if no one can think of a use case for this).
Comment 14 Sebastian Dröge (slomo) 2008-06-03 20:30:42 UTC
Ok, I guess I found a case where it still doesn't work correctly...

  c2 = gst_caps_from_string ("audio/x-raw-int,channels=1;audio/x-raw-int,channels=2");
  c1 = gst_caps_from_string ("audio/x-raw-int,channels=[1,2]");
  gst_caps_merge (c2, c1);
  GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2);
  fail_unless (gst_caps_get_size (c2) == 2, NULL);
  gst_caps_unref (c2);



This can be fixed by using simplified caps for checking if a structure is a subset of caps in gst_caps_merge_structure() but this will make negotiation even slower than it already is.
Comment 15 Edward Hervey 2013-07-18 05:02:44 UTC
(In reply to comment #14)
> Ok, I guess I found a case where it still doesn't work correctly...
> 
>   c2 = gst_caps_from_string
> ("audio/x-raw-int,channels=1;audio/x-raw-int,channels=2");
>   c1 = gst_caps_from_string ("audio/x-raw-int,channels=[1,2]");
>   gst_caps_merge (c2, c1);

  This results in "audio/x-raw-int,channels=[1,2]" ... which sounds correct to me.

  Why is this considered wrong ?

>   GST_DEBUG ("merged: (%d) %" GST_PTR_FORMAT, gst_caps_get_size (c2), c2);
>   fail_unless (gst_caps_get_size (c2) == 2, NULL);
>   gst_caps_unref (c2);
> 
> 
> 
> This can be fixed by using simplified caps for checking if a structure is a
> subset of caps in gst_caps_merge_structure() but this will make negotiation
> even slower than it already is.
Comment 16 Sebastian Dröge (slomo) 2013-07-18 09:03:13 UTC
Well, merge("channels=1;channels=2", "channels=[1,2]") should return "channels=1;channels=[1,2]" or "channels=1;channels=2" (which are equivalent). Merge should keep the preferences and order, which in this case means: Prefer 1 channel, otherwise I can also do 2 channels.
Comment 17 GStreamer system administrator 2018-11-03 12:11:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/1.