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

Linux 6.18.37 · Userspace API / Media / DVB / Demux

Digital TV demux write()

녹화된 Transport Stream을 DVR 논리 장치에 써서 재생합니다.

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

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

1. 요약·해설

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

요약·해설

dmx-fwrite.rst:1-70

write()는 DVR 논리 장치를 통한 녹화 TS 재생 경로입니다. 대응 demux 필터를 DMX_IN_DVR 입력으로 준비해야 front-end 수신 구성과 충돌하지 않습니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.dmx
3
4 .. _dmx_fwrite:
5
6 ========================
7 Digital TV demux write()
8 ========================
9
10 Name
11 ----
12
13 Digital TV demux write()
14
15 Synopsis
16 --------
17
18 .. c:function:: ssize_t write(int fd, const void *buf, size_t count)
19
20 Arguments
21 ---------
22
23 ``fd``
24 File descriptor returned by a previous call to :c:func:`open()`.
25
26 ``buf``
27 Buffer with data to be written
28
29 ``count``
30 Number of bytes at the buffer
31
32 Description
33 -----------
34
35 This system call is only provided by the logical device
36 ``/dev/dvb/adapter?/dvr?``, associated with the physical demux device that
37 provides the actual DVR functionality. It is used for replay of a
38 digitally recorded Transport Stream. Matching filters have to be defined
39 in the corresponding physical demux device, ``/dev/dvb/adapter?/demux?``.
40 The amount of data to be transferred is implied by count.
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 - - ``EWOULDBLOCK``
58 - No data was written. This might happen if ``O_NONBLOCK`` was
59 specified and there is no more buffer space available (if
60 ``O_NONBLOCK`` is not specified the function will block until buffer
61 space is available).
62
63 - - ``EBUSY``
64 - This error code indicates that there are conflicting requests. The
65 corresponding demux device is setup to receive data from the
66 front- end. Make sure that these filters are stopped and that the
67 filters with input set to ``DMX_IN_DVR`` are started.
68
69 The generic error codes are described at the
70 :ref:`Generic Error Codes <gen-errors>` chapter.
71

3. 한국어 전문 번역

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

이름과 호출 형식

1-18

이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 `dmx_fwrite` 참조 대상으로 Digital TV demux의 `write()`를 설명합니다.

함수 원형은 `ssize_t write(int fd, const void *buf, size_t count)`입니다.

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

.. _dmx_fwrite:

========================
Digital TV demux write()
========================

Name
----

Digital TV demux write()

Synopsis
--------

.. c:function:: ssize_t write(int fd, const void *buf, size_t count)

쓰기 인자

19-30

`fd`는 앞선 `open()` 호출이 반환한 file descriptor입니다.

`buf`는 기록할 데이터가 든 버퍼이고, `count`는 그 버퍼에 있는 바이트 수입니다.

write 인자
항목설명
fdDVR 논리 장치의 file descriptor
buf기록할 Transport Stream 데이터 버퍼
count전송할 바이트 수

재생할 전송 스트림을 전달하는 세 인자입니다.


Arguments
---------

``fd``
  File descriptor returned by a previous call to :c:func:`open()`.

``buf``
     Buffer with data to be written

``count``
    Number of bytes at the buffer

DVR 재생 데이터 경로

31-40

이 시스템 호출은 실제 DVR 기능을 제공하는 물리 demux 장치와 연결된 논리 장치 `/dev/dvb/adapter?/dvr?`에서만 제공합니다.

디지털 방식으로 녹화한 Transport Stream을 재생할 때 사용하며, 대응하는 물리 demux 장치 `/dev/dvb/adapter?/demux?`에 일치하는 필터를 미리 정의해야 합니다.

전송할 데이터 양은 `count`로 정합니다.

녹화 TS 재생
대응 demux 장치에 재생용 필터 정의필터 입력을 DMX_IN_DVR로 설정하고 시작녹화된 TS를 buf에 준비DVR 논리 장치에 count 바이트 write

DVR 입력과 물리 demux 필터를 함께 준비합니다.


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

This system call is only provided by the logical device
``/dev/dvb/adapter?/dvr?``, associated with the physical demux device that
provides the actual DVR functionality. It is used for replay of a
digitally recorded Transport Stream. Matching filters have to be defined
in the corresponding physical demux device, ``/dev/dvb/adapter?/demux?``.
The amount of data to be transferred is implied by count.

반환값과 오류

41-70

원문은 성공 시 0을 반환한다고 명시합니다. 함수 원형은 `ssize_t`이지만 반환 절의 문구는 수정하지 않고 그대로 옮깁니다.

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

Demux write 전용 오류
오류조건
EWOULDBLOCK데이터를 쓰지 못함. O_NONBLOCK 상태에서 남은 버퍼 공간이 없을 때 발생할 수 있음
EBUSY요청이 충돌함. 대응 demux 장치가 front-end에서 데이터를 받도록 구성되어 있음

비차단 버퍼 부족과 상충하는 입력 구성을 구분합니다.

`O_NONBLOCK`을 지정하지 않았다면 버퍼 공간이 생길 때까지 함수가 차단됩니다.

`EBUSY`를 피하려면 front-end 입력을 사용하는 필터를 중지하고, 입력이 `DMX_IN_DVR`로 설정된 필터를 시작해야 합니다.

EBUSY 구성 수정
대응 demux 장치의 활성 필터 확인front-end 입력 필터 중지DMX_IN_DVR 입력 필터 시작DVR 장치 write 재시도

front-end 수신과 DVR 재생 입력의 충돌을 해소합니다.

그 밖의 공통 오류 코드는 `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

    -  -  ``EWOULDBLOCK``
       -  No data was written. This might happen if ``O_NONBLOCK`` was
	  specified and there is no more buffer space available (if
	  ``O_NONBLOCK`` is not specified the function will block until buffer
	  space is available).

    -  -  ``EBUSY``
       -  This error code indicates that there are conflicting requests. The
	  corresponding demux device is setup to receive data from the
	  front- end. Make sure that these filters are stopped and that the
	  filters with input set to ``DMX_IN_DVR`` are started.

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