GST_DEBUG_BIN_TO_DOT: creates invalid .dot file when GstStructure parameter contains string with "@"
Submitted by Brendan Shanks
When GST_DEBUG_BIN_TO_DOT_FILE dumps a bin containing an element with a GstStructure parameter, if the GstStructure contains a string value with "@" in it, the resulting .dot file is invalid. xdot gives the error "unexpected char ''"
I came across this bug when dumping the media-pipeline of a GStreamer RTSP server. The GstRtpSession sdes parameter is a GstStructure with a string parameter ("cname") that has an "@" symbol in it.
I haven't investigated why this happens, but it looks like GstStructure
does extra quoting on the output string when it contains "@", and then g_strescape() adds too many backslashes when escaping.
Here's the invalid label line from the .dot file when the string doesn't contain "@": label="GstCapsFilter\nhi@\n\nparent=(GstPipeline) pipeline\ncaps=application/x-rtp-source-sdes, cname=(string)user2341dqw";
And with "@":
label="GstCapsFilter\ncapsfilter0\n\nparent=(GstPipeline) pipeline\ncaps=application/x-rtp-source-sdes, cname=(string)\"user2341\\@dqw\"";
According to the DOT language guide (http://www.graphviz.org/content/dot-language): "In quoted strings in DOT, the only escaped character is double-quote ("). That is, in quoted strings, the dyad " is converted to "; all other characters are left unchanged. In particular, \ remains \"