]> git.sesse.net Git - vlc/commitdiff
Merge branch 'master' of git@git.videolan.org:vlc
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 15 Feb 2009 17:26:12 +0000 (19:26 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 15 Feb 2009 17:26:12 +0000 (19:26 +0200)
include/vlc_vout.h
modules/gui/qt4/main_interface.cpp
modules/video_output/drawable.c
modules/video_output/msw/events.c
modules/video_output/x11/xcommon.c
src/video_output/video_output.c
src/video_output/vout_intf.c

index 4055f4cc6681fa0610f3a0546e4006dc0e724b80..23e98adc4d02b197ebb9cd96890d5b02c33ceffc 100644 (file)
@@ -506,8 +506,9 @@ struct vout_thread_t
     /**@{*/
     uint16_t            i_changes;          /**< changes made to the thread.
                                                       \see \ref vout_changes */
-    bool                b_fullscreen;         /**< toogle fullscreen display */
-    bool                b_autoscale;        /**< auto scaling picture or not */
+    unsigned            b_fullscreen:1;       /**< toogle fullscreen display */
+    unsigned            b_autoscale:1;      /**< auto scaling picture or not */
+    unsigned            b_on_top:1; /**< stay always on top of other windows */
     int                 i_zoom;               /**< scaling factor if no auto */
     unsigned int        i_window_width;              /**< video window width */
     unsigned int        i_window_height;            /**< video window height */
@@ -569,6 +570,8 @@ struct vout_thread_t
 #define VOUT_INTF_CHANGE        0x0004
 /** b_autoscale changed */
 #define VOUT_SCALE_CHANGE       0x0008
+/** b_on_top changed */
+#define VOUT_ON_TOP_CHANGE     0x0010
 /** b_cursor changed */
 #define VOUT_CURSOR_CHANGE      0x0020
 /** b_fullscreen changed */
@@ -700,7 +703,6 @@ static inline int vout_Control( vout_thread_t *p_vout, int i_query, ... )
 
 enum output_query_e
 {
-    VOUT_GET_SIZE,         /* arg1= unsigned int*, arg2= unsigned int*, res= */
     VOUT_SET_SIZE,         /* arg1= unsigned int, arg2= unsigned int, res= */
     VOUT_SET_STAY_ON_TOP,  /* arg1= bool       res=    */
     VOUT_REPARENT,
index e7dfb1ef2e2c9ec1a378441d4ab7a7cacba49b6e..0dff96afe31ad18f6de572b2778e5ebef8e1d942 100644 (file)
@@ -699,14 +699,6 @@ int MainInterface::controlVideo( int i_query, va_list args )
     int i_ret = VLC_SUCCESS;
     switch( i_query )
     {
-        case VOUT_GET_SIZE:
-        {
-            unsigned int *pi_width  = va_arg( args, unsigned int * );
-            unsigned int *pi_height = va_arg( args, unsigned int * );
-            *pi_width = videoWidget->videoSize.width();
-            *pi_height = videoWidget->videoSize.height();
-            break;
-        }
         case VOUT_SET_SIZE:
         {
             unsigned int i_width  = va_arg( args, unsigned int );
index b904ff9b9ebd15ecac4cf1f01e5e27c0f691f7b6..25ef4942081bb70f25f5dcee1508bf4b943e5550 100644 (file)
@@ -140,15 +140,6 @@ static int Control (vout_window_t *wnd, int query, va_list ap)
 {
     switch (query)
     {
-        case VOUT_GET_SIZE:
-        {
-            unsigned int *pi_width = va_arg (ap, unsigned int *);
-            unsigned int *pi_height = va_arg (ap, unsigned int *);
-            *pi_width = wnd->width;
-            *pi_height = wnd->height;
-            return VLC_SUCCESS;
-        }
-
         case VOUT_SET_SIZE: /* not allowed */
         case VOUT_SET_STAY_ON_TOP: /* not allowed either, would be ugly */
             return VLC_EGENERIC;
index 873321ac4731cda41c0ac5d24c2576ec4bb6dc58..9fe3c95705c0ce773aaf9aacf82f6f61a9ba59e3 100644 (file)
@@ -1044,19 +1044,6 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
 
     switch( i_query )
     {
-    case VOUT_GET_SIZE:
-        if( p_vout->p_sys->parent_window )
-            return vaControlParentWindow( p_vout, i_query, args );
-
-        pi_width  = va_arg( args, unsigned int * );
-        pi_height = va_arg( args, unsigned int * );
-
-        GetClientRect( p_vout->p_sys->hwnd, &rect_window );
-
-        *pi_width  = rect_window.right - rect_window.left;
-        *pi_height = rect_window.bottom - rect_window.top;
-        return VLC_SUCCESS;
-
     case VOUT_SET_SIZE:
         if( p_vout->p_sys->parent_window )
             return vaControlParentWindow( p_vout, i_query, args );
index e715339af6e5ab886ab2e2603c8fe1a32459e3bb..699a8cc550c1fe1a0652c9338babf04c6846be7f 100644 (file)
@@ -3128,18 +3128,6 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
 
     switch( i_query )
     {
-        case VOUT_GET_SIZE:
-            if( p_vout->p_sys->p_win->owner_window )
-                return vout_ControlWindow( p_vout->p_sys->p_win->owner_window,
-                                           i_query, args);
-
-            pi_width  = va_arg( args, unsigned int * );
-            pi_height = va_arg( args, unsigned int * );
-
-            *pi_width  = p_vout->p_sys->p_win->i_width;
-            *pi_height = p_vout->p_sys->p_win->i_height;
-            return VLC_SUCCESS;
-
         case VOUT_SET_SIZE:
             if( p_vout->p_sys->p_win->owner_window )
                 return vout_ControlWindow( p_vout->p_sys->p_win->owner_window,
index 476eb4303e88e1d05c4bd2124c40aeba443cde18..0751e7563328f579fbe553b075d5c4191fe182c5 100644 (file)
@@ -1265,6 +1265,14 @@ static void* RunThread( void *p_this )
             break;
         }
 
+        while( p_vout->i_changes & VOUT_ON_TOP_CHANGE )
+        {
+            p_vout->i_changes &= ~VOUT_ON_TOP_CHANGE;
+            vlc_mutex_unlock( &p_vout->change_lock );
+            vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, p_vout->b_on_top );
+            vlc_mutex_lock( &p_vout->change_lock );
+        }
+
         if( p_vout->i_changes & VOUT_SIZE_CHANGE )
         {
             /* this must only happen when the vout plugin is incapable of
index 8160e854a4a3674f53eb0c1b7b8ea4646a94ddfb..7cb21e89c1811ba9a6aeaba04f24f78798f53af7 100644 (file)
@@ -1221,13 +1221,17 @@ static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
-    vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, newval.b_bool );
-    (void)psz_cmd; (void)oldval; (void)p_data;
+
+    vlc_mutex_lock( &p_vout->change_lock );
+    p_vout->i_changes |= VOUT_ON_TOP_CHANGE;
+    p_vout->b_on_top = newval.b_bool;
+    vlc_mutex_unlock( &p_vout->change_lock );
 
     /* Modify libvlc as well because the vout might have to be restarted */
     var_Create( p_vout->p_libvlc, "video-on-top", VLC_VAR_BOOL );
     var_Set( p_vout->p_libvlc, "video-on-top", newval );
 
+    (void)psz_cmd; (void)oldval; (void)p_data;
     return VLC_SUCCESS;
 }