ssim: Report critical issue when override not attached

This commit is contained in:
Thibault Saunier 2019-05-23 11:49:01 -04:00
parent 1e2bf1c841
commit 6e9b2c35ce

View file

@ -44,6 +44,7 @@
#define SSIM_CONVERSION_ERROR g_quark_from_static_string ("validatessim::conversion-error") #define SSIM_CONVERSION_ERROR g_quark_from_static_string ("validatessim::conversion-error")
#define SSIM_SAVING_ERROR g_quark_from_static_string ("validatessim::saving-error") #define SSIM_SAVING_ERROR g_quark_from_static_string ("validatessim::saving-error")
#define MONITOR_DATA g_quark_from_static_string ("validate-ssim-monitor-data") #define MONITOR_DATA g_quark_from_static_string ("validate-ssim-monitor-data")
#define NOT_ATTACHED g_quark_from_static_string ("validatessim::not-attached")
typedef struct _ValidateSsimOverridePrivate ValidateSsimOverridePrivate; typedef struct _ValidateSsimOverridePrivate ValidateSsimOverridePrivate;
@ -129,6 +130,14 @@ runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self)
gst_structure_get_string (self->priv->config, gst_structure_get_string (self->priv->config,
"reference-images-dir"); "reference-images-dir");
if (!self->priv->is_attached) {
gchar *config_str = gst_structure_to_string (self->priv->config);
GST_VALIDATE_REPORT (self, NOT_ATTACHED,
"The test ended without SSIM being attached for config %s", config_str);
g_free (config_str);
return;
}
if (!compared_files_dir) { if (!compared_files_dir) {
return; return;
} }
@ -335,7 +344,6 @@ static void
validate_ssim_override_attached (GstValidateOverride * override) validate_ssim_override_attached (GstValidateOverride * override)
{ {
ValidateSsimOverride *self = VALIDATE_SSIM_OVERRIDE (override); ValidateSsimOverride *self = VALIDATE_SSIM_OVERRIDE (override);
GST_ERROR_OBJECT (override, "ATTACGHED!");
self->priv->is_attached = TRUE; self->priv->is_attached = TRUE;
} }
@ -391,6 +399,12 @@ validate_ssim_override_class_init (ValidateSsimOverrideClass * klass)
"The ValidateSSim plugin could not save PNG file", "The ValidateSSim plugin could not save PNG file",
"The ValidateSSim plugin could not save PNG file", "The ValidateSSim plugin could not save PNG file",
GST_VALIDATE_REPORT_LEVEL_CRITICAL)); GST_VALIDATE_REPORT_LEVEL_CRITICAL));
gst_validate_issue_register (gst_validate_issue_new
(NOT_ATTACHED,
"The ssim override was never attached.",
"The ssim override was never attached.",
GST_VALIDATE_REPORT_LEVEL_CRITICAL));
} }
static void static void