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 574484 - [patch] Make caps in DOT debug graphs more readable
[patch] Make caps in DOT debug graphs more readable
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal minor
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-07 16:12 UTC by Laszlo Pandy
Modified: 2009-03-11 08:29 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
patch to make caps output in DOT more readable (2.68 KB, patch)
2009-03-07 16:16 UTC, Laszlo Pandy
none Details | Review
A cropped DOT file rendering of the unreadable caps (gstreamer head) (71.56 KB, image/png)
2009-03-10 21:12 UTC, Laszlo Pandy
  Details
A cropped DOT file rendering of good caps (gstreamer with patch applied) (50.44 KB, image/png)
2009-03-10 21:13 UTC, Laszlo Pandy
  Details
patch to make caps output in DOT more readable, updated to current git (2.95 KB, patch)
2009-03-10 23:09 UTC, Laszlo Pandy
committed Details | Review

Description Laszlo Pandy 2009-03-07 16:12:46 UTC
When DEBUG_BIN_TO_DOT_FILE() is used with DEBUG_GRAPH_SHOW_CAPS_DETAILS, the caps are put in the DOT file by simply taking the to_string() of the caps and replacing ',' with '\n'. This is a problem because commas aren't only present between caps field name but also inside values such as { 1234, 4321 }.

When the caps have not been negotiated and you are trying to figure out why by looking at the caps in the DOT file you will see this terribly difficult to read block of text:

    audio/x-raw-float
      rate=(int)[ 1
      2147483647 ]
    channels=(int)[ 1
      2147483647 ]
  endianness=(int) { 1234
         4321 }
width=(int)64; audio/x-raw-float
    rate=(int)[ 1
      2147483647 ]
    channels=(int)[ 1
      2147483647 ]
  endianness=(int) { 1234
        4321 }
    width=(int)32;
    
    
You will also notice that none of the lines start at the same place because the text is centred.

My patch changes the font to monospace (so we can make things line up like in the terminal), and then outputs the caps in the same style as gst-inspect-0.10 does. The same caps above will now appear like this in the DOT file:

audio/x-raw-float
             rate: [ 1, 2147483647 ]
         channels: [ 1, 2147483647 ]
       endianness: { 1234, 4321 }
            width: 64
audio/x-raw-float
             rate: [ 1, 2147483647 ]
         channels: [ 1, 2147483647 ]
       endianness: { 1234, 4321 }
            width: 32


Other information:
Comment 1 Laszlo Pandy 2009-03-07 16:16:34 UTC
Created attachment 130237 [details] [review]
patch to make caps output in DOT more readable

I am not entirely sure about the policy for using private macros such as STRUCTURE_ESTIMATED_STRING_LEN(). Please review, and let me know. Thanks!
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2009-03-10 20:49:33 UTC
I have actually already fixed the naive \n scheme in git. I does not replace , inside  [](){}. The doump now also figures not negotiated caps and shows both the caps or src and sink. I am not really convinced about the formatting. You are supposed to render the dot as png or such and not look at it in a terminal :)

What shall we do?
Comment 3 Laszlo Pandy 2009-03-10 21:12:20 UTC
Created attachment 130433 [details]
A cropped DOT file rendering of the unreadable caps (gstreamer head)
Comment 4 Laszlo Pandy 2009-03-10 21:13:16 UTC
Created attachment 130434 [details]
A cropped DOT file rendering of good caps (gstreamer with patch applied)
Comment 5 Laszlo Pandy 2009-03-10 23:09:20 UTC
Created attachment 130439 [details] [review]
patch to make caps output in DOT more readable, updated to current git
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2009-03-11 08:29:54 UTC
I made a small change to set the label font per dot file and not for each label. Thanks for the patch!

commit 0890ebc0349e6363b0f73e222945b3d3f27a59e1
Author: Laszlo Pandy <laszlok2@gmail.com>
Date:   Wed Mar 11 10:27:16 2009 +0200

    dump2dot: make caps in DOT debug graphs more readable. Fixes 574484
    
    Use a monospace font for edge labels and indent.