[macOS] no element "wavparse"
I'm writing a new version of ripperX in rust (I used to be maintainer of the original in C 20+ years ago) using gstreamer-rs. However, when running the tests (or the app itself), it fails to find most elements (wavparse, audioconvert, vorbisenc...) on macOS (tried x86_64 and M1), while filesrc is found. When I run the exact same pipeline on the command line using gst-launch-1.0, it just works. On linux (also tried x86_64 and aarch64) it just works as expected. Gstreamer and all plugins were installed using homebrew.
You can check the code in the link above in src/ripper.rs, but here is a small snippet that reproduces the problem:
#[test]
pub fn test_parse() {
gstreamer::init().unwrap();
let mut path = env::var("CARGO_MANIFEST_DIR").unwrap();
path.push_str("/resources/test/file_example_WAV_1MG.wav");
let desc = format!(
r##"filesrc location={} ! wavparse ! audioconvert ! vorbisenc ! oggmux ! filesink location=out.ogg"##,
path
);
// Like teasered above, we use GLib's main loop to operate GStreamer's bus.
let main_loop = glib::MainLoop::new(None, false);
let pipeline = gstreamer::parse_launch(desc.as_str()).unwrap();
let bus = pipeline.bus().unwrap();
}
In this snippet, the pipeline is created using a description string, while in the actual code it's creating the elements using ElementFactory::make("wavparse", None).unwrap();
. Both methods panic on macOS. As the pipeline works on the command line (and in linux), I suspect the problem is not with gstreamer but with gstreamer-rs. If I'm doing something wrong, please tell me, but the above snippet pretty much is copied from the examples in gstreamer-rs.