static plugin registration
This patch allows static plugin registration and demonstrates the need for it in testing.
In the togglerecord plugin, a shared library in the target directory is loaded and tested. In is assumed that this shared library is created with an earlier cargo build
. Therefore, cargo test
is not consistent as it assumes a specific state of the file system. This approach can also break the development flow (e.g. cargo watch -x test
). A better approach would probably be to load the currently build library and do static plugin registration.
The problem can be reproduced with:
cargo clean -p gst-plugin-togglerecord && cargo test
In this patch, the plugin_define macro is (always) creating a public function plugin_register_static
. This makes it transparent for both plugin and application developer. In C, creation of this function needs to be done explicitly. Is this only related to visibility of symbols (which should not be a problem in Rust), or are other effects expected when this function is always available?