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

Linux 6.18.37 · Userspace API / Media / DVB / Demux

DMX_SET_FILTER

filter·mask·timeout·flags로 section 필터를 구성합니다.

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

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

1. 요약·해설

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

요약·해설

dmx-set-filter.rst:1-55

DMX_SET_FILTER는 section의 filter/mask, timeout, CRC·one-shot·즉시 시작 플래그를 설정합니다. 기존 필터는 취소되고 receive buffer는 flush됩니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.dmx
3
4 .. _DMX_SET_FILTER:
5
6 ==============
7 DMX_SET_FILTER
8 ==============
9
10 Name
11 ----
12
13 DMX_SET_FILTER
14
15 Synopsis
16 --------
17
18 .. c:macro:: DMX_SET_FILTER
19
20 ``int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)``
21
22 Arguments
23 ---------
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``params``
29
30 Pointer to structure containing filter parameters.
31
32 Description
33 -----------
34
35 This ioctl call sets up a filter according to the filter and mask
36 parameters provided. A timeout may be defined stating number of seconds
37 to wait for a section to be loaded. A value of 0 means that no timeout
38 should be applied. Finally there is a flag field where it is possible to
39 state whether a section should be CRC-checked, whether the filter should
40 be a "one-shot" filter, i.e. if the filtering operation should be
41 stopped after the first section is received, and whether the filtering
42 operation should be started immediately (without waiting for a
43 :ref:`DMX_START` ioctl call). If a filter was previously set-up, this
44 filter will be canceled, and the receive buffer will be flushed.
45
46 Return Value
47 ------------
48
49 On success 0 is returned.
50
51 On error -1 is returned, and the ``errno`` variable is set
52 appropriately.
53
54 The generic error codes are described at the
55 :ref:`Generic Error Codes <gen-errors>` chapter.
56

3. 한국어 전문 번역

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

이름과 호출 형식

1-20

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

호출 형식은 `int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)`입니다.

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

.. _DMX_SET_FILTER:

==============
DMX_SET_FILTER
==============

Name
----

DMX_SET_FILTER

Synopsis
--------

.. c:macro:: DMX_SET_FILTER

``int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)``

section 필터 매개변수와 플래그

21-44

`fd`는 `open()`이 반환한 file descriptor이고, `params`는 필터 매개변수가 든 구조체를 가리킵니다.

이 ioctl은 제공된 filter와 mask 매개변수에 따라 section 필터를 구성합니다.

timeout에는 section이 적재되기를 기다릴 초 수를 지정할 수 있고, 0은 제한 시간을 적용하지 않는다는 뜻입니다.

flag 필드에서는 section CRC 검사 여부, 첫 section을 받은 뒤 필터링을 멈추는 one-shot 여부, 별도의 `DMX_START`를 기다리지 않고 즉시 시작할지를 지정할 수 있습니다.

이미 설정된 필터가 있으면 기존 필터를 취소하고 receive buffer를 비웁니다.

DMX_SET_FILTER 제어 항목
항목설명
filter + mask수신할 section 바이트 패턴 선택
timeoutsection 적재 대기 시간. 0이면 제한 없음
CRC check수신 section의 CRC 검사
one-shot첫 section 수신 뒤 필터링 중지
immediate startDMX_START 없이 즉시 필터링 시작

section 필터에서 선택할 수 있는 동작입니다.

section 필터 재설정
dmx_sct_filter_params 준비filter/mask, timeout, flags 설정기존 필터가 있으면 취소receive buffer flush새 필터 적용 및 플래그에 따라 즉시 또는 DMX_START 후 실행

기존 필터가 있는 fd에 새 구성을 적용하는 과정입니다.


Arguments
---------

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

``params``

    Pointer to structure containing filter parameters.

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

This ioctl call sets up a filter according to the filter and mask
parameters provided. A timeout may be defined stating number of seconds
to wait for a section to be loaded. A value of 0 means that no timeout
should be applied. Finally there is a flag field where it is possible to
state whether a section should be CRC-checked, whether the filter should
be a "one-shot" filter, i.e. if the filtering operation should be
stopped after the first section is received, and whether the filtering
operation should be started immediately (without waiting for a
:ref:`DMX_START` ioctl call). If a filter was previously set-up, this
filter will be canceled, and the receive buffer will be flushed.

반환값

45-55

성공하면 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.