summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-03-26 17:48:09 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-04-03 15:47:18 +0200
commit2ba5854c6bc76354ab2b764529dd5edcc18627b1 (patch)
tree56b307636d86f3b96b94f0b5b5fff0286fac346c
parentf4862f8298d052cf9fd32653caeee6ded8a0d570 (diff)
downloadgstreamer-plugins-bad-2ba5854c6bc76354ab2b764529dd5edcc18627b1.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2058>
-rw-r--r--sys/va/gstvafilter.c7
-rw-r--r--sys/va/gstvafilter.h1
-rw-r--r--sys/va/gstvavpp.c12
3 files changed, 20 insertions, 0 deletions
diff --git a/sys/va/gstvafilter.c b/sys/va/gstvafilter.c
index d5cc080b5..4a14fdfda 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 da5130fdf..896694b74 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 2774c19cf..c1c9bca3d 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;