Lưu ý
Mục đích của file này là để độc giả tiếng Việt có thể đọc và hiểu tài liệu nhân kernel dễ dàng hơn, không phải để tạo ra một nhánh tài liệu riêng. Nếu bạn có bất kỳ nhận xét hoặc cập nhật nào cho file này, vui lòng thử cập nhật file tiếng Anh gốc trước. Nếu bạn thấy có sự khác biệt giữa bản dịch và bản gốc, hoặc có vấn đề về bản dịch, vui lòng gửi góp ý hoặc patch cho người dịch của file này, hoặc nhờ người bảo trì và người review tài liệu tiếng Việt giúp đỡ.
- Bản gốc:
- Người dịch:
Google Translate (machine translation)
- Phiên bản gốc:
8541d8f725c6
Cảnh báo
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/.
6.2.3.3. Thiết bị DVB OSD¶
Chú ý
Do not use in new drivers! See: General 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.
6.2.3.3.1. Các kiểu dữ liệu OSD¶
6.2.3.3.1.1. OSD_Lệnh¶
6.2.3.3.1.1.1. Tóm tắt¶
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;
6.2.3.3.1.1.2. Lệnh¶
Lưu ý
All functions return -2 on “not open”
Command |
Used variables of
struct osd_cmd_t.Usage{variable} if alternative use.
|
Description |
||
|---|---|---|---|---|
|
Disables OSD and releases the buffers.
Returns 0 on success.
|
|||
|
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”.
|
||
|
Enables OSD mode.
Returns 0 on success.
|
|||
|
Disables OSD mode.
Returns 0 on success.
|
|||
|
Sets all pixel to color 0.
Returns 0 on success.
|
|||
|
color |
Sets all pixel to color <color>.
Returns 0 on success.
|
||
|
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.
|
||
|
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
|
||
|
transparency{color} |
Sets transparency of mixed pixel (0..15).
Returns 0 on success.
|
||
|
x0,y0,color |
Sets pixel <x>,<y> to color number <color>.
Returns 0 on success, -1 on error.
|
||
|
x0,y0 |
Returns color number of pixel <x>,<y>, or -1.
Command currently not supported by the AV7110!
|
||
|
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).
|
||
|
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.
|
||
|
x0,y0,x1,color |
Fills pixels x0,y through x1,y with the color <color>.
Returns 0 on success, -1 on clipping all pixel.
|
||
|
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.
|
||
|
x0,y0,x1,y1,color |
Draw a line from x0,y0 to x1,y1 with the color <color>.
Returns 0 on success.
|
||
|
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!
|
||
|
Draws a test picture.
For debugging purposes only.
Returns 0 on success.
|
|||
|
x0,y0,size,color,text |
Draws a text at position x0,y0 with the color <color>. |
||
|
x0 |
Set window with number 0<x0<8 as current. |
||
|
x0,y0 |
Move current window to (x0, y0). |
||
|
x0,y0,x1,y1,
osd_raw_window_t {color}
|
Open other types of OSD windows. |
||
6.2.3.3.1.1.3. Sự miêu tả¶
Kiểu dữ liệu ZZ0000ZZ được sử dụng với ZZ0001ZZ ioctl để báo cho trình điều khiển OSD_Command nào sẽ thực thi.
6.2.3.3.1.2. osd_cmd_t¶
6.2.3.3.1.2.1. Tóm tắt¶
typedef struct osd_cmd_s {
OSD_Command cmd;
int x0;
int y0;
int x1;
int y1;
int color;
void __user *data;
} osd_cmd_t;
6.2.3.3.1.2.2. Biến¶
|
`OSD_Command`_ to be executed. |
|
First horizontal position. |
|
First vertical position. |
|
Second horizontal position. |
|
Second vertical position. |
|
Number of the color in the palette. |
|
Command specific Data. |
6.2.3.3.1.2.3. Sự miêu tả¶
Kiểu dữ liệu ZZ0000ZZ được sử dụng với ZZ0001ZZ ioctl. Nó chứa dữ liệu cho OSD_Command và chính ZZ0002ZZ. Cấu trúc phải được chuyển tới trình điều khiển và các thành phần có thể được bị nó sửa đổi.
6.2.3.3.1.3. osd_raw_window_t¶
6.2.3.3.1.3.1. Tóm tắt¶
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;
6.2.3.3.1.3.2. Hằng số¶
|
1 bit bitmap |
|
|
2 bit bitmap |
|
|
4 bit bitmap |
|
|
8 bit bitmap |
|
|
1 Bit bitmap half resolution |
|
|
2 Bit bitmap half resolution |
|
|
4 Bit bitmap half resolution |
|
|
8 Bit bitmap half resolution |
|
|
4:2:2 YCRCB Graphic Display |
|
|
4:4:4 YCRCB Graphic Display |
|
|
4:4:4 YCRCB graphic half resolution |
|
|
True Size Normal MPEG Video Display |
|
|
MPEG Video Display Half Resolution |
|
|
MPEG Video Display Quarter Resolution |
|
|
MPEG Video Display Double Resolution |
|
|
True Size MPEG Video Display Half Resolution |
|
|
True Size MPEG Video Display Quarter Resolution |
|
|
True Size MPEG Video Display Double Resolution |
|
|
Full Size MPEG Video Display |
|
|
Cursor |
|
6.2.3.3.1.3.3. Sự miêu tả¶
Kiểu dữ liệu ZZ0000ZZ được sử dụng với ZZ0001ZZ OSD_OpenRaw để báo cho trình điều khiển loại OSD nào sẽ mở.
6.2.3.3.1.4. osd_cap_t¶
6.2.3.3.1.4.1. Tóm tắt¶
typedef struct osd_cap_s {
int cmd;
#define OSD_CAP_MEMSIZE 1
long val;
} osd_cap_t;
6.2.3.3.1.4.2. Biến¶
|
Capability to query. |
|
Used to store the Data. |
6.2.3.3.1.4.3. Các khả năng được hỗ trợ¶
|
Memory size installed on the card. |
6.2.3.3.1.4.4. Sự miêu tả¶
Cấu trúc dữ liệu này được sử dụng với lệnh gọi ZZ0000ZZ.
6.2.3.3.2. Cuộc gọi chức năng OSD¶
6.2.3.3.2.1. OSD_SEND_CMD¶
6.2.3.3.2.1.1. Tóm tắt¶
-
OSD_SEND_CMD¶
int ioctl(int fd, int request = OSD_SEND_CMD, enum osd_cmd_t *cmd)
6.2.3.3.2.1.2. Đối số¶
|
||
|
Pointer to the location of the structure osd_cmd_t for this command. |
|
6.2.3.3.2.1.3. Sự miêu tả¶
Chú ý
Do not use in new drivers! See: General Notes
Ioctl này sẽ gửi ZZ0000ZZ tới thẻ.
6.2.3.3.2.1.4. Giá trị trả về¶
Khi thành công, trả về 0, lỗi -1 và biến ZZ0001ZZ được đặt một cách thích hợp. Các mã lỗi chung được mô tả tại Chương ZZ0000ZZ.
|
Command is out of range. |
6.2.3.3.2.2. OSD_GET_CAPABILITY¶
6.2.3.3.2.2.1. Tóm tắt¶
-
OSD_GET_CAPABILITY¶
int ioctl(int fd, int request = OSD_GET_CAPABILITY,
struct osd_cap_t *cap)
6.2.3.3.2.2.2. Đối số¶
|
||
|
Equals |
|
|
Pointer to the location of the structure osd_cap_t for this command. |
|
6.2.3.3.2.2.3. Sự miêu tả¶
Chú ý
Do not use in new drivers! See: General Notes
Ioctl này được sử dụng để có được các khả năng của OSD dựa trên AV7110 Thẻ giải mã DVB đang được sử dụng.
Lưu ý
The structure osd_cap_t has to be setup by the user and passed to the driver.
6.2.3.3.2.2.4. Giá trị trả về¶
Khi thành công, trả về 0, lỗi -1 và biến ZZ0001ZZ được đặt một cách thích hợp. Các mã lỗi chung được mô tả tại Chương ZZ0000ZZ.
|
Unsupported capability. |
6.2.3.3.2.3. mở()¶
6.2.3.3.2.3.1. Tóm tắt¶
#include <fcntl.h>
-
int open(const char *deviceName, int flags)¶
6.2.3.3.2.3.2. Đối số¶
|
Name of specific OSD device. |
|
|
A bit-wise OR of the following flags: |
|
|
read-only access |
|
|
read/write access |
|
|
Open in non-blocking mode
(blocking mode is the default)
|
|
6.2.3.3.2.3.3. 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.
6.2.3.3.2.3.4. Giá trị trả về¶
|
Device driver not loaded/available. |
|
Internal error. |
|
Device or resource busy. |
|
Invalid argument. |
6.2.3.3.2.4. đóng()¶
6.2.3.3.2.4.1. Tóm tắt¶
-
int close(int fd)¶
6.2.3.3.2.4.2. Đối số¶
|
||
6.2.3.3.2.4.3. Sự miêu tả¶
Cuộc gọi hệ thống này sẽ đóng thiết bị OSD đã mở trước đó.
6.2.3.3.2.4.4. Giá trị trả về¶
|
fd is not a valid open file descriptor. |