^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: MC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _media_ioc_setup_link:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ioctl MEDIA_IOC_SETUP_LINK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) MEDIA_IOC_SETUP_LINK - Modify the properties of a link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: MEDIA_IOC_SETUP_LINK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, MEDIA_IOC_SETUP_LINK, struct media_link_desc *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to struct :c:type:`media_link_desc`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) To change link properties applications fill a struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) :c:type:`media_link_desc` with link identification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) information (source and sink pad) and the new requested link flags. They
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) The only configurable property is the ``ENABLED`` link flag to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) not be enabled or disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Link configuration has no side effect on other links. If an enabled link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) at the sink pad prevents the link from being enabled, the driver returns
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) with an ``EBUSY`` error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) while streaming media data. Attempting to enable or disable a streaming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) non-dynamic link will return an ``EBUSY`` error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) If the specified link can't be found the driver returns with an ``EINVAL``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) error code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) The struct :c:type:`media_link_desc` references a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) non-existing link, or the link is immutable and an attempt to modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) its configuration was made.