From 2f30287b5f3b0d7519fde2260b2efe027f8a3956 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 29 Aug 2018 11:53:13 -0400 Subject: [PATCH] kmssink: Escape DRM property names This allow setting properties that contains spaces. The spaces are replaced with '-'. As an example, one can set the connector proper "scaling mode" with the following: ... ! kmssink connector-properties="s,scaling-mode=1" https://bugzilla.gnome.org/show_bug.cgi?id=797027 --- sys/kms/gstkmssink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c index 651a8eb77b..bc85ffe0f1 100644 --- a/sys/kms/gstkmssink.c +++ b/sys/kms/gstkmssink.c @@ -573,6 +573,12 @@ set_drm_property (gint fd, guint32 object, guint32 object_type, drmModePropertyPtr property; property = drmModeGetProperty (fd, properties->props[i]); + + /* GstStructure parser limits the set of supported character, so we + * replace the invalid characters with '-'. In DRM, this is generally + * replacing spaces into '-'. */ + g_strcanon (property->name, G_CSET_a_2_z G_CSET_A_2_Z G_CSET_DIGITS, '-'); + if (!strcmp (property->name, prop_name)) { drmModeObjectSetProperty (fd, object, object_type, property->prop_id, value);