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

Function set_control

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

Set a V4L2 control value (VIDIOC_S_CTRL). 设置 V4L2 控制参数值(VIDIOC_S_CTRL)。 Common uses: - Disable `exposure_dynamic_framerate` (id=0x009a0903, value=0) to prevent the camera from reducing FPS in low light. 常见用途: - 禁用 `exposure_dynamic_framerate`(id=0x009a0903, value=0), 防止摄像头在低光照下自动降低帧率。

(fd: RawFd, id: u32, value: i32)

Source from the content-addressed store, hash-verified

239/// - 禁用 `exposure_dynamic_framerate`(id=0x009a0903, value=0),
240/// 防止摄像头在低光照下自动降低帧率。
241pub fn set_control(fd: RawFd, id: u32, value: i32) -> io::Result<()> {
242 let mut ctrl: v4l2_control = unsafe { std::mem::zeroed() };
243 ctrl.id = id;
244 ctrl.value = value;
245 unsafe {
246 v4l2_ioctl(fd, VIDIOC_S_CTRL, &mut ctrl as *mut _ as *mut libc::c_void)?;
247 }
248 Ok(())
249}
250
251// ─── Buffer management ──────────────────────────────────────────────────────
252

Callers 1

openMethod · 0.85

Calls 1

v4l2_ioctlFunction · 0.85

Tested by

no test coverage detected