STRUCT MEDIA_ENTITY_OPERATIONS(9)
π struct media_entity_operations(9) β like, the whole ops table for media entities, bestie
okay so this is from the Kernel API Manual and it's genuinely one of those pages where the struct is the whole personality. it's giving "here's the callback buffet, pick your faves" π
β¨ NAME β¨
struct media_entity_operations β Media entity operations π
πΈ SYNOPSIS πΈ
struct media_entity_operations {
int (*get_fwnode_pad)(struct media_entity *entity, struct
fwnode_endpoint *endpoint);
int (*link_setup)(struct media_entity *entity, const struct
media_pad *local, const struct media_pad *remote, u32 flags);
int (*link_validate)(struct media_link *link);
bool (*has_pad_interdep)(struct media_entity *entity, unsigned int
pad0, unsigned int pad1);
};
like yes that's the actual layout, copy it exactly, don't come for me π
π Members π
get_fwnode_padβ returns the pad number based on a fwnode endpoint, or a negative value on error π¦ this one's for mapping a fwnode onto a media pad number. it's Optional.link_setupβ notifies the entity that links changed, bestie π₯ and here's the tea: the operation can return an error, and if it does, link setup gets cancelled. it's Optional.link_validateβ returns whether a link is valid from the entity's point of view β¨ themedia_pipeline_startfunction validates all links by calling this operation, so it's lowkey the vibe-checker of the whole pipeline. it's Optional.has_pad_interdepβ returns whether two pads of the entity are interdependent π and if two pads are interdependent they're part of the same pipeline, and enabling one of the pads means the other pad becomes "locked" and doesn't allow configuration changes πpad0andpad1are guaranteed to not both be sinks or sources.
Never call the.has_pad_interdepoperation directly β always usemedia_entity_has_pad_interdepπ fr fr, just use the wrapper.
Optional: if the operation isn't implemented, all pads will be considered as interdependent π
π Description π
NOTE: Those these callbacks are called with struct media_device.graph_mutex mutex held. π«Ά (so like, mind the lock, bestie β that mutex is already in your hands when these run)
π SEE ALSO π
kernel file ./include/media/media-entity.h β and here's the full squad, no skips, all of them π:
enum media_gobj_type(9)struct media_gobj(9)struct media_entity_enum(9)struct media_graph(9)struct media_pipeline(9)struct media_pipeline_pad(9)struct media_pipeline_pad_iter(9)struct media_pipeline_entity_iter(9)struct media_link(9)enum media_pad_signal_type(9)struct media_pad(9)enum media_entity_type(9)struct media_entity(9)media_entity_for_each_pad(9)struct media_interface(9)struct media_intf_devnode(9)media_entity_id(9)media_type(9)media_id(9)media_gobj_gen_id(9)is_media_entity_v4l2_video_device(9)is_media_entity_v4l2_subdev(9)media_entity_enum_init(9)media_entity_enum_cleanup(9)media_entity_enum_zero(9)media_entity_enum_set(9)media_entity_enum_clear(9)media_entity_enum_test(9)media_entity_enum_test_and_set(9)media_entity_enum_empty(9)media_entity_enum_intersects(9)gobj_to_entity(9)gobj_to_pad(9)gobj_to_link(9)gobj_to_intf(9)intf_to_devnode(9)media_gobj_create(9)media_gobj_destroy(9)media_entity_pads_init(9)media_entity_cleanup(9)media_get_pad_index(9)media_create_pad_link(9)media_create_pad_links(9)media_entity_remove_links(9)__media_entity_setup_link(9)media_entity_setup_link(9)media_entity_find_link(9)media_pad_remote_pad_first(9)media_pad_remote_pad_unique(9)media_entity_remote_pad_unique(9)media_entity_remote_source_pad_unique(9)media_pad_is_streaming(9)media_entity_is_streaming(9)media_entity_pipeline(9)media_pad_pipeline(9)media_entity_get_fwnode_pad(9)media_graph_walk_init(9)media_graph_walk_cleanup(9)media_graph_walk_start(9)media_graph_walk_next(9)media_pipeline_start(9)__media_pipeline_start(9)media_pipeline_stop(9)__media_pipeline_stop(9)media_pipeline_for_each_pad(9)media_pipeline_entity_iter_init(9)media_pipeline_entity_iter_cleanup(9)media_pipeline_for_each_entity(9)media_pipeline_alloc_start(9)media_devnode_create(9)media_devnode_remove(9)media_create_intf_link(9)__media_remove_intf_link(9)media_remove_intf_link(9)__media_remove_intf_links(9)media_remove_intf_links(9)media_entity_call(9)media_create_ancillary_link(9)__media_entity_next_link(9)for_each_media_entity_data_link(9)
and that's the page, periodt π
sign-off time: this lil masterpiece lives in ./include/media, it's dated October 2026, and it's filed under struct media...y_operations(9) β iconic, no notes, ate πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms