]> git.sesse.net Git - vlc/blobdiff - plugins/x11/vout_xvideo.c
* Fixed the BeOS compile typo.
[vlc] / plugins / x11 / vout_xvideo.c
index 7b627a4e1bfdeb2f27e6f372c56a7b1691b47ac3..bacb06ade4edfe0ea233c2cf9014d4b24e66d50b 100644 (file)
@@ -2,7 +2,7 @@
  * vout_xvideo.c: Xvideo video output display method
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: vout_xvideo.c,v 1.11 2001/04/26 03:55:44 sam Exp $
+ * $Id: vout_xvideo.c,v 1.18 2001/05/30 17:03:12 sam Exp $
  *
  * Authors: Shane Harper <shanegh@optusnet.com.au>
  *          Vincent Seguin <seguin@via.ecp.fr>
 #include <sys/ipc.h>
 #endif
 
+#ifndef WIN32
+#include <netinet/in.h>                               /* BSD: struct in_addr */
+#endif
+
 #include <sys/shm.h>                                   /* shmget(), shmctl() */
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
@@ -56,7 +60,6 @@
 #include "threads.h"
 #include "mtime.h"
 #include "tests.h"
-#include "modules.h"
 
 #include "video.h"
 #include "video_output.h"
@@ -71,6 +74,8 @@
 #include "stream_control.h"                 /* needed by input_ext-intf.h... */
 #include "input_ext-intf.h"
 
+#include "modules.h"
+#include "modules_export.h"
 
 #define GUID_YUV12_PLANAR 0x32315659
 
@@ -128,9 +133,6 @@ typedef struct vout_sys_s
     boolean_t           b_mouse_pointer_visible;
     mtime_t             i_time_mouse_last_moved; /* used to auto-hide pointer*/
 
-    /* Displaying fullscreen */
-    boolean_t           b_fullscreen;
-
 } vout_sys_t;
 
 /* Fullscreen needs to be able to hide the wm decorations */
@@ -207,7 +209,7 @@ static int vout_Probe( probedata_t *p_data )
         return( 999 );
     }
 
-    return( 110 );
+    return( 60 );
 }
 
 /*****************************************************************************
@@ -241,7 +243,7 @@ static int vout_Create( vout_thread_t *p_vout )
     }
     p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
 
-    p_vout->p_sys->b_fullscreen
+    p_vout->b_fullscreen
         = main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT );
     
     if( !XVideoCheckForXv( p_vout->p_sys->p_display ) )
@@ -336,12 +338,9 @@ static void vout_Destroy( vout_thread_t *p_vout )
 static int vout_Manage( vout_thread_t *p_vout )
 {
     XEvent      xevent;                                         /* X11 event */
-    boolean_t   b_toggle_fullscreen;               /* user wants full-screen */
     char        i_key;                                    /* ISO Latin-1 key */
     KeySym      x_key_symbol;
 
-    b_toggle_fullscreen = 0;
-
     /* Handle X11 events: ConfigureNotify events are parsed to know if the
      * output window's size changed, MapNotify and UnmapNotify to know if the
      * window is mapped (and if the display is useful), and ClientMessages
@@ -409,7 +408,7 @@ static int vout_Manage( vout_thread_t *p_vout )
                             break;
                         case 'f':
                         case 'F':
-                            b_toggle_fullscreen = 1;
+                            p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
                             break;
                         case '0':
                             network_ChannelJoin( 0 );
@@ -483,14 +482,12 @@ static int vout_Manage( vout_thread_t *p_vout )
             p_vout->p_sys->b_mouse_pointer_visible = 1; 
             XVideoSetMousePointer( p_vout ); 
         }
-#ifdef DEBUG
         /* Other event */
         else
         {
-            intf_DbgMsg( "%p -> unhandled event type %d received",
+            intf_WarnMsg( 3, "%p -> unhandled event type %d received",
                          p_vout, xevent.type );
         }
-#endif
     }
 
     /* Handle events for YUV video output sub-window */
@@ -527,11 +524,11 @@ static int vout_Manage( vout_thread_t *p_vout )
         }
     }
 
-    if ( b_toggle_fullscreen )
+    if ( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
     {
         intf_DbgMsg( "vout: changing full-screen status" );
 
-        p_vout->p_sys->b_fullscreen = !p_vout->p_sys->b_fullscreen;
+        p_vout->b_fullscreen = !p_vout->b_fullscreen;
 
         /* Get rid of the old window */
         XVideoDestroyWindow( p_vout );
@@ -668,7 +665,7 @@ static int XVideoUpdateImgSizeIfRequired( vout_thread_t *p_vout )
             (p_vout->p_sys->p_xvimage->data_size) /
             (p_vout->p_sys->p_xvimage->height);
 
-        /* vout_SetBuffers( p_vout, p_vout->p_sys->p_xvimage->data ); */
+        /* p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_xvimage->data ); */
     }
 
     return( 0 );
@@ -719,7 +716,7 @@ static int XVideoCreateWindow( vout_thread_t *p_vout )
 
     /* Set main window's size */
     /* If we're full screen, we're full screen! */
-    if( p_vout->p_sys->b_fullscreen )
+    if( p_vout->b_fullscreen )
     {
         p_vout->p_sys->i_window_width = DisplayWidth( p_vout->p_sys->p_display,
                                                       p_vout->p_sys->i_screen );
@@ -763,7 +760,7 @@ static int XVideoCreateWindow( vout_thread_t *p_vout )
                            CWBackPixel | CWEventMask,
                            &xwindow_attributes );
 
-    if ( p_vout->p_sys->b_fullscreen )
+    if ( p_vout->b_fullscreen )
     {
         prop = XInternAtom(p_vout->p_sys->p_display, "_MOTIF_WM_HINTS", False);
         mwmhints.flags = MWM_HINTS_DECORATIONS;
@@ -839,7 +836,7 @@ static int XVideoCreateWindow( vout_thread_t *p_vout )
                   ButtonPressMask | ButtonReleaseMask | 
                   PointerMotionMask );
 
-    if( p_vout->p_sys->b_fullscreen )
+    if( p_vout->b_fullscreen )
     {
         XSetInputFocus( p_vout->p_sys->p_display, p_vout->p_sys->window,
                         RevertToNone, CurrentTime );
@@ -1068,7 +1065,7 @@ static void XVideoOutputCoords( const picture_t *p_pic, const boolean_t scale,
                 *h = win_w * 9 / 16;
                 break;
 
-           case AR_221_1_PICTURE:
+            case AR_221_1_PICTURE:
                 *h = win_w * 100 / 221;
                 break;