我正在尝试为有许多嵌套箱的 GStreamer 应用程序生成图表。每个 bin 都有一些元素,但父 bin 的 bin 看起来像任何其他具有 pad(接收器和源)的常见元素。我想可视化它,但在 Graphviz 中我无法生成嵌套节点,所以我必须通过子图来完成。不幸的是,子图没有像记录形状这样的节点选项。在我的图中,每个节点都有记录形状,但子图不能。例子:
digraph G
{
graph [rankdir = TD]
node [shape = record]
subgraph cluster_player
{
label = "player"
subgraph cluster_bin1
{
label = "bin1"
bin1_sink1 [label = "sink1"]
bin1_sink2 [label = "sink2"]
obj1 [
label = "{ { <sink1> sink1 | <sink2> sink2 } | obj1 | { <src1> src1 | <src2> src2 } }"
]
bin1_src1 [label = "src1"]
bin1_src2 [label = "src2"]
bin1_sink1:s -> obj1:sink1:n []
bin1_sink2:s -> obj1:sink2:n []
obj1:src1:s -> bin1_src1:n []
obj1:src2:s -> bin1_src2:n []
}
bin1_src1:s -> bin2_sink1:n []
bin1_src2:s -> bin2_sink2:n []
subgraph cluster_bin2
{
label = "bin2"
bin2_sink1 [label = "sink1"]
bin2_sink2 [label = "sink2"]
bin2_obj1 [
label = "{ { <sink1> sink1 | <sink2> sink2 } | obj1 | { <src1> src1 } }"
]
bin2_obj2 [
label = "{ { <sink1> sink1 } | obj2 | { <src1> src1 } }"
]
bin2_src1 [label = "src1"]
bin2_sink1:s -> bin2_obj1:sink1:n []
bin2_sink2:s -> bin2_obj1:sink2:n []
bin2_obj1:src1:s -> bin2_obj2:sink1:n []
bin2_obj2:src1:s -> bin2_src1:n []
}
}
}
正如您现在可以看到的,垃圾箱中的源和接收器就像普通元素一样,但我希望它们看起来像“obj1”中的记录。怎么做?如果不可能,也许还有其他语言具有该功能?