Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sebastian Dröge
gst-plugins-good
Commits
73439f16
Commit
73439f16
authored
Dec 09, 2020
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt: Get display for the given window instead of NULL
parent
656af791
Pipeline
#241313
passed with stages
in 46 minutes
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
8 deletions
+10
-8
ext/qt/gstqtglutility.cc
ext/qt/gstqtglutility.cc
+3
-3
ext/qt/gstqtglutility.h
ext/qt/gstqtglutility.h
+2
-1
ext/qt/gstqtoverlay.cc
ext/qt/gstqtoverlay.cc
+1
-1
ext/qt/qtitem.cc
ext/qt/qtitem.cc
+3
-2
ext/qt/qtwindow.cc
ext/qt/qtwindow.cc
+1
-1
No files found.
ext/qt/gstqtglutility.cc
View file @
73439f16
...
...
@@ -62,7 +62,7 @@ G_LOCK_DEFINE_STATIC (display_lock);
static
GWeakRef
qt_display
;
GstGLDisplay
*
gst_qt_get_gl_display
()
gst_qt_get_gl_display
(
QWindow
*
window
)
{
GstGLDisplay
*
display
=
NULL
;
QGuiApplication
*
app
=
static_cast
<
QGuiApplication
*>
(
QCoreApplication
::
instance
());
...
...
@@ -99,7 +99,7 @@ gst_qt_get_gl_display ()
QPlatformNativeInterface
*
native
=
QGuiApplication
::
platformNativeInterface
();
wayland_display
=
(
struct
wl_display
*
)
native
->
nativeResourceForWindow
(
"display"
,
NULL
);
native
->
nativeResourceForWindow
(
"display"
,
window
);
display
=
(
GstGLDisplay
*
)
gst_gl_display_wayland_new_with_display
(
wayland_display
);
}
...
...
@@ -137,7 +137,7 @@ gst_qt_get_gl_display ()
QPlatformNativeInterface
*
native
=
QGuiApplication
::
platformNativeInterface
();
EGLDisplay
egl_display
=
(
EGLDisplay
)
native
->
nativeResourceForWindow
(
"egldisplay"
,
NULL
);
native
->
nativeResourceForWindow
(
"egldisplay"
,
window
);
if
(
egl_display
!=
EGL_NO_DISPLAY
)
display
=
(
GstGLDisplay
*
)
gst_gl_display_egl_new_with_egl_display
(
egl_display
);
#else
...
...
ext/qt/gstqtglutility.h
View file @
73439f16
...
...
@@ -23,12 +23,13 @@
#include <gst/gst.h>
#include <gst/gl/gl.h>
#include <QWindow>
#include <QVariant>
G_BEGIN_DECLS
GstGLDisplay
*
gst_qt_get_gl_display
();
GstGLDisplay
*
gst_qt_get_gl_display
(
QWindow
*
window
);
gboolean
gst_qt_get_gl_wrapcontext
(
GstGLDisplay
*
display
,
GstGLContext
**
wrap_glcontext
,
GstGLContext
**
context
);
...
...
ext/qt/gstqtoverlay.cc
View file @
73439f16
...
...
@@ -453,7 +453,7 @@ gst_qt_overlay_change_state (GstElement * element,
return
GST_STATE_CHANGE_FAILURE
;
}
display
=
gst_qt_get_gl_display
();
display
=
gst_qt_get_gl_display
(
NULL
);
if
(
display
!=
filter
->
display
)
/* always propagate. The application may need to choose between window
...
...
ext/qt/qtitem.cc
View file @
73439f16
...
...
@@ -129,8 +129,6 @@ QtGLVideoItem::QtGLVideoItem()
g_mutex_init
(
&
this
->
priv
->
lock
);
this
->
priv
->
display
=
gst_qt_get_gl_display
();
connect
(
this
,
SIGNAL
(
windowChanged
(
QQuickWindow
*
)),
this
,
SLOT
(
handleWindowChanged
(
QQuickWindow
*
)));
...
...
@@ -430,6 +428,7 @@ void
QtGLVideoItem
::
handleWindowChanged
(
QQuickWindow
*
win
)
{
if
(
win
)
{
this
->
priv
->
display
=
gst_qt_get_gl_display
(
win
);
if
(
win
->
isSceneGraphInitialized
())
win
->
scheduleRenderJob
(
new
InitializeSceneGraph
(
this
),
QQuickWindow
::
BeforeSynchronizingStage
);
else
...
...
@@ -437,6 +436,8 @@ QtGLVideoItem::handleWindowChanged(QQuickWindow *win)
connect
(
win
,
SIGNAL
(
sceneGraphInvalidated
()),
this
,
SLOT
(
onSceneGraphInvalidated
()),
Qt
::
DirectConnection
);
}
else
{
if
(
this
->
priv
->
display
)
gst_object_unref
(
this
->
priv
->
display
);
this
->
priv
->
qt_context
=
NULL
;
}
}
...
...
ext/qt/qtwindow.cc
View file @
73439f16
...
...
@@ -117,7 +117,7 @@ QtGLWindow::QtGLWindow ( QWindow * parent, QQuickWindow *src ) :
g_mutex_init
(
&
this
->
priv
->
lock
);
g_cond_init
(
&
this
->
priv
->
update_cond
);
this
->
priv
->
display
=
gst_qt_get_gl_display
();
this
->
priv
->
display
=
gst_qt_get_gl_display
(
parent
);
connect
(
source
,
SIGNAL
(
beforeRendering
()),
this
,
SLOT
(
beforeRendering
()),
Qt
::
DirectConnection
);
connect
(
source
,
SIGNAL
(
afterRendering
()),
this
,
SLOT
(
afterRendering
()),
Qt
::
DirectConnection
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment