Mercurial > mplayer.hg
annotate libvo/video_out.h @ 4708:000ca7a19331
mem2agpcpy_pic()
author | michael |
---|---|
date | Thu, 14 Feb 2002 22:34:24 +0000 |
parents | 95fa3901cafc |
children | c8125c117807 |
rev | line source |
---|---|
1 | 1 /* |
2 * video_out.h | |
3 * | |
4 * Copyright (C) Aaron Holtzman - Aug 1999 | |
31 | 5 * Strongly modified, most parts rewritten: A'rpi/ESP-team - 2000-2001 |
1 | 6 * |
7 */ | |
8 | |
9 #include <inttypes.h> | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
10 #include <stdarg.h> |
1 | 11 |
213 | 12 #include "font_load.h" |
408 | 13 #include "img_format.h" |
4352 | 14 #include "../vidix/vidix.h" |
1 | 15 |
31 | 16 #define VO_EVENT_EXPOSE 1 |
17 #define VO_EVENT_RESIZE 2 | |
18 #define VO_EVENT_KEYPRESS 4 | |
19 | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
20 /* takes a pointer to a vo_vaa_s struct */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
21 #define VOCTRL_QUERY_VAA 1 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
22 /* takes a pointer to uint32_t fourcc */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
23 #define VOCTRL_QUERY_FORMAT 2 |
4618 | 24 /* signal a device reset (seek/pause) */ |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
25 #define VOCTRL_RESET 3 |
4618 | 26 /* true if vo driver can use GUI created windows */ |
27 #define VOCTRL_GUISUPPORT 4 | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
28 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
29 #define VO_TRUE 1 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
30 #define VO_FALSE 0 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
31 #define VO_ERROR -1 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
32 #define VO_NOTAVAIL -2 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
33 #define VO_NOTIMPL -3 |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
34 |
1 | 35 typedef struct vo_info_s |
36 { | |
37 /* driver name ("Matrox Millennium G200/G400" */ | |
38 const char *name; | |
39 /* short name (for config strings) ("mga") */ | |
40 const char *short_name; | |
41 /* author ("Aaron Holtzman <aholtzma@ess.engr.uvic.ca>") */ | |
42 const char *author; | |
43 /* any additional comments */ | |
44 const char *comment; | |
45 } vo_info_t; | |
46 | |
4352 | 47 /* Direct access to BES */ |
48 typedef struct bes_da_s | |
49 { | |
50 vidix_rect_t dest; /* This field should be filled by x,y,w,h | |
51 from vidix:src but pitches from | |
52 vidix:dest */ | |
53 int flags; /* Probably will work only when flag == 0 */ | |
54 /* memory model */ | |
4618 | 55 unsigned frame_size; /* destination frame size */ |
56 unsigned num_frames; /* number of available frames */ | |
4352 | 57 unsigned offsets[VID_PLAY_MAXFRAMES]; /* relative offset of each frame from begin of video memory */ |
58 vidix_yuv_t offset; /* relative offsets within frame for yuv planes */ | |
59 void* dga_addr; /* linear address of BES */ | |
60 }bes_da_t; | |
61 | |
62 /* | |
63 Video Accelearted Architecture. | |
64 Every field of this structure can be set to NULL that means that | |
65 features is not supported | |
66 */ | |
67 typedef struct vo_vaa_s | |
68 { | |
69 uint32_t flags; /* currently undefined */ | |
70 /* | |
71 * Query Direct Access to BES | |
72 * info - information to be filled | |
73 * returns: 0 on success errno on error. | |
74 */ | |
75 int (*query_bes_da)(bes_da_t *info); | |
76 int (*get_video_eq)(vidix_video_eq_t *info); | |
77 int (*set_video_eq)(const vidix_video_eq_t *info); | |
78 int (*get_num_fx)(unsigned *info); | |
79 int (*get_oem_fx)(vidix_oem_fx_t *info); | |
80 int (*set_oem_fx)(const vidix_oem_fx_t *info); | |
81 int (*set_deint)(const vidix_deinterlace_t *info); | |
82 }vo_vaa_t; | |
83 | |
4433 | 84 /* Misc info to tuneup vo driver */ |
85 typedef struct vo_tune_info_s | |
86 { | |
87 int pitch[3]; /* Should be 0 if unknown else power of 2 */ | |
88 }vo_tune_info_t; | |
89 | |
1 | 90 typedef struct vo_functions_s |
91 { | |
4352 | 92 /* |
93 * Preinitializes driver (real INITIALIZATION) | |
94 * arg - currently it's vo_subdevice | |
95 * returns: zero on successful initialization, non-zero on error. | |
96 */ | |
97 uint32_t (*preinit)(const char *arg); | |
1 | 98 /* |
4352 | 99 * Initialize (means CONFIGURE) the display driver. |
31 | 100 * params: |
101 * width,height: image source size | |
102 * d_width,d_height: size of the requested window size, just a hint | |
103 * fullscreen: flag, 0=windowd 1=fullscreen, just a hint | |
104 * title: window title, if available | |
105 * format: fourcc of pixel format | |
106 * returns : zero on successful initialization, non-zero on error. | |
1 | 107 */ |
4433 | 108 uint32_t (*config)(uint32_t width, uint32_t height, uint32_t d_width, |
109 uint32_t d_height, uint32_t fullscreen, char *title, | |
110 uint32_t format,const vo_tune_info_t *); | |
1 | 111 |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
112 /* |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
113 * Control interface |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
114 */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
115 uint32_t (*control)(uint32_t request, void *data, ...); |
1 | 116 |
117 /* | |
118 * Return driver information. | |
119 * returns : read-only pointer to a vo_info_t structure. | |
120 */ | |
121 const vo_info_t* (*get_info)(void); | |
122 | |
123 /* | |
31 | 124 * Display a new RGB/BGR frame of the video to the screen. |
125 * params: | |
126 * src[0] - pointer to the image | |
1 | 127 */ |
128 uint32_t (*draw_frame)(uint8_t *src[]); | |
129 | |
130 /* | |
31 | 131 * Draw a planar YUV slice to the buffer: |
132 * params: | |
133 * src[3] = source image planes (Y,U,V) | |
134 * stride[3] = source image planes line widths (in bytes) | |
135 * w,h = width*height of area to be copied (in Y pixels) | |
136 * x,y = position at the destination image (in Y pixels) | |
1 | 137 */ |
138 uint32_t (*draw_slice)(uint8_t *src[], int stride[], int w,int h, int x,int y); | |
139 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
140 /* |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
141 * Draws OSD to the screen buffer |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
142 */ |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
143 void (*draw_osd)(void); |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1326
diff
changeset
|
144 |
1 | 145 /* |
31 | 146 * Blit/Flip buffer to the screen. Must be called after each frame! |
1 | 147 */ |
148 void (*flip_page)(void); | |
149 | |
31 | 150 /* |
151 * This func is called after every frames to handle keyboard and | |
152 * other events. It's called in PAUSE mode too! | |
153 */ | |
154 void (*check_events)(void); | |
155 | |
156 /* | |
157 * Closes driver. Should restore the original state of the system. | |
158 */ | |
1 | 159 void (*uninit)(void); |
160 | |
161 } vo_functions_t; | |
162 | |
1142 | 163 char *vo_format_name(int format); |
1326 | 164 int vo_init(void); |
165 | |
1 | 166 // NULL terminated array of all drivers |
167 extern vo_functions_t* video_out_drivers[]; | |
168 | |
4618 | 169 // correct resolution/bpp on screen: (should be autodetected by vo_init()) |
388 | 170 extern int vo_depthonscreen; |
171 extern int vo_screenwidth; | |
172 extern int vo_screenheight; | |
213 | 173 |
388 | 174 // requested resolution/bpp: (-x -y -bpp options) |
175 extern int vo_dwidth; | |
176 extern int vo_dheight; | |
177 extern int vo_dbpp; | |
178 | |
1268 | 179 extern int vo_doublebuffering; |
4667 | 180 extern int vo_vsync; |
1268 | 181 extern int vo_fsmode; |
182 | |
2707 | 183 extern int vo_pts; |
3201 | 184 extern float vo_fps; |
2707 | 185 |
1184 | 186 extern char *vo_subdevice; |
187 |