mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 23:06:22 +09:00
Move glClear and glx/eglSwapBuffers from capture backends to main
This commit is contained in:
@@ -275,9 +275,6 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
|
||||
gsr_capture_kms *self = cap->priv;
|
||||
const bool cursor_texture_id_is_external = self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA;
|
||||
|
||||
//egl->glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
self->params.egl->glClear(0);
|
||||
|
||||
gsr_capture_kms_cleanup_kms_fds(self);
|
||||
|
||||
gsr_kms_response_item *drm_fd = NULL;
|
||||
@@ -457,8 +454,6 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
|
||||
self->params.egl->glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
self->params.egl->eglSwapBuffers(self->params.egl->egl_display, self->params.egl->egl_surface);
|
||||
|
||||
//self->params.egl->glFlush();
|
||||
//self->params.egl->glFinish();
|
||||
|
||||
|
||||
@@ -418,16 +418,11 @@ static int gsr_capture_nvfbc_capture(gsr_capture *cap, AVFrame *frame, gsr_color
|
||||
return 0;
|
||||
}
|
||||
|
||||
//cap_nvfbc->params.egl->glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
cap_nvfbc->params.egl->glClear(0);
|
||||
|
||||
gsr_color_conversion_draw(color_conversion, cap_nvfbc->setup_params.dwTextures[grab_params.dwTextureIndex],
|
||||
(vec2i){0, 0}, (vec2i){frame->width, frame->height},
|
||||
(vec2i){0, 0}, (vec2i){frame->width, frame->height},
|
||||
0.0f, false);
|
||||
|
||||
cap_nvfbc->params.egl->glXSwapBuffers(cap_nvfbc->params.egl->x11.dpy, cap_nvfbc->params.egl->x11.window);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -297,9 +297,6 @@ static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_colo
|
||||
|
||||
gsr_capture_portal_cleanup_plane_fds(self);
|
||||
|
||||
//egl->glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
self->params.egl->glClear(0);
|
||||
|
||||
/* TODO: Handle formats other than RGB(a) */
|
||||
gsr_pipewire_region region = {0, 0, 0, 0};
|
||||
gsr_pipewire_region cursor_region = {0, 0, 0, 0};
|
||||
@@ -332,8 +329,6 @@ static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_colo
|
||||
0.0f, false);
|
||||
self->params.egl->glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
self->params.egl->eglSwapBuffers(self->params.egl->egl_display, self->params.egl->egl_surface);
|
||||
|
||||
//self->params.egl->glFlush();
|
||||
//self->params.egl->glFinish();
|
||||
|
||||
|
||||
@@ -317,9 +317,6 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_
|
||||
gsr_capture_xcomposite *self = cap->priv;
|
||||
(void)frame;
|
||||
|
||||
//self->params.egl->glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
self->params.egl->glClear(0);
|
||||
|
||||
if(self->clear_background) {
|
||||
self->clear_background = false;
|
||||
gsr_color_conversion_clear(color_conversion);
|
||||
@@ -352,8 +349,6 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_
|
||||
self->params.egl->glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
self->params.egl->eglSwapBuffers(self->params.egl->egl_display, self->params.egl->egl_surface);
|
||||
|
||||
// TODO: Do video encoder specific conversion here
|
||||
|
||||
//self->params.egl->glFlush();
|
||||
|
||||
Reference in New Issue
Block a user