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

Function v4l2_ioctl

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

Call a V4L2 ioctl and convert errors to `io::Result`. 调用 V4L2 ioctl 并将错误转换为 `io::Result`。 # Safety The caller must ensure `arg` points to a valid, correctly-typed struct for the given `request` code. 调用者必须确保 `arg` 指向与 `request` 对应的有效且类型正确的结构体。

(fd: RawFd, request: u32, arg: *mut libc::c_void)

Source from the content-addressed store, hash-verified

73/// for the given `request` code.
74/// 调用者必须确保 `arg` 指向与 `request` 对应的有效且类型正确的结构体。
75unsafe fn v4l2_ioctl(fd: RawFd, request: u32, arg: *mut libc::c_void) -> io::Result<()> {
76 let ret = libc::ioctl(fd, request as libc::c_ulong, arg);
77 if ret == -1 {
78 Err(io::Error::last_os_error())
79 } else {
80 Ok(())
81 }
82}
83
84// ─── Device capability ──────────────────────────────────────────────────────
85

Callers 14

query_capabilitiesFunction · 0.85
enum_formatsFunction · 0.85
enum_frame_sizesFunction · 0.85
enum_frame_intervalsFunction · 0.85
get_formatFunction · 0.85
set_formatFunction · 0.85
set_fpsFunction · 0.85
set_controlFunction · 0.85
request_buffersFunction · 0.85
query_bufferFunction · 0.85
queue_bufferFunction · 0.85
dequeue_bufferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected