-
Notifications
You must be signed in to change notification settings - Fork 54
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
Upgrade GStreamer dependencies and switch to Rust 2021 edition #393
Upgrade GStreamer dependencies and switch to Rust 2021 edition #393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better :)
This is wonderful; thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor things
let proxy_src = gst::ElementFactory::make("proxysrc", None).unwrap(); | ||
let proxy_sink = gst::ElementFactory::make("proxysink", None).unwrap(); | ||
proxy_src.set_property("proxysink", &proxy_sink).unwrap(); | ||
let proxy_sink = gst::ElementFactory::make("proxysink").build().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a later time but you should probably use gstreamer-utils::StreamProducer
instead of proxysrc
/ proxysink
@@ -585,17 +568,15 @@ impl GStreamerPlayer { | |||
let observer = self.observer.clone(); | |||
// Handle `position-update` signal. | |||
player!(inner).connect_position_updated(move |_, position| { | |||
if let Some(seconds) = position.seconds() { | |||
if let Some(seconds) = position.map(|p| p.seconds()) { | |||
notify!(observer, PlayerEvent::PositionChanged(seconds)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, with gst_play
you would get exactly this behaviour. There's a bus with messages instead of callback-based signals
@@ -1,13 +1,14 @@ | |||
use super::BACKEND_BASE_TIME; | |||
use crate::datachannel::GStreamerWebRtcDataChannel; | |||
use crate::media_stream::GStreamerMediaStream; | |||
use boxfnonce::SendBoxFnOnce; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This crate is not needed anymore nowadays
Thanks @sdroege
There are several examples reaching a deadlock, for example (I'm using this branch, rebased, and gstreamer 1.22 devenv):
As far as we digged, in the code we rely on receive the |
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5672 . No signals were emitted at all in your case. You can work around this for now (without any negative effects with any GStreamer version other than wasting a some resources) by having a thread run a main loop with the default GLib main context. |
Thanks so much for this fix! |
To be more concrete here, a single thread for the whole process is enough. Just something like thread::spawn(|| glib::MainLoop::new(None, false).run()); This would only be a problem if the same process is also using e.g. GTK. If embedding servo like this is a concern then I'll think of another work-around. |
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment)
Thank you so much! This seems to have worked (https://github.com/servo/media/actions/runs/6904007056/job/18783825835). Once #408 lands, we should be able to rebase this and land it! |
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment)
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment) Co-authored-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment) Co-authored-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Happy to rebase when it lands. |
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment) Co-authored-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
This is a workaround for an issue where GStreamer does not deliver end of stream signals unless there is a main loop running. See [1] for more information. 1. #393 (comment) Co-authored-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
79802c3
to
282a278
Compare
I've upgraded the version of the GStreamer Rust bindings. I've tried to make the minimal possible changes to the code, keeping all previous logic and behavior.
Please let me know if I've missed anything.