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

Function ioc

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

Build V4L2 ioctl command numbers at compile time. 在编译时构造 V4L2 ioctl 命令号。 Linux ioctl encoding: `direction(2) | size(14) | type(8) | nr(8)` Linux ioctl 编码:`方向(2) | 大小(14) | 类型(8) | 编号(8)`

(dir: u32, typ: u8, nr: u8, size: usize)

Source from the content-addressed store, hash-verified

28/// Linux ioctl encoding: `direction(2) | size(14) | type(8) | nr(8)`
29/// Linux ioctl 编码:`方向(2) | 大小(14) | 类型(8) | 编号(8)`
30const fn ioc(dir: u32, typ: u8, nr: u8, size: usize) -> u32 {
31 (dir << 30) | ((size as u32 & 0x3FFF) << 16) | ((typ as u32) << 8) | (nr as u32)
32}
33const fn ior<T>(typ: u8, nr: u8) -> u32 {
34 ioc(2, typ, nr, mem::size_of::<T>())
35}

Callers 3

iorFunction · 0.85
iowFunction · 0.85
iowrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected