-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread panicks when filter is used inside C code #23
Comments
Thanks for the report. This is indeed supposed to be possible. gst-launch-1.0 is not doing anything different than what your code is doing. Which makes it even more mysterious why it is failing with your code. Basically the problem here is that the plugin pointer here is not a GstPlugin: gst-plugin-rs/gst-plugin/src/plugin.rs Lines 42 to 44 in 768b68f
Maybe it is NULL, maybe something completely different. It really shouldn't though. Can you add this at the top of the function and give the output before it panics? println!("{:?}", plugin);
let type_ = from_glib(*(plugin as *const *const glib_sys::GType));
println!("{:?}", type_); |
update: The problem is on my side (since I've managed to create an So, I think it's OK to close this issue. It was confusing to be able to use the custom plugins with rust, and failing with C; but at the same time I have managed to compile it with unsafe extern "C" fn plugin_init_trampoline(plugin: *mut $crate::gst_ffi::GstPlugin) -> $crate::glib_ffi::gboolean {
println!("{:?}", plugin);
let type_: Type = from_glib((*(plugin as *const *const $crate::glib_ffi::GType)) as $crate::glib_ffi::GType);
println!("{:?}", type_);
super::$plugin_init(&from_glib_borrow(plugin)).to_glib()
} Sidenote: Without so I have found possible types in FromGlib crate docs and cast it to ... and got
Therefore, I guess it is |
If it works on Linux but not on macOS, that's definitely a bug and one that has to be solved. Unfortunately I don't have access to a macOS machine myself currently (mine is waiting in a box somewhere to be set up again). I'll have to find remote access to one, or so :) Thanks for the added output and sorry for missing that conversion is needed. That's unfortunately not too helpful either, it basically means that we get some random pointer there as plugin. It's not NULL but it's also no pointer to any GObject. @qezz Do you maybe have multiple versions of GObject on your system, and your C application, GStreamer and/or the Rust plugin are linking to different ones? |
@qezz How did you install GStreamer btw, and do you have multiple installations on your system (e.g. homebrew and from the GStreamer binaries)? |
I installed GStreamer 1.12.3 from homebrew and gst-plugin-rs from master, just running On macOS 10.13.1 (17B48), Xcode Version 9.1 (9B55), clang Apple LLVM version 9.0.0 (clang-900.0.38), GStreamer 1.12.3 from homebrew, cargo 0.22.0 (3423351a5 2017-10-06), rustc 1.21.0 (3b72af97e 2017-10-09). |
Oh, and: |
@qezz Maybe you can also run |
There is some mess with Gstreamer development package for mac, so yes, I definitely have. However, both versions are 1.12.3
# rust plugin
$ otool -L target/debug/libgstrsaudiofx.dylib
target/debug/libgstrsaudiofx.dylib:
/Users/username/sources/gstreamer/gst-plugin-rs/target/debug/deps/libgstrsaudiofx.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/gst-plugins-base/lib/libgstaudio-1.0.0.dylib (compatibility version 1204.0.0, current version 1204.0.0)
/usr/local/opt/gstreamer/lib/libgstbase-1.0.0.dylib (compatibility version 1204.0.0, current version 1204.0.0)
/usr/local/opt/gstreamer/lib/libgstreamer-1.0.0.dylib (compatibility version 1204.0.0, current version 1204.0.0)
/usr/local/opt/glib/lib/libgobject-2.0.0.dylib (compatibility version 5401.0.0, current version 5401.1.0)
/usr/local/opt/glib/lib/libglib-2.0.0.dylib (compatibility version 5401.0.0, current version 5401.1.0)
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
# app
$ otool -L GStCxxDynPipe
GStCxxDynPipe:
/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/GStreamer (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2) Does it mean that I have two different versions linked? If yes, then I'm about to purge |
Yes, it's using different versions. GStCxxDynPipe uses the GStreamer binaries, libgstrsaudiofx.dylib uses the Homebrew binaries. If you load both in the same process, things will fall apart :) You can keep both versions around, but it's dangerous and this might happen again. The only thing you need to do is to make sure that you use the same PKG_CONFIG_PATH for building the plugin as for your application (so that it links/uses the same GStreamer). |
I want to use
rsaudioecho
filter in C code (is it even possible?), but it panicks atgst_init()
ifGST_PLUGIN_PATH
is specified(macOS Sierra 10.12.6, Xcode 8.3.3 (8E3004b), clang-802.0.42, rustc 1.23.0-nightly, cargo 0.24.0-nightly, GStreamer 1.12.3)
output:
BTW,
rsaudioecho
works well withgst-launch-1.0
andgst-inspect-1.0
The text was updated successfully, but these errors were encountered: