x264enc: Check more video info fields to decide whether to reconfigure encoder

The encoder is also initialised using interlace mode, colorimetry, chroma-site
and multiview mode, so let's make sure we only skip reinitialising the encoder
in set_format() if none of those have changed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4395>
This commit is contained in:
Arun Raghavan 2023-04-11 11:50:57 -04:00 committed by GStreamer Marge Bot
parent 15b7c7ea25
commit d0d40c7845

View file

@ -2332,7 +2332,13 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc,
if (info->finfo->format == old->finfo->format
&& info->width == old->width && info->height == old->height
&& info->fps_n == old->fps_n && info->fps_d == old->fps_d
&& info->par_n == old->par_n && info->par_d == old->par_d) {
&& info->par_n == old->par_n && info->par_d == old->par_d
&& info->interlace_mode == old->interlace_mode
&& gst_video_colorimetry_is_equal (&info->colorimetry,
&old->colorimetry)
&& GST_VIDEO_INFO_CHROMA_SITE (info) == GST_VIDEO_INFO_CHROMA_SITE (old)
&& GST_VIDEO_INFO_MULTIVIEW_MODE (info) ==
GST_VIDEO_INFO_MULTIVIEW_MODE (old)) {
gst_video_codec_state_unref (encoder->input_state);
encoder->input_state = gst_video_codec_state_ref (state);
return TRUE;