Chapter 7: Demystifying V4L2 and Video Capture Device Drivers
Video has long been inherent in embedded systems. Given that Linux is the favorite kernel used in such systems, it goes without saying that it natively embeds its support for video. This is the so-called V4L2, which stands for Video 4 (for) Linux 2. Yes! 2 because there was a first version, V4L. V4L2 augments V4L with memory management features and other elements that make this framework as generic as possible. Through this framework, the Linux kernel is able to deal with camera devices and the bridge to which they are connected, as well as the associated DMA engines. These are not the only elements supported by V4L2. We will begin with an introduction to framework architecture, learning how it is organized, and walk through the main data structures it comprises. Then, we will learn how to design and write the bridge device driver, the one responsible for DMA operations, and finally, we will delve into sub-device drivers...