【问题标题】:how to create the caps for udpsrc element in gstreamer?如何在 gstreamer 中为 udpsrc 元素创建上限?
【发布时间】:2012-06-04 08:52:56
【问题描述】:

我想使用 udpsrc 元素运行音频管道。我要设置 udpsrc 的上限(功能) 例如 gst-launch-0.10 -vvv udpsrc multicast-iface=eth0 uri=udp://239.255.255.6:25012 caps="application/x-rtp, media=(string)audio, payload=(int) 96,clock-rate=(int)16000, encoding-name=(string)MPEG4-GENERIC,streamtype=(string)5,profile-level-id=(string)15,mode=(string)AAC-hbr,config =(string)1408,sizelength=(string)13, indexlength=(string)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);

但它显示了分段错误,所以请尽快告诉我该怎么做?.....

【问题讨论】:

    标签: c ubuntu gstreamer


    【解决方案1】:

    代码看起来不错(尽管您泄漏了大写)。要修复泄漏,请执行以下操作:

    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 内部“运行”,当它崩溃时输入“bt”以显示回溯。

    【讨论】:

      猜你喜欢
      • 2022-06-27
      • 1970-01-01
      • 2015-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多