arturoc / gstreamer1.0-rs

Idiomatic bindings for Gstreamer on Rust.
MIT License
36 stars 14 forks source link

Prevent duplicate glib main loop #25

Open aldonogueira opened 7 years ago

aldonogueira commented 7 years ago

Since I'm new to GStreamer, it took a while for me to understand that MainLoop is actually the glib main loop, the same one that is called by gtk-rs. It's clear when you read the code though. My project had both MainLoop::spawn() and gtk::main() and then all kinds of weird intermittent errors occurred. Something it's not expected when you are writing Rust code.

What could we do to avoid this kind of problem?

sdroege commented 7 years ago

GLib allows multiple mainloops with different main contexts. The only clean solution here would be to depend on glib, and this crate seems to be the one that is most actively developed: https://docs.rs/glib/0.1.2/glib/

sdroege commented 7 years ago

This should be solved by using the bindings from https://github.com/sdroege/gstreamer-rs