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 733320 - baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that is flushing
baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that is flushing
Status: RESOLVED OBSOLETE
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-07-17 14:25 UTC by Thibault Saunier
Modified: 2018-11-03 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that has been flushed (1.07 KB, patch)
2014-07-17 14:25 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2014-07-17 14:25:47 UTC
Another solution would be to set a dedictaed flag in PAUSED_TO_READY before linking
up so we could detect that precise case, but that patch solves the issue and sounds
correct to me.
Comment 1 Thibault Saunier 2014-07-17 14:25:49 UTC
Created attachment 281002 [details] [review]
baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that has been flushed

When going to READY, it is possible that we are still pusing a frame but that
our srcpad has already been set to flushing. In that case we should not
post any error on the bus but instead cleanly return FLOW_FLUSHING.
Comment 2 Tim-Philipp Müller 2014-07-17 14:57:34 UTC
Both that if (gst_pad_has_current_caps (pad)) check and this flushing check seem slightly weird imho.
Comment 3 Thibault Saunier 2014-07-17 15:01:24 UTC
Why do you say that? I do not think there is a check in GstPad to see if it has CAPS in its sticky event list does it?
Comment 4 Tim-Philipp Müller 2014-07-17 15:16:13 UTC
I say that because it seems weird to me from a logic point of view, I'm not bothered about the specific method used to determine whether caps are set or not.

Perhaps I don't understand the exact scenario yet where this happens. Could you provide more information?

It looks to me like this has_current_caps check is basically a check for programming errors, if it is triggered the sub-class is buggy, no?
Comment 5 Thibault Saunier 2014-07-17 15:21:40 UTC
The scenario is:

t1. gst_base_push_frame is called
t2. the parser state is set to READY, flushing the parser src pad, thus resetting its current caps
t1. gst_pad_has_current_caps is called, returning FALSE
t1. BaseParse sends an ERROR message on the bus.
Comment 7 Sebastian Dröge (slomo) 2014-07-17 15:29:15 UTC
This sounds like what the negotiate methods in the audio/video decoder base classes also try to prevent.
Comment 8 Thibault Saunier 2014-07-17 15:33:41 UTC
@Sebastian You mean here: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/video/gstvideodecoder.c#n2648 ?

Does that solution sound correct to you or do you have any other possible approach in mind?
Comment 9 Sebastian Dröge (slomo) 2014-07-17 15:44:36 UTC
I think the patch is ok, at least I have no better idea right now.
Comment 10 Thibault Saunier 2014-07-17 15:49:55 UTC
Attachment 281002 [details] pushed as 4c38895 - baseparse: Return FLOW_FLUSHING when pushing a frame on a pad that has been flushed
Comment 11 Tim-Philipp Müller 2014-07-17 15:59:38 UTC
Right, I think that's ok then too, but I'm not entirely convinced what we do in GstPad is 100% right here, clearing the caps while streaming still takes place just doesn't seem entirely right.
Comment 12 Sebastian Dröge (slomo) 2014-07-17 16:02:38 UTC
Yes, this does not look completely right. The caps should be removed while holding the stream lock, so that nothing is doing data flow anymore while the caps go away.
Comment 13 Sebastian Dröge (slomo) 2014-07-17 16:04:11 UTC
The events are removed in post_activate() in gstpad.c btw.
Comment 14 Sebastian Dröge (slomo) 2014-07-17 16:04:55 UTC
... while holding the stream *and* object lock. However that's the srcpad stream lock, while inside baseparse we're only having the sinkpad stream lock at that point.
Comment 15 Thibault Saunier 2014-07-17 16:09:18 UTC
Should we open another bug or reopen this one to do a deeper rework so we can totally avoid that situation to exist?
Comment 16 GStreamer system administrator 2018-11-03 12:21:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/65.