From 280678fe42b381f5e3dd03929c96d33ffa3678ff Mon Sep 17 00:00:00 2001 From: "U. Artie Eoff" Date: Thu, 23 Jun 2022 11:11:16 -0400 Subject: [PATCH] va: filter: add scale method field and setter Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvafilter.c | 15 +++++++++++++++ subprojects/gst-plugins-bad/sys/va/gstvafilter.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvafilter.c b/subprojects/gst-plugins-bad/sys/va/gstvafilter.c index f14f544907..05542550e4 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvafilter.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvafilter.c @@ -58,6 +58,8 @@ struct _GstVaFilter guint rotation; GstVideoOrientationMethod orientation; + guint32 scale_method; + gboolean crop_enabled; VARectangle input_region; @@ -934,6 +936,18 @@ gst_va_filter_get_surface_formats (GstVaFilter * self) return ret; } +gboolean +gst_va_filter_set_scale_method (GstVaFilter * self, guint32 method) +{ + g_return_val_if_fail (GST_IS_VA_FILTER (self), FALSE); + + GST_OBJECT_LOCK (self); + self->scale_method = method; + GST_OBJECT_UNLOCK (self); + + return TRUE; +} + static gboolean _from_video_orientation_method (GstVideoOrientationMethod orientation, guint * mirror, guint * rotation) @@ -1617,6 +1631,7 @@ _create_pipeline_buffer (GstVaFilter * self, GstVaSample * src, .output_surface_flag = dst->flags, .input_color_properties = self->input_color_properties, .output_color_properties = self->output_color_properties, + .filter_flags = self->scale_method, /* output to SDR */ .output_hdr_metadata = NULL, }; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvafilter.h b/subprojects/gst-plugins-bad/sys/va/gstvafilter.h index 0c93233462..b3d4597378 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvafilter.h +++ b/subprojects/gst-plugins-bad/sys/va/gstvafilter.h @@ -120,6 +120,8 @@ gboolean gst_va_filter_install_properties (GstVaFilter * self, gboolean gst_va_filter_install_deinterlace_properties (GstVaFilter * self, GObjectClass * klass); +gboolean gst_va_filter_set_scale_method (GstVaFilter * self, + guint32 method); gboolean gst_va_filter_set_orientation (GstVaFilter * self, GstVideoOrientationMethod orientation); GstVideoOrientationMethod gst_va_filter_get_orientation (GstVaFilter * self);