STRUCT MEDIA_LINK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, we're in the Kernel API Manual, and this is struct media_link(9) β€” literally a link object that's part of a media graph. That's the whole vibe. slay πŸ’…


✨ SYNOPSIS ✨

No cap, here's the exact struct, character for character:

       struct media_link {
           struct media_gobj graph_obj;
           struct list_head list;
           union {
             struct media_gobj *gobj0;
             struct media_pad *source;
             struct media_interface *intf;
           };
           union {
             struct media_gobj *gobj1;
             struct media_pad *sink;
             struct media_entity *entity;
           };
           struct media_link *reverse;
           unsigned long flags;
           bool is_backlink;
        };

🫢 Members 🫢

field-by-field tea, no skipping: πŸ“

  • graph_obj β€” embedded structure containing the media object common data. it's giving "shared info passport" ✨
  • list β€” linked list associated with an entity or an interface that owns the link.
  • {unnamed_union} β€” anonymous. mysterious, unnamed, iconic πŸŽ€
  • gobj0 β€” part of a union. Used to get the pointer for the first graph_object of the link.
  • source β€” part of a union. Used only if the first object (gobj0) is a pad. In that case, it represents the source pad.
  • intf β€” part of a union. Used only if the first object (gobj0) is an interface.
  • {unnamed_union} β€” anonymous. again, no name, still main character πŸ’€
  • gobj1 β€” part of a union. Used to get the pointer for the second graph_object of the link.
  • sink β€” part of a union. Used only if the second object (gobj1) is a pad. In that case, it represents the sink pad.
  • entity β€” part of a union. Used only if the second object (gobj1) is an entity.
  • reverse β€” pointer to the link for the reverse direction of a pad to pad link. the link's other-direction bestie πŸ¦‹
  • flags β€” link flags, as defined in uapi/media.h (MEDIA_LNK_FL_*).
  • is_backlink β€” indicate if the link is a backlink. yes, it tells you if it's a backlink πŸ‘‘

🌈 SEE ALSO 🌈

Kernel file ./include/media/media-entity.h β€” and honestly the whole friend group is here, no cap:


this cutie came from ./include/media, dated October 2026, and it's literally struct media_link(9) saying byeee πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from