Segfault when creating a ghost pad for a bin-based element
Hello.
I'm using Gstreamer 1.14 on ArchLinux, I'm trying to define a Bin-based element using rust bindings, but it ends up segfaulting at runtime when I try to create a ghost pad.
Attached are the source files to build a minimal example showing this (a Cargo.toml and some rust code to be placed in the same directory)
To run it:
$ cargo build
$ export GST_PLUGIN_PATH=`pwd`/target/debug
$ gst-inspect-1.0 customsource
Just adding an element to the bin works fine, by removing/commenting the following lines (source.rs):
let ghost_pad = gst::GhostPad::new("src", &pad).unwrap(); //segfault
println!("{:?}", ghost_pad);
bin.add_pad(&ghost_pad).unwrap();
the gst-inspect command displays the name of the child element 'testsource'.
I don't know if I'm having the best approach to begin with, this being said: I doubt segfaulting like that was meant to happen, I've tried using gdb on the gst-inspect command, but the stacktrace is fairly cryptic (to me).
Any idea?