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

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Apr 28 03:02:00 PDT 2010


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

--- Comment #9 from Benjamin Otte (Company) <otte at gnome.org> 2010-04-28 10:01:56 UTC ---
(In reply to comment #7)
>   That one is trivial, create caps with your format, result =
> gst_caps_merge(yourformats, theothers).

(This is off-topic now, but anyway):
I want a function that can reorder caps like these:
  video/x-raw-yuv,width=20; video/x-cairo,width=20; video/x-raw-rgb,width=20;
to:
  video/x-cairo,width=20; video/x-raw-yuv,width=20; video/x-raw-rgb,width=20;
with a function that I can tell something like "I prefer video/x-cairo to
anything else".

The current way I do that is roughly like this:
ordered = gst_caps_intersect (caps, my_preferred_caps);
if (ordered == NULL)
  return caps;
gst_caps_append (ordered, caps);
return ordered;
but this only works for one level of preference. It also results in duplicated
structures, as this code will return for the above example:
  video/x-cairo,width=20; video/x-raw-yuv,width=20; video/x-cairo,width=20;
video/x-raw-rgb,width=20;

-- 
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