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 709868 - Keep still meaningful pending events on FLUSH_STOP
Keep still meaningful pending events on FLUSH_STOP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 1.4.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 709867 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-10 21:51 UTC by Thibault Saunier
Modified: 2014-11-17 10:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audioencoder: Keep still meaningfull pending events on FLUSH_STOP (1.79 KB, patch)
2013-10-10 21:51 UTC, Thibault Saunier
none Details | Review
audioencoder: Keep still meaningfull pending events on FLUSH_STOP (1.79 KB, patch)
2013-10-10 22:59 UTC, Thibault Saunier
accepted-commit_now Details | Review
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP (2.55 KB, patch)
2013-10-14 22:01 UTC, Thibault Saunier
none Details | Review
videoencoder: Keep still meaningfull pending events on FLUSH_STOP (1.94 KB, patch)
2013-10-14 22:01 UTC, Thibault Saunier
needs-work Details | Review
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.85 KB, patch)
2013-10-14 22:01 UTC, Thibault Saunier
needs-work Details | Review
videodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.76 KB, patch)
2013-10-14 22:01 UTC, Thibault Saunier
needs-work Details | Review
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP (2.50 KB, patch)
2013-10-14 22:04 UTC, Thibault Saunier
needs-work Details | Review
audioencoder: Keep still meaningfull pending events on FLUSH_STOP (1.86 KB, patch)
2013-10-14 22:05 UTC, Thibault Saunier
needs-work Details | Review
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP (2.55 KB, patch)
2013-10-15 15:31 UTC, Thibault Saunier
none Details | Review
videoencoder: Keep still meaningfull pending events on FLUSH_STOP (2.48 KB, patch)
2013-10-15 15:31 UTC, Thibault Saunier
none Details | Review
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.90 KB, patch)
2013-10-15 15:31 UTC, Thibault Saunier
none Details | Review
videodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.97 KB, patch)
2013-10-15 15:31 UTC, Thibault Saunier
none Details | Review
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP (2.55 KB, patch)
2014-02-04 11:58 UTC, Thibault Saunier
none Details | Review
videoencoder: Keep still meaningfull pending events on FLUSH_STOP (2.47 KB, patch)
2014-02-04 11:58 UTC, Thibault Saunier
none Details | Review
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.81 KB, patch)
2014-02-04 11:58 UTC, Thibault Saunier
none Details | Review
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.81 KB, patch)
2014-02-04 12:00 UTC, Thibault Saunier
none Details | Review
videodecoder: Keep still meaningfull pending events on FLUSH_STOP (1.97 KB, patch)
2014-02-04 12:00 UTC, Thibault Saunier
none Details | Review
audioencoder: Keep still meaningfull pending events on FLUSH_STOP (1.90 KB, patch)
2014-02-04 12:02 UTC, Thibault Saunier
none Details | Review
audioencoder: Keep still meaningfull pending events on FLUSH_STOP (5.38 KB, patch)
2014-05-27 11:21 UTC, Thibault Saunier
committed Details | Review
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP (2.54 KB, patch)
2014-05-27 11:22 UTC, Thibault Saunier
committed Details | Review
videoencoder: Keep still meaningfull pending events on FLUSH_STOP (5.89 KB, patch)
2014-05-27 11:22 UTC, Thibault Saunier
committed Details | Review
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP (5.40 KB, patch)
2014-05-27 11:22 UTC, Thibault Saunier
committed Details | Review
videodecoder: Keep still meaningfull pending events on FLUSH_STOP (5.51 KB, patch)
2014-05-27 11:22 UTC, Thibault Saunier
committed Details | Review
capsfilter: Keep still meaningfull pending events on FLUSH_STOP (1.99 KB, patch)
2014-06-03 12:32 UTC, Thibault Saunier
needs-work Details | Review
capsfilter: Remove EOS event from pending_event list on FLUSH_STOP (1.03 KB, patch)
2014-09-23 14:22 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2013-10-10 21:51:28 UTC
Only EOS and segment should be deleted in that case.
Comment 1 Thibault Saunier 2013-10-10 21:51:31 UTC
Created attachment 256954 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP
Comment 2 Thibault Saunier 2013-10-10 22:59:42 UTC
Created attachment 256958 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 3 Sebastian Dröge (slomo) 2013-10-14 20:18:03 UTC
Probably also applies to videoencoder, audiodecoder and videoencoder
Comment 4 Sebastian Dröge (slomo) 2013-10-14 20:21:26 UTC
Review of attachment 256958 [details] [review]:

