From 2ba5854c6bc76354ab2b764529dd5edcc18627b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 26 Mar 2021 17:48:09 +0100 Subject: [PATCH] va: postproc, filter: add disable-passthrough property vapostproc tries to be in passthrough mode as much as possible. But they might be situations where the user might force to process the frames. For example, when upstream sets the crop meta and the user wants VA do that cropping, rather than downstream. For those situations this property will disable the passthrough mode, if it's enabled. Part-of: --- sys/va/gstvafilter.c | 7 +++++++ sys/va/gstvafilter.h | 1 + sys/va/gstvavpp.c | 12 ++++++++++++ 3 files changed, 20 insertions(+) diff --git a/sys/va/gstvafilter.c b/sys/va/gstvafilter.c index d5cc080b54..4a14fdfda2 100644 --- a/sys/va/gstvafilter.c +++ b/sys/va/gstvafilter.c @@ -664,6 +664,13 @@ gst_va_filter_install_properties (GstVaFilter * self, GObjectClass * klass) common_flags)); } + g_object_class_install_property (klass, + GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH, + g_param_spec_boolean ("disable-passthrough", "Disable Passthrough", + "Forces passing buffers through the postprocessor", FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS + | GST_PARAM_MUTABLE_READY)); + return TRUE; } diff --git a/sys/va/gstvafilter.h b/sys/va/gstvafilter.h index da5130fdf4..896694b74e 100644 --- a/sys/va/gstvafilter.h +++ b/sys/va/gstvafilter.h @@ -43,6 +43,7 @@ enum { GST_VA_FILTER_PROP_AUTO_SATURATION, GST_VA_FILTER_PROP_AUTO_BRIGHTNESS, GST_VA_FILTER_PROP_AUTO_CONTRAST, + GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH, GST_VA_FILTER_PROP_LAST }; diff --git a/sys/va/gstvavpp.c b/sys/va/gstvavpp.c index 2774c19cf7..c1c9bca3d5 100644 --- a/sys/va/gstvavpp.c +++ b/sys/va/gstvavpp.c @@ -161,6 +161,7 @@ enum VPP_CONVERT_DIRECTION = 1 << 3, VPP_CONVERT_FEATURE = 1 << 4, VPP_CONVERT_CROP = 1 << 5, + VPP_CONVERT_DUMMY = 1 << 6, }; extern GRecMutex GST_VA_SHARED_LOCK; @@ -328,6 +329,14 @@ gst_va_vpp_set_property (GObject * object, guint prop_id, self->auto_contrast = g_value_get_boolean (value); g_atomic_int_set (&self->rebuild_filters, TRUE); break; + case GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH:{ + gboolean disable_passthrough = g_value_get_boolean (value); + if (disable_passthrough) + self->op_flags |= VPP_CONVERT_DUMMY; + else + self->op_flags &= ~VPP_CONVERT_DUMMY; + break; + } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -385,6 +394,9 @@ gst_va_vpp_get_property (GObject * object, guint prop_id, GValue * value, case GST_VA_FILTER_PROP_AUTO_CONTRAST: g_value_set_boolean (value, self->auto_contrast); break; + case GST_VA_FILTER_PROP_DISABLE_PASSTHROUGH: + g_value_set_boolean (value, (self->op_flags & VPP_CONVERT_DUMMY)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break;