GNOME Bugzilla – Bug 782028
gst-stats: doesn't build with msvc
Last modified: 2017-07-09 19:12:02 UTC
Created attachment 350825 [details] [review] [PATCH gstreamer] tracers/stats: Use standard character escapes gst-stats.c uses character escapes '\e' and '\[' which seem to be gnu extensions.
Also, are these regexes working? It looks like they are meant to match ansi escape codes, but ansi escape codes won't have the '\[' thing after the escape character. AFAICT that is a bash-ism to tell the shell that the things between \[ and \] won't be printed, so that it knows how many characters long on the screen the thing it just printed is.
This is rather horrible :)
(In reply to Scott D Phillips from comment #1) > Also, are these regexes working? It looks like they are meant to match ansi > escape codes, but ansi escape codes won't have the '\[' thing after the > escape character. AFAICT that is a bash-ism to tell the shell that the > things between \[ and \] won't be printed, so that it knows how many > characters long on the screen the thing it just printed is. This is all wrong, sorry for the FUD. I was misunderstanding the ansi CSI, which is actually the two byte sequence 0x1b 0x5b ("\x1b["), and obviously '[' needs escaped in a regex. I tested gst-stats-1.0 (before and after the patch) and the regex is working fine.
So it's good to go? Did you test on Linux with gcc as well?
(In reply to Tim-Philipp Müller from comment #4) > So it's good to go? Did you test on Linux with gcc as well? I have only tested this with gcc on linux actually. gst-launch-1.0 (with the stats tracer) and gst-stats-1.0 both crash for me on windows for some reason that I haven't had time to dig into.
Well then, let's see how it goes: commit f37688ef4d81fd1a28eddb1e26b1efccc46329db Author: Scott D Phillips <scott.d.phillips@intel.com> Date: Mon May 1 13:35:09 2017 -0700 tools: gst-stats: Use standard character escapes Having '\e' expand to '\x1b' is a gnu extension. I didn't see any document describing the behavior, but gcc also seems to expand '\[' to '['. https://bugzilla.gnome.org/show_bug.cgi?id=782028 Thanks for the patch.