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 724828 - playbin: improve autoplug_query_caps return
playbin: improve autoplug_query_caps return
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-20 20:30 UTC by Matthieu Bouron
Modified: 2015-11-17 06:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
playbin: improve autoplug_query_caps return (1.48 KB, patch)
2014-02-20 20:31 UTC, Matthieu Bouron
needs-work Details | Review
playbin: improve autoplug_query_caps return (1.83 KB, patch)
2014-02-24 18:53 UTC, Matthieu Bouron
needs-work Details | Review
playbin: improve autoplug_query_caps return (3.16 KB, patch)
2014-02-26 12:14 UTC, Matthieu Bouron
reviewed Details | Review
playbin: improve autoplug_query_caps return (2.77 KB, patch)
2014-02-27 10:44 UTC, Matthieu Bouron
committed Details | Review

Description Matthieu Bouron 2014-02-20 20:30:09 UTC
The following patch improve the autoplug_query_caps return.
The function now returns:
  downstream_caps + intersect_first(filter_caps, element_caps)
instead of:
  intersect_first(filter_caps, downstream_caps + element_caps)
Comment 1 Matthieu Bouron 2014-02-20 20:31:51 UTC
Created attachment 269833 [details] [review]
playbin: improve autoplug_query_caps return
Comment 2 Sebastian Dröge (slomo) 2014-02-22 15:27:22 UTC
Comment on attachment 269833 [details] [review]
playbin: improve autoplug_query_caps return

Before the if (target) part, "result" is only filtered already if have_sink is TRUE. Otherwise result contains unfiltered caps from either the subtitleoverlay factories, or from the autoplug factories.
Comment 3 Matthieu Bouron 2014-02-24 18:53:49 UTC
Created attachment 270170 [details] [review]
playbin: improve autoplug_query_caps return

Patch updated. Caps are filtered is have_sink is FALSE.
Comment 4 Sebastian Dröge (slomo) 2014-02-25 09:00:28 UTC
Comment on attachment 270170 [details] [review]
playbin: improve autoplug_query_caps return

The return value of gst_subtitle_overlay_create_factory_caps() needs to be filtered too
Comment 5 Matthieu Bouron 2014-02-25 12:59:08 UTC
(In reply to comment #4)
> (From update of attachment 270170 [details] [review])
> The return value of gst_subtitle_overlay_create_factory_caps() needs to be
> filtered too

Unless I missed something, the return of
gst_subtitle_overlay_create_factory_caps() is filtered since have_sink is FALSE in this case.
Comment 6 Sebastian Dröge (slomo) 2014-02-26 08:36:54 UTC
Yes you missed something :) subcaps is merged into result directly, and the !have_sink path only merges new caps into result. result is never filtered by itself, thus the subcaps are never filtered.
Comment 7 Matthieu Bouron 2014-02-26 12:14:33 UTC
Created attachment 270377 [details] [review]
playbin: improve autoplug_query_caps return

Patch updated:

  * gst_subtitle_overlay_create_factory_caps () are now filtered before they are used or appended to result (btw, result is NULL before entering this code block)

  * when have_sink is FALSE and there is no autoplug_factories, result is now filtered

  * when have_sink is FALSE, autoplug_factories templates are now filtered individually before they are appended to result instead of filtering directly (result + autoplug_factories templates caps).

Hope it makes more sense now.
Comment 8 Sebastian Dröge (slomo) 2014-02-26 20:17:26 UTC
Review of attachment 270377 [details] [review]:

::: gst/playback/gstplaybin2.c
@@ +4697,3 @@
+
+    if (!n)
+      GST_PLAY_BIN_FILTER_CAPS (filter, result);

This does not make much sense to me. Why are you filtering "result" here? Where does result come from and why isn't the filtering done there if necessary?

Everything else looks good.
Comment 9 Matthieu Bouron 2014-02-27 10:43:28 UTC
(In reply to comment #8)
> Review of attachment 270377 [details] [review]:
> 
> ::: gst/playback/gstplaybin2.c
> @@ +4697,3 @@
> +
> +    if (!n)
> +      GST_PLAY_BIN_FILTER_CAPS (filter, result);
> 
> This does not make much sense to me. Why are you filtering "result" here? Where
> does result come from and why isn't the filtering done there if necessary?

It was in the case result hasn't been filtered before, but according to the current code result is always filtered. This part has been removed from the next update of the patch.
Comment 10 Matthieu Bouron 2014-02-27 10:44:03 UTC
Created attachment 270457 [details] [review]
playbin: improve autoplug_query_caps return
Comment 11 Sebastian Dröge (slomo) 2014-02-27 20:23:51 UTC
commit 45dfceacdb6506a001d435c94ba160389264f3dd
Author: Matthieu Bouron <matthieu.bouron@collabora.com>
Date:   Thu Feb 20 20:01:30 2014 +0000

    playbin: improve autoplug_query_caps return
    
    Makes autoplug_query_caps return
    downstream_caps + intersect_first(filter_caps, element_caps)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724828
Comment 12 Tim-Philipp Müller 2014-02-28 10:03:42 UTC
Minor nitpick regarding the commit message: it would be nice if in future you would also mention the *effect* and/or rationale/goal of the change, so people can quickly see what this is for, what it's supposed to help with, what issue this fixes.