Commit f7a2fb1b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt: Wayland vout window provider

Note that this depends on Qt5 private headers.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 4fbdd334
......@@ -3761,6 +3761,7 @@ AS_IF([test "${enable_qt}" != "no"], [
])
QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)"
AC_PATH_PROGS(MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
AC_PATH_PROGS(RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
AC_PATH_PROGS(UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
......@@ -3783,6 +3784,7 @@ AS_IF([test "${enable_qt}" != "no"], [
VLC_ADD_PLUGIN([qt])
ALIASES="${ALIASES} qvlc"
])
AC_SUBST(QT_VERSION)
AM_CONDITIONAL(ENABLE_QT, [test "$enable_qt" != "no"])
AM_CONDITIONAL([HAVE_QT5_X11], [test "${have_qt5_x11}" = "yes"])
......
......@@ -26,7 +26,9 @@ libqt_plugin_la_CXXFLAGS += $(QT5_X11_CFLAGS) -DQT5_HAS_X11
libqt_plugin_la_LIBADD += $(QT5_X11_LIBS) $(X_LIBS) $(X_PRE_LIB) -lX11
endif
if HAVE_WAYLAND
libqt_plugin_la_CXXFLAGS += $(WAYLAND_CLIENT_CFLAGS) -DQT5_HAS_WAYLAND
libqt_plugin_la_CPPFLAGS += -DQT5_HAS_WAYLAND \
-DQPNI_HEADER=\<$(QT_VERSION)/QtGui/qpa/qplatformnativeinterface.h\>
libqt_plugin_la_CXXFLAGS += $(WAYLAND_CLIENT_CFLAGS)
libqt_plugin_la_LIBADD += $(WAYLAND_CLIENT_LIBS)
endif
if HAVE_WIN32
......
......@@ -54,6 +54,10 @@
# include <X11/Xlib.h>
# include <QX11Info>
#endif
#ifdef QT5_HAS_WAYLAND
# include QPNI_HEADER
# include <QWindow>
#endif
#include <math.h>
#include <assert.h>
......@@ -148,6 +152,24 @@ bool VideoWidget::request( struct vout_window_t *p_wnd )
case VOUT_WINDOW_TYPE_NSOBJECT:
p_wnd->handle.nsobject = (void *)stable->winId();
break;
#ifdef QT5_HAS_WAYLAND
case VOUT_WINDOW_TYPE_WAYLAND:
{
QWindow *window = stable->windowHandle();
assert(window != NULL);
window->create();
QPlatformNativeInterface *qni = qApp->platformNativeInterface();
assert(qni != NULL);
p_wnd->handle.wl = reinterpret_cast<wl_surface*>(
qni->nativeResourceForWindow(QByteArrayLiteral("surface"),
window));
p_wnd->display.wl = reinterpret_cast<wl_display*>(
qni->nativeResourceForIntegration(QByteArrayLiteral("wl_display")));
break;
}
#endif
default:
vlc_assert_unreachable();
}
......
......@@ -605,6 +605,8 @@ static void *ThreadPlatform( void *obj, char *platform_name )
QString platform = app.platformName();
if( platform == qfu("xcb") )
p_sys->voutWindowType = VOUT_WINDOW_TYPE_XID;
else if( platform == qfu("wayland") )
p_sys->voutWindowType = VOUT_WINDOW_TYPE_WAYLAND;
else if( platform == qfu("windows") )
p_sys->voutWindowType = VOUT_WINDOW_TYPE_HWND;
else if( platform == qfu("cocoa" ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment