mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 13:56:32 +00:00
example: va: Add skin tone enhancement.
If camera is used as input stream and skin tone parameter is available in vapostproc, and no random changes are enabled, the skin tone will be enabled. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2470>
This commit is contained in:
parent
dc825d6a52
commit
5c5083586d
1 changed files with 15 additions and 4 deletions
|
@ -158,23 +158,34 @@ message_handler (GstBus * bus, GstMessage * msg, gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_vpp (GstElement * vpp)
|
config_simple (struct _app *app)
|
||||||
{
|
{
|
||||||
GParamSpec *pspec;
|
GParamSpec *pspec;
|
||||||
GObjectClass *g_class = G_OBJECT_GET_CLASS (vpp);
|
GObjectClass *g_class = G_OBJECT_GET_CLASS (app->vpp);
|
||||||
const static gchar *props[] = { "brightness", "hue", "saturation",
|
const static gchar *props[] = { "brightness", "hue", "saturation",
|
||||||
"contrast"
|
"contrast"
|
||||||
};
|
};
|
||||||
gfloat max;
|
gfloat max;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
|
if (camera && (pspec = g_object_class_find_property (g_class, "skin-tone"))) {
|
||||||
|
if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_BOOLEAN) {
|
||||||
|
g_object_set (app->vpp, "skin-tone", TRUE, NULL);
|
||||||
|
} else {
|
||||||
|
max = ((GParamSpecFloat *) pspec)->maximum;
|
||||||
|
g_object_set (app->vpp, "skin-tone", max, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (props); i++) {
|
for (i = 0; i < G_N_ELEMENTS (props); i++) {
|
||||||
pspec = g_object_class_find_property (g_class, props[i]);
|
pspec = g_object_class_find_property (g_class, props[i]);
|
||||||
if (!pspec)
|
if (!pspec)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
max = ((GParamSpecFloat *) pspec)->maximum;
|
max = ((GParamSpecFloat *) pspec)->maximum;
|
||||||
g_object_set (vpp, props[i], max, NULL);
|
g_object_set (app->vpp, props[i], max, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +219,7 @@ build_pipeline (struct _app *app)
|
||||||
|
|
||||||
app->vpp = gst_bin_get_by_name (GST_BIN (app->pipeline), "vpp");
|
app->vpp = gst_bin_get_by_name (GST_BIN (app->pipeline), "vpp");
|
||||||
if (!randomcb && !randomdir && !randomsharpen && !randomcrop)
|
if (!randomcb && !randomdir && !randomsharpen && !randomcrop)
|
||||||
config_vpp (app->vpp);
|
config_simple (app);
|
||||||
|
|
||||||
app->crop = gst_bin_get_by_name (GST_BIN (app->pipeline), "crop");
|
app->crop = gst_bin_get_by_name (GST_BIN (app->pipeline), "crop");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue