diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 14bec4dc60..681c019bfc 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -835,6 +835,16 @@ gst_validate_pad_monitor_check_first_buffer (GstValidatePadMonitor * } } +static void +gst_validate_pad_monitor_check_eos (GstValidatePadMonitor * + pad_monitor, GstBuffer * buffer) +{ + if (G_UNLIKELY (pad_monitor->is_eos)) { + GST_VALIDATE_REPORT (pad_monitor, BUFFER_AFTER_EOS, + "Received buffer %" GST_PTR_FORMAT " after EOS", buffer); + } +} + static void gst_validate_pad_monitor_update_buffer_data (GstValidatePadMonitor * pad_monitor, GstBuffer * buffer) @@ -1463,6 +1473,7 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent, gst_validate_pad_monitor_check_first_buffer (pad_monitor, buffer); gst_validate_pad_monitor_update_buffer_data (pad_monitor, buffer); + gst_validate_pad_monitor_check_eos (pad_monitor, buffer); GST_VALIDATE_MONITOR_UNLOCK (pad_monitor); GST_VALIDATE_PAD_MONITOR_PARENT_UNLOCK (pad_monitor); @@ -1475,6 +1486,9 @@ gst_validate_pad_monitor_chain_func (GstPad * pad, GstObject * parent, GST_VALIDATE_MONITOR_LOCK (pad_monitor); pad_monitor->last_flow_return = ret; + if (ret == GST_FLOW_EOS) { + pad_monitor->is_eos = ret; + } if (PAD_PARENT_IS_DEMUXER (pad_monitor)) gst_validate_pad_monitor_check_aggregated_return (pad_monitor, ret); @@ -1630,6 +1644,7 @@ gst_validate_pad_monitor_buffer_probe (GstPad * pad, GstBuffer * buffer, gst_validate_pad_monitor_check_first_buffer (monitor, buffer); gst_validate_pad_monitor_update_buffer_data (monitor, buffer); + gst_validate_pad_monitor_check_eos (monitor, buffer); if (PAD_PARENT_IS_DECODER (monitor) || PAD_PARENT_IS_ENCODER (monitor)) { GstClockTime tolerance = 0; diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index 95f90b1b00..a5b51ac556 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -120,6 +120,9 @@ gst_validate_report_load_issues (void) _("flow return from a 1:1 sink/src pad element is as simple as " "returning what downstream returned. For elements that have multiple " "src pads, flow returns should be properly combined")); + REGISTER_VALIDATE_ISSUE (ISSUE, BUFFER_AFTER_EOS, + _("buffer was received after EOS"), + _("a pad shouldn't receive any more buffers after it gets EOS")); REGISTER_VALIDATE_ISSUE (ISSUE, CAPS_IS_MISSING_FIELD, _("caps is missing a required field for its type"), diff --git a/validate/gst/validate/gst-validate-report.h b/validate/gst/validate/gst-validate-report.h index 2418886a60..96f4ea2693 100644 --- a/validate/gst/validate/gst-validate-report.h +++ b/validate/gst/validate/gst-validate-report.h @@ -73,6 +73,7 @@ typedef enum { #define GST_VALIDATE_ISSUE_ID_BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE (((GstValidateIssueId) GST_VALIDATE_AREA_BUFFER) << GST_VALIDATE_ISSUE_ID_SHIFT | 3) #define GST_VALIDATE_ISSUE_ID_FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO (((GstValidateIssueId) GST_VALIDATE_AREA_BUFFER) << GST_VALIDATE_ISSUE_ID_SHIFT | 4) #define GST_VALIDATE_ISSUE_ID_WRONG_FLOW_RETURN (((GstValidateIssueId) GST_VALIDATE_AREA_BUFFER) << GST_VALIDATE_ISSUE_ID_SHIFT | 5) +#define GST_VALIDATE_ISSUE_ID_BUFFER_AFTER_EOS (((GstValidateIssueId) GST_VALIDATE_AREA_BUFFER) << GST_VALIDATE_ISSUE_ID_SHIFT | 6) #define GST_VALIDATE_ISSUE_ID_CAPS_IS_MISSING_FIELD (((GstValidateIssueId) GST_VALIDATE_AREA_CAPS) << GST_VALIDATE_ISSUE_ID_SHIFT | 1) #define GST_VALIDATE_ISSUE_ID_CAPS_FIELD_HAS_BAD_TYPE (((GstValidateIssueId) GST_VALIDATE_AREA_CAPS) << GST_VALIDATE_ISSUE_ID_SHIFT | 2)