← Documents Documentation/userspace-api/media/dvb/dmx-get-stc.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / DVB / Demux

DMX_GET_STC

선택한 system time counter를 비율로 받아 90kHz STC를 계산합니다.

Source pathDocumentation/userspace-api/media/dvb/dmx-get-stc.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

dmx-get-stc.rst:1-64

DMX_GET_STC는 num으로 STC를 선택하고 64비트 분자와 32비트 분모를 반환합니다. 실제 90kHz 값은 stc->stc / stc->base입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.dmx
3
4 .. _DMX_GET_STC:
5
6 ===========
7 DMX_GET_STC
8 ===========
9
10 Name
11 ----
12
13 DMX_GET_STC
14
15 Synopsis
16 --------
17
18 .. c:macro:: DMX_GET_STC
19
20 ``int ioctl(int fd, DMX_GET_STC, struct dmx_stc *stc)``
21
22 Arguments
23 ---------
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``stc``
29 Pointer to :c:type:`dmx_stc` where the stc data is to be stored.
30
31 Description
32 -----------
33
34 This ioctl call returns the current value of the system time counter
35 (which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
36 Some hardware supports more than one STC, so you must specify which one by
37 setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
38 The result is returned in form of a ratio with a 64 bit numerator
39 and a 32 bit denominator, so the real 90kHz STC value is
40 ``stc->stc / stc->base``.
41
42 Return Value
43 ------------
44
45 On success 0 is returned.
46
47 On error -1 is returned, and the ``errno`` variable is set
48 appropriately.
49
50 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
51
52 .. flat-table::
53 :header-rows: 0
54 :stub-columns: 0
55 :widths: 1 16
56
57 - .. row 1
58
59 - ``EINVAL``
60
61 - Invalid stc number.
62
63 The generic error codes are described at the
64 :ref:`Generic Error Codes <gen-errors>` chapter.
65

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름과 호출 형식

1-20

이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 `DMX_GET_STC` ioctl을 설명합니다.

호출 형식은 `int ioctl(int fd, DMX_GET_STC, struct dmx_stc *stc)`입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx

.. _DMX_GET_STC:

===========
DMX_GET_STC
===========

Name
----

DMX_GET_STC

Synopsis
--------

.. c:macro:: DMX_GET_STC

``int ioctl(int fd, DMX_GET_STC, struct dmx_stc *stc)``

STC 선택과 90kHz 값 계산

21-40

`fd`는 `open()`이 반환한 file descriptor이고, `stc`는 STC 데이터를 저장할 `dmx_stc` 구조체를 가리킵니다.

이 ioctl은 `DMX_PES_PCR <dmx_ts_pes>` 형식의 PES 필터가 구동하는 현재 system time counter 값을 반환합니다.

STC를 둘 이상 지원하는 하드웨어에서는 ioctl을 호출하기 전에 `stc` 구조체의 `num <dmx_stc>` 필드를 0부터 n 범위의 원하는 STC 번호로 설정해야 합니다.

결과는 64비트 분자와 32비트 분모의 비율로 반환되며, 실제 90kHz STC 값은 `stc->stc / stc->base`로 계산합니다.

STC 조회와 환산
dmx_stc.num에 STC 번호 지정DMX_GET_STC ioctl 호출64비트 stc 분자와 32비트 base 분모 수신stc->stc / stc->base 계산90kHz STC 값 사용

하드웨어 STC를 선택하고 90kHz 시간값을 계산합니다.


Arguments
---------

``fd``
    File descriptor returned by :c:func:`open()`.

``stc``
    Pointer to :c:type:`dmx_stc` where the stc data is to be stored.

Description
-----------

This ioctl call returns the current value of the system time counter
(which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
Some hardware supports more than one STC, so you must specify which one by
setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
The result is returned in form of a ratio with a 64 bit numerator
and a 32 bit denominator, so the real 90kHz STC value is
``stc->stc / stc->base``.

반환값과 EINVAL

41-64

성공하면 0을 반환하고, 오류가 발생하면 -1을 반환하며 `errno`를 적절히 설정합니다.

DMX_GET_STC 전용 오류
오류조건
EINVALSTC 번호가 유효하지 않음

원문의 flat-table 오류 항목입니다.

그 밖의 공통 오류 코드는 `Generic Error Codes <gen-errors>` 장에서 설명합니다.


Return Value
------------

On success 0 is returned.

On error -1 is returned, and the ``errno`` variable is set
appropriately.

.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|

.. flat-table::
    :header-rows:  0
    :stub-columns: 0
    :widths: 1 16

    -  .. row 1

       -  ``EINVAL``

       -  Invalid stc number.

The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.