diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index d59496af05..569119873d 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -68,7 +68,7 @@ static const char gst_vaapipostproc_src_caps_str[] = GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; " #endif GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ", " - GST_CAPS_INTERLACED_FALSE; + GST_CAPS_INTERLACED_MODES; /* *INDENT-ON* */ /* *INDENT-OFF* */ diff --git a/gst/vaapi/gstvaapipostprocutil.c b/gst/vaapi/gstvaapipostprocutil.c index 956bd84d4d..d1bdd88920 100644 --- a/gst/vaapi/gstvaapipostprocutil.c +++ b/gst/vaapi/gstvaapipostprocutil.c @@ -585,6 +585,28 @@ _set_colorimetry (GstVaapiPostproc * postproc, GstVideoFormat format, return TRUE; } +static gboolean +_set_interlace_mode (GstVaapiPostproc * postproc, GstVideoInfo * vinfo, + GstStructure * outs) +{ + const gchar *interlace_mode = NULL; + + if (is_deinterlace_enabled (postproc, vinfo)) { + interlace_mode = "progressive"; + } else { + interlace_mode = + gst_video_interlace_mode_to_string (GST_VIDEO_INFO_INTERLACE_MODE + (vinfo)); + } + + if (!interlace_mode) + return FALSE; + + gst_structure_set (outs, "interlace-mode", G_TYPE_STRING, interlace_mode, + NULL); + return TRUE; +} + static gboolean _set_preferred_format (GstStructure * outs, GstVideoFormat format) { @@ -649,6 +671,9 @@ _get_preferred_caps (GstVaapiPostproc * postproc, GstVideoInfo * vinfo, if (f == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY) _set_colorimetry (postproc, format, structure); + if (!_set_interlace_mode (postproc, vinfo, structure)) + goto interlace_mode_failed; + outcaps = gst_caps_new_empty (); gst_caps_append_structure_full (outcaps, structure, gst_caps_features_copy (features)); @@ -673,6 +698,11 @@ invalid_caps: GST_WARNING_OBJECT (postproc, "No valid src caps found"); return NULL; } +interlace_mode_failed: + { + GST_WARNING_OBJECT (postproc, "Invalid sink caps interlace mode"); + return NULL; + } } /**