changeset 31315:ad274a5b093b

For vos that support the new libvo API (provide UPDATE_SCREENINFO), avoid duplicating some Gui-related code.
author reimar
date Sun, 13 Jun 2010 12:04:13 +0000
parents c69ecf7d80a4
children de902c34c33c
files gui/interface.c libvo/video_out.c libvo/vo_gl.c libvo/vo_gl2.c libvo/vo_vdpau.c libvo/vo_x11.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c
diffstat 9 files changed, 10 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/gui/interface.c	Sun Jun 13 12:04:13 2010 +0000
@@ -552,6 +552,7 @@
 	  guiIntfStruct.MovieHeight=vo_dheight;
           if (guiWinID>=0)
             wsMoveWindow( &appMPlayer.mainWindow,0,0, vo_dheight);
+          WinID = appMPlayer.subWindow.WindowID;
          }
 	break;
 #ifdef CONFIG_DVDREAD
--- a/libvo/video_out.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/video_out.c	Sun Jun 13 12:04:13 2010 +0000
@@ -30,6 +30,9 @@
 #include "aspect.h"
 #include "geometry.h"
 
+#ifdef CONFIG_GUI
+#include "gui/interface.h"
+#endif
 #include "mp_msg.h"
 #include "help_mp.h"
 #include "input/input.h"
@@ -361,6 +364,12 @@
     vo_dy += xinerama_y;
     vo_dwidth = d_width;
     vo_dheight = d_height;
+#ifdef CONFIG_GUI
+    if (use_gui) {
+      // GUI creates and manages window for us
+      guiGetEvent(guiSetShVideo, 0);
+    }
+#endif
   }
 
   return vo->config(width, height, d_width, d_height, flags, title, format);
--- a/libvo/vo_gl.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_gl.c	Sun Jun 13 12:04:13 2010 +0000
@@ -36,9 +36,6 @@
 
 #include "gl_common.h"
 #include "aspect.h"
-#ifdef CONFIG_GUI
-#include "gui/interface.h"
-#endif
 #include "fastmemcpy.h"
 #include "libass/ass_mp.h"
 
@@ -638,17 +635,9 @@
   int_pause = 0;
   vo_flipped = !!(flags & VOFLAG_FLIPPING);
 
-#ifdef CONFIG_GUI
-  if (use_gui) {
-    // GUI creates and manages window for us
-    guiGetEvent(guiSetShVideo, 0);
-    goto glconfig;
-  }
-#endif
   if (create_window(d_width, d_height, flags, title) < 0)
     return -1;
 
-glconfig:
   if (vo_config_count)
     uninitGl();
   if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
--- a/libvo/vo_gl2.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_gl2.c	Sun Jun 13 12:04:13 2010 +0000
@@ -33,9 +33,6 @@
 
 #include "gl_common.h"
 #include "aspect.h"
-#ifdef CONFIG_GUI
-#include "gui/interface.h"
-#endif
 
 #undef TEXTUREFORMAT_ALWAYS
 #ifdef __APPLE__
@@ -550,13 +547,6 @@
 }
 #endif
 
-#ifdef CONFIG_GUI
-static int config_glx_gui(uint32_t d_width, uint32_t d_height) {
-  guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window
-  return 0;
-}
-#endif
-
 static int initGl(uint32_t d_width, uint32_t d_height)
 {
   fragprog = lookupTex = 0;
@@ -631,15 +621,6 @@
 
   int_pause = 0;
 
-#ifdef CONFIG_GUI
-  if (use_gui) {
-    if (config_glx_gui(d_width, d_height) == -1)
-      return -1;
-  }
-#ifndef CONFIG_GL_WIN32
-  else
-#endif
-#endif
 #ifdef CONFIG_GL_WIN32
   if (config_w32(width, height, d_width, d_height, flags, title, format) == -1)
 #endif
--- a/libvo/vo_vdpau.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_vdpau.c	Sun Jun 13 12:04:13 2010 +0000
@@ -668,11 +668,6 @@
     int_pause   = 0;
     visible_buf = 0;
 
-#ifdef CONFIG_GUI
-    if (use_gui)
-        guiGetEvent(guiSetShVideo, 0);  // the GUI will set up / resize our window
-    else
-#endif
     {
 #ifdef CONFIG_XF86VM
         if (vm)
--- a/libvo/vo_x11.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_x11.c	Sun Jun 13 12:04:13 2010 +0000
@@ -56,11 +56,6 @@
 #include "mp_msg.h"
 #include "help_mp.h"
 
-#ifdef CONFIG_GUI
-#include "gui/interface.h"
-#include "mplayer.h"
-#endif
-
 static const vo_info_t info = {
     "X11 ( XImage/Shm )",
     "x11",
@@ -358,11 +353,6 @@
     image_width = (width + 7) & (~7);
     image_height = height;
 
-#ifdef CONFIG_GUI
-    if (use_gui)
-        guiGetEvent(guiSetShVideo, 0);  // the GUI will set up / resize the window
-    else
-#endif
     {
 #ifdef CONFIG_XF86VM
         if (vm)
--- a/libvo/vo_xv.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_xv.c	Sun Jun 13 12:04:13 2010 +0000
@@ -59,10 +59,6 @@
 
 #include "input/input.h"
 
-#ifdef CONFIG_GUI
-#include "gui/interface.h"
-#endif
-
 #include "libavutil/common.h"
 
 static const vo_info_t info = {
@@ -229,11 +225,6 @@
             return -1;
     }
 
-#ifdef CONFIG_GUI
-    if (use_gui)
-        guiGetEvent(guiSetShVideo, 0);  // the GUI will set up / resize the window
-    else
-#endif
     {
 #ifdef CONFIG_XF86VM
         if (vm)
--- a/libvo/vo_xvidix.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_xvidix.c	Sun Jun 13 12:04:13 2010 +0000
@@ -49,11 +49,6 @@
 #include "vosub_vidix.h"
 #include "vidix/vidix.h"
 
-#ifdef CONFIG_GUI
-#include "gui/interface.h"
-#endif
-
-
 static const vo_info_t info = {
     "X11 (VIDIX)",
     "xvidix",
@@ -252,13 +247,6 @@
     }
     mp_msg(MSGT_VO, MSGL_V, "Using colorkey: %x\n", colorkey);
 
-#ifdef CONFIG_GUI
-    if (use_gui)
-        guiGetEvent(guiSetShVideo, 0);  // the GUI will set up / resize the window
-    else
-    {
-#endif
-
 #ifdef X11_FULLSCREEN
         if ((flags & VOFLAG_FULLSCREEN) || (flags & VOFLAG_SWSCALE))
             aspect(&d_width, &d_height, A_ZOOM);
@@ -289,10 +277,6 @@
                     CopyFromParent, "xvidix", title);
             XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
 
-#ifdef CONFIG_GUI
-    }
-#endif
-
     if ((!WinID) && (flags & VOFLAG_FULLSCREEN))
     {
         vo_dx = 0;
--- a/libvo/vo_xvmc.c	Sun Jun 13 11:51:41 2010 +0000
+++ b/libvo/vo_xvmc.c	Sun Jun 13 12:04:13 2010 +0000
@@ -623,11 +623,6 @@
 
 skip_surface_allocation:
 
-#ifdef CONFIG_GUI
-    if(use_gui)
-        guiGetEvent( guiSetShVideo,0 ); // let the GUI to setup/resize our window
-    else
-#endif
     {
 #ifdef CONFIG_XF86VM
         if ( vm )