ioctl MEDIA_IOC_G_TOPOLOGY
&manvol;
MEDIA_IOC_G_TOPOLOGYEnumerate the graph topology and graph element propertiesint ioctlint fdint requeststruct media_v2_topology *argpArgumentsfdFile descriptor returned by
open().requestMEDIA_IOC_G_TOPOLOGYargpDescriptionThe typical usage of this ioctl is to call it twice.
On the first call, the structure defined at &media-v2-topology; should
be zeroed. At return, if no errors happen, this ioctl will return the
topology_version and the total number of entities,
interfaces, pads and links.Before the second call, the userspace should allocate arrays to
store the graph elements that are desired, putting the pointers to them
at the ptr_entities, ptr_interfaces, ptr_links and/or ptr_pads, keeping
the other values untouched.If the topology_version remains the same, the
ioctl should fill the desired arrays with the media graph elements.
struct media_v2_topology__u64topology_versionVersion of the media graph topology. When the graph is
created, this field starts with zero. Every time a graph
element is added or removed, this field is
incremented.__u64num_entitiesNumber of entities in the graph__u64ptr_entitiesA pointer to a memory area where the entities array
will be stored, converted to a 64-bits integer.
It can be zero. if zero, the ioctl won't store the
entities. It will just update
num_entities__u64num_interfacesNumber of interfaces in the graph__u64ptr_interfacesA pointer to a memory area where the interfaces array
will be stored, converted to a 64-bits integer.
It can be zero. if zero, the ioctl won't store the
interfaces. It will just update
num_interfaces__u64num_padsTotal number of pads in the graph__u64ptr_padsA pointer to a memory area where the pads array
will be stored, converted to a 64-bits integer.
It can be zero. if zero, the ioctl won't store the
pads. It will just update
num_pads__u64num_linksTotal number of data and interface links in the graph__u64ptr_linksA pointer to a memory area where the links array
will be stored, converted to a 64-bits integer.
It can be zero. if zero, the ioctl won't store the
links. It will just update
num_links
struct media_v2_entity__u32idUnique ID for the entity.charname[64]Entity name as an UTF-8 NULL-terminated string.__u32functionEntity main function, see for details.__u32reserved[12]Reserved for future extensions. Drivers and applications must
set this array to zero.
struct media_v2_interface__u32idUnique ID for the interface.__u32intf_typeInterface type, see for details.__u32flagsInterface flags. Currently unused.__u32reserved[9]Reserved for future extensions. Drivers and applications must
set this array to zero.struct media_v2_intf_devnodedevnodeUsed only for device node interfaces. See for details..
struct media_v2_interface__u32majorDevice node major number.__u32minorDevice node minor number.
struct media_v2_pad__u32idUnique ID for the pad.__u32entity_idUnique ID for the entity where this pad belongs.__u32flagsPad flags, see for more details.__u32reserved[9]Reserved for future extensions. Drivers and applications must
set this array to zero.
struct media_v2_pad__u32idUnique ID for the pad.__u32source_idOn pad to pad links: unique ID for the source pad.On interface to entity links: unique ID for the interface.__u32sink_idOn pad to pad links: unique ID for the sink pad.On interface to entity links: unique ID for the entity.__u32flagsLink flags, see for more details.__u32reserved[5]Reserved for future extensions. Drivers and applications must
set this array to zero.
&return-value;
ENOSPCThis is returned when either one or more of the num_entities,
num_interfaces, num_links or num_pads are non-zero and are smaller
than the actual number of elements inside the graph. This may happen
if the topology_version changed when compared
to the last time this ioctl was called. Userspace should usually
free the area for the pointers, zero the struct elements and call
this ioctl again.