X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=main.cpp;h=6cf1ddec055275855fd30bcd8824cfd4e0bd1aaf;hb=4e21ff10a3229bcab10fd0f3f201d7502ee660bf;hp=e4df08946dcf7a1249f70c027d10ac2521f45f23;hpb=12677633d653f654e3d75c232206585aebb06362;p=nageru diff --git a/main.cpp b/main.cpp index e4df089..6cf1dde 100644 --- a/main.cpp +++ b/main.cpp @@ -1,14 +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); @@ -21,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(mainWindow.sizeHint()); + 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; }