cudaconvert: Enhance debugging when setting video info fails

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2300>
This commit is contained in:
Thibault Saunier 2022-03-08 21:26:16 +00:00 committed by GStreamer Marge Bot
parent 9ec4041a51
commit 3c959ff53e

View file

@ -387,30 +387,31 @@ gst_cuda_convert_filter_meta (GstBaseTransform * trans, GstQuery * query,
return TRUE;
}
#define CHECK_INFO_FIELDS_MATCHES(field) { \
if (in_info->field != in_info->field) { \
GST_ERROR_OBJECT (btrans, "%s do not match %d != %d", G_STRINGIFY(field), \
in_info->field, out_info->field); \
return FALSE;\
} \
}
static gboolean
gst_cuda_convert_set_info (GstCudaBaseTransform * btrans, GstCaps * incaps,
GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{
/* these must match */
if (in_info->width != out_info->width || in_info->height != out_info->height
|| in_info->fps_n != out_info->fps_n || in_info->fps_d != out_info->fps_d)
goto format_mismatch;
CHECK_INFO_FIELDS_MATCHES (width);
CHECK_INFO_FIELDS_MATCHES (height);
CHECK_INFO_FIELDS_MATCHES (fps_n);
CHECK_INFO_FIELDS_MATCHES (fps_d);
CHECK_INFO_FIELDS_MATCHES (par_n);
/* if present, these must match too */
if (in_info->par_n != out_info->par_n || in_info->par_d != out_info->par_d)
goto format_mismatch;
CHECK_INFO_FIELDS_MATCHES (par_d);
CHECK_INFO_FIELDS_MATCHES (interlace_mode);
/* if present, these must match too */
if (in_info->interlace_mode != out_info->interlace_mode)
goto format_mismatch;
return GST_CUDA_BASE_TRANSFORM_CLASS (parent_class)->set_info (btrans, incaps,
in_info, outcaps, out_info);
/* ERRORS */
format_mismatch:
{
GST_ERROR_OBJECT (btrans, "input and output formats do not match");
return FALSE;
}
}
#undef CHECK_INFO_FIELDS_MATCHES