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

Function get_format

rustcv-camera/src/backend/linux/sys.rs:173–180  ·  view source on GitHub ↗
(fd: RawFd)

Source from the content-addressed store, hash-verified

171/// 获取当前视频格式(VIDIOC_G_FMT)。
172#[allow(dead_code)]
173pub fn get_format(fd: RawFd) -> io::Result<v4l2_format> {
174 let mut fmt: v4l2_format = unsafe { std::mem::zeroed() };
175 fmt.type_ = V4L2_BUF_TYPE_VIDEO_CAPTURE;
176 unsafe {
177 v4l2_ioctl(fd, VIDIOC_G_FMT, &mut fmt as *mut _ as *mut libc::c_void)?;
178 }
179 Ok(fmt)
180}
181
182/// Set the video format (VIDIOC_S_FMT).
183/// 设置视频格式(VIDIOC_S_FMT)。

Callers

nothing calls this directly

Calls 1

v4l2_ioctlFunction · 0.85

Tested by

no test coverage detected