From 09cf021307f6f8114af6dbaa81eb0a087275967c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 26 Feb 2010 21:41:42 +0000 Subject: Port yuv=... auto-detection from gl to gl2. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30753 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 9d1bd533d1..1607649a5f 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -865,7 +865,7 @@ static int preinit(const char *arg) #ifdef CONFIG_GL_WIN32 gltype = GLTYPE_W32; #endif - use_yuv = 0; + use_yuv = -1; use_glFinish = 1; if (subopt_parse(arg, subopts) != 0) { mp_msg(MSGT_VO, MSGL_FATAL, @@ -884,8 +884,25 @@ static int preinit(const char *arg) "\n" ); return -1; } - if(!init_mpglcontext(&glctx, gltype)) return -1; + if(!init_mpglcontext(&glctx, gltype)) goto err_out; + if (use_yuv == -1) { + const char *extensions; +#ifdef CONFIG_GL_WIN32 + if (config_w32(320, 200, 320, 200, VOFLAG_HIDDEN, "", 0) == -1) +#else + if (config_glx(320, 200, 320, 200, VOFLAG_HIDDEN, "", 0) == -1) +#endif + goto err_out; + if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED) + goto err_out; + extensions = GetString(GL_EXTENSIONS); + use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0; + } return 0; + +err_out: + uninit(); + return -1; } static int control(uint32_t request, void *data, ...) -- cgit v1.2.3 From 05c24134de2923762a718b4e1c31c60131d46124 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 27 Feb 2010 17:55:57 +0000 Subject: Enable StructureNotifyMask before waiting for a DestroyNotify event. Fixes hangs if OpenGL initialization fails in vo gl preinit and we call uninit while the window is still hidden. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30760 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libvo') diff --git a/libvo/x11_common.c b/libvo/x11_common.c index c0278caa42..5c21fee975 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -788,6 +788,7 @@ void vo_x11_uninit(void) XEvent xev; XUnmapWindow(mDisplay, vo_window); + XSelectInput(mDisplay, vo_window, StructureNotifyMask); XDestroyWindow(mDisplay, vo_window); do { -- cgit v1.2.3 From e92eaa0fd82d5824eb6a29acd7886b4331ad3087 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 27 Feb 2010 18:16:41 +0000 Subject: Only prefer -vo gl over -vo x11 if hardware acceleration is available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30761 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/video_out.c | 6 ++++-- libvo/vo_gl.c | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) (limited to 'libvo') diff --git a/libvo/video_out.c b/libvo/video_out.c index d721e0a526..8fca2b85c2 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -94,6 +94,7 @@ extern vo_functions_t video_out_xover; extern vo_functions_t video_out_xvmc; extern vo_functions_t video_out_vdpau; extern vo_functions_t video_out_xv; +extern vo_functions_t video_out_gl_nosw; extern vo_functions_t video_out_gl; extern vo_functions_t video_out_gl2; extern vo_functions_t video_out_matrixview; @@ -186,14 +187,15 @@ const vo_functions_t* const video_out_drivers[] = #ifdef CONFIG_XV &video_out_xv, #endif +#ifdef CONFIG_X11 #ifdef CONFIG_GL - &video_out_gl, + &video_out_gl_nosw, #endif -#ifdef CONFIG_X11 &video_out_x11, &video_out_xover, #endif #ifdef CONFIG_GL + &video_out_gl, &video_out_gl2, #endif #ifdef CONFIG_DGA diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index acf7e96891..502058ace6 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -47,6 +47,21 @@ static const vo_info_t info = const LIBVO_EXTERN(gl) + +static const vo_info_t info_nosw = +{ + "X11 (OpenGL) no software rendering", + "gl_nosw", + "Arpad Gereoffy ", + "" +}; +static int preinit_nosw(const char *arg); +#define info info_nosw +#define preinit preinit_nosw +const LIBVO_EXTERN(gl_nosw) +#undef info +#undef preinit + #ifdef CONFIG_GL_X11 static int wsGLXAttrib[] = { GLX_RGBA, GLX_RED_SIZE,1, @@ -444,6 +459,13 @@ static void uninitGl(void) { err_shown = 0; } +static int isSoftwareGl(void) +{ + const char *renderer = GetString(GL_RENDERER); +renderer = "Software Rasterizer"; + return strcmp(renderer, "Software Rasterizer") == 0; +} + static void autodetectGlExtensions(void) { const char *extensions = GetString(GL_EXTENSIONS); const char *vendor = GetString(GL_VENDOR); @@ -1052,7 +1074,7 @@ static const opt_t subopts[] = { {NULL} }; -static int preinit(const char *arg) +static int preinit_internal(const char *arg, int allow_sw) { enum MPGLType gltype = GLTYPE_X11; // set defaults @@ -1161,11 +1183,13 @@ static int preinit(const char *arg) } if (!init_mpglcontext(&glctx, gltype)) goto err_out; - if (use_yuv == -1) { + if (use_yuv == -1 || !allow_sw) { if (create_window(320, 200, VOFLAG_HIDDEN, NULL) < 0) goto err_out; if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED) goto err_out; + if (!allow_sw && isSoftwareGl()) + goto err_out; autodetectGlExtensions(); } if (many_fmts) @@ -1181,6 +1205,16 @@ err_out: return -1; } +static int preinit(const char *arg) +{ + return preinit_internal(arg, 1); +} + +static int preinit_nosw(const char *arg) +{ + return preinit_internal(arg, 0); +} + static const struct { const char *name; int *value; -- cgit v1.2.3 From 5f32754c143017e1a52f18a82f28f47026e8c27b Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 27 Feb 2010 18:17:33 +0000 Subject: 100l, remove forgotten debugging code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30762 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'libvo') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 502058ace6..a2e832e2ed 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -462,7 +462,6 @@ static void uninitGl(void) { static int isSoftwareGl(void) { const char *renderer = GetString(GL_RENDERER); -renderer = "Software Rasterizer"; return strcmp(renderer, "Software Rasterizer") == 0; } -- cgit v1.2.3 From 84a962ebea8e695de1a9af41ccd100a969cec1a0 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 27 Feb 2010 18:20:22 +0000 Subject: Update -vo gl info structs, it isn't X11-only since ages and there's basically no code left from Arpi and it's unlikely the email address is still working anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30763 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index a2e832e2ed..4fd8efb671 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -39,9 +39,9 @@ static const vo_info_t info = { - "X11 (OpenGL)", + "OpenGL", "gl", - "Arpad Gereoffy ", + "Reimar Doeffinger ", "" }; @@ -50,9 +50,9 @@ const LIBVO_EXTERN(gl) static const vo_info_t info_nosw = { - "X11 (OpenGL) no software rendering", + "OpenGL no software rendering", "gl_nosw", - "Arpad Gereoffy ", + "Reimar Doeffinger ", "" }; static int preinit_nosw(const char *arg); -- cgit v1.2.3 From 8271fc722b86853e6da929c0d3ffc5c4ee5b4766 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sat, 27 Feb 2010 20:22:30 +0000 Subject: Remove unused static function send_lpcm_packet(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30766 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_mpegpes.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_mpegpes.c b/libvo/vo_mpegpes.c index 4813916fbd..f9f02c7654 100644 --- a/libvo/vo_mpegpes.c +++ b/libvo/vo_mpegpes.c @@ -225,13 +225,6 @@ static void send_pes_packet(unsigned char* data, int len, int id, int timestamp) send_mpeg_pes_packet (data, len, id, timestamp, 1, my_write); } -static void send_lpcm_packet(unsigned char* data, int len, int id, - unsigned int timestamp, int freq_id) -{ - send_mpeg_lpcm_packet(data, len, id, timestamp, freq_id, my_write); -} - - static int draw_frame(uint8_t * src[]) { vo_mpegpes_t *p=(vo_mpegpes_t *)src[0]; -- cgit v1.2.3