validatessim: Avoid having ':' in file names

This is unsupported on windows
This commit is contained in:
Thibault Saunier 2020-02-10 14:55:18 -03:00
parent e4f687e0e7
commit 06f6fd8de1
3 changed files with 9 additions and 6 deletions

View file

@ -482,7 +482,8 @@ _filename_get_timestamp (GstValidateSsim * self, const gchar * filename,
gchar *other = g_strdup (bname); gchar *other = g_strdup (bname);
gboolean res = TRUE; gboolean res = TRUE;
if (sscanf (bname, "%" GST_TIME_FORMAT "%s", &h, &m, &s, &ns, other) < 4) { if (sscanf (bname, "%" GST_VALIDATE_SSIM_TIME_FORMAT "%s", &h, &m, &s, &ns,
other) < 4) {
GST_INFO_OBJECT (self, "Can not sscanf %s", bname); GST_INFO_OBJECT (self, "Can not sscanf %s", bname);
goto fail; goto fail;

View file

@ -47,6 +47,8 @@ typedef struct {
GstObjectClass parent; GstObjectClass parent;
} GstValidateSsimClass; } GstValidateSsimClass;
#define GST_VALIDATE_SSIM_TIME_FORMAT "u-%02u-%02u.%09u"
#define GST_VALIDATE_SSIM_TYPE (gst_validate_ssim_get_type ()) #define GST_VALIDATE_SSIM_TYPE (gst_validate_ssim_get_type ())
#define GST_VALIDATE_SSIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_VALIDATE_SSIM_TYPE, GstValidateSsim)) #define GST_VALIDATE_SSIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_VALIDATE_SSIM_TYPE, GstValidateSsim))
#define GST_VALIDATE_SSIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_VALIDATE_SSIM_TYPE, GstValidateSsimClass)) #define GST_VALIDATE_SSIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_VALIDATE_SSIM_TYPE, GstValidateSsimClass))

View file

@ -523,10 +523,10 @@ _get_filename (ValidateSsimOverride * self, GstValidatePadMonitor * monitor,
gchar *outname = NULL, *s; gchar *outname = NULL, *s;
if (self->priv->save_format == GST_VIDEO_FORMAT_ENCODED) if (self->priv->save_format == GST_VIDEO_FORMAT_ENCODED)
s = g_strdup_printf ("%" GST_TIME_FORMAT ".%s", GST_TIME_ARGS (position), s = g_strdup_printf ("%" GST_VALIDATE_SSIM_TIME_FORMAT ".%s",
self->priv->ext); GST_TIME_ARGS (position), self->priv->ext);
else else
s = g_strdup_printf ("%" GST_TIME_FORMAT ".%dx%d.%s", s = g_strdup_printf ("%" GST_VALIDATE_SSIM_TIME_FORMAT ".%dx%d.%s",
GST_TIME_ARGS (position), GST_TIME_ARGS (position),
self->priv->out_info.width, self->priv->out_info.width,
self->priv->out_info.height, self->priv->ext); self->priv->out_info.height, self->priv->ext);
@ -537,10 +537,10 @@ _get_filename (ValidateSsimOverride * self, GstValidatePadMonitor * monitor,
while (has_frame (self, outname)) { while (has_frame (self, outname)) {
g_free (outname); g_free (outname);
if (self->priv->save_format == GST_VIDEO_FORMAT_ENCODED) if (self->priv->save_format == GST_VIDEO_FORMAT_ENCODED)
s = g_strdup_printf ("%" GST_TIME_FORMAT "-%d.%s", s = g_strdup_printf ("%" GST_VALIDATE_SSIM_TIME_FORMAT "-%d.%s",
GST_TIME_ARGS (position), i++, self->priv->ext); GST_TIME_ARGS (position), i++, self->priv->ext);
else else
s = g_strdup_printf ("%" GST_TIME_FORMAT "-%d.%dx%d.%s", s = g_strdup_printf ("%" GST_VALIDATE_SSIM_TIME_FORMAT "-%d.%dx%d.%s",
GST_TIME_ARGS (position), i++, self->priv->out_info.width, GST_TIME_ARGS (position), i++, self->priv->out_info.width,
self->priv->out_info.height, self->priv->ext); self->priv->out_info.height, self->priv->ext);