Framework architecture and the main data structures
Video devices are becoming increasingly complex. In such devices, hardware often comprises several integrated IPs that need to cooperate with one another in a controlled manner, and this leads to complex V4L2 drivers. This requires figuring out the architecture prior to delving into the code and this is precisely the requirement that this section addresses.
It is known that drivers normally mirror the hardware model in programming. In the V4L2 context, the diverse IP components are modeled as software blocks called sub-devices. V4L2 sub-devices are usually kernel-only objects. Moreover, if the V4L2 driver implements the media device API (which we will discuss in the next chapter, Chapter 8, Integrating with V4L2 Async and Media Controller Frameworks), those sub-devices will automatically inherit from media entities, allowing applications to enumerate the sub-devices and to discover the hardware topology using the media framework...