Skip to content

Commit 6bb97be

Browse files
authored
default to gstreamer backend for linux (#1140)
* Default to gstreamer backend to prevent capture card flickering * default auto-reset to 0 on linux builds to prevent black frames on reset * another comment
1 parent 781f0a2 commit 6bb97be

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

SerialPrograms/Source/CommonFramework/Main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ int main(int argc, char *argv[]){
201201
set_program_path(argv[0]);
202202
#endif
203203

204+
#if defined(__linux__)
205+
// Qt multimedia, default to gstreamer to prevent flickering
206+
// Easier than the alternative which is compiling qt6multimedia with QT_DEFAULT_MEDIA_BACKEND
207+
// See: https://doc.qt.io/qt-6.5/qtmultimedia-index.html
208+
if (qEnvironmentVariableIsEmpty("QT_MEDIA_BACKEND"))
209+
qputenv("QT_MEDIA_BACKEND", "gstreamer");
210+
#endif
211+
204212
// So far, this is only needed on Mac where static initialization is fucked up.
205213
PokemonAutomation::register_all_statics();
206214

SerialPrograms/Source/CommonFramework/VideoPipeline/VideoPipelineOptions.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ class VideoPipelineOptions : public GroupOption{
3434
, AUTO_RESET_SECONDS(
3535
"<b>Video Auto-Reset:</b><br>"
3636
"Attempt to reset the video if this many seconds has elapsed since the last video frame (in order to fix issues with RDP disconnection, etc).<br>"
37-
"This option is not supported by all video frameworks.",
37+
"This option is not supported by all video frameworks. Set to a value of 0 to disable Auto-Reset.",
3838
LockMode::UNLOCK_WHILE_RUNNING,
39+
#if defined(__linux__)
40+
0 // Default to disabled on linux, auto-resets briefly output black frames
41+
#else
3942
5
43+
#endif
4044
)
4145
{
4246
PA_ADD_OPTION(VIDEO_BACKEND);

0 commit comments

Comments
 (0)