After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 164479 - [cli-tools] gst_parse_launch can't handle spaces
[cli-tools] gst_parse_launch can't handle spaces
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.8.10
Assigned To: Andy Wingo
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-01-18 15:42 UTC by Andy Wingo
Modified: 2005-03-21 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hackish fix (1.32 KB, patch)
2005-02-11 11:53 UTC, Tim-Philipp Müller
none Details | Review

Description Andy Wingo 2005-01-18 15:42:31 UTC
This should work:

gst-launch-0.8 -v v4lsrc ! 'video/x-raw-yuv, format=(fourcc)I420,
width=(int)320, height=(int)240, framerate=(double)28.125' ! xvimagesink

The caps string comes from what gst-launch -v prints out.

This works, however:
gst-launch-0.8 -v v4lsrc !
'video/x-raw-yuv,format=(fourcc)I420,width=(int)320,height=(int)240,framerate=(double)28.125'
! xvimagesink
Comment 1 Tim-Philipp Müller 2005-02-11 11:53:53 UTC
Created attachment 37335 [details] [review]
hackish fix

The problem seems to be that in the string passed to
gst_structure_from_string() the whitespaces are escaped with a leading
backslash (not any other special shell characters like round brackets though).
The parsing code doesn't expect those escape slashes. Not sure who does the
escaping.

One could fix this like in the attached patch, but it seems a bit hackish to me
somehow.

Cheers
 -Tim
Comment 2 Ronald Bultje 2005-03-11 20:23:29 UTC
Shouldn't you unescape such strings then? I'm not opposed to this patch, but it
seems a bit wrong, since you'll skip other escaped sequences as well.
Comment 3 Ronald Bultje 2005-03-12 23:19:07 UTC
A better method is to use g_ascii_isspace(*s) || (s[0] == '\\' &&
g_ascii_isspace(s[1])). Feel free to commit the patch with that fixed.
Comment 4 Tim-Philipp Müller 2005-03-21 16:23:21 UTC
The thing is that only spaces seem to be escaped, not brackets etc.

The cleaner fix would undoubtedly have been to unescape the string once before
parsing and then parse it in the usual way, but that would have been much less
straight-forward and more error-prone IMHO, because of the gchar **end out
parameter in gst_structure_new_from_string() and related functions (you can't
just add the number of escaped spaces to the end-pointer-in-the-unescaped-string
because it's not easy to know how many of the escaped spaces are in the parsed
part of the string and how many are in the part of the string after *end etc.).

Anyway, committed and changed as suggested.

Cheers
 -Tim