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 768526 - funnel: Always push all sticky events whenever we forward a serialized event
funnel: Always push all sticky events whenever we forward a serialized event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-07 16:43 UTC by Sebastian Dröge (slomo)
Modified: 2016-11-01 19:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
funnel: Always push all sticky events whenever we forward a serialized event (1.44 KB, patch)
2016-07-07 16:43 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2016-07-07 16:43:18 UTC
This currently breaks the unit test.

Any opinions on if this patch is correct?
Comment 1 Sebastian Dröge (slomo) 2016-07-07 16:43:22 UTC
Created attachment 331006 [details] [review]
funnel: Always push all sticky events whenever we forward a serialized event

Otherwise downstream will have an inconsistent set of sticky events at this
point, e.g. when a TAG event is pushed and downstream wants to relate it to
the stream by looking at the current STREAM_START event.
Comment 2 Olivier Crête 2016-07-07 18:02:22 UTC
I guess serialized events should indeed be treated like buffers.. Or we can not forward serialized sticky event before a buffer is received on that pad?
Comment 3 Sebastian Dröge (slomo) 2016-07-07 18:04:32 UTC
What do you mean with that? There's nothing preventing serialized events before buffers, no. Like the initial TAG events you usually see :)
Comment 4 Olivier Crête 2016-07-07 19:19:42 UTC
Funnel doesn't forward any sticky event before it gets the first buffer (or GAP event), then it forwards all sticky events. So sticky events are currently sent only for the current pad (which means that the other ones have already been forwarded when the pad was changed).

The only non-sticky serialized event we have are segment-done and flush-stop.. and flushing/seeking is a bit awkward for funnel.. It should probably implement the same logic as the aggregator if we cared about flushing and flushing seeks.

What's the goal of this patch anyway? I'd be tempted to suggest we reject it unless something breaks with the current functionality.
Comment 5 Sebastian Dröge (slomo) 2016-07-07 21:00:55 UTC
The point is to make it consistent and not just special case GAP events. If anything, GAP and other serialized events should be handled the same here.

Also the sink event function seems to forward sticky events as they arrive?
Comment 6 Olivier Crête 2016-07-08 14:53:02 UTC
Sticky events are only forwarded for the current pad:
"
 else if (pad != funnel->last_sinkpad) {
      forward = FALSE;
    }
"

So the only serialized events that are just forwarded are flush_stop and egment_done.

I'm still not sure why the current way is not right, I think we have 3 kinds of serialized things:
 - Buffers and gaps: those are forwarded immediately
 - Sticky events: They describe the surrounding buffers (and are useless on their own), so we only forward them with a gap or buffer
 - Flushes and segment_done: Those would need special handling around seeks, but I don't think anything does seeks through a funnel?
Comment 7 Sebastian Dröge (slomo) 2016-07-08 14:56:37 UTC
Indeed, I misread the sticky event handling.

The current way is not right because we forward non-sticky serialized events immediately without updating the "context" (the set of sticky events related to the stream). For GAP events this is an obvious problem (but GAP is in no way special), for custom serialized events (or any non-sticky serialized events that we might want to add later) this could very well be a problem and it just seems wrong.

Alternatively we could just drop non-sticky serialized events if they're not for the current pad, but then they're gone obviously ;)
Comment 8 Olivier Crête 2016-07-08 16:25:23 UTC
We forward sticky events before GAP events, we probably just want to replace "GST_EVENT_TYPE (event) == GST_EVENT_GAP" with "GST_EVENT_IS_SERIALIZED (event). And also do the same thing on flush-stop. ?
Comment 9 Sebastian Dröge (slomo) 2016-07-10 18:33:38 UTC
That's exactly what my patch does though :) It forwards all serialized events if the code above considers them forwardable (that is: all non-sticky serialized events and all sticky events that are considered forwardable above, and flush-stop which has forward=true).
Comment 10 Sebastian Dröge (slomo) 2016-07-25 06:11:04 UTC
Olivier, any further opinions? :)
Comment 11 Sebastian Dröge (slomo) 2016-10-20 09:59:00 UTC
Comment on attachment 331006 [details] [review]
funnel: Always push all sticky events whenever we forward a serialized event

Going to merge after 1.10
Comment 12 Sebastian Dröge (slomo) 2016-11-01 19:01:59 UTC
Attachment 331006 [details] pushed as c56e1d1 - funnel: Always push all sticky events whenever we forward a serialized event