1

I'm trying to use Gstreamer in a C program.

I use udpsrc so I have to put caps :

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

With this, I get an Segmentation fault.

So, I've tried with G_DEBUG="fatal_warnings" gdb --args ./test_gst. Here's the output :

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 ()

I don't know if this can help, but I'm working on a Raspberry PI 3 (raspbian).

ks1322
  • 33,961
  • 14
  • 109
  • 164
kecalace
  • 117
  • 1
  • 16

1 Answers1

0

I found a similar bug report with Segmentation fault in gst_mini_object_init(). According to this comment you should call gst_init() before using Gstreamer.

Did you call gst_init() before using Gstreamer API ?

ks1322
  • 33,961
  • 14
  • 109
  • 164
  • I was doing it after (I'm so stupid ^^). Now I have another issue with `g_object_set(G_OBJECT(data.udpsrc), "port", 5000, "caps", caps, NULL);` : `strchr() at ../ports/sysdeps/arm/armv6/strchr.S : No such file or directory` – kecalace Jan 12 '17 at 12:31
  • See [Segmentation fault with g_object_set / strchr](http://stackoverflow.com/questions/41614067/segmentation-fault-with-g-object-set-strchr) – kecalace Jan 12 '17 at 13:09