diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-06-10 00:34:21 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-06-10 00:34:21 +0200 |
commit | ca0be79344d1ec9f8c4026254e0d6772b1cd8040 (patch) | |
tree | a1563d15f5e193e2c1162a0ced6a3204d3e199e8 | |
parent | 53557133c21205dab879365234727416977e8a4b (diff) |
Fix nvidia capture after switch to opengl es
-rw-r--r-- | include/egl.h | 1 | ||||
-rw-r--r-- | src/egl.c | 1 | ||||
-rw-r--r-- | src/main.cpp | 3 | ||||
-rw-r--r-- | src/utils.c | 3 |
4 files changed, 4 insertions, 4 deletions
diff --git a/include/egl.h b/include/egl.h index 0b6a034..90aa2b7 100644 --- a/include/egl.h +++ b/include/egl.h @@ -263,6 +263,7 @@ struct gsr_egl { void (*glGetTexLevelParameteriv)(unsigned int target, int level, unsigned int pname, int *params); void (*glTexImage2D)(unsigned int target, int level, int internalFormat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels); void (*glTexSubImage2D)(unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, const void *pixels); + void (*glTexStorage2D)(unsigned int target, int levels, unsigned int internalformat, int width, int height); void (*glGetTexImage)(unsigned int target, int level, unsigned int format, unsigned int type, void *pixels); void (*glGenFramebuffers)(int n, unsigned int *framebuffers); void (*glBindFramebuffer)(unsigned int target, unsigned int framebuffer); @@ -277,6 +277,7 @@ static bool gsr_egl_load_gl(gsr_egl *self, void *library) { { (void**)&self->glGetTexLevelParameteriv, "glGetTexLevelParameteriv" }, { (void**)&self->glTexImage2D, "glTexImage2D" }, { (void**)&self->glTexSubImage2D, "glTexSubImage2D" }, + { (void**)&self->glTexStorage2D, "glTexStorage2D" }, { (void**)&self->glGetTexImage, "glGetTexImage" }, { (void**)&self->glGenFramebuffers, "glGenFramebuffers" }, { (void**)&self->glBindFramebuffer, "glBindFramebuffer" }, diff --git a/src/main.cpp b/src/main.cpp index 2703c60..67619f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -663,7 +663,6 @@ static void open_video_software(AVCodecContext *codec_context, const args_parser av_dict_set(&options, "preset", "veryfast", 0); av_dict_set(&options, "tune", "film", 0); - av_dict_set(&options, "profile", "high", 0); if(codec_context->codec_id == AV_CODEC_ID_H264) { av_dict_set(&options, "coder", "cabac", 0); // TODO: cavlc is faster than cabac but worse compression. Which to use? @@ -2311,7 +2310,6 @@ static void capture_image_to_file(args_parser &arg_parser, gsr_egl *egl, gsr_ima color_conversion_params.destination_textures[0] = image_writer.texture; color_conversion_params.num_destination_textures = 1; color_conversion_params.destination_color = GSR_DESTINATION_COLOR_RGB8; - color_conversion_params.force_graphics_shader = true; gsr_color_conversion color_conversion; if(gsr_color_conversion_init(&color_conversion, &color_conversion_params) != 0) { @@ -3209,7 +3207,6 @@ int main(int argc, char **argv) { color_conversion_params.color_range = arg_parser.color_range; color_conversion_params.egl = &egl; color_conversion_params.load_external_image_shader = gsr_capture_uses_external_image(capture); - color_conversion_params.force_graphics_shader = arg_parser.video_encoder == GSR_VIDEO_ENCODER_HW_CPU; gsr_video_encoder_get_textures(video_encoder, color_conversion_params.destination_textures, &color_conversion_params.num_destination_textures, &color_conversion_params.destination_color); gsr_color_conversion color_conversion; diff --git a/src/utils.c b/src/utils.c index 092f1a5..c1d399a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -601,7 +601,8 @@ unsigned int gl_create_texture(gsr_egl *egl, int width, int height, int internal unsigned int texture_id = 0; egl->glGenTextures(1, &texture_id); egl->glBindTexture(GL_TEXTURE_2D, texture_id); - egl->glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, GL_UNSIGNED_BYTE, NULL); + //egl->glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, GL_UNSIGNED_BYTE, NULL); + egl->glTexStorage2D(GL_TEXTURE_2D, 1, internal_format, width, height); egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); |