我有一个名为Node的类
class Node:
def __init__(self,name, childList, parentList):
self.name = name
# a list of all nodes which are children of this node
# may have length 0 to many
self.childList = childList
# a list of all nodes which are parents of this node
# may have length 0 to many
self.parentList = parentList
Run Code Online (Sandbox Code Playgroud)
我有一个节点列表(nodeList).这些节点可以在彼此的父列表或子列表中.我希望能够将他们的childLists和父代列表中指定的节点之间的关系可视化到stdout上(作为ASCII绘图).
例如,下面的名称是nodeList中节点的名称.
Classifier
|
|
FeatureCombiner
/ \
/ \
/ \
FeatureGenerator1 FeatureGenerator2
\ /
\ /
\ /
\ /
\ /
\ / …Run Code Online (Sandbox Code Playgroud) 我想知道如何使用post-messages = TRUE属性从gstreamer multifilesink元素获取回调?在下面的代码中,永不调用my_bus_callback函数。
Multifilesink文档说:如果“ post-messages”属性为TRUE,则在写入每个缓冲区后会发送名为“ GstMultiFileSink”的应用程序消息。
#include <gst/gst.h>
#include <stdio.h>
#include <unistd.h>
// Compilation:
// gcc gst_messages.c -g3 -o gst_messages `pkg-config --cflags --libs gstreamer-0.10`
static GMainLoop *loop;
static gboolean
my_bus_callback (GstBus *bus,
GstMessage *message,
gpointer data)
{
printf("Got %s message\n", GST_MESSAGE_TYPE_NAME (message));
/* we want to be notified again the next time there is a message
* on the bus, so returning TRUE (FALSE means we want to stop watching
* for messages on the bus and our …Run Code Online (Sandbox Code Playgroud)