[gstreamer-bugs] [Bug 617045] [caps] New method for intersecting caps while retaining order

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Apr 28 01:16:35 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=617045
  GStreamer | gstreamer (core) | git

--- Comment #7 from Edward Hervey <bilboed at gmail.com> 2010-04-28 08:16:30 UTC ---
(In reply to comment #6)
> Shouldn't that intersecting with the template be removed? Isn't it a bug to
> return caps that are not a subset of the template caps?

  You'd be amazed by the number of filters that don't obey that rule :( And
yes, that check should be removed since gst_pad_get_caps() will check/filter
the caps itself. The problem is that that code does it gracefully, whereas
gst_pad_get_caps spurts out errors and g_warning assertions.

(In reply to comment #5)
> I dislike the name because it implies that gst_caps_intersect() does not sort
> the caps. 
> 
> I'm also wondering if it would make sense to instead:
> 
> - Change gst_caps_intersect() to sort like your gst_caps_intersect_sorted()
> Would that change the current API too much?

  The zig-zagging comes from the very first 0.9 commit that introduced that
method. Wim should have his word on this. I guess there's a reason behind it.
The other problem is that it is going to check the order of the outputted caps,
so we might see some hidden side effects (like going from going from a result
that was mostly sorted for the callee to something that is not at all sorted as
the callee would expect (because of the ordering of arguments).

> 
> - Have a gst_caps_reorder (GstCaps *caps, GstCaps *order) function that does
> sort caps according to a specific order.
> I'm asking because there's a lot of places where elements would be happy if
> there was an easy way to reorder caps. Examples are getcaps()ing on filters
> that want to prefer passthrough or my hw-accelerated converters that want to
> prefer hw-accelerated formats.
> So I think having something like gst_caps_reorder (caps, gst_caps_from_string
> ("favorite/format; *")); would be very useful.

  That one is trivial, create caps with your format, result =
gst_caps_merge(yourformats, theothers).

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list