MCPcopy Create free account
hub / github.com/RustCV/RustCV / query_capabilities

Function query_capabilities

rustcv-camera/src/backend/linux/sys.rs:93–103  ·  view source on GitHub ↗

Query device capabilities (VIDIOC_QUERYCAP). 查询设备能力(VIDIOC_QUERYCAP)。 Used to check if the device supports video capture (`V4L2_CAP_VIDEO_CAPTURE`) and streaming I/O (`V4L2_CAP_STREAMING`). 用于检查设备是否支持视频采集(`V4L2_CAP_VIDEO_CAPTURE`) 和流式 I/O(`V4L2_CAP_STREAMING`)。

(fd: RawFd)

Source from the content-addressed store, hash-verified

91/// 用于检查设备是否支持视频采集(`V4L2_CAP_VIDEO_CAPTURE`)
92/// 和流式 I/O(`V4L2_CAP_STREAMING`)。
93pub fn query_capabilities(fd: RawFd) -> io::Result<v4l2_capability> {
94 let mut caps: v4l2_capability = unsafe { std::mem::zeroed() };
95 unsafe {
96 v4l2_ioctl(
97 fd,
98 VIDIOC_QUERYCAP,
99 &mut caps as *mut _ as *mut libc::c_void,
100 )?;
101 }
102 Ok(caps)
103}
104
105// ─── Format enumeration ─────────────────────────────────────────────────────
106

Callers 1

openMethod · 0.85

Calls 1

v4l2_ioctlFunction · 0.85

Tested by

no test coverage detected