요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: MC
.. _media_ioc_setup_link:
**************************
ioctl MEDIA_IOC_SETUP_LINK
**************************
Name
====
MEDIA_IOC_SETUP_LINK - Modify the properties of a link
Synopsis
========
.. c:macro:: MEDIA_IOC_SETUP_LINK
``int ioctl(int fd, MEDIA_IOC_SETUP_LINK, struct media_link_desc *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`media_link_desc`.
Description
===========
To change link properties applications fill a struct
:c:type:`media_link_desc` with link identification
information (source and sink pad) and the new requested link flags. They
then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
structure.
The only configurable property is the ``ENABLED`` link flag to
enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can
not be enabled or disabled.
Link configuration has no side effect on other links. If an enabled link
at the sink pad prevents the link from being enabled, the driver returns
with an ``EBUSY`` error code.
Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled
while streaming media data. Attempting to enable or disable a streaming
non-dynamic link will return an ``EBUSY`` error code.
If the specified link can't be found the driver returns with an ``EINVAL``
error code.
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
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
The struct :c:type:`media_link_desc` references a
non-existing link, or the link is immutable and an attempt to modify
its configuration was made.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름, 호출 형식과 인자
1-30`MEDIA_IOC_SETUP_LINK`는 media graph link의 속성을 변경하는 ioctl입니다.
int ioctl(int fd, MEDIA_IOC_SETUP_LINK, struct media_link_desc *argp);
대상 link는 source와 sink pad로 식별합니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: MC
.. _media_ioc_setup_link:
**************************
ioctl MEDIA_IOC_SETUP_LINK
**************************
Name
====
MEDIA_IOC_SETUP_LINK - Modify the properties of a link
Synopsis
========
.. c:macro:: MEDIA_IOC_SETUP_LINK
``int ioctl(int fd, MEDIA_IOC_SETUP_LINK, struct media_link_desc *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`media_link_desc`.
변경 가능한 link flag
31-43Application은 `struct media_link_desc`에 source pad, sink pad와 새 link flag를 채운 뒤 이 ioctl을 호출합니다.
설정 가능한 유일한 속성은 link를 켜고 끄는 `ENABLED` flag입니다. `IMMUTABLE`로 표시된 link는 enable하거나 disable할 수 없습니다.
변경 가능 여부와 streaming 중 제약을 구분합니다.
Description
===========
To change link properties applications fill a struct
:c:type:`media_link_desc` with link identification
information (source and sink pad) and the new requested link flags. They
then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
structure.
The only configurable property is the ``ENABLED`` link flag to
enable/disable a link. Links marked with the ``IMMUTABLE`` link flag can
not be enabled or disabled.
충돌, streaming과 link 검색
44-53한 link의 설정은 다른 link의 상태를 자동으로 바꾸지 않습니다. Sink pad에 이미 enable된 link가 있어 새 link를 enable할 수 없으면 driver는 `EBUSY`를 반환합니다.
Media data를 streaming하는 동안에는 `DYNAMIC` link만 enable하거나 disable할 수 있습니다. Streaming 중 non-dynamic link의 상태 변경도 `EBUSY`입니다.
Source와 sink가 가리키는 지정 link를 찾을 수 없으면 driver는 `EINVAL`을 반환합니다.
Link configuration has no side effect on other links. If an enabled link
at the sink pad prevents the link from being enabled, the driver returns
with an ``EBUSY`` error code.
Only links marked with the ``DYNAMIC`` link flag can be enabled/disabled
while streaming media data. Attempting to enable or disable a streaming
non-dynamic link will return an ``EBUSY`` error code.
If the specified link can't be found the driver returns with an ``EINVAL``
error code.
반환값과 EINVAL
54-65성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 알맞게 설정합니다. 공통 오류는 `Generic Error Codes <gen-errors>` 장을 따릅니다.
`EINVAL`은 `struct media_link_desc`가 존재하지 않는 link를 참조하거나, immutable link의 설정을 변경하려 한 경우 발생합니다.
원문에 명시된 link 설정 실패 조건입니다.
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
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
The struct :c:type:`media_link_desc` references a
non-existing link, or the link is immutable and an attempt to modify
its configuration was made.
요약·해설
media-ioc-setup-link.rst:1-65변경 가능한 속성은 `ENABLED`뿐입니다. `IMMUTABLE` link는 변경할 수 없고, streaming 중에는 `DYNAMIC` link만 변경할 수 있으며 다른 link 상태를 자동 조정하지 않습니다.