diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-04-15 20:39:02 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-04-15 20:39:02 +0200 |
commit | c510bc5ae5099640869ae4a9a475339a5593e676 (patch) | |
tree | 65674357e79b277ccda35e3fd2c9ceee1ba2d83d /src | |
parent | c9c615d4c711618e66e95220643d3f97f9fc7b87 (diff) |
Remove extra swapBuffer in kms capture
Diffstat (limited to 'src')
-rw-r--r-- | src/capture/kms_vaapi.c | 3 | ||||
-rw-r--r-- | src/color_conversion.c | 5 | ||||
-rw-r--r-- | src/shader.c | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index ce97400..7bc2a0b 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -419,9 +419,6 @@ static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { cap_kms->dmabuf_fd = 0; } - // TODO: Remove - cap_kms->egl.eglSwapBuffers(cap_kms->egl.egl_display, cap_kms->egl.egl_surface); - return 0; } diff --git a/src/color_conversion.c b/src/color_conversion.c index fbbe9e6..8b1590b 100644 --- a/src/color_conversion.c +++ b/src/color_conversion.c @@ -186,6 +186,9 @@ int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conver } void gsr_color_conversion_deinit(gsr_color_conversion *self) { + if(!self->egl) + return; + if(self->vertex_buffer_object_id) { self->egl->glDeleteBuffers(1, &self->vertex_buffer_object_id); self->vertex_buffer_object_id = 0; @@ -204,6 +207,8 @@ void gsr_color_conversion_deinit(gsr_color_conversion *self) { for(int i = 0; i < MAX_SHADERS; ++i) { gsr_shader_deinit(&self->shaders[i]); } + + self->egl = NULL; } int gsr_color_conversion_update(gsr_color_conversion *self, int width, int height) { diff --git a/src/shader.c b/src/shader.c index e7b3bb2..f8d7eb2 100644 --- a/src/shader.c +++ b/src/shader.c @@ -116,10 +116,15 @@ int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, c } void gsr_shader_deinit(gsr_shader *self) { + if(!self->egl) + return; + if(self->program_id) { self->egl->glDeleteProgram(self->program_id); self->program_id = 0; } + + self->egl = NULL; } int gsr_shader_bind_attribute_location(gsr_shader *self, const char *attribute, int location) { |