요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later OR GPL-2.0
.. c:namespace:: dtv.legacy.osd
.. _dvb_osd:
==============
DVB OSD Device
==============
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
The DVB OSD device controls the OnScreen-Display of the AV7110 based
DVB-cards with hardware MPEG2 decoder. It can be accessed through
``/dev/dvb/adapter?/osd0``.
Data types and ioctl definitions can be accessed by including
``linux/dvb/osd.h`` in your application.
The OSD is not a frame-buffer like on many other cards.
It is a kind of canvas one can draw on.
The color-depth is limited depending on the memory size installed.
An appropriate palette of colors has to be set up.
The installed memory size can be identified with the `OSD_GET_CAPABILITY`_
ioctl.
OSD Data Types
==============
OSD_Command
-----------
Synopsis
~~~~~~~~
.. code-block:: c
typedef enum {
/* All functions return -2 on "not open" */
OSD_Close = 1,
OSD_Open,
OSD_Show,
OSD_Hide,
OSD_Clear,
OSD_Fill,
OSD_SetColor,
OSD_SetPalette,
OSD_SetTrans,
OSD_SetPixel,
OSD_GetPixel,
OSD_SetRow,
OSD_SetBlock,
OSD_FillRow,
OSD_FillBlock,
OSD_Line,
OSD_Query,
OSD_Test,
OSD_Text,
OSD_SetWindow,
OSD_MoveWindow,
OSD_OpenRaw,
} OSD_Command;
Commands
~~~~~~~~
.. note:: All functions return -2 on "not open"
.. flat-table::
:header-rows: 1
:stub-columns: 0
- ..
- Command
- | Used variables of ``struct`` `osd_cmd_t`_.
| Usage{variable} if alternative use.
- :cspan:`2` Description
- ..
- ``OSD_Close``
- -
- | Disables OSD and releases the buffers.
| Returns 0 on success.
- ..
- ``OSD_Open``
- | x0,y0,x1,y1,
| BitPerPixel[2/4/8]{color&0x0F},
| mix[0..15]{color&0xF0}
- | Opens OSD with this size and bit depth
| Returns 0 on success,
| -1 on DRAM allocation error,
| -2 on "already open".
- ..
- ``OSD_Show``
- -
- | Enables OSD mode.
| Returns 0 on success.
- ..
- ``OSD_Hide``
- -
- | Disables OSD mode.
| Returns 0 on success.
- ..
- ``OSD_Clear``
- -
- | Sets all pixel to color 0.
| Returns 0 on success.
- ..
- ``OSD_Fill``
- color
- | Sets all pixel to color <color>.
| Returns 0 on success.
- ..
- ``OSD_SetColor``
- | color,
| R{x0},G{y0},B{x1},
| opacity{y1}
- | Set palette entry <num> to <r,g,b>, <mix> and <trans> apply
| R,G,B: 0..255
| R=Red, G=Green, B=Blue
| opacity=0: pixel opacity 0% (only video pixel shows)
| opacity=1..254: pixel opacity as specified in header
| opacity=255: pixel opacity 100% (only OSD pixel shows)
| Returns 0 on success, -1 on error.
- ..
- ``OSD_SetPalette``
- | firstcolor{color},
| lastcolor{x0},data
- | Set a number of entries in the palette.
| Sets the entries "firstcolor" through "lastcolor" from the
array "data".
| Data has 4 byte for each color:
| R,G,B, and a opacity value: 0->transparent, 1..254->mix,
255->pixel
- ..
- ``OSD_SetTrans``
- transparency{color}
- | Sets transparency of mixed pixel (0..15).
| Returns 0 on success.
- ..
- ``OSD_SetPixel``
- x0,y0,color
- | Sets pixel <x>,<y> to color number <color>.
| Returns 0 on success, -1 on error.
- ..
- ``OSD_GetPixel``
- x0,y0
- | Returns color number of pixel <x>,<y>, or -1.
| Command currently not supported by the AV7110!
- ..
- ``OSD_SetRow``
- x0,y0,x1,data
- | Fills pixels x0,y through x1,y with the content of data[].
| Returns 0 on success, -1 on clipping all pixel (no pixel
drawn).
- ..
- ``OSD_SetBlock``
- | x0,y0,x1,y1,
| increment{color},
| data
- | Fills pixels x0,y0 through x1,y1 with the content of data[].
| Inc contains the width of one line in the data block,
| inc<=0 uses block width as line width.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_FillRow``
- x0,y0,x1,color
- | Fills pixels x0,y through x1,y with the color <color>.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_FillBlock``
- x0,y0,x1,y1,color
- | Fills pixels x0,y0 through x1,y1 with the color <color>.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_Line``
- x0,y0,x1,y1,color
- | Draw a line from x0,y0 to x1,y1 with the color <color>.
| Returns 0 on success.
- ..
- ``OSD_Query``
- | x0,y0,x1,y1,
| xasp{color}; yasp=11
- | Fills parameters with the picture dimensions and the pixel
aspect ratio.
| Returns 0 on success.
| Command currently not supported by the AV7110!
- ..
- ``OSD_Test``
- -
- | Draws a test picture.
| For debugging purposes only.
| Returns 0 on success.
- ..
- ``OSD_Text``
- x0,y0,size,color,text
- Draws a text at position x0,y0 with the color <color>.
- ..
- ``OSD_SetWindow``
- x0
- Set window with number 0<x0<8 as current.
- ..
- ``OSD_MoveWindow``
- x0,y0
- Move current window to (x0, y0).
- ..
- ``OSD_OpenRaw``
- | x0,y0,x1,y1,
| `osd_raw_window_t`_ {color}
- Open other types of OSD windows.
Description
~~~~~~~~~~~
The ``OSD_Command`` data type is used with the `OSD_SEND_CMD`_ ioctl to
tell the driver which OSD_Command to execute.
-----
osd_cmd_t
---------
Synopsis
~~~~~~~~
.. code-block:: c
typedef struct osd_cmd_s {
OSD_Command cmd;
int x0;
int y0;
int x1;
int y1;
int color;
void __user *data;
} osd_cmd_t;
Variables
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_Command cmd``
- `OSD_Command`_ to be executed.
- ..
- ``int x0``
- First horizontal position.
- ..
- ``int y0``
- First vertical position.
- ..
- ``int x1``
- Second horizontal position.
- ..
- ``int y1``
- Second vertical position.
- ..
- ``int color``
- Number of the color in the palette.
- ..
- ``void __user *data``
- Command specific Data.
Description
~~~~~~~~~~~
The ``osd_cmd_t`` data type is used with the `OSD_SEND_CMD`_ ioctl.
It contains the data for the OSD_Command and the `OSD_Command`_ itself.
The structure has to be passed to the driver and the components may be
modified by it.
-----
osd_raw_window_t
----------------
Synopsis
~~~~~~~~
.. code-block:: c
typedef enum {
OSD_BITMAP1,
OSD_BITMAP2,
OSD_BITMAP4,
OSD_BITMAP8,
OSD_BITMAP1HR,
OSD_BITMAP2HR,
OSD_BITMAP4HR,
OSD_BITMAP8HR,
OSD_YCRCB422,
OSD_YCRCB444,
OSD_YCRCB444HR,
OSD_VIDEOTSIZE,
OSD_VIDEOHSIZE,
OSD_VIDEOQSIZE,
OSD_VIDEODSIZE,
OSD_VIDEOTHSIZE,
OSD_VIDEOTQSIZE,
OSD_VIDEOTDSIZE,
OSD_VIDEONSIZE,
OSD_CURSOR
} osd_raw_window_t;
Constants
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_BITMAP1``
- :cspan:`1` 1 bit bitmap
- ..
- ``OSD_BITMAP2``
- 2 bit bitmap
- ..
- ``OSD_BITMAP4``
- 4 bit bitmap
- ..
- ``OSD_BITMAP8``
- 8 bit bitmap
- ..
- ``OSD_BITMAP1HR``
- 1 Bit bitmap half resolution
- ..
- ``OSD_BITMAP2HR``
- 2 Bit bitmap half resolution
- ..
- ``OSD_BITMAP4HR``
- 4 Bit bitmap half resolution
- ..
- ``OSD_BITMAP8HR``
- 8 Bit bitmap half resolution
- ..
- ``OSD_YCRCB422``
- 4:2:2 YCRCB Graphic Display
- ..
- ``OSD_YCRCB444``
- 4:4:4 YCRCB Graphic Display
- ..
- ``OSD_YCRCB444HR``
- 4:4:4 YCRCB graphic half resolution
- ..
- ``OSD_VIDEOTSIZE``
- True Size Normal MPEG Video Display
- ..
- ``OSD_VIDEOHSIZE``
- MPEG Video Display Half Resolution
- ..
- ``OSD_VIDEOQSIZE``
- MPEG Video Display Quarter Resolution
- ..
- ``OSD_VIDEODSIZE``
- MPEG Video Display Double Resolution
- ..
- ``OSD_VIDEOTHSIZE``
- True Size MPEG Video Display Half Resolution
- ..
- ``OSD_VIDEOTQSIZE``
- True Size MPEG Video Display Quarter Resolution
- ..
- ``OSD_VIDEOTDSIZE``
- True Size MPEG Video Display Double Resolution
- ..
- ``OSD_VIDEONSIZE``
- Full Size MPEG Video Display
- ..
- ``OSD_CURSOR``
- Cursor
Description
~~~~~~~~~~~
The ``osd_raw_window_t`` data type is used with the `OSD_Command`_
OSD_OpenRaw to tell the driver which type of OSD to open.
-----
osd_cap_t
---------
Synopsis
~~~~~~~~
.. code-block:: c
typedef struct osd_cap_s {
int cmd;
#define OSD_CAP_MEMSIZE 1
long val;
} osd_cap_t;
Variables
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int cmd``
- Capability to query.
- ..
- ``long val``
- Used to store the Data.
Supported capabilities
~~~~~~~~~~~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_CAP_MEMSIZE``
- Memory size installed on the card.
Description
~~~~~~~~~~~
This structure of data used with the `OSD_GET_CAPABILITY`_ call.
-----
OSD Function Calls
==================
OSD_SEND_CMD
------------
Synopsis
~~~~~~~~
.. c:macro:: OSD_SEND_CMD
.. code-block:: c
int ioctl(int fd, int request = OSD_SEND_CMD, enum osd_cmd_t *cmd)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_.
- ..
- ``int request``
- Pointer to the location of the structure `osd_cmd_t`_ for this
command.
Description
~~~~~~~~~~~
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
This ioctl sends the `OSD_Command`_ to the card.
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.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EINVAL``
- Command is out of range.
-----
OSD_GET_CAPABILITY
------------------
Synopsis
~~~~~~~~
.. c:macro:: OSD_GET_CAPABILITY
.. code-block:: c
int ioctl(int fd, int request = OSD_GET_CAPABILITY,
struct osd_cap_t *cap)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_.
- ..
- ``int request``
- Equals ``OSD_GET_CAPABILITY`` for this command.
- ..
- ``unsigned int *cap``
- Pointer to the location of the structure `osd_cap_t`_ for this
command.
Description
~~~~~~~~~~~
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
This ioctl is used to get the capabilities of the OSD of the AV7110 based
DVB-decoder-card in use.
.. note::
The structure osd_cap_t has to be setup by the user and passed to the
driver.
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.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EINVAL``
- Unsupported capability.
-----
open()
------
Synopsis
~~~~~~~~
.. code-block:: c
#include <fcntl.h>
.. c:function:: int open(const char *deviceName, int flags)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``const char *deviceName``
- Name of specific OSD device.
- ..
- :rspan:`3` ``int flags``
- :cspan:`1` A bit-wise OR of the following flags:
- ..
- ``O_RDONLY``
- read-only access
- ..
- ``O_RDWR``
- read/write access
- ..
- ``O_NONBLOCK``
- | Open in non-blocking mode
| (blocking mode is the default)
Description
~~~~~~~~~~~
This system call opens a named OSD device (e.g.
``/dev/dvb/adapter?/osd0``) for subsequent use.
Return Value
~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``ENODEV``
- Device driver not loaded/available.
- ..
- ``EINTERNAL``
- Internal error.
- ..
- ``EBUSY``
- Device or resource busy.
- ..
- ``EINVAL``
- Invalid argument.
-----
close()
-------
Synopsis
~~~~~~~~
.. c:function:: int close(int fd)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_ .
Description
~~~~~~~~~~~
This system call closes a previously opened OSD device.
Return Value
~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EBADF``
- fd is not a valid open file descriptor.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
AV7110 OSD 장치
1-29DVB OSD 장치는 hardware MPEG-2 decoder가 있는 AV7110 기반 DVB card의 OnScreen Display를 제어합니다. `/dev/dvb/adapter?/osd0`로 접근하고 응용 프로그램에서 `linux/dvb/osd.h`를 포함해 type과 ioctl 정의를 사용합니다.
이 OSD는 일반적인 framebuffer가 아니라 그 위에 그리는 canvas에 가깝습니다. 설치된 memory 크기에 따라 color depth가 제한되므로 적절한 color palette를 먼저 설정해야 합니다.
설치된 memory 크기는 `OSD_GET_CAPABILITY` ioctl의 `OSD_CAP_MEMSIZE` capability로 확인합니다.
주의: 이 legacy OSD API는 새 드라이버에서 사용하면 안 됩니다. 현대 media pipeline은 V4L2·ALSA·Media Controller API를 사용해야 합니다.
Canvas를 열고 표시하기 위한 기본 흐름입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later OR GPL-2.0
.. c:namespace:: dtv.legacy.osd
.. _dvb_osd:
==============
DVB OSD Device
==============
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
The DVB OSD device controls the OnScreen-Display of the AV7110 based
DVB-cards with hardware MPEG2 decoder. It can be accessed through
``/dev/dvb/adapter?/osd0``.
Data types and ioctl definitions can be accessed by including
``linux/dvb/osd.h`` in your application.
The OSD is not a frame-buffer like on many other cards.
It is a kind of canvas one can draw on.
The color-depth is limited depending on the memory size installed.
An appropriate palette of colors has to be set up.
The installed memory size can be identified with the `OSD_GET_CAPABILITY`_
ioctl.
OSD Data Types
==============
OSD_Command 명령 집합
30-309`OSD_Command`는 `OSD_SEND_CMD` ioctl이 driver에 실행할 OSD 작업을 지정하는 enum입니다. OSD가 열리지 않은 상태에서는 모든 함수가 -2를 반환합니다.
Window의 수명과 표시 상태를 제어합니다.
Color, transparency 및 개별 pixel을 제어합니다.
연속 pixel과 도형·문자를 그립니다.
화면 정보 조회와 debug 명령입니다.
OSD_Command
-----------
Synopsis
~~~~~~~~
.. code-block:: c
typedef enum {
/* All functions return -2 on "not open" */
OSD_Close = 1,
OSD_Open,
OSD_Show,
OSD_Hide,
OSD_Clear,
OSD_Fill,
OSD_SetColor,
OSD_SetPalette,
OSD_SetTrans,
OSD_SetPixel,
OSD_GetPixel,
OSD_SetRow,
OSD_SetBlock,
OSD_FillRow,
OSD_FillBlock,
OSD_Line,
OSD_Query,
OSD_Test,
OSD_Text,
OSD_SetWindow,
OSD_MoveWindow,
OSD_OpenRaw,
} OSD_Command;
Commands
~~~~~~~~
.. note:: All functions return -2 on "not open"
.. flat-table::
:header-rows: 1
:stub-columns: 0
- ..
- Command
- | Used variables of ``struct`` `osd_cmd_t`_.
| Usage{variable} if alternative use.
- :cspan:`2` Description
- ..
- ``OSD_Close``
- -
- | Disables OSD and releases the buffers.
| Returns 0 on success.
- ..
- ``OSD_Open``
- | x0,y0,x1,y1,
| BitPerPixel[2/4/8]{color&0x0F},
| mix[0..15]{color&0xF0}
- | Opens OSD with this size and bit depth
| Returns 0 on success,
| -1 on DRAM allocation error,
| -2 on "already open".
- ..
- ``OSD_Show``
- -
- | Enables OSD mode.
| Returns 0 on success.
- ..
- ``OSD_Hide``
- -
- | Disables OSD mode.
| Returns 0 on success.
- ..
- ``OSD_Clear``
- -
- | Sets all pixel to color 0.
| Returns 0 on success.
- ..
- ``OSD_Fill``
- color
- | Sets all pixel to color <color>.
| Returns 0 on success.
- ..
- ``OSD_SetColor``
- | color,
| R{x0},G{y0},B{x1},
| opacity{y1}
- | Set palette entry <num> to <r,g,b>, <mix> and <trans> apply
| R,G,B: 0..255
| R=Red, G=Green, B=Blue
| opacity=0: pixel opacity 0% (only video pixel shows)
| opacity=1..254: pixel opacity as specified in header
| opacity=255: pixel opacity 100% (only OSD pixel shows)
| Returns 0 on success, -1 on error.
- ..
- ``OSD_SetPalette``
- | firstcolor{color},
| lastcolor{x0},data
- | Set a number of entries in the palette.
| Sets the entries "firstcolor" through "lastcolor" from the
array "data".
| Data has 4 byte for each color:
| R,G,B, and a opacity value: 0->transparent, 1..254->mix,
255->pixel
- ..
- ``OSD_SetTrans``
- transparency{color}
- | Sets transparency of mixed pixel (0..15).
| Returns 0 on success.
- ..
- ``OSD_SetPixel``
- x0,y0,color
- | Sets pixel <x>,<y> to color number <color>.
| Returns 0 on success, -1 on error.
- ..
- ``OSD_GetPixel``
- x0,y0
- | Returns color number of pixel <x>,<y>, or -1.
| Command currently not supported by the AV7110!
- ..
- ``OSD_SetRow``
- x0,y0,x1,data
- | Fills pixels x0,y through x1,y with the content of data[].
| Returns 0 on success, -1 on clipping all pixel (no pixel
drawn).
- ..
- ``OSD_SetBlock``
- | x0,y0,x1,y1,
| increment{color},
| data
- | Fills pixels x0,y0 through x1,y1 with the content of data[].
| Inc contains the width of one line in the data block,
| inc<=0 uses block width as line width.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_FillRow``
- x0,y0,x1,color
- | Fills pixels x0,y through x1,y with the color <color>.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_FillBlock``
- x0,y0,x1,y1,color
- | Fills pixels x0,y0 through x1,y1 with the color <color>.
| Returns 0 on success, -1 on clipping all pixel.
- ..
- ``OSD_Line``
- x0,y0,x1,y1,color
- | Draw a line from x0,y0 to x1,y1 with the color <color>.
| Returns 0 on success.
- ..
- ``OSD_Query``
- | x0,y0,x1,y1,
| xasp{color}; yasp=11
- | Fills parameters with the picture dimensions and the pixel
aspect ratio.
| Returns 0 on success.
| Command currently not supported by the AV7110!
- ..
- ``OSD_Test``
- -
- | Draws a test picture.
| For debugging purposes only.
| Returns 0 on success.
- ..
- ``OSD_Text``
- x0,y0,size,color,text
- Draws a text at position x0,y0 with the color <color>.
- ..
- ``OSD_SetWindow``
- x0
- Set window with number 0<x0<8 as current.
- ..
- ``OSD_MoveWindow``
- x0,y0
- Move current window to (x0, y0).
- ..
- ``OSD_OpenRaw``
- | x0,y0,x1,y1,
| `osd_raw_window_t`_ {color}
- Open other types of OSD windows.
Description
~~~~~~~~~~~
The ``OSD_Command`` data type is used with the `OSD_SEND_CMD`_ ioctl to
tell the driver which OSD_Command to execute.
osd_cmd_t command payload
310-388`osd_cmd_t`는 실행할 `OSD_Command`와 command별 좌표·color·data를 함께 담아 `OSD_SEND_CMD`에 전달합니다. Driver가 구조체 멤버를 수정할 수 있습니다.
같은 field가 command에 따라 다른 의미로 재사용됩니다.
-----
osd_cmd_t
---------
Synopsis
~~~~~~~~
.. code-block:: c
typedef struct osd_cmd_s {
OSD_Command cmd;
int x0;
int y0;
int x1;
int y1;
int color;
void __user *data;
} osd_cmd_t;
Variables
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_Command cmd``
- `OSD_Command`_ to be executed.
- ..
- ``int x0``
- First horizontal position.
- ..
- ``int y0``
- First vertical position.
- ..
- ``int x1``
- Second horizontal position.
- ..
- ``int y1``
- Second vertical position.
- ..
- ``int color``
- Number of the color in the palette.
- ..
- ``void __user *data``
- Command specific Data.
Description
~~~~~~~~~~~
The ``osd_cmd_t`` data type is used with the `OSD_SEND_CMD`_ ioctl.
It contains the data for the OSD_Command and the `OSD_Command`_ itself.
The structure has to be passed to the driver and the components may be
modified by it.
-----
osd_raw_window_t window 형식
389-556`osd_raw_window_t`는 `OSD_OpenRaw` command가 열 OSD window의 bitmap, YCrCb, MPEG video 또는 cursor 형식을 지정합니다.
Bit depth와 half-resolution graphic 형식입니다.
Video display의 크기·배율 변형과 cursor입니다.
osd_raw_window_t
----------------
Synopsis
~~~~~~~~
.. code-block:: c
typedef enum {
OSD_BITMAP1,
OSD_BITMAP2,
OSD_BITMAP4,
OSD_BITMAP8,
OSD_BITMAP1HR,
OSD_BITMAP2HR,
OSD_BITMAP4HR,
OSD_BITMAP8HR,
OSD_YCRCB422,
OSD_YCRCB444,
OSD_YCRCB444HR,
OSD_VIDEOTSIZE,
OSD_VIDEOHSIZE,
OSD_VIDEOQSIZE,
OSD_VIDEODSIZE,
OSD_VIDEOTHSIZE,
OSD_VIDEOTQSIZE,
OSD_VIDEOTDSIZE,
OSD_VIDEONSIZE,
OSD_CURSOR
} osd_raw_window_t;
Constants
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_BITMAP1``
- :cspan:`1` 1 bit bitmap
- ..
- ``OSD_BITMAP2``
- 2 bit bitmap
- ..
- ``OSD_BITMAP4``
- 4 bit bitmap
- ..
- ``OSD_BITMAP8``
- 8 bit bitmap
- ..
- ``OSD_BITMAP1HR``
- 1 Bit bitmap half resolution
- ..
- ``OSD_BITMAP2HR``
- 2 Bit bitmap half resolution
- ..
- ``OSD_BITMAP4HR``
- 4 Bit bitmap half resolution
- ..
- ``OSD_BITMAP8HR``
- 8 Bit bitmap half resolution
- ..
- ``OSD_YCRCB422``
- 4:2:2 YCRCB Graphic Display
- ..
- ``OSD_YCRCB444``
- 4:4:4 YCRCB Graphic Display
- ..
- ``OSD_YCRCB444HR``
- 4:4:4 YCRCB graphic half resolution
- ..
- ``OSD_VIDEOTSIZE``
- True Size Normal MPEG Video Display
- ..
- ``OSD_VIDEOHSIZE``
- MPEG Video Display Half Resolution
- ..
- ``OSD_VIDEOQSIZE``
- MPEG Video Display Quarter Resolution
- ..
- ``OSD_VIDEODSIZE``
- MPEG Video Display Double Resolution
- ..
- ``OSD_VIDEOTHSIZE``
- True Size MPEG Video Display Half Resolution
- ..
- ``OSD_VIDEOTQSIZE``
- True Size MPEG Video Display Quarter Resolution
- ..
- ``OSD_VIDEOTDSIZE``
- True Size MPEG Video Display Double Resolution
- ..
- ``OSD_VIDEONSIZE``
- Full Size MPEG Video Display
- ..
- ``OSD_CURSOR``
- Cursor
Description
~~~~~~~~~~~
The ``osd_raw_window_t`` data type is used with the `OSD_Command`_
OSD_OpenRaw to tell the driver which type of OSD to open.
-----
osd_cap_t capability
557-611`osd_cap_t`는 `OSD_GET_CAPABILITY`에 전달하는 query 구조체입니다. 사용자가 `cmd`를 설정하고 driver가 결과를 `val`에 기록합니다.
현재 문서가 정의하는 capability는 설치 memory 크기입니다.
osd_cap_t
---------
Synopsis
~~~~~~~~
.. code-block:: c
typedef struct osd_cap_s {
int cmd;
#define OSD_CAP_MEMSIZE 1
long val;
} osd_cap_t;
Variables
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int cmd``
- Capability to query.
- ..
- ``long val``
- Used to store the Data.
Supported capabilities
~~~~~~~~~~~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``OSD_CAP_MEMSIZE``
- Memory size installed on the card.
Description
~~~~~~~~~~~
This structure of data used with the `OSD_GET_CAPABILITY`_ call.
-----
OSD_SEND_CMD
612-677`OSD_SEND_CMD`는 `osd_cmd_t`에 담긴 `OSD_Command`를 AV7110 card로 보냅니다.
Driver에 command 구조체를 전달합니다.
원문 synopsis는 `enum osd_cmd_t *cmd`라고 적지만 `osd_cmd_t`는 앞에서 struct typedef로 선언됩니다. 또한 원문 인자 표의 `int request` 설명에는 command 구조체 pointer 설명이 들어가고 별도 `cmd` 행이 없습니다. 원문은 수정하지 않고 차이를 표시했습니다.
주의: 이 legacy OSD API는 새 드라이버에서 사용하면 안 됩니다. 현대 media pipeline은 V4L2·ALSA·Media Controller API를 사용해야 합니다.
성공하면 0을 반환합니다. 오류이면 -1을 반환하고 `errno`를 설정하며, 공통 오류 의미는 Generic Error Codes 절을 따릅니다.
OSD Function Calls
==================
OSD_SEND_CMD
------------
Synopsis
~~~~~~~~
.. c:macro:: OSD_SEND_CMD
.. code-block:: c
int ioctl(int fd, int request = OSD_SEND_CMD, enum osd_cmd_t *cmd)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_.
- ..
- ``int request``
- Pointer to the location of the structure `osd_cmd_t`_ for this
command.
Description
~~~~~~~~~~~
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
This ioctl sends the `OSD_Command`_ to the card.
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.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EINVAL``
- Command is out of range.
-----
OSD_GET_CAPABILITY
678-752`OSD_GET_CAPABILITY`는 사용 중인 AV7110 기반 DVB decoder card의 OSD capability를 조회합니다. 사용자가 `osd_cap_t`를 준비해 driver에 전달해야 합니다.
현재는 `OSD_CAP_MEMSIZE`로 설치 memory 크기를 조회합니다.
원문 synopsis는 `struct osd_cap_t *cap`을 사용하지만 인자 표는 `unsigned int *cap`이라고 적습니다. 번역 설명은 구조체 기반 호출을 따르며 원문 표기는 그대로 보존했습니다.
주의: 이 legacy OSD API는 새 드라이버에서 사용하면 안 됩니다. 현대 media pipeline은 V4L2·ALSA·Media Controller API를 사용해야 합니다.
성공하면 0을 반환합니다. 오류이면 -1을 반환하고 `errno`를 설정하며, 공통 오류 의미는 Generic Error Codes 절을 따릅니다.
OSD_GET_CAPABILITY
------------------
Synopsis
~~~~~~~~
.. c:macro:: OSD_GET_CAPABILITY
.. code-block:: c
int ioctl(int fd, int request = OSD_GET_CAPABILITY,
struct osd_cap_t *cap)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_.
- ..
- ``int request``
- Equals ``OSD_GET_CAPABILITY`` for this command.
- ..
- ``unsigned int *cap``
- Pointer to the location of the structure `osd_cap_t`_ for this
command.
Description
~~~~~~~~~~~
.. attention:: Do **not** use in new drivers!
See: :ref:`legacy_dvb_decoder_notes`
This ioctl is used to get the capabilities of the OSD of the AV7110 based
DVB-decoder-card in use.
.. note::
The structure osd_cap_t has to be setup by the user and passed to the
driver.
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.
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EINVAL``
- Unsupported capability.
-----
open() OSD 장치 열기
753-842`open()`은 `/dev/dvb/adapter?/osd0` 같은 OSD device를 열어 이후 ioctl에 사용할 file descriptor를 얻습니다.
`flags`는 다음 access·blocking flag를 bitwise OR로 조합합니다.
대표 오류 code입니다.
open()
------
Synopsis
~~~~~~~~
.. code-block:: c
#include <fcntl.h>
.. c:function:: int open(const char *deviceName, int flags)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``const char *deviceName``
- Name of specific OSD device.
- ..
- :rspan:`3` ``int flags``
- :cspan:`1` A bit-wise OR of the following flags:
- ..
- ``O_RDONLY``
- read-only access
- ..
- ``O_RDWR``
- read/write access
- ..
- ``O_NONBLOCK``
- | Open in non-blocking mode
| (blocking mode is the default)
Description
~~~~~~~~~~~
This system call opens a named OSD device (e.g.
``/dev/dvb/adapter?/osd0``) for subsequent use.
Return Value
~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``ENODEV``
- Device driver not loaded/available.
- ..
- ``EINTERNAL``
- Internal error.
- ..
- ``EBUSY``
- Device or resource busy.
- ..
- ``EINVAL``
- Invalid argument.
-----
close() OSD 장치 닫기
843-883`close(fd)`는 이전에 연 OSD device를 닫습니다.
열린 file descriptor만 닫을 수 있습니다.
close()
-------
Synopsis
~~~~~~~~
.. c:function:: int close(int fd)
Arguments
~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``int fd``
- :cspan:`1` File descriptor returned by a previous call
to `open()`_ .
Description
~~~~~~~~~~~
This system call closes a previously opened OSD device.
Return Value
~~~~~~~~~~~~
.. flat-table::
:header-rows: 0
:stub-columns: 0
- ..
- ``EBADF``
- fd is not a valid open file descriptor.
요약·해설
legacy_dvb_osd.rst:1-883Frame-buffer가 아닌 palette 기반 canvas를 command 구조체로 제어합니다. Prototype과 인자 표의 type 불일치는 자동 수정하지 않고 번역 해설에 검수 지점으로 표시했습니다.