From 6079a0162d0ddf2cee9911659c92033552df7b3a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 1 Mar 2026 18:12:00 +0100 Subject: [PATCH] Portal capture: test disable modifier recheck same --- TODO | 2 -- include/pipewire_video.h | 1 - src/main.cpp | 10 +++++----- src/pipewire_video.c | 7 ------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/TODO b/TODO index dc72261..00db3fa 100644 --- a/TODO +++ b/TODO @@ -396,8 +396,6 @@ Should -low-power option also use vaapi/vulkan low power, if available? Should capture option x=bla;y=bla be scaled by -s (output resolution scale)? width and height is. -Certain webcam resolutions yuyv resolutions dont work (on amd at least), such as 800x600. Maybe it's because of alignment issue, 600 isn't divisible by 16. - Add option to capture all monitors automatically. Make -w optional, to only capture audio. diff --git a/include/pipewire_video.h b/include/pipewire_video.h index 4b898f1..8722d21 100644 --- a/include/pipewire_video.h +++ b/include/pipewire_video.h @@ -106,7 +106,6 @@ typedef struct { bool no_modifiers_fallback; bool external_texture_fallback; - uint64_t renegotiated_modifier; uint64_t modifiers[GSR_PIPEWIRE_VIDEO_MAX_MODIFIERS]; size_t num_modifiers; diff --git a/src/main.cpp b/src/main.cpp index 3b20df0..0bba4f8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3267,7 +3267,7 @@ static const AVCodec* pick_video_codec(gsr_egl *egl, args_parser *args_parser, b if(!video_codec_f && use_fallback_codec && args_parser->video_encoder != GSR_VIDEO_ENCODER_HW_CPU) { switch(args_parser->video_codec) { case GSR_VIDEO_CODEC_H264: { - fprintf(stderr, "gsr error: selected video codec h264 is not supported\n"); + fprintf(stderr, "gsr error: selected video codec h264 is not supported by your hardware\n"); if(args_parser->fallback_cpu_encoding) { fprintf(stderr, "gsr warning: gpu encoding is not available on your system, trying cpu encoding instead because -fallback-cpu-encoding is enabled. Install the proper vaapi drivers on your system (if supported) if you experience performance issues\n"); force_cpu_encoding(args_parser); @@ -3277,14 +3277,14 @@ static const AVCodec* pick_video_codec(gsr_egl *egl, args_parser *args_parser, b case GSR_VIDEO_CODEC_HEVC: case GSR_VIDEO_CODEC_HEVC_HDR: case GSR_VIDEO_CODEC_HEVC_10BIT: { - fprintf(stderr, "gsr warning: selected video codec hevc is not supported, trying h264 instead\n"); + fprintf(stderr, "gsr warning: selected video codec hevc is not supported by your hardware, trying h264 instead\n"); args_parser->video_codec = GSR_VIDEO_CODEC_H264; return pick_video_codec(egl, args_parser, true, low_power, supported_video_codecs); } case GSR_VIDEO_CODEC_AV1: case GSR_VIDEO_CODEC_AV1_HDR: case GSR_VIDEO_CODEC_AV1_10BIT: { - fprintf(stderr, "gsr warning: selected video codec av1 is not supported, trying h264 instead\n"); + fprintf(stderr, "gsr warning: selected video codec av1 is not supported by your hardware, trying h264 instead\n"); args_parser->video_codec = GSR_VIDEO_CODEC_H264; return pick_video_codec(egl, args_parser, true, low_power, supported_video_codecs); } @@ -3293,7 +3293,7 @@ static const AVCodec* pick_video_codec(gsr_egl *egl, args_parser *args_parser, b // TODO: Cant fallback to other codec because webm only supports vp8/vp9 break; case GSR_VIDEO_CODEC_H264_VULKAN: { - fprintf(stderr, "gsr warning: selected video codec h264_vulkan is not supported, trying h264 instead\n"); + fprintf(stderr, "gsr warning: selected video codec h264_vulkan is not supported by your hardware, trying h264 instead\n"); args_parser->video_codec = GSR_VIDEO_CODEC_H264; // Need to do a query again because this time it's without vulkan if(!get_supported_video_codecs(egl, args_parser->video_codec, false, true, supported_video_codecs)) { @@ -3304,7 +3304,7 @@ static const AVCodec* pick_video_codec(gsr_egl *egl, args_parser *args_parser, b return pick_video_codec(egl, args_parser, true, low_power, supported_video_codecs); } case GSR_VIDEO_CODEC_HEVC_VULKAN: { - fprintf(stderr, "gsr warning: selected video codec hevc_vulkan is not supported, trying hevc instead\n"); + fprintf(stderr, "gsr warning: selected video codec hevc_vulkan is not supported by your hardware, trying hevc instead\n"); args_parser->video_codec = GSR_VIDEO_CODEC_HEVC; // Need to do a query again because this time it's without vulkan if(!get_supported_video_codecs(egl, args_parser->video_codec, false, true, supported_video_codecs)) { diff --git a/src/pipewire_video.c b/src/pipewire_video.c index eaf8c8d..a09e39f 100644 --- a/src/pipewire_video.c +++ b/src/pipewire_video.c @@ -692,7 +692,6 @@ bool gsr_pipewire_video_init(gsr_pipewire_video *self, int pipewire_fd, uint32_t self->video_info.fps_num = fps; self->video_info.fps_den = 1; self->cursor.visible = capture_cursor; - self->renegotiated_modifier = DRM_FORMAT_MOD_INVALID; if(!gsr_pipewire_video_setup_stream(self)) { gsr_pipewire_video_deinit(self); @@ -798,14 +797,8 @@ static EGLImage gsr_pipewire_video_create_egl_image_with_fallback(gsr_pipewire_v fprintf(stderr, "gsr error: gsr_pipewire_video_create_egl_image_with_fallback: failed to create egl image with modifiers, trying without modifiers\n"); self->no_modifiers_fallback = true; image = gsr_pipewire_video_create_egl_image(self, fds, offsets, pitches, modifiers, false); - } else if(self->renegotiated_modifier == self->format.info.raw.modifier) { - fprintf(stderr, "gsr error: gsr_pipewire_video_create_egl_image_with_fallback: modifier 0x%" PRIx64 " failed again after renegotiation, trying without modifiers as last resort\n", self->format.info.raw.modifier); - image = gsr_pipewire_video_create_egl_image(self, fds, offsets, pitches, modifiers, false); - if(image) - self->no_modifiers_fallback = true; } else { fprintf(stderr, "gsr error: gsr_pipewire_video_create_egl_image_with_fallback: failed to create egl image with modifier 0x%" PRIx64 ", renegotiating with a different modifier\n", self->format.info.raw.modifier); - self->renegotiated_modifier = self->format.info.raw.modifier; self->negotiated = false; pw_thread_loop_lock(self->thread_loop); gsr_pipewire_video_remove_modifier(self, self->format.info.raw.modifier);