aboutsummaryrefslogtreecommitdiff
path: root/src/capture
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-21 15:43:19 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-21 15:43:19 +0200
commiteddb07ac408fe80af0ffd88e85880f813c57642a (patch)
tree0039022efb2d145d2c7e2a757135dba954f3c14e /src/capture
parentff6d46871387ebae99904602b51d619f8d6ae957 (diff)
Revert recent time framing and performance changes as it affects slower devices badly
Diffstat (limited to 'src/capture')
-rw-r--r--src/capture/kms.c23
-rw-r--r--src/capture/portal.c3
-rw-r--r--src/capture/xcomposite.c3
3 files changed, 2 insertions, 27 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c
index fcf2058..7a61962 100644
--- a/src/capture/kms.c
+++ b/src/capture/kms.c
@@ -570,15 +570,6 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
if(!capture_is_combined_plane)
capture_pos = (vec2i){drm_fd->x, drm_fd->y};
- // TODO: Hack!! cursor flickers without this when using vaapi copy on wayland.
- // There is probably some sync issue between opengl and vaapi. It flickers more when capture fps is lower.
- // Remove this when that has been figured out. Same for the below glFlush && glFinish
- const int hack_iterations = max_int(1, roundf(1000.0 / (double)self->params.fps));
- for(int i = 0; i < hack_iterations; ++i) {
- self->params.egl->glFlush();
- self->params.egl->glFinish();
- }
-
/* Fast opengl free path */
if(self->monitor_rotation == GSR_MONITOR_ROT_0 && video_codec_context_is_vaapi(self->video_codec_context) && self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD) {
int fds[4];
@@ -599,20 +590,12 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
self->params.egl->eglDestroyImage(self->params.egl->egl_display, image);
}
- self->params.egl->glFlush();
- self->params.egl->glFinish();
-
gsr_color_conversion_draw(color_conversion, self->external_texture_fallback ? self->external_input_texture_id : self->input_texture_id,
target_pos, self->capture_size,
capture_pos, self->capture_size,
texture_rotation, self->external_texture_fallback);
}
- for(int i = 0; i < hack_iterations; ++i) {
- self->params.egl->glFlush();
- self->params.egl->glFinish();
- }
-
if(self->params.record_cursor) {
gsr_kms_response_item *cursor_drm_fd = find_cursor_drm_if_on_monitor(self, drm_fd->connector_id, capture_is_combined_plane);
// The cursor is handled by x11 on x11 instead of using the cursor drm plane because on prime systems with a dedicated nvidia gpu
@@ -625,10 +608,8 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
}
}
- for(int i = 0; i < hack_iterations; ++i) {
- self->params.egl->glFlush();
- self->params.egl->glFinish();
- }
+ self->params.egl->glFlush();
+ self->params.egl->glFinish();
gsr_capture_kms_cleanup_kms_fds(self);
diff --git a/src/capture/portal.c b/src/capture/portal.c
index 40e4581..58d16d9 100644
--- a/src/capture/portal.c
+++ b/src/capture/portal.c
@@ -333,9 +333,6 @@ static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_colo
} else {
return 0;
}
-
- self->params.egl->glFlush();
- self->params.egl->glFinish();
const vec2i target_pos = { max_int(0, frame->width / 2 - self->capture_size.x / 2), max_int(0, frame->height / 2 - self->capture_size.y / 2) };
diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c
index 9d053bb..31d0b7e 100644
--- a/src/capture/xcomposite.c
+++ b/src/capture/xcomposite.c
@@ -258,9 +258,6 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_
const vec2i target_pos = { max_int(0, frame->width / 2 - self->texture_size.x / 2), max_int(0, frame->height / 2 - self->texture_size.y / 2) };
- self->params.egl->glFlush();
- self->params.egl->glFinish();
-
/* Fast opengl free path */
if(video_codec_context_is_vaapi(self->video_codec_context) && self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_AMD) {
vaapi_copy_egl_image_to_video_surface(self->params.egl, self->window_texture.image, (vec2i){0, 0}, self->texture_size, target_pos, self->texture_size, self->video_codec_context, frame);