mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
gst/: Add some more comments and debug output. Quote structure name to fix deserialisation of some strings.
Original commit message from CVS: * gst/gststructure.c: * gst/gstvalue.c: Add some more comments and debug output. Quote structure name to fix deserialisation of some strings.
This commit is contained in:
parent
de997d56cc
commit
68ba3b4384
3 changed files with 20 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-10-15 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* gst/gststructure.c:
|
||||||
|
* gst/gstvalue.c:
|
||||||
|
Add some more comments and debug output. Quote structure name to fix
|
||||||
|
deserialisation of some strings.
|
||||||
|
|
||||||
2007-10-15 Stefan Kost <ensonic@users.sf.net>
|
2007-10-15 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* gst/gstbuffer.h:
|
* gst/gstbuffer.h:
|
||||||
|
|
|
@ -1464,6 +1464,7 @@ gst_structure_value_get_generic_type (GValue * val)
|
||||||
return G_VALUE_TYPE (val);
|
return G_VALUE_TYPE (val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* keep in sync with gstvalue.c */
|
||||||
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
|
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
|
||||||
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
|
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
|
||||||
((c) == '.'))
|
((c) == '.'))
|
||||||
|
@ -1494,7 +1495,7 @@ gst_structure_to_string (const GstStructure * structure)
|
||||||
|
|
||||||
s = g_string_new ("");
|
s = g_string_new ("");
|
||||||
/* FIXME this string may need to be escaped */
|
/* FIXME this string may need to be escaped */
|
||||||
g_string_append_printf (s, "%s", g_quark_to_string (structure->name));
|
g_string_append_printf (s, "\"%s\"", g_quark_to_string (structure->name));
|
||||||
for (i = 0; i < structure->fields->len; i++) {
|
for (i = 0; i < structure->fields->len; i++) {
|
||||||
char *t;
|
char *t;
|
||||||
GType type;
|
GType type;
|
||||||
|
@ -1566,7 +1567,6 @@ gst_structure_parse_range (gchar * s, gchar ** after, GValue * value,
|
||||||
GType range_type;
|
GType range_type;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
|
|
||||||
if (*s != '[')
|
if (*s != '[')
|
||||||
return FALSE;
|
return FALSE;
|
||||||
s++;
|
s++;
|
||||||
|
@ -1861,13 +1861,18 @@ gst_structure_from_string (const gchar * string, gchar ** end)
|
||||||
r = copy;
|
r = copy;
|
||||||
|
|
||||||
name = r;
|
name = r;
|
||||||
if (!gst_structure_parse_string (r, &w, &r))
|
if (!gst_structure_parse_string (r, &w, &r)) {
|
||||||
|
GST_WARNING ("Failed to parse structure string");
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* skip spaces */
|
||||||
while (g_ascii_isspace (*r) || (r[0] == '\\' && g_ascii_isspace (r[1])))
|
while (g_ascii_isspace (*r) || (r[0] == '\\' && g_ascii_isspace (r[1])))
|
||||||
r++;
|
r++;
|
||||||
if (*r != 0 && *r != ';' && *r != ',')
|
if (*r != 0 && *r != ';' && *r != ',') {
|
||||||
|
GST_WARNING ("Failed to find delimiter, r=%s", r);
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
save = *w;
|
save = *w;
|
||||||
*w = 0;
|
*w = 0;
|
||||||
|
@ -1875,8 +1880,10 @@ gst_structure_from_string (const gchar * string, gchar ** end)
|
||||||
*w = save;
|
*w = save;
|
||||||
|
|
||||||
while (*r && (*r != ';')) {
|
while (*r && (*r != ';')) {
|
||||||
if (*r != ',')
|
if (*r != ',') {
|
||||||
|
GST_WARNING ("Failed to find delimiter, r=%s", r);
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
r++;
|
r++;
|
||||||
while (*r && (g_ascii_isspace (*r) || (r[0] == '\\'
|
while (*r && (g_ascii_isspace (*r) || (r[0] == '\\'
|
||||||
&& g_ascii_isspace (r[1]))))
|
&& g_ascii_isspace (r[1]))))
|
||||||
|
|
|
@ -1711,6 +1711,7 @@ gst_value_compare_string (const GValue * value1, const GValue * value2)
|
||||||
return GST_VALUE_EQUAL;
|
return GST_VALUE_EQUAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* keep in sync with gststructure.c */
|
||||||
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
|
#define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
|
||||||
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
|
((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
|
||||||
((c) == '.'))
|
((c) == '.'))
|
||||||
|
|
Loading…
Reference in a new issue