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>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-03-26 17:48:09 +01:00
parent f4862f8298
commit 2ba5854c6b
3 changed files with 20 additions and 0 deletions

View file

@ -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;
}

View file

@ -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
};

View file

@ -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;