euresys: Show warning if frames have been dropped
This commit is contained in:
parent
4645490fa1
commit
390ad794e0
@ -314,6 +314,9 @@ gst_euresys_init (GstEuresys * euresys, GstEuresysClass * euresys_class)
|
|||||||
|
|
||||||
euresys->acq_started = FALSE;
|
euresys->acq_started = FALSE;
|
||||||
|
|
||||||
|
euresys->last_time_code = -1;
|
||||||
|
euresys->dropped_frame_count = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -613,6 +616,9 @@ gst_euresys_stop (GstBaseSrc * src)
|
|||||||
gst_caps_unref (euresys->caps);
|
gst_caps_unref (euresys->caps);
|
||||||
euresys->caps = NULL;
|
euresys->caps = NULL;
|
||||||
|
|
||||||
|
euresys->dropped_frame_count = 0;
|
||||||
|
euresys->last_time_code = -1;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -685,6 +691,7 @@ gst_euresys_create (GstPushSrc * src, GstBuffer ** buf)
|
|||||||
INT64 timeStamp;
|
INT64 timeStamp;
|
||||||
int newsize;
|
int newsize;
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
|
int dropped_frame_count;
|
||||||
|
|
||||||
/* Start acquisition */
|
/* Start acquisition */
|
||||||
if (!euresys->acq_started) {
|
if (!euresys->acq_started) {
|
||||||
@ -738,6 +745,15 @@ gst_euresys_create (GstPushSrc * src, GstBuffer ** buf)
|
|||||||
|
|
||||||
GST_INFO ("Got surface #%05d", timeCode);
|
GST_INFO ("Got surface #%05d", timeCode);
|
||||||
|
|
||||||
|
dropped_frame_count = timeCode - (euresys->last_time_code + 1);
|
||||||
|
if (dropped_frame_count != 0) {
|
||||||
|
euresys->dropped_frame_count += dropped_frame_count;
|
||||||
|
GST_WARNING ("Dropped %d frames (%d total)", dropped_frame_count, euresys->dropped_frame_count);
|
||||||
|
/* TODO: emit message here about dropped frames */
|
||||||
|
}
|
||||||
|
euresys->last_time_code = timeCode;
|
||||||
|
|
||||||
|
|
||||||
/* Create the buffer */
|
/* Create the buffer */
|
||||||
ret = gst_pad_alloc_buffer (GST_BASE_SRC_PAD (GST_BASE_SRC (src)),
|
ret = gst_pad_alloc_buffer (GST_BASE_SRC_PAD (GST_BASE_SRC (src)),
|
||||||
GST_BUFFER_OFFSET_NONE, newsize,
|
GST_BUFFER_OFFSET_NONE, newsize,
|
||||||
|
|||||||
@ -54,7 +54,10 @@ struct _GstEuresys
|
|||||||
|
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
|
gint dropped_frame_count;
|
||||||
gboolean acq_started;
|
gboolean acq_started;
|
||||||
|
|
||||||
|
INT32 last_time_code;
|
||||||
MCHANDLE hChannel;
|
MCHANDLE hChannel;
|
||||||
INT32 boardType;
|
INT32 boardType;
|
||||||
INT32 boardIdx;
|
INT32 boardIdx;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user