mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-08 18:25:30 +00:00
gtk4: Asynchronously flush frames from GDK
There is no need to wait until the frames are flushed as the textures will be kept alive until GDK is finished with them, and doing so can cause deadlocks. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/287 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1053>
This commit is contained in:
parent
2a68be2000
commit
101bcbc1a0
1 changed files with 3 additions and 1 deletions
|
@ -233,8 +233,10 @@ impl ElementImpl for PaintableSink {
|
|||
let _ = self.info.lock().unwrap().take();
|
||||
let _ = self.pending_frame.lock().unwrap().take();
|
||||
|
||||
// Flush frames from the GDK paintable but don't wait
|
||||
// for this to finish as this can other deadlock.
|
||||
let self_ = self.to_owned();
|
||||
utils::invoke_on_main_thread(move || {
|
||||
glib::MainContext::default().invoke(move || {
|
||||
let paintable = self_.paintable.lock().unwrap();
|
||||
if let Some(paintable) = &*paintable {
|
||||
paintable.get_ref().handle_flush_frames();
|
||||
|
|
Loading…
Reference in a new issue