mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-27 20:40:31 +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/1052>
This commit is contained in:
parent
b161f56a5c
commit
03df4f253c
1 changed files with 3 additions and 1 deletions
|
@ -236,8 +236,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