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 739581 - basetransform: First query downstream before answering the query position
basetransform: First query downstream before answering the query position
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-03 17:34 UTC by Thibault Saunier
Modified: 2014-11-06 11:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
basetransform: First query downstream before answering the query position (1.53 KB, patch)
2014-11-03 17:34 UTC, Thibault Saunier
needs-work Details | Review
basetransform: First query downstream before answering the query position (1.52 KB, patch)
2014-11-04 10:51 UTC, Thibault Saunier
none Details | Review

Description Thibault Saunier 2014-11-03 17:34:40 UTC
Currently basetransform gives its current position right away.
When upstream elements query position, by default it should let
the sink answer the current position, and if there is a problem
doing that, answer the query itself.
Comment 1 Thibault Saunier 2014-11-03 17:34:42 UTC
Created attachment 289922 [details] [review]
basetransform: First query downstream before answering the query position
Comment 2 Sebastian Dröge (slomo) 2014-11-04 09:56:22 UTC
Review of attachment 289922 [details] [review]:

Not sure this is correct, the upstream/downstream position might be different to the position inside basesink.

::: libs/gst/base/gstbasetransform.c
@@ +1497,3 @@
       gst_query_parse_position (query, &format, NULL);
+      ret = gst_pad_peer_query (otherpad, query);
+      if (ret == FALSE && format == GST_FORMAT_TIME

Don't compare booleans by equality. if (!ret && ...)
Comment 3 Thibault Saunier 2014-11-04 10:50:47 UTC
(In reply to comment #2)
> Review of attachment 289922 [details] [review]:
> 
> Not sure this is correct, the upstream/downstream position might be different
> to the position inside basesink.

FMPOV when an upstream element send a downstream POSITION query what should be return is the position at the end of the pipeline by default, not the position of some random element is. That is what that patch is about.

> ::: libs/gst/base/gstbasetransform.c
> @@ +1497,3 @@
>        gst_query_parse_position (query, &format, NULL);
> +      ret = gst_pad_peer_query (otherpad, query);
> +      if (ret == FALSE && format == GST_FORMAT_TIME
> 
> Don't compare booleans by equality. if (!ret && ...)

FALSE being #define FALSE 0 that is the exact same thing, anyway, doing that.
Comment 4 Thibault Saunier 2014-11-04 10:51:41 UTC
Created attachment 289972 [details] [review]
basetransform: First query downstream before answering the query position

Currently basetransform gives its current position right away.
When upstream elements query position, by default it should let
the sink answer the current position, and if there is a problem
doing that, answer the query itself.
Comment 5 Sebastian Dröge (slomo) 2014-11-06 09:58:00 UTC
Should this become RESOLVED/NOTABUG according to our discussion on IRC?
Comment 6 Thibault Saunier 2014-11-06 11:20:01 UTC
Yes, closing it, the current behaviour is the expected one.