我想使用udpsrc元素运行音频管道我将设置udpsrc的上限(能力)
例如gst-launch-0.10-vvv udpsrc multicast iface=eth0 uri=udp://239.255.255.6:25012 caps=“应用程序/x-rtp,媒体=(字符串)音频,负载=(int)96,时钟速率=(int)16000,编码名称=(字符串)MPEG4-GENERIC,流类型=(字符串)5,配置文件级别id=(字符串)15,模式=(字符串)AAC hbr,配置文件=(字符串)1408,大小长度=(字符串)13,索引长度=(字符串)3,indexdeltalength=(string)3“在程序i中使用
g_object_set(G_OBJECT(Source),"caps",gst_caps_new_simple ("application/x-rtp",
"media", G_TYPE_STRING, "audio",
"payload",G_TYPE_INT,96,
"clock-rate", G_TYPE_INT, 16000,
"encoding-name", G_TYPE_STRING,"MPEG4-GENERIC",
"streamtype",G_TYPE_STRING,"5",
"profile-level-id", G_TYPE_STRING,"15",
"mode",G_TYPE_STRING,"AAC-hbr",
"config",G_TYPE_STRING,"1408",
"sizelength",G_TYPE_STRING,"13",
"indexlength",G_TYPE_STRING,"3"
"indexdeltalength",G_TYPE_STRING,"3",
NULL),NULL);
但它显示了一个分割错误,所以请尽快告诉我该怎么做?.....
最佳答案
代码看起来没问题(尽管你漏掉了盖子)要修复泄漏,请执行以下操作:
GstCaps *caps = gst_caps_new_simple( ....);
g_object_set(source, "caps", caps, NULL);
gst_caps_unref(caps);
要弄清楚为什么它会在gdb下运行应用程序:
G_DEBUG="fatal_warnings" gdb --args ./my-app <args>
在gdb“run”中,当它崩溃时,键入“bt”来显示回溯。
关于c - 如何在gstreamer中为udpsrc元素创建上限?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10878656/