Same comments as for the streamsplitter commit
Comment 5 Thibault Saunier 2013-10-14 22:01:37 UTC
Created attachment 257310 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=709867
Comment 6 Thibault Saunier 2013-10-14 22:01:43 UTC
Created attachment 257311 [details] [review]
videoencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 7 Thibault Saunier 2013-10-14 22:01:49 UTC
Created attachment 257312 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 8 Thibault Saunier 2013-10-14 22:01:55 UTC
Created attachment 257313 [details] [review]
videodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 9 Thibault Saunier 2013-10-14 22:03:16 UTC
*** Bug 709867 has been marked as a duplicate of this bug. ***
Comment 10 Thibault Saunier 2013-10-14 22:04:32 UTC
Created attachment 257314 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 11 Thibault Saunier 2013-10-14 22:05:47 UTC
Created attachment 257315 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 12 Sebastian Dröge (slomo) 2013-10-15 07:43:22 UTC
Review of attachment 257311 [details] [review]:

::: gst-libs/gst/video/gstvideoencoder.c
@@ +363,3 @@
+    }
+    g_list_free (priv->current_frame_events);
+    priv->current_frame_events = NULL;

You also need to check the pending events of all previous frames and handle them. There might be queued frames that have some sticky events.
Comment 13 Sebastian Dröge (slomo) 2013-10-15 07:43:54 UTC
Comment on attachment 257313 [details] [review]
videodecoder: Keep still meaningfull pending events on FLUSH_STOP

same as for the encoder
Comment 14 Sebastian Dröge (slomo) 2013-10-15 07:45:10 UTC
Comment on attachment 257312 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

These could also contain non-sticky events.

Also you forget to actually free the GList
Comment 15 Sebastian Dröge (slomo) 2013-10-15 07:45:22 UTC
Comment on attachment 257315 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP

same as for the decoder
Comment 16 Sebastian Dröge (slomo) 2013-10-15 07:46:35 UTC
Comment on attachment 257314 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

This could also contain other non-sticky events
Comment 17 Thibault Saunier 2013-10-15 15:31:32 UTC
Created attachment 257354 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 18 Thibault Saunier 2013-10-15 15:31:37 UTC
Created attachment 257355 [details] [review]
videoencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 19 Thibault Saunier 2013-10-15 15:31:44 UTC
Created attachment 257356 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 20 Thibault Saunier 2013-10-15 15:31:49 UTC
Created attachment 257357 [details] [review]
videodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 21 Sebastian Dröge (slomo) 2014-01-14 19:17:45 UTC
Thibault, what's the status of this?
Comment 22 Thibault Saunier 2014-01-15 11:21:26 UTC
It needs to be reviewed and merged afaict.
Comment 23 Sebastian Dröge (slomo) 2014-02-04 11:43:49 UTC
I would be surprised if this still applies cleanly... can you check that and also if it works properly with the unit tests (especially the new ones added by Thiago). And then also add a tests for this?
Comment 24 Thibault Saunier 2014-02-04 11:58:22 UTC
Created attachment 268058 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 25 Thibault Saunier 2014-02-04 11:58:35 UTC
Created attachment 268059 [details] [review]
videoencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 26 Thibault Saunier 2014-02-04 11:58:52 UTC
Created attachment 268060 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 27 Thibault Saunier 2014-02-04 12:00:28 UTC
Created attachment 268061 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 28 Thibault Saunier 2014-02-04 12:00:55 UTC
Created attachment 268062 [details] [review]
videodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 29 Thibault Saunier 2014-02-04 12:02:35 UTC
Created attachment 268063 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 30 Thibault Saunier 2014-02-04 12:05:04 UTC
(In reply to comment #23)
> I would be surprised if this still applies cleanly... can you check that and
> also if it works properly with the unit tests (especially the new ones added by
> Thiago). And then also add a tests for this?

I uploaded rebased patches and make check passes. What kind of test do you expect for that?
Comment 31 Sebastian Dröge (slomo) 2014-02-04 12:18:36 UTC
Ideally one that fails before your patches and succeeds afterwards :) If that's not easily possible that would be sad but acceptable too... I think all this crazy event handling in the base classes really needs some tests as it's too easy to break things there :(
Comment 32 Sebastian Dröge (slomo) 2014-04-17 07:47:44 UTC
Thibault, any news here? Would be nice to get this in before 1.4 :)
Comment 33 Thibault Saunier 2014-04-17 10:39:24 UTC
I totally forgot about that, I will have a look soon.
Comment 34 Sebastian Dröge (slomo) 2014-05-08 12:15:31 UTC
Ping again? :)
Comment 35 Thibault Saunier 2014-05-27 11:21:46 UTC
Created attachment 277276 [details] [review]
audioencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 36 Thibault Saunier 2014-05-27 11:22:00 UTC
Created attachment 277277 [details] [review]
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 37 Thibault Saunier 2014-05-27 11:22:10 UTC
Created attachment 277278 [details] [review]
videoencoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 38 Thibault Saunier 2014-05-27 11:22:21 UTC
Created attachment 277279 [details] [review]
audiodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 39 Thibault Saunier 2014-05-27 11:22:36 UTC
Created attachment 277280 [details] [review]
videodecoder: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.

