v4l2: skip resolutions that we cant import with eglCreateImage for yuyv

This commit is contained in:
dec05eba
2026-04-17 01:09:12 +02:00
parent 286158a838
commit 3e6bc0224a
2 changed files with 8 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ dep = [
dependency('libdrm'),
dependency('wayland-egl'),
dependency('wayland-client'),
dependency('vulkan'),
]
if build_machine.system() == 'linux'

View File

@@ -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,