From fef4eba9a26f45ced4125729d72f80f41d54b41f Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 2 Sep 2013 10:46:55 -0300 Subject: [PATCH] pad-monitor: also track eos event that should be emitted after a seek When seeking out of the media file length, the element should push an EOS with the same seqnum of the seek event --- validate/gst/validate/gst-validate-pad-monitor.c | 11 +++++++++++ validate/gst/validate/gst-validate-pad-monitor.h | 1 + 2 files changed, 12 insertions(+) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index a3a4344..4968828 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -1159,6 +1159,9 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor * } } + /* got a segment, no need for EOS now */ + pad_monitor->pending_eos_seqnum = 0; + if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK) { gst_validate_pad_monitor_add_expected_newsegment (pad_monitor, event); } else { @@ -1186,6 +1189,13 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor * break; case GST_EVENT_EOS: pad_monitor->is_eos = TRUE; + if (pad_monitor->pending_eos_seqnum && + pad_monitor->pending_eos_seqnum != seqnum) { + GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM, + "The expected EOS seqnum should be the same as the " + "one from the seek that caused it. Got: %u." + " Expected: %u", seqnum, pad_monitor->pending_eos_seqnum); + } /* * TODO add end of stream checks for * - events not pushed @@ -1270,6 +1280,7 @@ gst_validate_pad_monitor_src_event_check (GstValidatePadMonitor * pad_monitor, pad_monitor->pending_flush_stop_seqnum = seqnum; } pad_monitor->pending_newsegment_seqnum = seqnum; + pad_monitor->pending_eos_seqnum = seqnum; } break; /* both flushes are handled by the common event handling function */ diff --git a/validate/gst/validate/gst-validate-pad-monitor.h b/validate/gst/validate/gst-validate-pad-monitor.h index 5b11dba..e91e740 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.h +++ b/validate/gst/validate/gst-validate-pad-monitor.h @@ -80,6 +80,7 @@ struct _GstValidatePadMonitor { guint32 pending_flush_stop_seqnum; guint32 pending_flush_start_seqnum; guint32 pending_newsegment_seqnum; + guint32 pending_eos_seqnum; GstEvent *expected_segment; GPtrArray *serialized_events; -- 2.7.4