summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2018-06-05 16:36:24 +0200
committerEdward Hervey <bilboed@bilboed.com>2018-06-05 16:37:35 +0200
commit9af908195c29e7c4a6159bb920c6ff76ae56fc8c (patch)
treedf4a6ca81bedbbce745a3cc605e23790e22dbe0e
parent18b0d109f21f3cef9ba0c66dc5f2ef33d1578339 (diff)
validate: Add a new issue to detect invalid event seqnum
Events should always have a valid seqnum. Add a new issue which allows detecting such events. And use that check in the pad monitor
-rw-r--r--validate/gst/validate/gst-validate-pad-monitor.c5
-rw-r--r--validate/gst/validate/gst-validate-report.c4
-rw-r--r--validate/gst/validate/gst-validate-report.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c
index a81f104..a42634b 100644
--- a/validate/gst/validate/gst-validate-pad-monitor.c
+++ b/validate/gst/validate/gst-validate-pad-monitor.c
@@ -1616,6 +1616,11 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
{
guint32 seqnum = gst_event_get_seqnum (event);
+ if (seqnum == GST_SEQNUM_INVALID)
+ GST_VALIDATE_REPORT (pad_monitor, EVENT_INVALID_SEQNUM,
+ "Event %p (%s) has an invalid SEQNUM", event,
+ GST_EVENT_TYPE_NAME (event));
+
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
{
diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c
index e773f75..e67d5c5 100644
--- a/validate/gst/validate/gst-validate-report.c
+++ b/validate/gst/validate/gst-validate-report.c
@@ -342,6 +342,10 @@ gst_validate_report_load_issues (void)
" EOS being some kind of data flow, there is no exception"
" in that regard"));
+ REGISTER_VALIDATE_ISSUE (CRITICAL, EVENT_INVALID_SEQNUM,
+ _("Event has an invalid seqnum"),
+ _("An event is using GST_SEQNUM_INVALID. This should never happen"));
+
REGISTER_VALIDATE_ISSUE (CRITICAL, STATE_CHANGE_FAILURE,
_("state change failed"), NULL);
diff --git a/validate/gst/validate/gst-validate-report.h b/validate/gst/validate/gst-validate-report.h
index c701f3a..09db598 100644
--- a/validate/gst/validate/gst-validate-report.h
+++ b/validate/gst/validate/gst-validate-report.h
@@ -92,6 +92,7 @@ typedef enum {
#define EVENT_SEEK_NOT_HANDLED _QUARK("event::seek-not-handled")
#define EVENT_SEEK_RESULT_POSITION_WRONG _QUARK("event::seek-result-position-wrong")
#define EVENT_EOS_WITHOUT_SEGMENT _QUARK("event::eos-without-segment")
+#define EVENT_INVALID_SEQNUM _QUARK("event::invalid-seqnum")
#define STATE_CHANGE_FAILURE _QUARK("state::change-failure")