GNOME Bugzilla – Bug 710253
Pipeline stalls after sending FLUSH_STOP event to it
Last modified: 2014-06-22 12:30:30 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.
This should work with 1.2, there were some changes that allow sending flush events to the pipeline and basesrc directly.
Yes, Sebastian, I can confirm that's right. Forgot to close this report, sorry.