X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=a0d8f669ca083085deaca67119451303cd7226a4;hb=c0bf9deb26205bf35758d49f587961f19bdb15b8;hp=8ebe6d21ca7b790a4968045089519a5e83ba5080;hpb=95295bd41bc711bbc450ac6f5ccc68e64fefffa3;p=nageru diff --git a/main.cpp b/main.cpp index 8ebe6d2..a0d8f66 100644 --- a/main.cpp +++ b/main.cpp @@ -1,17 +1,35 @@ +extern "C" { +#include +} +#include +#include +#include #include + #include -#include +#include +#include +#include #include -#include -#include +#include "context.h" +#include "flags.h" +#include "image_input.h" #include "mainwindow.h" #include "mixer.h" -#include "context.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); @@ -29,10 +47,15 @@ int main(int argc, char *argv[]) global_share_widget = new QGLWidget(); MainWindow mainWindow; - mainWindow.resize(QSize(1280, 720)); + mainWindow.resize(QSize(1500, 810)); mainWindow.show(); + app.installEventFilter(&mainWindow); // For white balance color picking. + int rc = app.exec(); - mixer_quit(); + global_mixer->quit(); + mainWindow.mixer_shutting_down(); + delete global_mixer; + ImageInput::shutdown_updaters(); return rc; }