x264enc: Auto-detect interlace mode from caps

If the caps are interlaced, interlacing is always enabled on the
encoder. If the interlace-mode field is missing or if it's progressive,
the encoder uses the "interlaced" property.

https://bugzilla.gnome.org/show_bug.cgi?id=775228
This commit is contained in:
Vivia Nikolaidou 2016-11-28 15:14:18 +02:00 committed by Sebastian Dröge
parent 8b8419cefb
commit f7d82312bb

View file

@ -2264,6 +2264,12 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc,
gst_caps_unref (template_caps);
if (GST_VIDEO_INFO_IS_INTERLACED (&state->info))
g_string_append_printf (encoder->option_string, ":interlaced=%d", TRUE);
else
g_string_append_printf (encoder->option_string, ":interlaced=%d",
encoder->interlaced);
if (!gst_x264_enc_init_encoder (encoder))
return FALSE;
@ -2709,8 +2715,6 @@ gst_x264_enc_set_property (GObject * object, guint prop_id,
break;
case ARG_INTERLACED:
encoder->interlaced = g_value_get_boolean (value);
g_string_append_printf (encoder->option_string, ":interlaced=%d",
encoder->interlaced);
break;
case ARG_FRAME_PACKING:
encoder->frame_packing = g_value_get_enum (value);