diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-26 05:21:47 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-26 10:55:24 +0200 |
commit | b1d8346ed95f356842455fedb415f97d6c4cacb9 (patch) | |
tree | 90be0f3054f0e5f9988f25290c5fbedf1ee9914e /src/main.cpp | |
parent | af4f9b805a947b4495961a519af6045cd3f19a33 (diff) |
Move glClear and glx/eglSwapBuffers from capture backends to main
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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)) |