This is required for OpenGL to work nowadays on macOS. Simply running an
CFRunLoop on the main thread is not sufficient.
Thanks to Philippe Normand for testing this on macOS and making sure it
actually compiles and works.
When importing the prelude of a crate like `gst` the `glib` prelude is
provided too. Shedding these imports saves quite a few lines and
adheres to keeping it simple; we're not reexporting base/parent preludes
for no reason :)
Since https://github.com/gtk-rs/gtk-rs/pull/447, supposedly the native
function is never returning a `NULL` `Application` hence it makes little
sense to handle an "unreachable" error here.
Winit 0.19 uses uninitialized variables which is invalid since Rust
1.48, leading to a runtime panic [1]. Updating to the latest version
resolves these issues but requires significant refactoring since the
event loop now runs entirely within a closure.
[1]: https://github.com/rust-windowing/winit/issues/1811
If EGL and Wayland were both set the Wayland bit of code would never be
build-tested nor used. Now if both are enabled try to acquire a
GLDisplay through both handles before bailing. The methods can still be
tested in isolation by not enabling one or the other feature.
Solves the following warning:
gstreamer-rs/examples/Cargo.toml: unused manifest key: bin.31.features
Enabling features when a single bin is built is not supported, and users
would have to manually select desired features anyway: -wayland cannot
be used in conjunction with -egl thanks to the cfg_if.
This scales better as there will only be only such data instead of two
or more when having deeper class hierarchies with multiple Rust
elements, and also makes it unnecessary to use a special instance struct
so the default works well.
If we don't handle the case of RTSPServer::attach() failing, we end up
with a panic. Unfortunately, we don't get any details from the
underlying call so we've to live with a generic error. :(
This is closer to how this works in Python and also how properties and
signals work now in the glib bindings.
class_init() only has to be implemented for more special uses now.