}
}
+ pad_monitor->pending_newsegment_seqnum = seqnum;
+ pad_monitor->pending_eos_seqnum = seqnum;
+
if (!pad_monitor->pending_flush_stop) {
gchar *event_str = _get_event_string (event);
if (pad_monitor->pending_newsegment_seqnum == seqnum) {
pad_monitor->pending_newsegment_seqnum = 0;
} else {
- /* TODO is this an error? could be a segment from the start
- * received just before the seek segment */
+ 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);
}
}
- /* got a segment, no need for EOS now */
- pad_monitor->pending_eos_seqnum = 0;
+ pad_monitor->pending_eos_seqnum = seqnum;
if (GST_PAD_DIRECTION (pad) == GST_PAD_SINK) {
gst_validate_pad_monitor_add_expected_newsegment (pad_monitor, event);
}
case GST_EVENT_EOS:
pad_monitor->is_eos = TRUE;
- if (pad_monitor->pending_eos_seqnum &&
- pad_monitor->pending_eos_seqnum != seqnum) {
+ if (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
pad_monitor->pending_flush_start_seqnum = seqnum;
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 */
REGISTER_VALIDATE_ISSUE (CRITICAL, EVENT_SEEK_RESULT_POSITION_WRONG,
_("position after a seek is wrong"), NULL);
+ REGISTER_VALIDATE_ISSUE (WARNING, EVENT_EOS_WITHOUT_SEGMENT,
+ _("EOS received without segment event before"),
+ _("A segment event should always be sent before data flow"
+ " EOS being some kind of data flow, there is no exception"
+ " in that regard"));
+
REGISTER_VALIDATE_ISSUE (CRITICAL, STATE_CHANGE_FAILURE,
_("state change failed"), NULL);
#define EVENT_CAPS_DUPLICATE _QUARK("event::caps-duplicate")
#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 STATE_CHANGE_FAILURE _QUARK("state::change-failure")
/* There's gonna be some clunkiness in here because of funnel*/
probe_id1 = gst_pad_add_probe (srcpad1,
- GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) drop_buffers, NULL, NULL);
probe_id2 = gst_pad_add_probe (srcpad2,
- GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) drop_buffers, NULL, NULL);
/* We want to handle the src behaviour ourselves */
/* There's gonna be some clunkiness in here because of funnel */
probe_id1 = gst_pad_add_probe (srcpad1,
- GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) drop_buffers, NULL, NULL);
probe_id2 = gst_pad_add_probe (srcpad2,
- GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST,
+ GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_BUFFER_LIST | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
(GstPadProbeCallback) drop_buffers, NULL, NULL);
/* We want to handle the src behaviour ourselves */