aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-06 13:28:35 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-06 13:28:35 +0200
commit2682df9e0fd84b69bb232c6457161d274b394052 (patch)
tree861fc8352ce07f1b1a6fb7be1a3e66b84d89c88b
parent111432f7dd83f1212f622c1979119f83025814f3 (diff)
Portal: fix external texture
-rw-r--r--include/egl.h1
-rw-r--r--src/capture/portal.c10
-rw-r--r--src/main.cpp5
3 files changed, 6 insertions, 10 deletions
diff --git a/include/egl.h b/include/egl.h
index e54f23d..d9d555a 100644
--- a/include/egl.h
+++ b/include/egl.h
@@ -114,7 +114,6 @@ typedef void(*__GLXextFuncPtr)(void);
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WIDTH 0x1000
#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
#define GL_NEAREST 0x2600
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_LINEAR 0x2601
diff --git a/src/capture/portal.c b/src/capture/portal.c
index 7d50c0a..f134179 100644
--- a/src/capture/portal.c
+++ b/src/capture/portal.c
@@ -307,14 +307,6 @@ static int max_int(int a, int b) {
return a > b ? a : b;
}
-static int gl_texture_get_internal_image_format(gsr_egl *egl, unsigned int texture) {
- int internal_image_format = 0;
- egl->glBindTexture(GL_TEXTURE_EXTERNAL_OES, texture);
- egl->glGetTexLevelParameteriv(GL_TEXTURE_EXTERNAL_OES, 0, GL_TEXTURE_INTERNAL_FORMAT, &internal_image_format);
- egl->glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0);
- return internal_image_format;
-}
-
static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_color_conversion *color_conversion) {
(void)frame;
(void)color_conversion;
@@ -343,7 +335,7 @@ static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_colo
gsr_color_conversion_draw(color_conversion, using_external_image ? self->texture_map.external_texture_id : self->texture_map.texture_id,
(vec2i){target_x, target_y}, self->capture_size,
(vec2i){region.x, region.y}, self->capture_size,
- 0.0f, false);
+ 0.0f, using_external_image);
if(self->params.record_cursor) {
const vec2i cursor_pos = {
diff --git a/src/main.cpp b/src/main.cpp
index 4693830..db44530 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2705,6 +2705,11 @@ int main(int argc, char **argv) {
disable_prime_run();
}
+ if(strcmp(window_str, "portal") == 0 && is_using_prime_run()) {
+ fprintf(stderr, "Warning: use of prime-run with -w portal option is currently not supported. Disabling prime-run\n");
+ disable_prime_run();
+ }
+
if(video_codec_is_hdr(video_codec) && !wayland) {
fprintf(stderr, "Error: hdr video codec option %s is not available on X11\n", video_codec_to_use);
_exit(1);