GNOME Bugzilla – Bug 643269
dot file flow direction
Last modified: 2011-08-06 16:30:45 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.
Sorry, the last line should read - If this is reversed, then flow goes from top right, rightwards to bottom right.
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.
Thanks Edward, Why would you think it wouldn't make a difference for bins or ghostpads? Can you give me an example of this?
(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?
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.
(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().
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.
Yes, make a new function and have the common parts there, so that you can call it for both cases.
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".
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 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.