Expand description
This library provides two levels of abstraction over V4L2:
- 
The ioctlmodule 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 devicemodule (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).
Modules§
- Safe definitions around V4L2 extended controls.
- High-level interface for a V4L2 video decoder. Currently only supports the stateful interface.
- Interface to the V4L2 primitives that is both safe and higher-level thanioctl, while staying low-level enough to allow the implementation of any kind of V4L2 program on top of it.
- High-level interface for a V4L2 video encoder.
- Provides safer versions of the V4L2 ioctls through simple functions working on aRawFd, and safer variants of the main V4L2 structures. This module can be used directly, but thedevicemodule is very likely to be a better fit for application code.
- Abstracts the different kinds of backing memory (MMAP,USERPTR,DMABUF) supported by V4L2.
Structs§
- Unified representation of a V4L2 format capable of handling both single and multi-planar formats. When the single-planar API is used, only one plane shall be used - attempts to have more will be rejected by the ioctl wrappers.
- A Fourcc pixel format, used to pass formats to V4L2. It can be converted back and forth from a 32-bit integer, or a 4-bytes string.
- Description of a single plane in a format.
- A more elegant representation forv4l2_rect.
Enums§
- Equivalent ofenum v4l2_colorspace.
- Equivalent ofenum v4l2_quantization.
- Possible directions for the queue
- Types of queues currently supported by this library.
- Equivalent ofenum v4l2_xfer_func.
- Equivalent ofenum v4l2_ycbcr_encoding.