validate: Be more precise in issue type for wrong seqnum

Depending on the type of event where the bug occurs,
it is not the same issue type. That allows us to have
much precise reports, and better explain the user
where the issue stands.
This commit is contained in:
Thibault Saunier 2014-10-30 14:10:33 +01:00
parent c77089cc62
commit 4a2b9d6431
3 changed files with 43 additions and 22 deletions

View file

@ -122,7 +122,7 @@ typedef struct
} SerializedEventData;
static GstPad *
_get_actual_pad (GstPad *pad)
_get_actual_pad (GstPad * pad)
{
GstPad *tmp_pad;
@ -1408,10 +1408,9 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
if (seqnum == pad_monitor->pending_flush_start_seqnum) {
pad_monitor->pending_flush_start_seqnum = 0;
} else {
GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM,
"The expected flush-start seqnum should be the same as the "
"one from the event that caused it (probably a seek). Got: %u."
" Expected: %u", seqnum, pad_monitor->pending_flush_start_seqnum);
GST_VALIDATE_REPORT (pad_monitor, FLUSH_START_HAS_WRONG_SEQNUM,
"Got: %u Expected: %u", seqnum,
pad_monitor->pending_flush_start_seqnum);
}
}
@ -1428,10 +1427,9 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
if (seqnum == pad_monitor->pending_flush_stop_seqnum) {
pad_monitor->pending_flush_stop_seqnum = 0;
} else {
GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM,
"The expected flush-stop seqnum should be the same as the "
"one from the event that caused it (probably a seek). Got: %u."
" Expected: %u", seqnum, pad_monitor->pending_flush_stop_seqnum);
GST_VALIDATE_REPORT (pad_monitor, FLUSH_STOP_HAS_WRONG_SEQNUM,
"Got: %u Expected: %u", seqnum,
pad_monitor->pending_flush_stop_seqnum);
}
}
@ -1457,7 +1455,7 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
}
static void
mark_pads_eos (GstValidatePadMonitor *pad_monitor)
mark_pads_eos (GstValidatePadMonitor * pad_monitor)
{
GstValidatePadMonitor *peer_monitor;
GstPad *peer = gst_pad_get_peer (pad_monitor->pad);
@ -1466,7 +1464,8 @@ mark_pads_eos (GstValidatePadMonitor *pad_monitor)
pad_monitor->is_eos = TRUE;
if (peer) {
real_peer = _get_actual_pad (peer);
peer_monitor = g_object_get_data ((GObject *) real_peer, "validate-monitor");
peer_monitor =
g_object_get_data ((GObject *) real_peer, "validate-monitor");
if (peer_monitor)
peer_monitor->is_eos = TRUE;
gst_object_unref (peer);
@ -1587,10 +1586,8 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor *
if (pad_monitor->pending_newsegment_seqnum == seqnum) {
pad_monitor->pending_newsegment_seqnum = 0;
} else {
GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM,
"The expected segment seqnum should be the same as the "
"one from the seek that caused it. Got: %u."
" Expected: %u", seqnum, pad_monitor->pending_eos_seqnum);
GST_VALIDATE_REPORT (pad_monitor, SEGMENT_HAS_WRONG_SEQNUM,
"Got: %u Expected: %u", seqnum, pad_monitor->pending_eos_seqnum);
}
}
@ -1635,10 +1632,8 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor *
"EOS %" GST_PTR_FORMAT " received before a segment was received",
event);
} else 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);
GST_VALIDATE_REPORT (pad_monitor, EOS_HAS_WRONG_SEQNUM,
"Got: %u. Expected: %u", seqnum, pad_monitor->pending_eos_seqnum);
}
/*

View file

@ -198,8 +198,28 @@ gst_validate_report_load_issues (void)
"received and serialized with buffers. If an event is received after"
" a buffer with timestamp end 'X', it should be pushed right after "
"buffers with timestamp end 'X'"));
REGISTER_VALIDATE_ISSUE (ISSUE, EVENT_HAS_WRONG_SEQNUM,
_("events that are part of the same pipeline 'operation' should "
REGISTER_VALIDATE_ISSUE (ISSUE, EOS_HAS_WRONG_SEQNUM,
_("EOS events that are part of the same pipeline 'operation' should "
"have the same seqnum"),
_("when events/messages are created from another event/message, "
"they should have their seqnums set to the original event/message "
"seqnum"));
REGISTER_VALIDATE_ISSUE (ISSUE, FLUSH_START_HAS_WRONG_SEQNUM,
_
("FLUSH_START events that are part of the same pipeline 'operation' should "
"have the same seqnum"),
_("when events/messages are created from another event/message, "
"they should have their seqnums set to the original event/message "
"seqnum"));
REGISTER_VALIDATE_ISSUE (ISSUE, FLUSH_STOP_HAS_WRONG_SEQNUM,
_
("FLUSH_STOP events that are part of the same pipeline 'operation' should "
"have the same seqnum"),
_("when events/messages are created from another event/message, "
"they should have their seqnums set to the original event/message "
"seqnum"));
REGISTER_VALIDATE_ISSUE (ISSUE, SEGMENT_HAS_WRONG_SEQNUM,
_("SEGMENT events that are part of the same pipeline 'operation' should "
"have the same seqnum"),
_("when events/messages are created from another event/message, "
"they should have their seqnums set to the original event/message "

View file

@ -72,7 +72,13 @@ typedef enum {
#define EVENT_NEWSEGMENT_NOT_PUSHED _QUARK("event::newsegment-not-pushed")
#define SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME _QUARK("event::serialized-event-wasnt-pushed-in-time")
#define EVENT_HAS_WRONG_SEQNUM _QUARK("event::has-wrong-seqnum")
#define EOS_HAS_WRONG_SEQNUM _QUARK("event::eos-has-wrong-seqnum")
#define FLUSH_START_HAS_WRONG_SEQNUM _QUARK("event::flush-start-has-wrong-seqnum")
#define FLUSH_STOP_HAS_WRONG_SEQNUM _QUARK("event::flush-stop-has-wrong-seqnum")
#define SEGMENT_HAS_WRONG_SEQNUM _QUARK("event::segment-has-wrong-seqnum")
#define EVENT_SERIALIZED_OUT_OF_ORDER _QUARK("event::serialized-out-of-order")
#define EVENT_NEW_SEGMENT_MISMATCH _QUARK("event::segment-mismatch")
#define EVENT_FLUSH_START_UNEXPECTED _QUARK("event::flush-start-unexpected")