Skip to content

Commit

Permalink
Fix video output on Qt6 for Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
TishSerg committed Apr 30, 2024
1 parent 580a999 commit 7d1dcce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/qmlglsink/qt6/gstqt6glutility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ gst_qml6_get_gl_wrapcontext (GstGLDisplay * display,
gst_gl_display_filter_gl_api (display, gst_gl_context_get_gl_api (*wrap_glcontext));
gst_gl_context_activate (*wrap_glcontext, FALSE);
}
#if 0
#if 1
#if GST_GL_HAVE_WINDOW_WIN32 && GST_GL_HAVE_PLATFORM_WGL && defined (HAVE_QT_WIN32)
g_return_val_if_fail (context != NULL, FALSE);

Expand Down
8 changes: 6 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,18 @@ int main(int argc, char *argv[])
#endif

#ifdef Q_OS_WIN
// Unlike Qt5, Qt6 on Windows use Direct3D by default,
// so force it to use OpenGL since it is required by qt6glitem
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

// Set our own OpenGL buglist
qputenv("QT_OPENGL_BUGLIST", ":/opengl/resources/opengl/buglist.json");

// Allow for command line override of renderer
for (int i = 0; i < argc; i++) {
const QString arg(argv[i]);
if (arg == QStringLiteral("-angle")) {
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
if (arg == QStringLiteral("-desktop")) {
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
break;
} else if (arg == QStringLiteral("-swrast")) {
QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
Expand Down

0 comments on commit 7d1dcce

Please sign in to comment.