Mercurial > mplayer.hg
annotate libvo/vo_gl.c @ 16474:01d27e023ae4
Improved glFindFormat
author | reimar |
---|---|
date | Tue, 13 Sep 2005 15:56:32 +0000 |
parents | c35ed5cdf07e |
children | 3191dcb27a12 |
rev | line source |
---|---|
1 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 #include <string.h> | |
4 | |
16221 | 5 #include "config.h" |
11988 | 6 #include "mp_msg.h" |
14286 | 7 #include "subopt-helper.h" |
1 | 8 #include "video_out.h" |
9 #include "video_out_internal.h" | |
13585 | 10 #include "font_load.h" |
11 #include "sub.h" | |
1 | 12 |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
13601
diff
changeset
|
13 #include "gl_common.h" |
2057 | 14 #include "aspect.h" |
13843 | 15 #ifdef HAVE_NEW_GUI |
16 #include "Gui/interface.h" | |
17 #endif | |
31 | 18 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
19 static vo_info_t info = |
1 | 20 { |
21 "X11 (OpenGL)", | |
22 "gl", | |
23 "Arpad Gereoffy <arpi@esp-team.scene.hu>", | |
24 "" | |
25 }; | |
26 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
27 LIBVO_EXTERN(gl) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7931
diff
changeset
|
28 |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
29 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
30 static int gl_vinfo = 0; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
31 static HGLRC gl_context = 0; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
32 #else |
13843 | 33 static XVisualInfo *gl_vinfo = NULL; |
34 static GLXContext gl_context = 0; | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
35 static int wsGLXAttrib[] = { GLX_RGBA, |
1 | 36 GLX_RED_SIZE,1, |
37 GLX_GREEN_SIZE,1, | |
38 GLX_BLUE_SIZE,1, | |
39 GLX_DOUBLEBUFFER, | |
40 None }; | |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
41 #endif |
1 | 42 |
13599 | 43 static int use_osd; |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
44 static int scaled_osd; |
14269 | 45 //! How many parts the OSD may consist of at most |
13585 | 46 #define MAX_OSD_PARTS 20 |
14269 | 47 //! Textures for OSD |
13599 | 48 static GLuint osdtex[MAX_OSD_PARTS]; |
13585 | 49 #ifndef FAST_OSD |
14269 | 50 //! Alpha textures for OSD |
13599 | 51 static GLuint osdatex[MAX_OSD_PARTS]; |
13585 | 52 #endif |
14269 | 53 //! Display lists that draw the OSD parts |
13599 | 54 static GLuint osdDispList[MAX_OSD_PARTS]; |
14269 | 55 //! How many parts the OSD currently consists of |
16433 | 56 static int osdtexCnt; |
1 | 57 |
13601 | 58 static int use_aspect; |
16099 | 59 static int use_rectangle; |
60 static int err_shown; | |
1 | 61 static uint32_t image_width; |
62 static uint32_t image_height; | |
12159 | 63 static int many_fmts; |
16235 | 64 static int use_glFinish; |
16268 | 65 static int swap_interval; |
16099 | 66 static GLenum gl_target; |
16303
a87c6cf3fe52
Fix texture format variable types. Internal format is GLint, others are GLenum
reimar
parents:
16282
diff
changeset
|
67 static GLint gl_texfmt; |
12159 | 68 static GLenum gl_format; |
69 static GLenum gl_type; | |
16434 | 70 static GLuint gl_buffer; |
16099 | 71 static int gl_buffersize; |
1 | 72 |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
73 static int int_pause; |
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
74 |
1 | 75 static uint32_t texture_width; |
76 static uint32_t texture_height; | |
77 | |
13237
f85c105bfeaa
improved suboption parsing, fixes also compiler warnings
reimar
parents:
13206
diff
changeset
|
78 static unsigned int slice_height = 1; |
8654
2c4cebb8637d
- optional slice height for -vo gl (example: -vo gl:32)
arpi
parents:
8148
diff
changeset
|
79 |
612 | 80 static void resize(int x,int y){ |
11988 | 81 mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y); |
15748 | 82 if (WinID >= 0) { |
83 int top = 0, left = 0, w = x, h = y; | |
84 geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight); | |
85 glViewport(top, left, w, h); | |
86 } else | |
1 | 87 glViewport( 0, 0, x, y ); |
88 | |
89 glMatrixMode(GL_PROJECTION); | |
90 glLoadIdentity(); | |
13601 | 91 if (vo_fs && use_aspect) { |
92 int new_w, new_h; | |
93 GLdouble scale_x, scale_y; | |
94 aspect(&new_w, &new_h, A_ZOOM); | |
95 panscan_calc(); | |
96 new_w += vo_panscan_x; | |
97 new_h += vo_panscan_y; | |
98 scale_x = (GLdouble) new_w / (GLdouble) x; | |
99 scale_y = (GLdouble) new_h / (GLdouble) y; | |
100 glScaled(scale_x, scale_y, 1); | |
101 } | |
1 | 102 glOrtho(0, image_width, image_height, 0, -1,1); |
103 | |
104 glMatrixMode(GL_MODELVIEW); | |
105 glLoadIdentity(); | |
13585 | 106 |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
107 if (!scaled_osd) { |
15086
c9eee448e5b2
revert the previous commit, gl needs to reload the font immediately
henry
parents:
15080
diff
changeset
|
108 #ifdef HAVE_FREETYPE |
c9eee448e5b2
revert the previous commit, gl needs to reload the font immediately
henry
parents:
15080
diff
changeset
|
109 // adjust font size to display size |
c9eee448e5b2
revert the previous commit, gl needs to reload the font immediately
henry
parents:
15080
diff
changeset
|
110 force_load_font = 1; |
c9eee448e5b2
revert the previous commit, gl needs to reload the font immediately
henry
parents:
15080
diff
changeset
|
111 #endif |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
112 vo_osd_changed(OSDTYPE_OSD); |
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
113 } |
1 | 114 } |
115 | |
16099 | 116 static void texSize(int w, int h, int *texw, int *texh) { |
117 if (use_rectangle) { | |
118 *texw = w; *texh = h; | |
119 } else { | |
120 *texw = 32; | |
121 while (*texw < w) | |
122 *texw *= 2; | |
123 *texh = 32; | |
124 while (*texh < h) | |
125 *texh *= 2; | |
126 } | |
127 } | |
128 | |
16436 | 129 /** |
130 * \brief remove all OSD textures and display-lists, thus clearing it. | |
131 */ | |
16433 | 132 static void clearOSD() { |
133 int i; | |
134 glDeleteTextures(osdtexCnt, osdtex); | |
135 #ifndef FAST_OSD | |
136 glDeleteTextures(osdtexCnt, osdatex); | |
137 #endif | |
138 for (i = 0; i < osdtexCnt; i++) | |
139 glDeleteLists(osdDispList[i], 1); | |
140 osdtexCnt = 0; | |
141 } | |
142 | |
143 /** | |
144 * \brief uninitialize OpenGL context, freeing textures, buffers etc. | |
145 */ | |
146 static void uninitGl() { | |
147 clearOSD(); | |
148 if (DeleteBuffers && gl_buffer) | |
149 DeleteBuffers(1, &gl_buffer); | |
150 gl_buffer = 0; gl_buffersize = 0; | |
151 err_shown = 0; | |
152 } | |
153 | |
13843 | 154 /** |
155 * \brief Initialize a (new or reused) OpenGL context. | |
16433 | 156 * set global gl-related variables to their default values |
13843 | 157 */ |
158 static int initGl(uint32_t d_width, uint32_t d_height) { | |
16433 | 159 osdtexCnt = 0; gl_buffer = 0; gl_buffersize = 0; err_shown = 0; |
16099 | 160 texSize(image_width, image_height, &texture_width, &texture_height); |
13843 | 161 |
162 glDisable(GL_BLEND); | |
163 glDisable(GL_DEPTH_TEST); | |
164 glDepthMask(GL_FALSE); | |
165 glDisable(GL_CULL_FACE); | |
16099 | 166 glEnable(gl_target); |
16458 | 167 glDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT); |
13843 | 168 |
169 mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n", | |
170 texture_width, texture_height); | |
171 | |
16117 | 172 glCreateClearTex(gl_target, gl_texfmt, GL_LINEAR, |
173 texture_width, texture_height, 0); | |
13843 | 174 |
175 resize(d_width, d_height); | |
176 | |
177 glClearColor( 0.0f,0.0f,0.0f,0.0f ); | |
178 glClear( GL_COLOR_BUFFER_BIT ); | |
16271 | 179 if (SwapInterval && swap_interval >= 0) |
16268 | 180 SwapInterval(swap_interval); |
13920 | 181 return 1; |
13843 | 182 } |
183 | |
1 | 184 /* connect to server, create and map window, |
185 * allocate colors and (shared) memory | |
186 */ | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
187 static int |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
7111
diff
changeset
|
188 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
1 | 189 { |
190 image_height = height; | |
191 image_width = width; | |
16474 | 192 glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type); |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
193 |
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
194 int_pause = 0; |
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
195 |
13601 | 196 panscan_init(); |
2249
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
197 aspect_save_orig(width,height); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
198 aspect_save_prescale(d_width,d_height); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
199 aspect_save_screenres(vo_screenwidth,vo_screenheight); |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
200 |
48f0ac1e9d13
Update to new (cleaner, more bugfree, better) aspect api. vo_gl vo_gl2 and vo_xmga are untested!
atmos4
parents:
2057
diff
changeset
|
201 aspect(&d_width,&d_height,A_NOZOOM); |
15595
b4c3f02811dd
-geometry support for gl2 under win, default window pos centered for gl, gl2
reimar
parents:
15589
diff
changeset
|
202 vo_dx = (vo_screenwidth - d_width) / 2; |
b4c3f02811dd
-geometry support for gl2 under win, default window pos centered for gl, gl2
reimar
parents:
15589
diff
changeset
|
203 vo_dy = (vo_screenheight - d_height) / 2; |
15589 | 204 geometry(&vo_dx, &vo_dy, &d_width, &d_height, |
205 vo_screenwidth, vo_screenheight); | |
2040 | 206 #ifdef X11_FULLSCREEN |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
15086
diff
changeset
|
207 // if( flags&VOFLAG_FULLSCREEN ){ // (-fs) |
6095 | 208 // aspect(&d_width,&d_height,A_ZOOM); |
209 // } | |
2040 | 210 #endif |
13843 | 211 #ifdef HAVE_NEW_GUI |
212 if (use_gui) { | |
213 // GUI creates and manages window for us | |
214 vo_dwidth = d_width; | |
215 vo_dheight= d_height; | |
216 guiGetEvent(guiSetShVideo, 0); | |
15748 | 217 goto glconfig; |
13843 | 218 } |
219 #endif | |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
220 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
221 o_dwidth = d_width; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
222 o_dheight = d_height; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
223 vo_fs = flags & VOFLAG_FULLSCREEN; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
224 vo_vm = flags & VOFLAG_MODESWITCHING; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
225 vo_dwidth = d_width; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
226 vo_dheight = d_height; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
227 if (!createRenderingContext()) |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
228 return -1; |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
229 #else |
15748 | 230 if (WinID >= 0) { |
231 vo_window = WinID ? (Window)WinID : mRootWin; | |
16239 | 232 vo_x11_selectinput_witherr(mDisplay, vo_window, |
233 StructureNotifyMask | KeyPressMask | PointerMotionMask | | |
234 ButtonPressMask | ButtonReleaseMask | ExposureMask); | |
15748 | 235 goto glconfig; |
236 } | |
13843 | 237 if ( vo_window == None ) { |
238 unsigned int fg, bg; | |
239 XSizeHints hint; | |
240 XVisualInfo *vinfo; | |
241 XEvent xev; | |
242 | |
13871 | 243 vo_fs = VO_FALSE; |
13843 | 244 |
15589 | 245 hint.x = vo_dx; |
246 hint.y = vo_dy; | |
1 | 247 hint.width = d_width; |
248 hint.height = d_height; | |
249 hint.flags = PPosition | PSize; | |
250 | |
251 /* Get some colors */ | |
252 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
253 bg = WhitePixel(mDisplay, mScreen); |
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
254 fg = BlackPixel(mDisplay, mScreen); |
1 | 255 |
256 /* Make the window */ | |
257 | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
258 vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib ); |
1290 | 259 if (vinfo == NULL) |
260 { | |
11988 | 261 mp_msg(MSGT_VO, MSGL_ERR, "[gl] no GLX support present\n"); |
1290 | 262 return -1; |
263 } | |
1 | 264 |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
265 |
1137
4c7b219e126c
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
arpi_esp
parents:
1109
diff
changeset
|
266 |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
267 vo_window = vo_x11_create_smooth_window(mDisplay, mRootWin, vinfo->visual, hint.x, hint.y, hint.width, hint.height, |
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
268 vinfo->depth, XCreateColormap(mDisplay, mRootWin, vinfo->visual, AllocNone)); |
1 | 269 |
7777 | 270 vo_x11_classhint( mDisplay,vo_window,"gl" ); |
271 vo_hidecursor(mDisplay,vo_window); | |
1 | 272 |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
15086
diff
changeset
|
273 // if ( flags&VOFLAG_FULLSCREEN ) vo_x11_decoration( mDisplay,vo_window,0 ); |
7777 | 274 XSelectInput(mDisplay, vo_window, StructureNotifyMask); |
275 /* Tell other applications about this window */ | |
10138
5e286cc6ad21
Removed YUV (YV12) and BGR support, leaving the native RGB support. Also cleaned some other parts.
alex
parents:
8654
diff
changeset
|
276 XSetStandardProperties(mDisplay, vo_window, title, title, None, NULL, 0, &hint); |
7777 | 277 /* Map window. */ |
278 XMapWindow(mDisplay, vo_window); | |
4017 | 279 #ifdef HAVE_XINERAMA |
7777 | 280 vo_x11_xinerama_move(mDisplay,vo_window); |
4017 | 281 #endif |
1 | 282 |
7777 | 283 /* Wait for map. */ |
284 do | |
285 { | |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
286 XNextEvent(mDisplay, &xev); |
7777 | 287 } |
288 while (xev.type != MapNotify || xev.xmap.event != vo_window); | |
1 | 289 |
7777 | 290 XSelectInput(mDisplay, vo_window, NoEventMask); |
1 | 291 |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
292 XSync(mDisplay, False); |
1 | 293 |
6953
ce67cc1f0beb
ignore BadAccess error at XSelectInput() (grabbing mouse etc) with warning
arpi
parents:
6212
diff
changeset
|
294 vo_x11_selectinput_witherr(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PointerMotionMask |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
295 | ButtonPressMask | ButtonReleaseMask | ExposureMask |
4658 | 296 ); |
13843 | 297 } |
298 if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); | |
13575 | 299 |
15589 | 300 vo_x11_nofs_sizepos(vo_dx, vo_dy, d_width, d_height); |
13843 | 301 if (vo_fs ^ (flags & VOFLAG_FULLSCREEN)) |
302 vo_x11_fullscreen(); | |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
303 #endif |
15748 | 304 |
305 glconfig: | |
16433 | 306 if (vo_config_count) |
307 uninitGl(); | |
13843 | 308 setGlWindow(&gl_vinfo, &gl_context, vo_window); |
309 initGl(vo_dwidth, vo_dheight); | |
11542 | 310 |
1 | 311 return 0; |
312 } | |
313 | |
31 | 314 static void check_events(void) |
1 | 315 { |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
316 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
317 int e=vo_w32_check_events(); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
318 #else |
2041
ba8a225d1a18
now using x11_common stuff for X11 opening and w/h/bpp query
arpi
parents:
2040
diff
changeset
|
319 int e=vo_x11_check_events(mDisplay); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
320 #endif |
31 | 321 if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight); |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
322 if(e&VO_EVENT_EXPOSE && int_pause) flip_page(); |
31 | 323 } |
1 | 324 |
13585 | 325 /** |
326 * Creates the textures and the display list needed for displaying | |
327 * an OSD part. | |
328 * Callback function for vo_draw_text(). | |
329 */ | |
330 static void create_osd_texture(int x0, int y0, int w, int h, | |
331 unsigned char *src, unsigned char *srca, | |
332 int stride) | |
333 { | |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
13601
diff
changeset
|
334 // initialize to 8 to avoid special-casing on alignment |
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
13601
diff
changeset
|
335 int sx = 8, sy = 8; |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
336 GLint scale_type = (scaled_osd) ? GL_LINEAR : GL_NEAREST; |
16099 | 337 texSize(w, h, &sx, &sy); |
13585 | 338 |
339 if (osdtexCnt >= MAX_OSD_PARTS) { | |
340 mp_msg(MSGT_VO, MSGL_ERR, "Too many OSD parts, contact the developers!\n"); | |
341 return; | |
342 } | |
343 | |
344 // create Textures for OSD part | |
345 glGenTextures(1, &osdtex[osdtexCnt]); | |
16099 | 346 BindTexture(gl_target, osdtex[osdtexCnt]); |
16117 | 347 glCreateClearTex(gl_target, GL_LUMINANCE, scale_type, sx, sy, 0); |
348 glUploadTex(gl_target, GL_LUMINANCE, GL_UNSIGNED_BYTE, src, stride, | |
349 0, 0, w, h, 0); | |
13585 | 350 |
351 #ifndef FAST_OSD | |
352 glGenTextures(1, &osdatex[osdtexCnt]); | |
16099 | 353 BindTexture(gl_target, osdatex[osdtexCnt]); |
16117 | 354 glCreateClearTex(gl_target, GL_ALPHA, scale_type, sx, sy, 0); |
355 { | |
16221 | 356 int i; |
16117 | 357 char *tmp = (char *)malloc(stride * h); |
16272 | 358 // convert alpha from weird MPlayer scale. |
359 // in-place is not possible since it is reused for future OSDs | |
16396 | 360 for (i = h * stride - 1; i; i--) |
16272 | 361 tmp[i] = srca[i] - 1; |
16117 | 362 glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, tmp, stride, |
363 0, 0, w, h, 0); | |
364 free(tmp); | |
365 } | |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
13601
diff
changeset
|
366 #endif |
13585 | 367 |
16099 | 368 BindTexture(gl_target, 0); |
13585 | 369 |
370 // Create a list for rendering this OSD part | |
371 osdDispList[osdtexCnt] = glGenLists(1); | |
372 glNewList(osdDispList[osdtexCnt], GL_COMPILE); | |
373 #ifndef FAST_OSD | |
374 // render alpha | |
375 glBlendFunc(GL_ZERO, GL_SRC_ALPHA); | |
16099 | 376 BindTexture(gl_target, osdatex[osdtexCnt]); |
16214
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16171
diff
changeset
|
377 glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1); |
13585 | 378 #endif |
379 // render OSD | |
380 glBlendFunc (GL_ONE, GL_ONE); | |
16099 | 381 BindTexture(gl_target, osdtex[osdtexCnt]); |
16214
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16171
diff
changeset
|
382 glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1); |
13585 | 383 glEndList(); |
384 | |
385 osdtexCnt++; | |
386 } | |
387 | |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
388 static void draw_osd(void) |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
389 { |
13585 | 390 if (!use_osd) return; |
391 if (vo_osd_changed(0)) { | |
16221 | 392 int osd_h, osd_w; |
16433 | 393 clearOSD(); |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
394 osd_w = (scaled_osd) ? image_width : vo_dwidth; |
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
395 osd_h = (scaled_osd) ? image_height : vo_dheight; |
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
396 vo_draw_text(osd_w, osd_h, create_osd_texture); |
13585 | 397 } |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1302
diff
changeset
|
398 } |
31 | 399 |
400 static void | |
401 flip_page(void) | |
402 { | |
1 | 403 // glEnable(GL_TEXTURE_2D); |
404 // glBindTexture(GL_TEXTURE_2D, texture_id); | |
405 | |
406 glColor3f(1,1,1); | |
16214
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16171
diff
changeset
|
407 glDrawTex(0, 0, texture_width, texture_height, |
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16171
diff
changeset
|
408 0, 0, texture_width, texture_height, |
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16171
diff
changeset
|
409 texture_width, texture_height, use_rectangle == 1); |
1 | 410 |
13585 | 411 if (osdtexCnt > 0) { |
412 // set special rendering parameters | |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
413 if (!scaled_osd) { |
13585 | 414 glMatrixMode(GL_PROJECTION); |
415 glPushMatrix(); | |
416 glLoadIdentity(); | |
417 glOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1); | |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
418 } |
13585 | 419 glEnable(GL_BLEND); |
420 // draw OSD | |
421 glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); | |
422 // set rendering parameters back to defaults | |
423 glDisable (GL_BLEND); | |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
424 if (!scaled_osd) |
13585 | 425 glPopMatrix(); |
16099 | 426 BindTexture(gl_target, 0); |
13585 | 427 } |
428 | |
1 | 429 // glFlush(); |
16235 | 430 if (use_glFinish) |
1 | 431 glFinish(); |
16458 | 432 if (vo_doublebuffering) |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
433 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
434 SwapBuffers(vo_hdc); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
435 #else |
6095 | 436 glXSwapBuffers( mDisplay,vo_window ); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
437 #endif |
6095 | 438 |
16458 | 439 if (vo_fs && use_aspect && vo_doublebuffering) |
13601 | 440 glClear(GL_COLOR_BUFFER_BIT); |
1 | 441 } |
442 | |
443 //static inline uint32_t draw_slice_x11(uint8_t *src[], uint32_t slice_num) | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
444 static int draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y) |
1 | 445 { |
446 return 0; | |
447 } | |
448 | |
16099 | 449 static uint32_t get_image(mp_image_t *mpi) { |
16233
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16221
diff
changeset
|
450 if (!GenBuffers || !BindBuffer || !BufferData || !MapBuffer) { |
16099 | 451 if (!err_shown) |
452 mp_msg(MSGT_VO, MSGL_ERR, "[gl] extensions missing for dr\n" | |
453 "Expect a _major_ speed penalty\n"); | |
16113 | 454 err_shown = 1; |
16099 | 455 return VO_FALSE; |
456 } | |
457 if (mpi->flags & MP_IMGFLAG_READABLE) return VO_FALSE; | |
16117 | 458 if (mpi->type == MP_IMGTYPE_IP || mpi->type == MP_IMGTYPE_IPB) |
459 return VO_FALSE; // we can not provide readable buffers | |
16233
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16221
diff
changeset
|
460 if (!gl_buffer) |
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16221
diff
changeset
|
461 GenBuffers(1, &gl_buffer); |
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16221
diff
changeset
|
462 BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer); |
16099 | 463 mpi->stride[0] = mpi->width * mpi->bpp / 8; |
464 if (mpi->stride[0] * mpi->h > gl_buffersize) { | |
465 BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[0] * mpi->h, | |
16237
b951a75d4f83
Our buffer usage actually fits better to GL_DYNAMIC_DRAW than GL_STREAM_DRAW.
reimar
parents:
16236
diff
changeset
|
466 NULL, GL_DYNAMIC_DRAW); |
16099 | 467 gl_buffersize = mpi->stride[0] * mpi->h; |
468 } | |
16117 | 469 UnmapBuffer(GL_PIXEL_UNPACK_BUFFER); // HACK, needed for some MPEG4 files?? |
16099 | 470 mpi->planes[0] = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); |
471 BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); | |
16113 | 472 if (mpi->planes[0] == NULL) { |
473 if (!err_shown) | |
474 mp_msg(MSGT_VO, MSGL_ERR, "[gl] could not aquire buffer for dr\n" | |
475 "Expect a _major_ speed penalty\n"); | |
476 err_shown = 1; | |
477 return VO_FALSE; | |
478 } | |
16099 | 479 mpi->flags |= MP_IMGFLAG_DIRECT; |
480 return VO_TRUE; | |
481 } | |
482 | |
16092 | 483 static uint32_t draw_image(mp_image_t *mpi) { |
484 char *data = mpi->planes[0]; | |
16117 | 485 int slice = slice_height; |
16092 | 486 if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) |
487 return VO_TRUE; | |
16099 | 488 if (mpi->flags & MP_IMGFLAG_DIRECT) { |
489 data = NULL; | |
16233
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16221
diff
changeset
|
490 BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer); |
16099 | 491 UnmapBuffer(GL_PIXEL_UNPACK_BUFFER); |
16117 | 492 slice = 0; // always "upload" full texture |
16099 | 493 } |
16117 | 494 glUploadTex(gl_target, gl_format, gl_type, data, mpi->stride[0], |
495 mpi->x, mpi->y, mpi->w, mpi->h, slice); | |
16099 | 496 if (mpi->flags & MP_IMGFLAG_DIRECT) |
497 BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); | |
16092 | 498 return VO_TRUE; |
499 } | |
1 | 500 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
501 static int |
10138
5e286cc6ad21
Removed YUV (YV12) and BGR support, leaving the native RGB support. Also cleaned some other parts.
alex
parents:
8654
diff
changeset
|
502 draw_frame(uint8_t *src[]) |
1 | 503 { |
16092 | 504 return VO_ERROR; |
1 | 505 } |
506 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
507 static int |
1 | 508 query_format(uint32_t format) |
509 { | |
16092 | 510 int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | |
511 VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_ACCEPT_STRIDE; | |
13585 | 512 if (use_osd) |
513 caps |= VFCAP_OSD; | |
13206
6e8d1ac141fc
Using updated colorspace specifications from colorspaces.txt.
reimar
parents:
13188
diff
changeset
|
514 if ((format == IMGFMT_RGB24) || (format == IMGFMT_RGBA)) |
13585 | 515 return caps; |
14078
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13993
diff
changeset
|
516 if (many_fmts && |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13993
diff
changeset
|
517 glFindFormat(format, NULL, NULL, NULL, NULL)) |
13585 | 518 return caps; |
1 | 519 return 0; |
520 } | |
521 | |
522 | |
523 static void | |
524 uninit(void) | |
525 { | |
6095 | 526 if ( !vo_config_count ) return; |
16433 | 527 uninitGl(); |
13843 | 528 releaseGlContext(&gl_vinfo, &gl_context); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
529 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
530 vo_w32_uninit(); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
531 #else |
6095 | 532 vo_x11_uninit(); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
533 #endif |
1 | 534 } |
4352 | 535 |
14286 | 536 static opt_t subopts[] = { |
537 {"manyfmts", OPT_ARG_BOOL, &many_fmts, NULL}, | |
538 {"osd", OPT_ARG_BOOL, &use_osd, NULL}, | |
539 {"scaled-osd", OPT_ARG_BOOL, &scaled_osd, NULL}, | |
540 {"aspect", OPT_ARG_BOOL, &use_aspect, NULL}, | |
541 {"slice-height", OPT_ARG_INT, &slice_height, (opt_test_f)int_non_neg}, | |
16099 | 542 {"rectangle", OPT_ARG_INT, &use_rectangle,(opt_test_f)int_non_neg}, |
16235 | 543 {"glfinish", OPT_ARG_BOOL, &use_glFinish, NULL}, |
16268 | 544 {"swapinterval", OPT_ARG_INT, &swap_interval,NULL}, |
14286 | 545 {NULL} |
546 }; | |
547 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
548 static int preinit(const char *arg) |
4352 | 549 { |
14286 | 550 // set defaults |
16012 | 551 many_fmts = 1; |
13585 | 552 use_osd = 1; |
13660
b34c5aa5f798
OSD variant for vo_gl.c that behaves more like the one of other vos.
reimar
parents:
13653
diff
changeset
|
553 scaled_osd = 0; |
13601 | 554 use_aspect = 1; |
16099 | 555 use_rectangle = 0; |
16235 | 556 use_glFinish = 0; |
16268 | 557 swap_interval = 1; |
12159 | 558 slice_height = 4; |
14286 | 559 if (subopt_parse(arg, subopts) != 0) { |
13237
f85c105bfeaa
improved suboption parsing, fixes also compiler warnings
reimar
parents:
13206
diff
changeset
|
560 mp_msg(MSGT_VO, MSGL_FATAL, |
12212
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
561 "\n-vo gl command line help:\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
562 "Example: mplayer -vo gl:slice-height=4\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
563 "\nOptions:\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
564 " manyfmts\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
565 " Enable extended color formats for OpenGL 1.2 and later\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
566 " slice-height=<0-...>\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
567 " Slice size for texture transfer, 0 for whole image\n" |
13585 | 568 " noosd\n" |
569 " Do not use OpenGL OSD code\n" | |
13601 | 570 " noaspect\n" |
571 " Do not do aspect scaling\n" | |
16099 | 572 " rectangle=<0,1,2>\n" |
573 " 0: use power-of-two textures\n" | |
574 " 1: use texture_rectangle\n" | |
575 " 2: use texture_non_power_of_two\n" | |
16235 | 576 " glfinish\n" |
577 " Call glFinish() before swapping buffers\n" | |
16268 | 578 " swapinterval=<n>\n" |
579 " Interval in displayed frames between to buffer swaps.\n" | |
580 " 1 is equivalent to enable VSYNC, 0 to disable VSYNC.\n" | |
581 " Requires GLX_SGI_swap_control support to work.\n" | |
12212
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
582 "\n" ); |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
583 return -1; |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
584 } |
16099 | 585 if (use_rectangle == 1) |
586 gl_target = GL_TEXTURE_RECTANGLE; | |
587 else | |
588 gl_target = GL_TEXTURE_2D; | |
12212
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
589 if (many_fmts) |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
590 mp_msg (MSGT_VO, MSGL_WARN, "[gl] using extended formats.\n" |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
591 "Make sure you have OpenGL >= 1.2 and used corresponding " |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
592 "headers for compiling!\n"); |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
593 mp_msg (MSGT_VO, MSGL_INFO, "[gl] Using %d as slice height " |
2e8b305586a0
fixed suboption parsing, added help for suboptions
reimar
parents:
12159
diff
changeset
|
594 "(0 means image height).\n", slice_height); |
7931 | 595 if( !vo_init() ) return -1; // Can't open X11 |
7777 | 596 |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4658
diff
changeset
|
597 return 0; |
4352 | 598 } |
599 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
16117
diff
changeset
|
600 static int control(uint32_t request, void *data, ...) |
4352 | 601 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
602 switch (request) { |
10757
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
603 case VOCTRL_PAUSE: return (int_pause=1); |
3aea64e0d6d9
Avoid flickering during resizes. Keep video contents even when paused. Fix by Tomas Simonaitis <haden@homelan.lt>
mosu
parents:
10138
diff
changeset
|
604 case VOCTRL_RESUME: return (int_pause=0); |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
605 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
606 return query_format(*((uint32_t*)data)); |
16099 | 607 case VOCTRL_GET_IMAGE: |
608 return get_image(data); | |
16092 | 609 case VOCTRL_DRAW_IMAGE: |
610 return draw_image(data); | |
13843 | 611 case VOCTRL_GUISUPPORT: |
612 return VO_TRUE; | |
11542 | 613 case VOCTRL_ONTOP: |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
614 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
615 vo_w32_ontop(); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
616 #else |
11542 | 617 vo_x11_ontop(); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
618 #endif |
11542 | 619 return VO_TRUE; |
6095 | 620 case VOCTRL_FULLSCREEN: |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
621 #ifdef GL_WIN32 |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
622 vo_w32_fullscreen(); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
623 resize(vo_dwidth, vo_dheight); |
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
624 #else |
6095 | 625 vo_x11_fullscreen(); |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
626 #endif |
6095 | 627 return VO_TRUE; |
13601 | 628 case VOCTRL_GET_PANSCAN: |
629 if (!use_aspect) return VO_NOTIMPL; | |
630 return VO_TRUE; | |
631 case VOCTRL_SET_PANSCAN: | |
632 if (!use_aspect) return VO_NOTIMPL; | |
633 resize (vo_dwidth, vo_dheight); | |
634 return VO_TRUE; | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
635 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4448
diff
changeset
|
636 return VO_NOTIMPL; |
4352 | 637 } |