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 733482 - discoverer: Prettify tags with samples
discoverer: Prettify tags with samples
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-21 08:37 UTC by Vivia Nikolaidou
Modified: 2014-07-22 07:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch - first version (2.65 KB, patch)
2014-07-21 08:37 UTC, Vivia Nikolaidou
reviewed Details | Review
The patch - second version (1.73 KB, patch)
2014-07-21 10:52 UTC, Vivia Nikolaidou
committed Details | Review
Use that code for topology tags (7.09 KB, patch)
2014-07-21 13:09 UTC, Vivia Nikolaidou
committed Details | Review

Description Vivia Nikolaidou 2014-07-21 08:37:36 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 1 Sebastian Dröge (slomo) 2014-07-21 08:40:08 UTC
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
Comment 2 Tim-Philipp Müller 2014-07-21 09:13:47 UTC
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?
Comment 3 Tim-Philipp Müller 2014-07-21 09:52:40 UTC
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
Comment 4 Vivia Nikolaidou 2014-07-21 10:52:35 UTC
Created attachment 281300 [details] [review]
The patch - second version

Cool, thanks Tim for the idea! I implemented that now, no option this time.
Comment 5 Tim-Philipp Müller 2014-07-21 11:44:42 UTC
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.
Comment 6 Vivia Nikolaidou 2014-07-21 13:09:18 UTC
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).
Comment 7 Sebastian Dröge (slomo) 2014-07-22 07:30:01 UTC
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...
Comment 8 Sebastian Dröge (slomo) 2014-07-22 07:34:23 UTC
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.