c - gst_mini_object_init 中的段错误

标签 c debugging gstreamer

我正在尝试在 C 程序中使用 Gstreamer。

我使用 udpsrc 所以我必须大写 :

GstCaps *caps = gst_caps_new_empty_simple("application/x-rtp");

有了这个,我得到了一个段错误

因此,我尝试使用 G_DEBUG="fatal_warnings"gdb --args ./test_gst。 这是输出:

Program received signal SIGSEGV, Segmentation fault.
0x76f010e4 in gst_mini_object_init (mini_object=0x28600, flags=0, type=0, copy_func=0x76ed6174 <_gst_caps_copy>, dispose_func=0x0, free_func=0x76ed5128 <_gst_caps_free>)
    at gstminiobject.c:133
133 gstminiobject.c: No such file or directory.
(gdb) bt
#0  0x76f010e4 in gst_mini_object_init (mini_object=0x28600, flags=0, type=0, copy_func=0x76ed6174 <_gst_caps_copy>, dispose_func=0x0, free_func=0x76ed5128 <_gst_caps_free>)
    at gstminiobject.c:133
#1  0x76ed57b4 in gst_caps_init (caps=0x28600) at gstcaps.c:209
#2  gst_caps_new_empty () at gstcaps.c:239
#3  0x76ed58f8 in gst_caps_new_empty_simple (media_type=0x110b4 "application/x-rtp") at gstcaps.c:282
#4  0x00010bbc in main ()

我不知道这是否有帮助,但我正在研究 Raspberry PI 3 (raspbian)。

最佳答案

我找到了一个类似的 bug reportgst_mini_object_init() 中出现段错误。根据this comment你应该在使用 Gstreamer 之前调用 gst_init()

在使用 Gstreamer API 之前,您是否调用了 gst_init()

关于c - gst_mini_object_init 中的段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41611041/

相关文章:

将 Long 转换为 Unsigned Short Int/Strtol

c - 如何在 C 中返回 SQLPOINTER 数组?

c - 无法在 C 中打印 float64 值

php - Emacs+geben : Open local files when debugging instead of remote ones

android - Android 上的 GStreamer

c - C变量中是否有可能 "Turn off"或 "Turn on"波动?

c++ - 从命令行运行到 "Run without Debugging"的不同行为

python - 在 Atom 中编写 Python 代码时,是否有一种巧妙的方法来调试 Python 代码?

networking - 在有损网络上流式传输视频

c++ - 在 Visual Studio 中使用 C++ 中的 GStreamer