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 643269 - dot file flow direction
dot file flow direction
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal enhancement
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-25 06:29 UTC by shaun
Modified: 2011-08-06 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Visual example of the existing configuration, and an example of the proposed configuration (496.35 KB, image/png)
2011-02-25 06:29 UTC, shaun
  Details
New pipeline dot graph. (16.88 KB, image/png)
2011-08-05 03:15 UTC, shaun
  Details
Patch changes the order that the sink and src pads are written to dot file. (3.19 KB, patch)
2011-08-05 03:19 UTC, shaun
committed Details | Review

Description shaun 2011-02-25 06:29:56 UTC
Created attachment 181895 [details]
Visual example of the existing configuration, and an example of the proposed configuration

This is a question/request about the direction of flow in an image processed from the dot file created by the GST_DEBUG_BIN_TO_DOT_FILE function.

By default the rank direction LR. Therefore in the png, the flow goes from bottom left, rightwards to the top right. But this means the downstream elements are above the reference element, and upstream elements are below the current element.

Wouldn't it be more logical if the flow went from top right, rightwards to the bottom right? (This is not the same as rankdir=TB, with is top left, downwards to bottom left).

That way, elements that are "upstream" are physically located above and before the current element, and vice versa.

From what I can tell the function debug_dump_element( in the file gstdebugutils.c prints the dot file with the src pads preceding the sink pad. If this is reversed, then you get a bottom left, rightwards to top right flow direction.
Comment 1 shaun 2011-02-25 06:33:51 UTC
Sorry, the last line should read - 
If this is reversed, then flow goes from top right, rightwards to bottom right.
Comment 2 Edward Hervey 2011-02-25 08:07:03 UTC
Makes sense (having upstream 'up' the document and downstream 'down' the document).

That being said, it won't solve the ordering for elements with ghostpads or bins I think.

Interesting collection of elements you have there btw.
Comment 3 shaun 2011-02-25 09:16:35 UTC
Thanks Edward,

Why would you think it wouldn't make a difference for bins or ghostpads?

Can you give me an example of this?
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2011-02-27 20:23:55 UTC
(In reply to comment #0)
> From what I can tell the function debug_dump_element( in the file
> gstdebugutils.c prints the dot file with the src pads preceding the sink pad.
> If this is reversed, then you get a bottom left, rightwards to top right flow
> direction.

Sounds good. Can you make a patch and try if it works as you were thinking?
Comment 5 shaun 2011-02-28 03:04:17 UTC
I would really like to make a patch. However I can't seem to find where the src pads get written before the sink pads.

On line 659 of gstdebugutils.c, there is a call debug_dump_element, which (on line 519) calls gst_element_iterate_pads. Am I right in thinking this function gets the list of pads that element has? If so, I am not sure how they are ordered.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2011-02-28 08:23:59 UTC
(In reply to comment #5)
> I would really like to make a patch. However I can't seem to find where the src
> pads get written before the sink pads.
> 
> On line 659 of gstdebugutils.c, there is a call debug_dump_element, which (on
> line 519) calls gst_element_iterate_pads. Am I right in thinking this function
> gets the list of pads that element has? If so, I am not sure how they are
> ordered.

Yes, I would extract the part below gst_element_iterate_pads to a new static function (debug_dump_element_pads()) and call it twice with the iterators obtained by gst_element_iterate_src_pads() and gst_element_iterate_sink_pads().
Comment 7 shaun 2011-06-08 02:58:00 UTC
Thanks Stefan,

Although I'm not really sure what you mean. Do you mean create a new function debug_dump_element_pads()? I guess I'm just not sure which part has to be 'extracted' and replaced with.
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2011-06-08 15:58:42 UTC
Yes, make a new function and have the common parts there, so that you can call it for both cases.
Comment 9 shaun 2011-08-05 03:15:50 UTC
Created attachment 193290 [details]
New pipeline dot graph.

A visual example of the new changes output in terms of a dot graph. Upstream elements appear "up" in the graph, whilst downstream elements appear "down".
Comment 10 shaun 2011-08-05 03:19:35 UTC
Created attachment 193291 [details] [review]
Patch changes the order that the sink and src pads are written to dot file.

I have implemented Stefan's suggestion, and created a new static function
debug_dump_element_pads() in gstdebugutils.c. This function is called within
the function debug_dump_element(), after the iterator from
gst_element_iterate_sink_pads() is obtained, and then again after the iterator
after gst_element_iterate_src_pads().

I have tested the changes on some test pipeline, and it is giving the results I
expect, i.e. a dot file that has the sink pads written before the src pads,
meaning upstream elements are above downstream elements in the graph.

As Edward suggested, I'm not sure this helps when using ghostpads.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2011-08-06 16:27:27 UTC
Comment on attachment 193291 [details] [review]
Patch changes the order that the sink and src pads are written to dot file.

Thanks for the patch. Please submit a git style patch (git add, git commit, git format-patch) in the future.