X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=6cf1ddec055275855fd30bcd8824cfd4e0bd1aaf;hb=8f98b9f1ae9c813859058bd8199f578c7029e7c9;hp=b39fafe2c837d285d4ffb294726b710a0f8a06e2;hpb=340de19ccede5808c033e8706070731204b832a4;p=nageru diff --git a/main.cpp b/main.cpp index b39fafe..6cf1dde 100644 --- a/main.cpp +++ b/main.cpp @@ -1,15 +1,34 @@ +extern "C" { +#include +} +#include +#include +#include #include + #include -#include +#include +#include +#include #include -#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); @@ -22,11 +41,19 @@ int main(int argc, char *argv[]) fmt.setMinorVersion(1); QSurfaceFormat::setDefaultFormat(fmt); + QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt)); + + 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; return rc; }