detecting sink underruns in appsrc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

detecting sink underruns in appsrc

Luca Bacci
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.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: detecting sink underruns in appsrc

Luca Bacci
Sorry, I mean to say that appsrc timestamps data in the past, with respect to actual running time

Luca B.

2018-03-14 14:47 GMT+01:00 Luca Bacci <[hidden email]>:
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.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel