Move glClear and glx/eglSwapBuffers from capture backends to main

This commit is contained in:
dec05eba
2024-07-26 05:21:47 +02:00
parent af4f9b805a
commit b1d8346ed9
7 changed files with 15 additions and 24 deletions

View File

@@ -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))