.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later OR GPL-2.0 .. include:: ../../../../disclaimer-vi.rst :Original: Documentation/userspace-api/media/dvb/legacy_dvb_osd.rst :Translator: Google Translate (machine translation) :Upstream-at: 8541d8f725c6 .. warning:: Tài liệu này được dịch tự động bằng máy và chưa được review bởi người dịch. Nội dung có thể không chính xác hoặc khó hiểu ở một số chỗ. Khi có sự khác biệt với bản gốc, bản gốc luôn là chuẩn. Bản dịch chất lượng cao (được review) được đặt trong thư mục vi_VN/. .. c:namespace:: dtv.legacy.osd .. _dvb_osd: ================ Thiết bị DVB OSD ================ .. attention:: Do **not** use in new drivers! See: :ref:`legacy_dvb_decoder_notes` Thiết bị DVB OSD điều khiển OnScreen-Display của AV7110 dựa trên Thẻ DVB với bộ giải mã MPEG2 phần cứng. Nó có thể được truy cập thông qua ZZ0000ZZ. Các kiểu dữ liệu và định nghĩa ioctl có thể được truy cập bằng cách bao gồm ZZ0001ZZ trong ứng dụng của bạn. OSD không phải là bộ đệm khung như trên nhiều thẻ khác. Nó là một loại canvas mà người ta có thể vẽ lên. Độ sâu màu bị giới hạn tùy thuộc vào kích thước bộ nhớ được cài đặt. Một bảng màu thích hợp phải được thiết lập. Kích thước bộ nhớ đã cài đặt có thể được xác định bằng ZZ0000ZZ ioctl. Các kiểu dữ liệu OSD ==================== OSD_Lệnh ----------- Tóm tắt ~~~~~~~~ .. 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; Lệnh ~~~~~~~~ .. 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 . | Returns 0 on success. - .. - ``OSD_SetColor`` - | color, | R{x0},G{y0},B{x1}, | opacity{y1} - | Set palette entry to , and 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 , to color number . | Returns 0 on success, -1 on error. - .. - ``OSD_GetPixel`` - x0,y0 - | Returns color number of pixel ,, 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 . | 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 . | 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 . | 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 . - .. - ``OSD_SetWindow`` - x0 - Set window with number 0 .. c:function:: int open(const char *deviceName, int flags) Đối số ~~~~~~~~~ .. 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) Sự miêu tả ~~~~~~~~~~~ Cuộc gọi hệ thống này sẽ mở một thiết bị OSD có tên (ví dụ: ZZ0000ZZ) để sử dụng tiếp theo. Giá trị trả về ~~~~~~~~~~~~~~ .. 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. ----- đóng() ------- Tóm tắt ~~~~~~~~ .. c:function:: int close(int fd) Đối số ~~~~~~~~~ .. flat-table:: :header-rows: 0 :stub-columns: 0 - .. - ``int fd`` - :cspan:`1` File descriptor returned by a previous call to `open()`_ . Sự miêu tả ~~~~~~~~~~~ Cuộc gọi hệ thống này sẽ đóng thiết bị OSD đã mở trước đó. Giá trị trả về ~~~~~~~~~~~~~~ .. flat-table:: :header-rows: 0 :stub-columns: 0 - .. - ``EBADF`` - fd is not a valid open file descriptor.