detecting sink underruns in appsrc

Luca Bacci luca.bacci982 at gmail.com
Wed Mar 14 13:47:45 UTC 2018


Hello,

I have a pipeline where data is produced upstream by an appsrc element,
passes through some elements and at the end there is a sink (pulsesink,
alsasink) that outputs to the soundcard.

Data is produced in the appsrc like that

appsrc_needdata_cb(GstElement *appsrc, guint bytes, gpointer) {
  static guint64 bytescounter = 0;
  GstBuffer *buffer;

  /* allocate buffer and produce data */

  GST_BUFFER_PTS(buffer) = bytescounter;
  GST_BUFFER_DURATION(buffer) = bytes;
  bytescount += bytes;
}

everything is fine as long as I don't get underruns. If i underrun for say
1 second, the sink knows that and the clock increases as well by 1 second,
but the appsrc callback doesn't detect that condition and timestamps data
past the running time.

How can I acknowledge for this in appsrc?

Thank you very much!
Luca B.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180314/4d679c3d/attachment-0001.html>


More information about the gstreamer-devel mailing list