This library provides two levels of abstraction over V4L2:
-
The
ioctl
module provides direct, thin wrappers over the V4L2 ioctls with added safety. Note that "safety" here is in terms of memory safety: this layer won't guard against passing invalid data that the ioctls will reject - it just makes sure that data passed from and to the kernel can be accessed safely. Since this is a 1:1 mapping over the V4L2 ioctls, working at this level is a bit laborious, although more comfortable than doing the same in C. -
The
device
module (still WIP) provides a higher-level abstraction over the V4L2 entities, like device and queue. Strong typing will ensure that most inconsistencies while using the V4L2 API can be caught at compile-time.
These two layers should provide the foundations for higher-level libraries to provide safe, specialized APIs that support various V4L2 usage scenarios (camera, decoder/encoder, etc).