report: Avoid repeating long macros

Makes the code a bit more readable and compact
This commit is contained in:
Edward Hervey 2013-08-23 11:38:15 +02:00
parent 60a2dfaf72
commit 4f3e1de776
4 changed files with 106 additions and 141 deletions

View file

@ -128,8 +128,7 @@ _check_field_type (GstValidatePadMonitor * monitor, GstStructure * structure,
gint rejected_types_index = 0; gint rejected_types_index = 0;
if (!gst_structure_has_field (structure, field)) { if (!gst_structure_has_field (structure, field)) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, CAPS_IS_MISSING_FIELD,
GST_VALIDATE_ISSUE_ID_CAPS_IS_MISSING_FIELD,
"Field '%s' is missing from structure: %" GST_PTR_FORMAT, field, "Field '%s' is missing from structure: %" GST_PTR_FORMAT, field,
structure); structure);
return; return;
@ -147,12 +146,11 @@ _check_field_type (GstValidatePadMonitor * monitor, GstStructure * structure,
va_end (var_args); va_end (var_args);
joined_types = g_strjoinv (" / ", (gchar **) rejected_types); joined_types = g_strjoinv (" / ", (gchar **) rejected_types);
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, CAPS_FIELD_HAS_BAD_TYPE,
GST_VALIDATE_ISSUE_ID_CAPS_FIELD_HAS_BAD_TYPE,
"Field '%s' has wrong type %s in structure '%" GST_PTR_FORMAT "Field '%s' has wrong type %s in structure '%" GST_PTR_FORMAT
"'. Expected: %s", field, "'. Expected: %s", field,
g_type_name (gst_structure_get_field_type (structure, field)), g_type_name (gst_structure_get_field_type (structure, field)), structure,
structure, joined_types); joined_types);
g_free (joined_types); g_free (joined_types);
} }
@ -418,8 +416,7 @@ gst_validate_pad_monitor_check_caps_fields_proxied (GstValidatePadMonitor *
} }
if (type_match && !found) { if (type_match && !found) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, GET_CAPS_NOT_PROXYING_FIELDS,
GST_VALIDATE_ISSUE_ID_GET_CAPS_NOT_PROXYING_FIELDS,
"Peer pad structure '%" GST_PTR_FORMAT "' has no similar version " "Peer pad structure '%" GST_PTR_FORMAT "' has no similar version "
"on pad's caps '%" GST_PTR_FORMAT "'", otherstructure, caps); "on pad's caps '%" GST_PTR_FORMAT "'", otherstructure, caps);
} }
@ -438,8 +435,7 @@ gst_validate_pad_monitor_check_late_serialized_events (GstValidatePadMonitor *
SerializedEventData *data = SerializedEventData *data =
g_ptr_array_index (monitor->serialized_events, i); g_ptr_array_index (monitor->serialized_events, i);
if (data->timestamp < ts) { if (data->timestamp < ts) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME,
GST_VALIDATE_ISSUE_ID_SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME,
"Serialized event %" GST_PTR_FORMAT " wasn't pushed before expected " "Serialized event %" GST_PTR_FORMAT " wasn't pushed before expected "
"timestamp %" GST_TIME_FORMAT " on pad %s:%s", data->event, "timestamp %" GST_TIME_FORMAT " on pad %s:%s", data->event,
GST_TIME_ARGS (data->timestamp), GST_TIME_ARGS (data->timestamp),
@ -704,8 +700,7 @@ static void
return; return;
} }
if (!found) { if (!found) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE,
GST_VALIDATE_ISSUE_ID_BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE,
"Timestamp %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT "Timestamp %" GST_TIME_FORMAT " - %" GST_TIME_FORMAT
" is out of range of received input", GST_TIME_ARGS (ts), " is out of range of received input", GST_TIME_ARGS (ts),
GST_TIME_ARGS (ts_end)); GST_TIME_ARGS (ts_end));
@ -722,16 +717,14 @@ gst_validate_pad_monitor_check_first_buffer (GstValidatePadMonitor *
if (!pad_monitor->has_segment if (!pad_monitor->has_segment
&& PAD_IS_IN_PUSH_MODE (GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor))) && PAD_IS_IN_PUSH_MODE (GST_VALIDATE_PAD_MONITOR_GET_PAD (pad_monitor)))
{ {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, BUFFER_BEFORE_SEGMENT,
GST_VALIDATE_ISSUE_ID_BUFFER_BEFORE_SEGMENT,
"Received buffer before Segment event"); "Received buffer before Segment event");
} }
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer))) { if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer))) {
gint64 running_time = gst_segment_to_running_time (&pad_monitor->segment, gint64 running_time = gst_segment_to_running_time (&pad_monitor->segment,
pad_monitor->segment.format, GST_BUFFER_TIMESTAMP (buffer)); pad_monitor->segment.format, GST_BUFFER_TIMESTAMP (buffer));
if (running_time != 0) { if (running_time != 0) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO,
GST_VALIDATE_ISSUE_ID_FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO,
"First buffer running time is not 0, it is: %" GST_TIME_FORMAT, "First buffer running time is not 0, it is: %" GST_TIME_FORMAT,
GST_TIME_ARGS (running_time)); GST_TIME_ARGS (running_time));
} }
@ -843,10 +836,10 @@ gst_validate_pad_monitor_check_aggregated_return (GstValidatePadMonitor *
return; return;
} }
if (aggregated != ret) { if (aggregated != ret) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_ISSUE_ID_WRONG_FLOW_RETURN, GST_VALIDATE_REPORT (monitor, WRONG_FLOW_RETURN,
"Wrong combined flow return %s(%d). Expected: %s(%d)", "Wrong combined flow return %s(%d). Expected: %s(%d)",
gst_flow_get_name (ret), ret, gst_flow_get_name (ret), ret, gst_flow_get_name (aggregated),
gst_flow_get_name (aggregated), aggregated); aggregated);
} }
} }
@ -1019,8 +1012,7 @@ gst_validate_pad_monitor_add_expected_newsegment (GstValidatePadMonitor *
othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor"); othermonitor = g_object_get_data ((GObject *) otherpad, "qa-monitor");
GST_VALIDATE_MONITOR_LOCK (othermonitor); GST_VALIDATE_MONITOR_LOCK (othermonitor);
if (othermonitor->expected_segment) { if (othermonitor->expected_segment) {
GST_VALIDATE_REPORT (othermonitor, GST_VALIDATE_REPORT (othermonitor, EVENT_NEWSEGMENT_NOT_PUSHED, "");
GST_VALIDATE_ISSUE_ID_EVENT_NEWSEGMENT_NOT_PUSHED, "");
gst_event_unref (othermonitor->expected_segment); gst_event_unref (othermonitor->expected_segment);
} }
othermonitor->expected_segment = gst_event_ref (event); othermonitor->expected_segment = gst_event_ref (event);
@ -1056,8 +1048,7 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
if (seqnum == pad_monitor->pending_flush_start_seqnum) { if (seqnum == pad_monitor->pending_flush_start_seqnum) {
pad_monitor->pending_flush_start_seqnum = 0; pad_monitor->pending_flush_start_seqnum = 0;
} else { } else {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM,
GST_VALIDATE_ISSUE_ID_EVENT_HAS_WRONG_SEQNUM,
"The expected flush-start seqnum should be the same as the " "The expected flush-start seqnum should be the same as the "
"one from the event that caused it (probably a seek). Got: %u." "one from the event that caused it (probably a seek). Got: %u."
" Expected: %u", seqnum, pad_monitor->pending_flush_start_seqnum); " Expected: %u", seqnum, pad_monitor->pending_flush_start_seqnum);
@ -1065,8 +1056,7 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
} }
if (pad_monitor->pending_flush_stop) { if (pad_monitor->pending_flush_stop) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, EVENT_FLUSH_START_UNEXPECTED,
GST_VALIDATE_ISSUE_ID_EVENT_FLUSH_START_UNEXPECTED,
"Received flush-start from " " when flush-stop was expected"); "Received flush-start from " " when flush-stop was expected");
} }
pad_monitor->pending_flush_stop = TRUE; pad_monitor->pending_flush_stop = TRUE;
@ -1078,8 +1068,7 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
if (seqnum == pad_monitor->pending_flush_stop_seqnum) { if (seqnum == pad_monitor->pending_flush_stop_seqnum) {
pad_monitor->pending_flush_stop_seqnum = 0; pad_monitor->pending_flush_stop_seqnum = 0;
} else { } else {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, EVENT_HAS_WRONG_SEQNUM,
GST_VALIDATE_ISSUE_ID_EVENT_HAS_WRONG_SEQNUM,
"The expected flush-stop seqnum should be the same as the " "The expected flush-stop seqnum should be the same as the "
"one from the event that caused it (probably a seek). Got: %u." "one from the event that caused it (probably a seek). Got: %u."
" Expected: %u", seqnum, pad_monitor->pending_flush_stop_seqnum); " Expected: %u", seqnum, pad_monitor->pending_flush_stop_seqnum);
@ -1087,8 +1076,7 @@ gst_validate_pad_monitor_common_event_check (GstValidatePadMonitor *
} }
if (!pad_monitor->pending_flush_stop) { if (!pad_monitor->pending_flush_stop) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, EVENT_FLUSH_STOP_UNEXPECTED,
GST_VALIDATE_ISSUE_ID_EVENT_FLUSH_STOP_UNEXPECTED,
"Unexpected flush-stop %p" GST_PTR_FORMAT, event); "Unexpected flush-stop %p" GST_PTR_FORMAT, event);
} }
pad_monitor->pending_flush_stop = FALSE; pad_monitor->pending_flush_stop = FALSE;
@ -1148,8 +1136,7 @@ gst_validate_pad_monitor_sink_event_check (GstValidatePadMonitor * pad_monitor,
|| exp_segment->start != segment->start || exp_segment->start != segment->start
|| exp_segment->stop != segment->stop || exp_segment->stop != segment->stop
|| exp_segment->position != segment->position) { || exp_segment->position != segment->position) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, EVENT_NEW_SEGMENT_MISMATCH,
GST_VALIDATE_ISSUE_ID_EVENT_NEW_SEGMENT_MISMATCH,
"Expected segment didn't match received segment event"); "Expected segment didn't match received segment event");
} }
} }
@ -1444,8 +1431,7 @@ gst_validate_pad_monitor_buffer_probe (GstPad * pad, GstBuffer * buffer,
GST_BUFFER_TIMESTAMP (buffer), GST_BUFFER_TIMESTAMP (buffer) + GST_BUFFER_TIMESTAMP (buffer), GST_BUFFER_TIMESTAMP (buffer) +
GST_BUFFER_DURATION (buffer), NULL, NULL)) { GST_BUFFER_DURATION (buffer), NULL, NULL)) {
/* TODO is this a timestamp issue? */ /* TODO is this a timestamp issue? */
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, BUFFER_IS_OUT_OF_SEGMENT,
GST_VALIDATE_ISSUE_ID_BUFFER_IS_OUT_OF_SEGMENT,
"buffer is out of segment and shouldn't be pushed. Timestamp: %" "buffer is out of segment and shouldn't be pushed. Timestamp: %"
GST_TIME_FORMAT " - duration: %" GST_TIME_FORMAT ". Range: %" GST_TIME_FORMAT " - duration: %" GST_TIME_FORMAT ". Range: %"
GST_TIME_FORMAT " - %" GST_TIME_FORMAT, GST_TIME_FORMAT " - %" GST_TIME_FORMAT,
@ -1492,8 +1478,7 @@ gst_validate_pad_monitor_event_probe (GstPad * pad, GstEvent * event,
if (event == stored_event->event if (event == stored_event->event
|| GST_EVENT_TYPE (event) == GST_EVENT_TYPE (stored_event->event)) { || GST_EVENT_TYPE (event) == GST_EVENT_TYPE (stored_event->event)) {
GST_VALIDATE_REPORT (monitor, GST_VALIDATE_REPORT (monitor, EVENT_SERIALIZED_OUT_OF_ORDER,
GST_VALIDATE_ISSUE_ID_EVENT_SERIALIZED_OUT_OF_ORDER,
"Serialized event %" GST_PTR_FORMAT " was pushed out of original " "Serialized event %" GST_PTR_FORMAT " was pushed out of original "
"serialization order in pad %s:%s", event, "serialization order in pad %s:%s", event,
GST_DEBUG_PAD_NAME (GST_VALIDATE_PAD_MONITOR_GET_PAD (monitor))); GST_DEBUG_PAD_NAME (GST_VALIDATE_PAD_MONITOR_GET_PAD (monitor)));
@ -1545,13 +1530,11 @@ gst_validate_pad_monitor_setcaps_pre (GstValidatePadMonitor * pad_monitor,
gst_structure_get_value (pad_monitor->pending_setcaps_fields, name); gst_structure_get_value (pad_monitor->pending_setcaps_fields, name);
if (v == NULL) { if (v == NULL) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, CAPS_EXPECTED_FIELD_NOT_FOUND,
GST_VALIDATE_ISSUE_ID_CAPS_EXPECTED_FIELD_NOT_FOUND,
"Field %s is missing from setcaps caps '%" GST_PTR_FORMAT "'", "Field %s is missing from setcaps caps '%" GST_PTR_FORMAT "'",
name, caps); name, caps);
} else if (gst_value_compare (v, otherv) != GST_VALUE_EQUAL) { } else if (gst_value_compare (v, otherv) != GST_VALUE_EQUAL) {
GST_VALIDATE_REPORT (pad_monitor, GST_VALIDATE_REPORT (pad_monitor, CAPS_FIELD_UNEXPECTED_VALUE,
GST_VALIDATE_ISSUE_ID_CAPS_FIELD_UNEXPECTED_VALUE,
"Field %s from setcaps caps '%" GST_PTR_FORMAT "' is different " "Field %s from setcaps caps '%" GST_PTR_FORMAT "' is different "
"from expected value in caps '%" GST_PTR_FORMAT "'", name, caps, "from expected value in caps '%" GST_PTR_FORMAT "'", name, caps,
pad_monitor->pending_setcaps_fields); pad_monitor->pending_setcaps_fields);

View file

@ -78,7 +78,9 @@ gst_validate_issue_register (GstValidateIssue * issue)
(gpointer) gst_validate_issue_get_id (issue), issue); (gpointer) gst_validate_issue_get_id (issue), issue);
} }
#define REGISTER_VALIDATE_ISSUE(id,sum,desc,lvl) gst_validate_issue_register (gst_validate_issue_new (id, sum, desc, lvl)) #define REGISTER_VALIDATE_ISSUE(lvl,id,sum,desc) \
gst_validate_issue_register (gst_validate_issue_new (GST_VALIDATE_ISSUE_ID_##id, \
sum, desc, GST_VALIDATE_REPORT_LEVEL_##lvl))
static void static void
gst_validate_report_load_issues (void) gst_validate_report_load_issues (void)
{ {
@ -87,132 +89,114 @@ gst_validate_report_load_issues (void)
_gst_validate_issues = g_hash_table_new_full (g_direct_hash, g_direct_equal, _gst_validate_issues = g_hash_table_new_full (g_direct_hash, g_direct_equal,
NULL, (GDestroyNotify) gst_validate_issue_free); NULL, (GDestroyNotify) gst_validate_issue_free);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_BUFFER_BEFORE_SEGMENT, REGISTER_VALIDATE_ISSUE (WARNING, BUFFER_BEFORE_SEGMENT,
_("buffer was received before a segment"), _("buffer was received before a segment"),
_("in push mode, a segment event must be received before a buffer"), _("in push mode, a segment event must be received before a buffer"));
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (ISSUE, BUFFER_IS_OUT_OF_SEGMENT,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_BUFFER_IS_OUT_OF_SEGMENT,
_("buffer is out of the segment range"), _("buffer is out of the segment range"),
_("buffer being pushed is out of the current segment's start-stop " _("buffer being pushed is out of the current segment's start-stop "
" range. Meaning it is going to be discarded downstream without " " range. Meaning it is going to be discarded downstream without "
"any use"), GST_VALIDATE_REPORT_LEVEL_ISSUE); "any use"));
REGISTER_VALIDATE_ISSUE REGISTER_VALIDATE_ISSUE (WARNING, BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE,
(GST_VALIDATE_ISSUE_ID_BUFFER_TIMESTAMP_OUT_OF_RECEIVED_RANGE,
_("buffer timestamp is out of the received buffer timestamps' range"), _("buffer timestamp is out of the received buffer timestamps' range"),
_("a buffer leaving an element should have its timestamps in the range " _("a buffer leaving an element should have its timestamps in the range "
"of the received buffers timestamps. i.e. If an element received " "of the received buffers timestamps. i.e. If an element received "
"buffers with timestamps from 0s to 10s, it can't push a buffer with " "buffers with timestamps from 0s to 10s, it can't push a buffer with "
"with a 11s timestamp, because it doesn't have data for that"), "with a 11s timestamp, because it doesn't have data for that"));
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (WARNING, FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO,
REGISTER_VALIDATE_ISSUE
(GST_VALIDATE_ISSUE_ID_FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO,
_("first buffer's running time isn't 0"), _("first buffer's running time isn't 0"),
_("the first buffer's received running time is expected to be 0"), _("the first buffer's received running time is expected to be 0"));
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (CRITICAL, WRONG_FLOW_RETURN,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_WRONG_FLOW_RETURN, _("flow return from pad push doesn't match expected value"), _("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"), /* TODO fill me more */ _("flow return from pad push doesn't match expected value"),
GST_VALIDATE_REPORT_LEVEL_CRITICAL); _("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 (GST_VALIDATE_ISSUE_ID_CAPS_IS_MISSING_FIELD, REGISTER_VALIDATE_ISSUE (ISSUE, CAPS_IS_MISSING_FIELD,
_("caps is missing a required field for its type"), _("caps is missing a required field for its type"),
_("some caps types are expected to contain a set of basic fields. " _("some caps types are expected to contain a set of basic fields. "
"For example, raw video should have 'width', 'height', 'framerate' " "For example, raw video should have 'width', 'height', 'framerate' "
"and 'pixel-aspect-ratio'"), GST_VALIDATE_REPORT_LEVEL_ISSUE); "and 'pixel-aspect-ratio'"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_CAPS_FIELD_HAS_BAD_TYPE, REGISTER_VALIDATE_ISSUE (WARNING, CAPS_FIELD_HAS_BAD_TYPE,
_("caps field has an unexpected type"), _("caps field has an unexpected type"),
_("some common caps fields should always use the same expected types"), _("some common caps fields should always use the same expected types"));
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (WARNING, CAPS_EXPECTED_FIELD_NOT_FOUND,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_CAPS_EXPECTED_FIELD_NOT_FOUND,
_("caps expected field wasn't present"), _("caps expected field wasn't present"),
_("a field that should be present in the caps wasn't found. " _("a field that should be present in the caps wasn't found. "
"Fields sets on a sink pad caps should be propagated downstream " "Fields sets on a sink pad caps should be propagated downstream "
"when it makes sense to do so"), GST_VALIDATE_REPORT_LEVEL_WARNING); "when it makes sense to do so"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_GET_CAPS_NOT_PROXYING_FIELDS, REGISTER_VALIDATE_ISSUE (CRITICAL, GET_CAPS_NOT_PROXYING_FIELDS,
_("getcaps function isn't proxying downstream fields correctly"), _("getcaps function isn't proxying downstream fields correctly"),
_("elements should set downstream caps restrictions on its caps when " _("elements should set downstream caps restrictions on its caps when "
"replying upstream's getcaps queries to avoid upstream sending data" "replying upstream's getcaps queries to avoid upstream sending data"
" in an unsupported format"), GST_VALIDATE_REPORT_LEVEL_CRITICAL); " in an unsupported format"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_CAPS_FIELD_UNEXPECTED_VALUE, REGISTER_VALIDATE_ISSUE (CRITICAL, CAPS_FIELD_UNEXPECTED_VALUE,
_("a field in caps has an unexpected value"), _("a field in caps has an unexpected value"),
_("fields set on a sink pad should be propagated downstream via " _("fields set on a sink pad should be propagated downstream via "
"set caps"), GST_VALIDATE_REPORT_LEVEL_CRITICAL); "set caps"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_NEWSEGMENT_NOT_PUSHED, REGISTER_VALIDATE_ISSUE (WARNING, EVENT_NEWSEGMENT_NOT_PUSHED,
_("new segment event wasn't propagated downstream"), _("new segment event wasn't propagated downstream"),
_("segments received from upstream should be pushed downstream"), _("segments received from upstream should be pushed downstream"));
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (WARNING, SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME,
REGISTER_VALIDATE_ISSUE
(GST_VALIDATE_ISSUE_ID_SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME,
_("a serialized event received should be pushed in the same 'time' " _("a serialized event received should be pushed in the same 'time' "
"as it was received"), "as it was received"),
_("serialized events should be pushed in the same order they are " _("serialized events should be pushed in the same order they are "
"received and serialized with buffers. If an event is received after" "received and serialized with buffers. If an event is received after"
" a buffer with timestamp end 'X', it should be pushed right after " " a buffer with timestamp end 'X', it should be pushed right after "
"buffers with timestamp end 'X'"), GST_VALIDATE_REPORT_LEVEL_WARNING); "buffers with timestamp end 'X'"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_HAS_WRONG_SEQNUM, REGISTER_VALIDATE_ISSUE (ISSUE, EVENT_HAS_WRONG_SEQNUM,
_("events that are part of the same pipeline 'operation' should " _("events that are part of the same pipeline 'operation' should "
"have the same seqnum"), "have the same seqnum"),
_("when events/messages are created from another event/message, " _("when events/messages are created from another event/message, "
"they should have their seqnums set to the original event/message " "they should have their seqnums set to the original event/message "
"seqnum"), GST_VALIDATE_REPORT_LEVEL_ISSUE); "seqnum"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_SERIALIZED_OUT_OF_ORDER, REGISTER_VALIDATE_ISSUE (WARNING, EVENT_SERIALIZED_OUT_OF_ORDER,
_("a serialized event received should be pushed in the same order " _("a serialized event received should be pushed in the same order "
"as it was received"), "as it was received"),
_("serialized events should be pushed in the same order they are " _("serialized events should be pushed in the same order they are "
"received."), GST_VALIDATE_REPORT_LEVEL_WARNING); "received."));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_NEW_SEGMENT_MISMATCH, REGISTER_VALIDATE_ISSUE (WARNING, EVENT_NEW_SEGMENT_MISMATCH,
_("a new segment event has different value than the received one"), _("a new segment event has different value than the received one"),
_("when receiving a new segment, an element should push an equivalent" _("when receiving a new segment, an element should push an equivalent"
"segment downstream"), GST_VALIDATE_REPORT_LEVEL_WARNING); "segment downstream"));
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_FLUSH_START_UNEXPECTED, REGISTER_VALIDATE_ISSUE (WARNING, EVENT_FLUSH_START_UNEXPECTED,
_("received an unexpected flush start event"), NULL, _("received an unexpected flush start event"), NULL);
GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (WARNING, EVENT_FLUSH_STOP_UNEXPECTED,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_FLUSH_STOP_UNEXPECTED, _("received an unexpected flush stop event"), NULL);
_("received an unexpected flush stop event"), NULL,
GST_VALIDATE_REPORT_LEVEL_WARNING);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_EVENT_SEEK_NOT_HANDLED, REGISTER_VALIDATE_ISSUE (CRITICAL, EVENT_SEEK_NOT_HANDLED,
_("seek event wasn't handled"), NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); _("seek event wasn't handled"), NULL);
REGISTER_VALIDATE_ISSUE REGISTER_VALIDATE_ISSUE (CRITICAL, EVENT_SEEK_RESULT_POSITION_WRONG,
(GST_VALIDATE_ISSUE_ID_EVENT_SEEK_RESULT_POSITION_WRONG, _("position after a seek is wrong"), NULL);
_("position after a seek is wrong"), NULL,
GST_VALIDATE_REPORT_LEVEL_CRITICAL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_STATE_CHANGE_FAILURE, REGISTER_VALIDATE_ISSUE (CRITICAL, STATE_CHANGE_FAILURE,
_("state change failed"), NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); _("state change failed"), NULL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_SIZE_IS_ZERO, REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_SIZE_IS_ZERO,
_("resulting file size is 0"), NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); _("resulting file size is 0"), NULL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_SIZE_INCORRECT, REGISTER_VALIDATE_ISSUE (WARNING, FILE_SIZE_INCORRECT,
_("resulting file size wasn't within the expected values"), _("resulting file size wasn't within the expected values"), NULL);
NULL, GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (WARNING, FILE_DURATION_INCORRECT,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_DURATION_INCORRECT, _("resulting file duration wasn't within the expected values"), NULL);
_("resulting file duration wasn't within the expected values"), REGISTER_VALIDATE_ISSUE (WARNING, FILE_SEEKABLE_INCORRECT,
NULL, GST_VALIDATE_REPORT_LEVEL_WARNING); _("resulting file wasn't seekable or not seekable as expected"), NULL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_SEEKABLE_INCORRECT, REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_PROFILE_INCORRECT,
_("resulting file wasn't seekable or not seekable as expected"), _("resulting file stream profiles didn't match expected values"), NULL);
NULL, GST_VALIDATE_REPORT_LEVEL_WARNING); REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_NOT_FOUND,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_PROFILE_INCORRECT, _("resulting file could not be found for testing"), NULL);
_("resulting file stream profiles didn't match expected values"), REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_CHECK_FAILURE,
NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); _("an error occured while checking the file for conformance"), NULL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_NOT_FOUND, REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_PLAYBACK_START_FAILURE,
_("resulting file could not be found for testing"), NULL, _("an error occured while starting playback of the test file"), NULL);
GST_VALIDATE_REPORT_LEVEL_CRITICAL); REGISTER_VALIDATE_ISSUE (CRITICAL, FILE_PLAYBACK_ERROR,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_CHECK_FAILURE, _("an error during playback of the file"), NULL);
_("an error occured while checking the file for conformance"), NULL,
GST_VALIDATE_REPORT_LEVEL_CRITICAL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_PLAYBACK_START_FAILURE,
_("an error occured while starting playback of the test file"), NULL,
GST_VALIDATE_REPORT_LEVEL_CRITICAL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_FILE_PLAYBACK_ERROR,
_("an error during playback of the file"), NULL,
GST_VALIDATE_REPORT_LEVEL_CRITICAL);
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_ALLOCATION_FAILURE, REGISTER_VALIDATE_ISSUE (CRITICAL, ALLOCATION_FAILURE,
_("a memory allocation failed during Validate run"), _("a memory allocation failed during Validate run"), NULL);
NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); REGISTER_VALIDATE_ISSUE (CRITICAL, MISSING_PLUGIN,
REGISTER_VALIDATE_ISSUE (GST_VALIDATE_ISSUE_ID_MISSING_PLUGIN,
_("a gstreamer plugin is missing and prevented Validate from running"), _("a gstreamer plugin is missing and prevented Validate from running"),
NULL, GST_VALIDATE_REPORT_LEVEL_CRITICAL); NULL);
} }
void void

View file

@ -37,19 +37,20 @@ G_BEGIN_DECLS
#define GST_VALIDATE_REPORTER_CAST(obj) ((GstValidateReporter *) obj) #define GST_VALIDATE_REPORTER_CAST(obj) ((GstValidateReporter *) obj)
#ifdef G_HAVE_ISO_VARARGS #ifdef G_HAVE_ISO_VARARGS
#define GST_VALIDATE_REPORT(m, issue_id, ...) \ #define GST_VALIDATE_REPORT(m, issue_id, ...) \
G_STMT_START { \ G_STMT_START { \
gst_validate_report (GST_VALIDATE_REPORTER (m), issue_id, \ gst_validate_report (GST_VALIDATE_REPORTER (m), \
__VA_ARGS__ ); \ GST_VALIDATE_ISSUE_ID_##issue_id, \
} G_STMT_END __VA_ARGS__ ); \
} G_STMT_END
#else /* G_HAVE_GNUC_VARARGS */ #else /* G_HAVE_GNUC_VARARGS */
#ifdef G_HAVE_GNUC_VARARGS #ifdef G_HAVE_GNUC_VARARGS
#define GST_VALIDATE_REPORT(m, issue_id, args...) \ #define GST_VALIDATE_REPORT(m, issue_id, args...) \
G_STMT_START { \ G_STMT_START { \
gst_validate_report (GST_VALIDATE_REPORTER (m), \ gst_validate_report (GST_VALIDATE_REPORTER (m), \
issue_id, ##args ); \ GST_VALIDATE_ISSUE_ID_##issue_id, ##args ); \
} G_STMT_END } G_STMT_END
#endif /* G_HAVE_ISO_VARARGS */ #endif /* G_HAVE_ISO_VARARGS */
#endif /* G_HAVE_GNUC_VARARGS */ #endif /* G_HAVE_GNUC_VARARGS */

View file

@ -416,7 +416,7 @@ _pause_action_restore_playing (GstValidateScenario * scenario)
if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == if (gst_element_set_state (pipeline, GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) { GST_STATE_CHANGE_FAILURE) {
GST_VALIDATE_REPORT (scenario, GST_VALIDATE_ISSUE_ID_STATE_CHANGE_FAILURE, GST_VALIDATE_REPORT (scenario, STATE_CHANGE_FAILURE,
"Failed to set state to playing"); "Failed to set state to playing");
} }
@ -441,8 +441,7 @@ _execute_action (GstValidateScenario * scenario, ScenarioAction * act)
seek->format, seek->flags, seek->format, seek->flags,
seek->start_type, seek->start, seek->start_type, seek->start,
seek->stop_type, seek->stop) == FALSE) { seek->stop_type, seek->stop) == FALSE) {
GST_VALIDATE_REPORT (scenario, GST_VALIDATE_REPORT (scenario, EVENT_SEEK_NOT_HANDLED,
GST_VALIDATE_ISSUE_ID_EVENT_SEEK_NOT_HANDLED,
"Could not seek to position %" GST_TIME_FORMAT, "Could not seek to position %" GST_TIME_FORMAT,
GST_TIME_ARGS (priv->seeked_position)); GST_TIME_ARGS (priv->seeked_position));
} }
@ -455,7 +454,7 @@ _execute_action (GstValidateScenario * scenario, ScenarioAction * act)
if (gst_element_set_state (pipeline, GST_STATE_PAUSED) == if (gst_element_set_state (pipeline, GST_STATE_PAUSED) ==
GST_STATE_CHANGE_FAILURE) { GST_STATE_CHANGE_FAILURE) {
GST_VALIDATE_REPORT (scenario, GST_VALIDATE_ISSUE_ID_STATE_CHANGE_FAILURE, GST_VALIDATE_REPORT (scenario, STATE_CHANGE_FAILURE,
"Failed to set state to paused"); "Failed to set state to paused");
} }
gst_element_get_state (pipeline, NULL, NULL, -1); gst_element_get_state (pipeline, NULL, NULL, -1);
@ -495,8 +494,7 @@ get_position (GstValidateScenario * scenario)
/* TODO what about non flushing seeks? */ /* TODO what about non flushing seeks? */
/* TODO why is this inside the action time if ? */ /* TODO why is this inside the action time if ? */
if (GST_CLOCK_TIME_IS_VALID (priv->seeked_position)) if (GST_CLOCK_TIME_IS_VALID (priv->seeked_position))
GST_VALIDATE_REPORT (scenario, GST_VALIDATE_REPORT (scenario, EVENT_SEEK_NOT_HANDLED,
GST_VALIDATE_ISSUE_ID_EVENT_SEEK_NOT_HANDLED,
"Previous seek to %" GST_TIME_FORMAT " was not handled", "Previous seek to %" GST_TIME_FORMAT " was not handled",
GST_TIME_ARGS (priv->seeked_position)); GST_TIME_ARGS (priv->seeked_position));
@ -526,8 +524,7 @@ async_done_cb (GstBus * bus, GstMessage * message,
position < (MAX (0, position < (MAX (0,
((gint64) (priv->seeked_position - priv->seek_pos_tol))))) { ((gint64) (priv->seeked_position - priv->seek_pos_tol))))) {
GST_VALIDATE_REPORT (scenario, GST_VALIDATE_REPORT (scenario, EVENT_SEEK_RESULT_POSITION_WRONG,
GST_VALIDATE_ISSUE_ID_EVENT_SEEK_RESULT_POSITION_WRONG,
"Seeked position %" GST_TIME_FORMAT "not in the expected range [%" "Seeked position %" GST_TIME_FORMAT "not in the expected range [%"
GST_TIME_FORMAT " -- %" GST_TIME_FORMAT, GST_TIME_ARGS (position), GST_TIME_FORMAT " -- %" GST_TIME_FORMAT, GST_TIME_ARGS (position),
GST_TIME_ARGS (((MAX (0, GST_TIME_ARGS (((MAX (0,