+ Add a testcase
Comment 40 Nicolas Dufresne (ndufresne) 2014-05-27 13:21:18 UTC
Are we completely sure of that ? TAGs may not be right any-more after flush-stop. CAPS may change, hence if you keep it, you might endup with caps being sent twice, and we'll get yet another configure, cleanup, configure dance. Or do we guaranty they will be updated before being sent again (a bit like what the pad does with sticky I guess).
Comment 41 Sebastian Dröge (slomo) 2014-05-31 15:23:54 UTC
Nicolas, that's exactly what GstPad is doing too when flushing
Comment 42 Sebastian Dröge (slomo) 2014-05-31 15:37:38 UTC
Also queue, queue2 and multiqueue do it like that. Without this it can happen that you get data-flow without a caps event if flushing happens while the initial caps event is still somewhere in a pending_events list.

commit a91b51c9b7cc7adabfa0cf0153a2e25efd0b6b7c
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sat May 31 17:35:52 2014 +0200

    typefind: Keep still meaningfull pending events on FLUSH_STOP
    
    Only EOS and segment should be deleted in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709868
Comment 43 Thibault Saunier 2014-06-03 11:15:03 UTC
Attachment 277276 [details] pushed as 967d1fb - audioencoder: Keep still meaningfull pending events on FLUSH_STOP
Attachment 277277 [details] pushed as 42ecafe - streamsplitter: Keep still meaningfull pending events on FLUSH_STOP
Attachment 277278 [details] pushed as 2843f35 - videoencoder: Keep still meaningfull pending events on FLUSH_STOP
Attachment 277279 [details] pushed as 12df7fa - audiodecoder: Keep still meaningfull pending events on FLUSH_STOP
Attachment 277280 [details] pushed as d2ea326 - videodecoder: Keep still meaningfull pending events on FLUSH_STOP
Comment 44 Thibault Saunier 2014-06-03 12:32:50 UTC
Created attachment 277794 [details] [review]
capsfilter: Keep still meaningfull pending events on FLUSH_STOP

Only EOS and segment should be deleted in that case.
Comment 45 Sebastian Dröge (slomo) 2014-06-03 12:42:05 UTC
Comment on attachment 277794 [details] [review]
capsfilter: Keep still meaningfull pending events on FLUSH_STOP

Not sure if this is correct. You're by-passing the basetransform event handling vfunc with that, right?
Comment 46 Thibault Saunier 2014-06-03 13:54:19 UTC
The difference between the code from that patch and old code is that in old code we were just removing the SEGMENT from the list, now we are removing everything that is not STICKY + SEGMENT + EOS.
Comment 47 Sebastian Dröge (slomo) 2014-06-03 13:57:39 UTC
Review of attachment 277794 [details] [review]:

::: plugins/elements/gstcapsfilter.c
@@ +384,3 @@
+      gst_event_unref (tmp->data);
+    } else {
+      gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data));

Not really. You're not filtering the list, you store those events on the pad and then free the list.
Comment 48 Thibault Saunier 2014-06-03 14:37:28 UTC
(In reply to comment #47)
> Review of attachment 277794 [details] [review]:
> 
> ::: plugins/elements/gstcapsfilter.c
> @@ +384,3 @@
> +      gst_event_unref (tmp->data);
> +    } else {
> +      gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data));
> 
> Not really. You're not filtering the list, you store those events on the pad
> and then free the list.

Ah, you are right sorry. Not sure what should be done then, should we just remove EOSes also and be done?
Comment 49 Sebastian Dröge (slomo) 2014-06-03 14:50:45 UTC
I think so
Comment 50 Thibault Saunier 2014-09-23 14:22:21 UTC
Created attachment 286877 [details] [review]
capsfilter: Remove EOS event from pending_event list on FLUSH_STOP
Comment 51 Sebastian Dröge (slomo) 2014-09-24 07:56:46 UTC
Comment on attachment 286877 [details] [review]
capsfilter: Remove EOS event from pending_event list on FLUSH_STOP

Also to 1.4
Comment 52 Thibault Saunier 2014-11-16 16:04:04 UTC
Hrm, why is that still open? It is not clear to me at this point.
Comment 53 Tim-Philipp Müller 2014-11-17 01:23:24 UTC
Thibault, it would seem the capsfilter patch marked as needs-work is still outstanding?
Comment 54 Thibault Saunier 2014-11-17 10:02:47 UTC
(In reply to comment #53)
> Thibault, it would seem the capsfilter patch marked as needs-work is still
> outstanding?

It has been replace and pushed as:

commit d1181ed98aa79fd472e90f0324d54655bd67cc65
Author: Thibault Saunier <tsaunier@gnome.org>
Date:   Tue Jun 3 14:23:30 2014 +0200

    capsfilter: Remove EOS event from pending_event list on FLUSH_STOP
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709868

Closing for good.