aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-04-17 01:09:12 +0200
committerdec05eba <dec05eba@protonmail.com>2026-04-17 01:10:27 +0200
commit3e6bc0224a2484e9df97c24a7c6db3dab04453af (patch)
tree8cb6cf9323e175063c83be99ac324dd6daa06ab9
parent286158a838e94420403257cf8c6e9052ff02b9f1 (diff)
v4l2: skip resolutions that we cant import with eglCreateImage for yuyv
-rw-r--r--meson.build1
-rw-r--r--src/capture/v4l2.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index b0fa9dc..921efa5 100644
--- a/meson.build
+++ b/meson.build
@@ -74,6 +74,7 @@ dep = [
dependency('libdrm'),
dependency('wayland-egl'),
dependency('wayland-client'),
+ dependency('vulkan'),
]
if build_machine.system() == 'linux'
diff --git a/src/capture/v4l2.c b/src/capture/v4l2.c
index 95a2171..79c3c08 100644
--- a/src/capture/v4l2.c
+++ b/src/capture/v4l2.c
@@ -222,6 +222,13 @@ static size_t gsr_capture_v4l2_get_supported_resolutions(int fd, gsr_capture_v4l
while(xioctl(fd, VIDIOC_ENUM_FRAMESIZES, &fmt) == 0) {
if(fmt.type == V4L2_FRMSIZE_TYPE_DISCRETE && resolution_index < max_resolutions) {
+ // Skip unsupported resolutions for now (those that eglCreateImage cant import because of pitch hardware limitation).
+ // TODO: Find a fix for this.
+ if(pixfmt == GSR_CAPTURE_V4L2_PIXFMT_YUYV && (fmt.discrete.width % 128 != 0)) {
+ ++fmt.index;
+ continue;
+ }
+
resolutions[resolution_index] = (gsr_capture_v4l2_resolution){
.width = fmt.discrete.width,
.height = fmt.discrete.height,