The Linux Kernel
  • Linux Kernel Documentation
    • Introduction
    • Sphinx Build
    • Writing Documentation
    • Including kernel-doc comments
    • Writing kernel-doc comments
    • DocBook XML [DEPRECATED]
  • Linux Media Infrastructure userspace API
    • Introduction
    • Part I - Video for Linux API
    • Part II - Digital TV API
    • Part III - Remote Controller API
    • Part IV - Media Controller API
    • Part V - Consumer Electronics Control API
    • Generic Error Codes
    • GNU Free Documentation License
  • Media subsystem kernel internal API
    • 1. Video2Linux devices
    • 2. Digital TV (DVB) devices
    • 3. Digital TV Common functions
    • 4. Digital TV Frontend kABI
    • 5. Digital TV Demux kABI
    • 6. Demux Callback API
    • 7. Digital TV Conditional Access kABI
    • 8. Remote Controller devices
    • 9. Media Controller devices
  • Linux Digital TV driver-specific documentation
    • 1. Introdution
    • 2. HOWTO: Get An Avermedia DVB-T working under Linux
    • 3. How to get the bt8xx cards working
    • 4. Hardware supported by the linuxtv.org DVB drivers
    • 5. Digital TV Conditional Access Interface (CI API)
    • 6. Idea behind the dvb-usb-framework
    • 7. FAQ
    • 8. Firmware files for lmedm04 cards
    • 9. Opera firmware
    • 10. How to set up the Technisat/B2C2 Flexcop devices
    • 11. TechnoTrend/Hauppauge DEC USB Driver
    • 12. UDEV rules for DVB
    • 13. Contributors
  • Video4Linux (V4L) driver-specific documentation
    • 1. Guidelines for Linux4Linux pixel format 4CCs
    • 2. Infrared remote control support in video4linux drivers
    • 3. Using with lircd
    • 4. Using without lircd
    • 5. Tuner drivers
    • 6. Cards List
    • 7. The bttv driver
    • 8. The cafe_ccic driver
    • 9. The cpia2 driver
    • 10. The cx18 driver
    • 11. The cx2341x driver
    • 12. The cx88 driver
    • 13. The VPBE V4L2 driver design
    • 14. The Samsung S5P/EXYNOS4 FIMC driver
    • 15. The ivtv driver
    • 16. Vaio Picturebook Motion Eye Camera Driver
    • 17. OMAP 3 Image Signal Processor (ISP) driver
    • 18. OMAP4 ISS Driver
    • 19. The pvrusb2 driver
    • 20. PXA-Camera Host Driver
    • 21. The Radiotrack radio driver
    • 22. The saa7134 driver
    • 23. Cropping and Scaling algorithm, used in the sh_mobile_ceu_camera driver
    • 24. The Silicon Labs Si470x FM Radio Receivers driver
    • 25. The Silicon Labs Si4713 FM Radio Transmitter Driver
    • 26. The SI476x Driver
    • 27. The Soc-Camera Drivers
    • 28. The Linux USB Video Class (UVC) driver
    • 29. The Virtual Video Test Driver (vivid)
    • 30. The Zoran driver
    • 31. Zoran 364xx based USB webcam module
  • Linux GPU Driver Developer’s Guide
    • Introduction
    • DRM Internals
    • DRM Memory Management
    • Kernel Mode Setting (KMS)
    • Mode Setting Helper Functions
    • Userland interfaces
    • drm/i915 Intel GFX Driver
    • VGA Switcheroo
 
The Linux Kernel
  • Docs »
  • Linux Media Infrastructure userspace API »
  • Part IV - Media Controller API »
  • 4. Function Reference »
  • 4.7. ioctl MEDIA_IOC_ENUM_LINKS
  • View page source

4.7. ioctl MEDIA_IOC_ENUM_LINKS¶

4.7.1. Name¶

MEDIA_IOC_ENUM_LINKS - Enumerate all pads and links for a given entity

4.7.2. Synopsis¶

int ioctl(int fd, int request, struct media_links_enum* argp)¶

4.7.3. Arguments¶

fd
File descriptor returned by open().
request
MEDIA_IOC_ENUM_LINKS

argp

4.7.4. Description¶

To enumerate pads and/or links for a given entity, applications set the entity field of a struct media_links_enum structure and initialize the struct media_pad_desc and struct media_link_desc structure arrays pointed by the pads and links fields. They then call the MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure.

If the pads field is not NULL, the driver fills the pads array with information about the entity’s pads. The array must have enough room to store all the entity’s pads. The number of pads can be retrieved with ioctl MEDIA_IOC_ENUM_ENTITIES.

If the links field is not NULL, the driver fills the links array with information about the entity’s outbound links. The array must have enough room to store all the entity’s outbound links. The number of outbound links can be retrieved with ioctl MEDIA_IOC_ENUM_ENTITIES.

Only forward links that originate at one of the entity’s source pads are returned during the enumeration process.

struct media_links_enum
__u32 entity Entity id, set by the application.
struct media_pad_desc *pads Pointer to a pads array allocated by the application. Ignored if NULL.
struct media_link_desc *links Pointer to a links array allocated by the application. Ignored if NULL.
struct media_pad_desc
__u32 entity ID of the entity this pad belongs to.
__u16 index 0-based pad index.
__u32 flags Pad flags, see Media pad flags for more details.
struct media_link_desc
struct media_pad_desc source Pad at the origin of this link.
struct media_pad_desc sink Pad at the target of this link.
__u32 flags Link flags, see Media link flags for more details.

4.7.5. Return Value¶

On success 0 is returned, on error -1 and the errno variable is set appropriately. The generic error codes are described at the Generic Error Codes chapter.

EINVAL
The struct media_links_enum id references a non-existing entity.
Next Previous

© Copyright 2016, The kernel development community.

Sphinx theme provided by Read the Docs