요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _DMX_GET_PES_PIDS:
================
DMX_GET_PES_PIDS
================
Name
----
DMX_GET_PES_PIDS
Synopsis
--------
.. c:macro:: DMX_GET_PES_PIDS
``int ioctl(fd, DMX_GET_PES_PIDS, __u16 pids[5])``
Arguments
---------
``fd``
File descriptor returned by :c:func:`open()`.
``pids``
Array used to store 5 Program IDs.
Description
-----------
This ioctl allows to query a DVB device to return the first PID used
by audio, video, textext, subtitle and PCR programs on a given service.
They're stored as:
======================= ======== =======================================
PID element position content
======================= ======== =======================================
pids[DMX_PES_AUDIO] 0 first audio PID
pids[DMX_PES_VIDEO] 1 first video PID
pids[DMX_PES_TELETEXT] 2 first teletext PID
pids[DMX_PES_SUBTITLE] 3 first subtitle PID
pids[DMX_PES_PCR] 4 first Program Clock Reference PID
======================= ======== =======================================
.. note::
A value equal to 0xffff means that the PID was not filled by the
Kernel.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름과 호출 형식
1-20이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 `DMX_GET_PES_PIDS` ioctl을 설명합니다.
호출 형식은 `int ioctl(fd, DMX_GET_PES_PIDS, __u16 pids[5])`이며 결과를 받을 16비트 PID 배열의 길이는 5입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _DMX_GET_PES_PIDS:
================
DMX_GET_PES_PIDS
================
Name
----
DMX_GET_PES_PIDS
Synopsis
--------
.. c:macro:: DMX_GET_PES_PIDS
``int ioctl(fd, DMX_GET_PES_PIDS, __u16 pids[5])``
인자와 조회 대상
21-36`fd`는 `open()`이 반환한 DVB demux 장치의 file descriptor입니다.
`pids`는 다섯 개의 Program ID를 저장하는 배열입니다.
이 ioctl은 지정한 서비스에서 오디오, 비디오, 텔레텍스트, 자막, PCR 프로그램이 처음 사용하는 PID를 DVB 장치에 질의합니다. 원문 35행의 `textext` 표기는 이어지는 표의 `teletext` 항목을 가리키는 것으로 읽되 원문 자체는 보존합니다.
Arguments
---------
``fd``
File descriptor returned by :c:func:`open()`.
``pids``
Array used to store 5 Program IDs.
Description
-----------
This ioctl allows to query a DVB device to return the first PID used
by audio, video, textext, subtitle and PCR programs on a given service.
They're stored as:
PID 배열 배치와 미설정 값
37-52반환된 PID는 아래처럼 `pids` 배열의 고정 위치에 저장됩니다.
원문의 표를 같은 위치와 의미로 구조화했습니다.
배열 값이 `0xffff`이면 커널이 해당 PID를 채우지 않았다는 뜻입니다.
하나의 호출로 다섯 종류의 첫 PID를 받습니다.
======================= ======== =======================================
PID element position content
======================= ======== =======================================
pids[DMX_PES_AUDIO] 0 first audio PID
pids[DMX_PES_VIDEO] 1 first video PID
pids[DMX_PES_TELETEXT] 2 first teletext PID
pids[DMX_PES_SUBTITLE] 3 first subtitle PID
pids[DMX_PES_PCR] 4 first Program Clock Reference PID
======================= ======== =======================================
.. note::
A value equal to 0xffff means that the PID was not filled by the
Kernel.
반환값
53-62성공하면 0을 반환합니다.
오류가 발생하면 -1을 반환하고 `errno`를 적절히 설정합니다. 공통 오류 코드는 `Generic Error Codes <gen-errors>` 장에서 설명합니다.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
요약·해설
dmx-get-pes-pids.rst:1-62DMX_GET_PES_PIDS는 길이 5의 배열에 서비스별 첫 PID를 고정 순서로 채우며, 0xffff는 커널이 값을 채우지 않았음을 뜻합니다.