X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fmain.cpp;h=37034edd2c823fbb36eb7d3dc262be86f258c7e2;hb=dc78f9a5b3936fe7cdcc61368c7a5e21ba473608;hp=d5654a5a07c4ef26bb8924b7fa8cd7f1362cc827;hpb=eeda8995329601f9f4e35047358400833eeae68e;p=nageru diff --git a/nageru/main.cpp b/nageru/main.cpp index d5654a5..37034ed 100644 --- a/nageru/main.cpp +++ b/nageru/main.cpp @@ -20,6 +20,10 @@ extern "C" { #include #endif +#ifdef HAVE_SRT +#include +#endif + #include "basic_stats.h" #ifdef HAVE_CEF #include "nageru_cef_app.h" @@ -63,6 +67,9 @@ int main(int argc, char *argv[]) global_flags.va_display = QuickSyncEncoder::get_usable_va_display(); } + // The OpenGL widgets do not work well with the native Wayland integration. + setenv("QT_QPA_PLATFORM", "xcb", 0); + if ((global_flags.va_display.empty() || global_flags.va_display[0] != '/') && !global_flags.x264_video_to_disk) { // We normally use EGL for zerocopy, but if we use VA against DRM @@ -74,6 +81,12 @@ int main(int argc, char *argv[]) av_register_all(); #endif +#ifdef HAVE_SRT + if (global_flags.srt_port >= 0) { + srt_startup(); + } +#endif + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QSurfaceFormat fmt; @@ -95,7 +108,7 @@ int main(int argc, char *argv[]) global_share_widget = new QGLWidget(); if (!global_share_widget->isValid()) { fprintf(stderr, "Failed to initialize OpenGL. Nageru needs at least OpenGL 3.1 to function properly.\n"); - exit(1); + abort(); } MainWindow mainWindow; @@ -119,9 +132,11 @@ int main(int argc, char *argv[]) } int rc = app.exec(); - global_mixer->quit(); - mainWindow.mixer_shutting_down(); delete global_mixer; - ImageInput::shutdown_updaters(); +#ifdef HAVE_SRT + if (global_flags.srt_port >= 0) { + srt_cleanup(); + } +#endif return rc; }