X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=6cf1ddec055275855fd30bcd8824cfd4e0bd1aaf;hb=d6c0853940f64de5b9d6b55a663db58871c6d7d9;hp=d3206f7ff86786032b55a978105cf7e0874c70e4;hpb=a5df4d76d64fa6fdffb1af7f0f2c3dfd4cfdde3c;p=nageru diff --git a/main.cpp b/main.cpp index d3206f7..6cf1dde 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,8 @@ +extern "C" { +#include +} +#include +#include #include #include @@ -8,12 +13,22 @@ #include #include "context.h" +#include "flags.h" #include "mainwindow.h" #include "mixer.h" int main(int argc, char *argv[]) { - setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 0); + parse_flags(argc, argv); + + if (global_flags.va_display.empty() || + global_flags.va_display[0] != '/') { + // We normally use EGL for zerocopy, but if we use VA against DRM + // instead of against X11, we turn it off, and then don't need EGL. + setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 0); + } + setlinebuf(stdout); + av_register_all(); QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QApplication app(argc, argv); @@ -31,10 +46,14 @@ int main(int argc, char *argv[]) global_share_widget = new QGLWidget(); MainWindow mainWindow; - mainWindow.resize(QSize(1500, 720)); + mainWindow.resize(QSize(1500, 810)); mainWindow.show(); + app.installEventFilter(&mainWindow); // For white balance color picking. + int rc = app.exec(); global_mixer->quit(); + mainWindow.mixer_shutting_down(); + delete global_mixer; return rc; }