From b1d8346ed95f356842455fedb415f97d6c4cacb9 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 26 Jul 2024 05:21:47 +0200 Subject: Move glClear and glx/eglSwapBuffers from capture backends to main --- src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 2c6bced..48d94f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1731,7 +1731,7 @@ static void list_supported_capture_options(gsr_egl *egl, bool wayland) { #endif } -static void list_command() { +static void info_command() { bool wayland = false; Display *dpy = XOpenDisplay(nullptr); if (!dpy) { @@ -2022,7 +2022,7 @@ int main(int argc, char **argv) { usage_full(); if(argc == 2 && strcmp(argv[1], "--info") == 0) { - list_command(); + info_command(); _exit(0); } @@ -3154,7 +3154,10 @@ int main(int argc, char **argv) { const int num_frames = framerate_mode == FramerateMode::CONSTANT ? std::max((int64_t)0LL, expected_frames - video_pts_counter) : 1; if(num_frames > 0 && !paused) { + egl.glClear(0); gsr_capture_capture(capture, video_frame, &color_conversion); + gsr_egl_swap_buffers(&egl); + gsr_video_encoder_copy_textures_to_frame(video_encoder, video_frame); if(hdr && !hdr_metadata_set && replay_buffer_size_secs == -1 && add_hdr_metadata_to_video_stream(capture, video_stream)) -- cgit v1.2.3