mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix Nheko freezing after stopping a call on Wayland
This commit is contained in:
parent
34ebd2b30e
commit
c69f0f95a9
2 changed files with 17 additions and 1 deletions
|
@ -606,7 +606,7 @@ endif()
|
||||||
|
|
||||||
if(VOIP)
|
if(VOIP)
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18)
|
pkg_check_modules(GSTREAMER REQUIRED IMPORTED_TARGET gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18 gstreamer-gl-1.0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(X11 AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
if(X11 AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#ifdef GSTREAMER_AVAILABLE
|
#ifdef GSTREAMER_AVAILABLE
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
|
#include "gst/gl/gstgldisplay.h"
|
||||||
#include "gst/gst.h"
|
#include "gst/gst.h"
|
||||||
#include "gst/sdp/sdp.h"
|
#include "gst/sdp/sdp.h"
|
||||||
|
|
||||||
|
@ -346,6 +347,21 @@ newVideoSinkChain(GstElement *pipe)
|
||||||
gst_element_sync_state_with_parent(glupload);
|
gst_element_sync_state_with_parent(glupload);
|
||||||
gst_element_sync_state_with_parent(glcolorconvert);
|
gst_element_sync_state_with_parent(glcolorconvert);
|
||||||
gst_element_sync_state_with_parent(glsinkbin);
|
gst_element_sync_state_with_parent(glsinkbin);
|
||||||
|
|
||||||
|
// to propagate context (hopefully)
|
||||||
|
gst_element_set_state(qmlglsink, GST_STATE_READY);
|
||||||
|
|
||||||
|
// Workaround: On wayland, when egl is used, gstreamer might terminate the display connection.
|
||||||
|
// Prevent that by "leaking" a reference to the display. See
|
||||||
|
// https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3743
|
||||||
|
if (QGuiApplication::platformName() == QStringLiteral("wayland")) {
|
||||||
|
auto context = gst_element_get_context(qmlglsink, "gst.gl.GLDisplay");
|
||||||
|
if (context) {
|
||||||
|
GstGLDisplay *display;
|
||||||
|
gst_context_get_gl_display(context, &display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue