gstvalue: use value_nick for serialization
authorMathieu Duponchelle <mathieu@centricular.com>
Sat, 7 Sep 2019 02:36:18 +0000 (04:36 +0200)
committerMathieu Duponchelle <mduponchelle1@gmail.com>
Tue, 17 Sep 2019 01:09:05 +0000 (01:09 +0000)
not value_name . This was causing incorrect launch lines to be
displayed by gst-device-monitor, and the deserialization code
below works with nicks.

gst/gstvalue.c
tests/check/gst/gstvalue.c

index 8835dce..4b396cd 100644 (file)
@@ -3754,7 +3754,7 @@ gst_value_serialize_enum (const GValue * value)
   }
 
   g_return_val_if_fail (en, NULL);
-  return g_strdup (en->value_name);
+  return g_strdup (en->value_nick);
 }
 
 static gint
index 841a4c8..4c898c7 100644 (file)
@@ -2668,9 +2668,9 @@ GST_START_TEST (test_serialize_deserialize_format_enum)
   str = gst_structure_to_string (s);
   GST_LOG ("Got structure string '%s'", GST_STR_NULL (str));
   fail_unless (str != NULL);
-  fail_unless (strstr (str, "TIME") != NULL);
-  fail_unless (strstr (str, "BYTE") != NULL);
-  fail_unless (strstr (str, "DEFAULT") != NULL);
+  fail_unless (strstr (str, "time") != NULL);
+  fail_unless (strstr (str, "byte") != NULL);
+  fail_unless (strstr (str, "default") != NULL);
   fail_unless (strstr (str, "FOOBAR") != NULL);
 
   s2 = gst_structure_from_string (str, &end);