Linux video media (kernel layer analysis) mainly consists of three files:
(/drivers/media/media-device.c,/drivers/media/media-devnode.c,/DRIVERS/MEDIA/MEDIA-ENTITY.C)
I. Main analysis of the/drivers/media/media-device.c file, the main structure of this file is:
structMedia_device {structDevice *dev;//Dev->driver_data points to this struct structMedia_devnode devnode; Charmodel[ +]; Chardriver_name[ +]; Charserial[ +]; Charbus_info[ +]; U32 hw_revision; U32 driver_version; U32 topology_version; U32 ID; structIda Entity_internal_idx; intEntity_internal_idx_max; structlist_head entities; structList_head interfaces; structList_head pads; structList_head links; structList_head entity_notify;//Notify callback list invoked when a new entity is registeredspinlock_tLock;//protects the graph objects Creation/removal structMutex Graph_mutex;//serializes graph operations. structmedia_entity_graph Pm_count_walk; void*Source_priv; int(*enable_source) (structMedia_entity *entity,structMedia_pipeline *pipe); void(*disable_source) (structMedia_entity *entity); int(*link_notify) (structMedia_link *link, u32 flags, unsignedintnotification);};
Media Framework for Linux video