gstvideoaggregator: always update converter when needed

In prepare_frame, it is not enough for the target info
(conversion_info) to not have changed to decide not to update
the converter, as the vpad info may have changed as well.

Fixes #714
This commit is contained in:
Mathieu Duponchelle 2019-12-27 12:53:41 +01:00 committed by Mathieu Duponchelle
parent ad68f71d9a
commit 64d2e6b70d

View file

@ -398,31 +398,27 @@ gst_video_aggregator_convert_pad_prepare_frame (GstVideoAggregatorPad * vpad,
return FALSE; return FALSE;
pad->priv->converter_config_changed = FALSE; pad->priv->converter_config_changed = FALSE;
if (!pad->priv->conversion_info.finfo pad->priv->conversion_info = conversion_info;
|| !gst_video_info_is_equal (&conversion_info,
&pad->priv->conversion_info)) {
pad->priv->conversion_info = conversion_info;
if (pad->priv->convert) if (pad->priv->convert)
gst_video_converter_free (pad->priv->convert); gst_video_converter_free (pad->priv->convert);
pad->priv->convert = NULL; pad->priv->convert = NULL;
if (!gst_video_info_is_equal (&vpad->info, &pad->priv->conversion_info)) { if (!gst_video_info_is_equal (&vpad->info, &pad->priv->conversion_info)) {
pad->priv->convert = pad->priv->convert =
gst_video_converter_new (&vpad->info, &pad->priv->conversion_info, gst_video_converter_new (&vpad->info, &pad->priv->conversion_info,
pad->priv->converter_config ? gst_structure_copy (pad-> pad->priv->converter_config ? gst_structure_copy (pad->
priv->converter_config) : NULL); priv->converter_config) : NULL);
if (!pad->priv->convert) { if (!pad->priv->convert) {
GST_WARNING_OBJECT (pad, "No path found for conversion"); GST_WARNING_OBJECT (pad, "No path found for conversion");
return FALSE; return FALSE;
}
GST_DEBUG_OBJECT (pad, "This pad will be converted from %d to %d",
GST_VIDEO_INFO_FORMAT (&vpad->info),
GST_VIDEO_INFO_FORMAT (&pad->priv->conversion_info));
} else {
GST_DEBUG_OBJECT (pad, "This pad will not need conversion");
} }
GST_DEBUG_OBJECT (pad, "This pad will be converted from %d to %d",
GST_VIDEO_INFO_FORMAT (&vpad->info),
GST_VIDEO_INFO_FORMAT (&pad->priv->conversion_info));
} else {
GST_DEBUG_OBJECT (pad, "This pad will not need conversion");
} }
} }