X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fmain.cpp;h=cbf66e6fbcccbf029e1a1153c8ce7d54f629e3d5;hb=b22b0f8e945c5a0b9e738eb982b61aa70b88ed1d;hp=351662039d2cd8e1790129f5d2d5e0282de76982;hpb=533f00a9b992d06767737f9db236b4cf76b9c124;p=nageru diff --git a/nageru/main.cpp b/nageru/main.cpp index 3516620..cbf66e6 100644 --- a/nageru/main.cpp +++ b/nageru/main.cpp @@ -20,13 +20,16 @@ extern "C" { #include #endif +#ifdef HAVE_SRT +#include +#endif + #include "basic_stats.h" #ifdef HAVE_CEF #include "nageru_cef_app.h" #endif #include "shared/context.h" #include "flags.h" -#include "image_input.h" #include "mainwindow.h" #include "mixer.h" #include "quicksync_encoder.h" @@ -63,6 +66,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 +80,12 @@ int main(int argc, char *argv[]) av_register_all(); #endif +#ifdef HAVE_SRT + if (global_flags.srt_port >= 0 || !global_flags.srt_destination_host.empty()) { + srt_startup(); + } +#endif + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); QSurfaceFormat fmt; @@ -120,5 +132,10 @@ int main(int argc, char *argv[]) int rc = app.exec(); delete global_mixer; +#ifdef HAVE_SRT + if (global_flags.srt_port >= 0) { + srt_cleanup(); + } +#endif return rc; }