linux client: only show 10-bit if supported

This commit is contained in:
galister
2026-09-29 19:22:33 +02:00
committed by xytovl
parent 9062f082e5
commit e5923e155a
9 changed files with 106 additions and 28 deletions
+16 -3
View File
@@ -88,13 +88,13 @@ bool is_iris_decoder(int fd)
(capabilities & V4L2_CAP_VIDEO_M2M_MPLANE) && (capabilities & V4L2_CAP_STREAMING);
}
bool supports_format(int fd, uint32_t pixel_format)
bool supports_format(int fd, v4l2_buf_type type, uint32_t pixel_format)
{
for (uint32_t index = 0;; ++index)
{
v4l2_fmtdesc fmt{};
fmt.index = index;
fmt.type = output_type;
fmt.type = type;
if (xioctl(fd, VIDIOC_ENUM_FMT, &fmt) < 0)
return false;
if (fmt.pixelformat == pixel_format)
@@ -118,7 +118,7 @@ wivrn::fd_base find_device(wivrn::video_codec codec)
const bool suitable =
is_iris_decoder(probe_fd) &&
supports_format(probe_fd, pixel_format);
supports_format(probe_fd, output_type, pixel_format);
close(probe_fd);
@@ -1028,6 +1028,19 @@ bool decoder::available_for(wivrn::video_codec codec)
return true;
}
bool decoder::supports_10bit(wivrn::video_codec codec)
{
try
{
auto device = find_device(codec);
return supports_format(device.get_fd(), capture_type, V4L2_PIX_FMT_P010);
}
catch (...)
{
return false;
}
}
void decoder::supported_codecs(std::vector<wivrn::video_codec> & result)
{
if (available_for(wivrn::video_codec::h265))