From a1a051bdeb84766b4ae98b166980bd5d8b16a5ed Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Thu, 10 Aug 2017 10:21:05 -0400 Subject: [PATCH] niimaqdxsrc: post dropped-frame-info message --- sys/niimaqdx/gstniimaqdx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/niimaqdx/gstniimaqdx.c b/sys/niimaqdx/gstniimaqdx.c index 7d5a5e7..2fe45f8 100644 --- a/sys/niimaqdx/gstniimaqdx.c +++ b/sys/niimaqdx/gstniimaqdx.c @@ -767,10 +767,19 @@ gst_niimaqdxsrc_fill (GstPushSrc * psrc, GstBuffer * buf) dropped = copied_number - src->cumbufnum; if (dropped > 0) { + GstStructure *infoStruct; + src->n_dropped_frames += dropped; GST_WARNING_OBJECT (src, "Asked to copy buffer #%d but was given #%d; just dropped %d frames (%d total)", src->cumbufnum, copied_number, dropped, src->n_dropped_frames); + + infoStruct = gst_structure_new ("dropped-frame-info", + "num-dropped-frames", G_TYPE_INT, dropped, + "total-dropped-frames", G_TYPE_INT, src->n_dropped_frames, + "timestamp", GST_TYPE_CLOCK_TIME, GST_BUFFER_TIMESTAMP (buf), NULL); + gst_element_post_message (GST_ELEMENT (src), + gst_message_new_element (GST_OBJECT (src), infoStruct)); } /* set cumulative buffer number to get next frame */