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 710253 - Pipeline stalls after sending FLUSH_STOP event to it
Pipeline stalls after sending FLUSH_STOP event to it
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.0.6
Other Linux
: Normal normal
: 1.2.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-16 09:31 UTC by Alexey Chernov
Modified: 2014-06-22 12:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexey Chernov 2013-10-16 09:31:24 UTC
I experience difficulties with flushing out the data from the pipeline out of my application. I asked about the preferred way to do it for several times in mailing-list, but, unfortunately, with no success. I'm trying to flush the pipeline using the same techniques it's done in some GStreamer elements, but unfortunately pipeline is stalled right after I send FLUSH_STOP event to it.

My pipeline consists of two branches:
appsrc -> decodebin -> queue -> autoaudiosink
appsrc -> decodebin -> queue -> videoscale -> videoconvert -> autovideosink

I have my data received by network, I just depacketize it, set PTS according to pipeline's running time and push to appsrc.

Here's the code where I send FLUSH_START and right after that FLUSH_STOP to pipeline:

	GST_INFO_OBJECT(pipeline(), "flushing pipeline...");
	guint32 seq_num = gst_util_seqnum_next();
	GST_INFO_OBJECT(pipeline(), "sending flush start...");
	GstEvent* flush_start = gst_event_new_flush_start();
	gst_event_set_seqnum(flush_start, seq_num);
	gboolean ret = FALSE;
	ret = gst_element_send_event(GST_ELEMENT(pipeline()), flush_start);
	if (!ret)
		GST_INFO_OBJECT(pipeline(), "failed to send flush-start event");
	GST_INFO_OBJECT(pipeline(), "sending flush stop...");

	GstEvent* flush_stop = gst_event_new_flush_stop(FALSE);

	gst_event_set_seqnum(flush_stop, seq_num);
	ret = gst_element_send_event(GST_ELEMENT(pipeline()), flush_stop);
	if (!ret)
		GST_INFO_OBJECT(pipeline(), "failed to send flush-stop event");

Log with GST_LEVEL_DEBUG loglevel is attached.

As far as I can see, the problem is that in spite of I explicitly set to not reset time when creating FLUSH_STOP event, new_segment is created anyway so time is efficiently reset.

I tried to set seq_num for events, to set reset_time to TRUE and actually reset PTS of input packets starting from 0, but nothing actually helped.
Comment 1 Sebastian Dröge (slomo) 2014-01-14 19:46:40 UTC
This should work with 1.2, there were some changes that allow sending flush events to the pipeline and basesrc directly.
Comment 2 Alexey Chernov 2014-01-14 20:04:42 UTC
Yes, Sebastian, I can confirm that's right. Forgot to close this report, sorry.