summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2018-08-29 11:53:13 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-08-29 12:03:52 -0400
commit2f30287b5f3b0d7519fde2260b2efe027f8a3956 (patch)
tree26728d704f933cda4a12f04a5628b8587dfcf09c
parent63dca26fac961c2db7349bbd8b746eda2efadcf2 (diff)
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
-rw-r--r--sys/kms/gstkmssink.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
index 651a8eb77..bc85ffe0f 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);