Flushing a pipeline with appsrc
Alexey Chernov
4ernov at gmail.com
Thu Sep 5 15:12:55 PDT 2013
Hello,
IIRC I asked about a proper way of flushing pipeline here previously, but
unfortunately it still remains a great mystery for me. However, as we
discussed in the report on this
(https://bugzilla.gnome.org/show_bug.cgi?id=689113), it became easier in 1.0,
so I hope things would get clearer for me now.
I have the following pipeline:
Audio: appsrc -> decodebin -> autoaudiosink
Video: appsrc -> decodebin -> videoconvert -> videoscale -> autovideosink
with some possible variations. My use case is that I feed the pipeline's
appsrcs with data received from network. Sometimes I also receive a signal
along with the data unit to present it as soon as possible, so ideally I want
to send flush to the pipeline to have all the internal queues cleared. If I got
it right, I should do the following:
gboolean ret = FALSE;
GstEvent *flush_start, *flush_stop;
GST_INFO_OBJECT(pipeline, "flushing pipeline...");
flush_start = gst_event_new_flush_start();
flush_stop = gst_event_new_flush_stop(FALSE);
ret = gst_element_send_event(GST_ELEMENT(pipeline), flush_start);
if (!ret)
GST_INFO_OBJECT(pipeline, "failed to send flush-start event");
ret = gst_element_send_event(GST_ELEMENT(pipeline), flush_stop);
if (!ret)
GST_INFO_OBJECT(pipeline, "failed to send flush-stop event");
But trying to do this exactly renders my pipeline stalling. I use FLUSH_STOP
event without reset_time flag which should apparently help as I keep
timestamping input buffers monotonically, but neither FALSE nor TRUE value does
help.
Obviously I don't make it the proper way or use it in a wrong manner. How can
it be done properly?
Thanks for any help.
Best regards,
Alexey Chernov
More information about the gstreamer-devel
mailing list