GNOME Bugzilla – Bug 724893
playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return
Last modified: 2014-02-26 08:35:34 UTC
The following patch makes gst_play_sink_convert_bin_getcaps return: peer_caps + intersect_first (filter, converter_caps) instead of intersect_first (filter, peer_caps + converter_caps) so it preservers downstream caps preference order.
Created attachment 269922 [details] [review] playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return
Comment on attachment 269922 [details] [review] playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return This is not 100% correct yet. "converter_caps" might be bigger than the filter caps. What you need to do is to return intersect_first(filter, peer_caps) + intersect_first(filter, converter_caps) Also I think the intersection part should just be moved from the bottom inside the if (otherpad) branch and its else branch instead of adding this "apply_filter" variable.
(In reply to comment #2) > (From update of attachment 269922 [details] [review]) > This is not 100% correct yet. "converter_caps" might be bigger than the filter > caps. > > What you need to do is to return > intersect_first(filter, peer_caps) + intersect_first(filter, converter_caps) Nevermind, ignore that part. It's correct as is, the peer_caps are already filtered. But please make the code a bit clearer by moving the filtering inside the if/else blocks.
Created attachment 270101 [details] [review] playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return Patch updated. I moved the filtering part to each relevant if else blocks.
Review of attachment 270101 [details] [review]: ::: gst/playback/gstplaysinkconvertbin.c @@ +395,3 @@ + self->converter_caps, GST_CAPS_INTERSECT_FIRST); + } + ret = gst_caps_merge (peer_caps, converter_caps); Why don't you use the macro here too? @@ +406,3 @@ } else { ret = gst_caps_new_any (); + GST_PLAY_SINK_CONVERT_BIN_FILTER_CAPS (filter, ret); ret = filter ? gst_caps_ref (filter) : gst_caps_new_any ();
Created attachment 270267 [details] [review] playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return Patch updated taking into account your latest comments. Thanks for the review.
commit 5c1167a2c7eff6fb370176ae4541d4e670d65cab Author: Matthieu Bouron <matthieu.bouron@collabora.com> Date: Fri Feb 21 14:01:37 2014 +0000 playsinkconvertbin: improve gst_play_sink_convert_bin_getcaps return If we have the peer caps and a caps filter, return peer_caps + intersect_first (filter, converter_caps) instead of intersect_first (filter, peer_caps + converter_caps) and preservers downstream caps preference order. https://bugzilla.gnome.org/show_bug.cgi?id=724893