GNOME Bugzilla – Bug 733482
discoverer: Prettify tags with samples
Last modified: 2014-07-22 07:34:23 UTC
Created attachment 281283 [details] [review] The patch - first version Attaching a patch for gst-discoverer to trim long tags e.g. images (longer than 100 characters) to avoid flooding the terminal. Added a --full-tags option in case the user still wants to see them.
Comment on attachment 281283 [details] [review] The patch - first version Looks good to me, but on top of that we could probably write something that extracts the different fields of the sample from the base64 encoded strings... and then e.g. prints the width/height for image tags. But that can be done separately, the way we printed GstSamples before was completely useless and just dropping some chars from the middle is a big improvement already
Well, they had to be printed in a way that can easily be de-serialized again. I'm not sure this code is entirely correct, because samples are made up of multiple items, and the shortening now treats all items as one, doesn't it? Perhaps it should just not serialize the sample value to begin with, but instead get the GstSample out and then print the buffer data (shortened) plus the caps separately?
Even easier: perhaps just print the number of bytes in the buffer and the caps, like gst-launch does: http://cgit.freedesktop.org/gstreamer/gstreamer/tree/tools/gst-launch.c#n349
Created attachment 281300 [details] [review] The patch - second version Cool, thanks Tim for the idea! I implemented that now, no option this time.
Pushed with minor changes (moved variables into block where they're used), thanks: commit fe67cd3d002afec55a2a69a01c8cb51ee76d6a88 Author: Vivia Nikolaidou <n.vivia@gmail.com> Date: Mon Jul 21 13:48:31 2014 +0300 discoverer: prettier image tag printing Rather than dumping the serialized sample value, the code now prints the number of bytes in the buffer, then the caps in a human-readable format. https://bugzilla.gnome.org/show_bug.cgi?id=733482 If you want to fix up the other occurences too, feel free to attach patches here as well.
Created attachment 281310 [details] [review] Use that code for topology tags Attaching a patch to print the tags in topology the same way (with a mild refactoring to achieve that).
Review of attachment 281310 [details] [review]: ::: tools/gst-discoverer.c @@ +139,3 @@ + } + if (verbose) + g_print ("%*s\n", 2 * depth, " "); Not sure what the point of this printing of whitespace and an empty line is :) Especially why only in verbose mode? But it was there before...
commit a0dd71ad805db89725ab8265bab7c047ff515501 Author: Vivia Nikolaidou <n.vivia@gmail.com> Date: Mon Jul 21 15:54:05 2014 +0300 discoverer: Pretty-print topology tags Call the code used in properties for topology tags too. Side-effect achieved: more tags printed, buffers (e.g. images) shortened.