Commit b2149863 authored by Gildas Bazin's avatar Gildas Bazin

* ALL: new main --video-on-top config option (in use by the x11/xvideo/osx/directx video outputs.)
* modules/video_output/x11/*: implemented support for "video on top". Will likely only work with KDE for now.
parent 1ddac121
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.m,v 1.56 2003/11/20 14:39:30 hartman Exp $
* $Id: controls.m,v 1.57 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -713,7 +713,7 @@
if ( [[o_mi title] isEqualToString: _NS("Float On Top")] )
{
int i_state = config_GetInt( p_playlist, "macosx-float" ) ?
int i_state = config_GetInt( p_playlist, "video-on-top" ) ?
NSOnState : NSOffState;
[o_mi setState: i_state];
}
......
......@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.15 2003/06/17 16:09:16 gbazin Exp $
* $Id: macosx.m,v 1.16 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu>
......@@ -54,10 +54,6 @@ void E_(CloseVideo) ( vlc_object_t * );
"Set the transparency of the video output. 1 is non-transparent (default) " \
"0 is fully transparent.")
#define FLOAT_TEXT N_("Always float on top")
#define FLOAT_LONGTEXT N_( \
"Let the video window float on top of other windows.")
vlc_module_begin();
set_description( _("MacOS X interface, sound and video") );
set_capability( "interface", 100 );
......@@ -69,6 +65,5 @@ vlc_module_begin();
add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_LONGTEXT, VLC_FALSE );
add_float_with_range( "macosx-opaqueness", 1, 0, 1, NULL, OPAQUENESS_TEXT,
OPAQUENESS_LONGTEXT, VLC_TRUE );
add_bool( "macosx-float", 0, NULL, FLOAT_TEXT, FLOAT_LONGTEXT, VLC_FALSE );
vlc_module_end();
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.65 2003/11/15 22:42:16 hartman Exp $
* $Id: vout.m,v 1.66 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -791,14 +791,14 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
- (void)toggleFloatOnTop
{
if( config_GetInt( p_vout, "macosx-float" ) )
if( config_GetInt( p_vout, "video-on-top" ) )
{
config_PutInt( p_vout, "macosx-float", 0 );
config_PutInt( p_vout, "video-on-top", 0 );
[p_vout->p_sys->o_window setLevel: NSNormalWindowLevel];
}
else
{
config_PutInt( p_vout, "macosx-float", 1 );
config_PutInt( p_vout, "video-on-top", 1 );
[p_vout->p_sys->o_window setLevel: NSStatusWindowLevel];
}
}
......@@ -1250,7 +1250,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
[p_vout->p_sys->o_window setAlphaValue: config_GetFloat( p_vout, "macosx-opaqueness" )];
if( config_GetInt( p_vout, "macosx-float" ) )
if( config_GetInt( p_vout, "video-on-top" ) )
{
[p_vout->p_sys->o_window setLevel: NSStatusWindowLevel];
}
......
......@@ -2,7 +2,7 @@
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: menus.cpp,v 1.28 2003/11/29 16:36:56 gbazin Exp $
* $Id: menus.cpp,v 1.29 2003/12/08 19:50:21 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -146,11 +146,7 @@ void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "crop";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "directx-on-top";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "xvideo-on-top";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "x11-on-top";
ppsz_varnames[i] = "video-on-top";
pi_objects[i++] = p_object->i_object_id;
p_dec_obj = (vlc_object_t *)vlc_object_find( p_object,
......
......@@ -2,7 +2,7 @@
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: directx.c,v 1.25 2003/11/20 17:48:44 gbazin Exp $
* $Id: directx.c,v 1.26 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -93,8 +93,6 @@ static int OnTopCallback( vlc_object_t *, char const *,
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define ON_TOP_TEXT N_("Always on top")
#define ON_TOP_LONGTEXT N_("Place the directx window on top of other windows")
#define HW_YUV_TEXT N_("Use hardware YUV->RGB conversions")
#define HW_YUV_LONGTEXT N_( \
"Try to use hardware acceleration for YUV->RGB conversions. " \
......@@ -112,7 +110,6 @@ static int OnTopCallback( vlc_object_t *, char const *,
vlc_module_begin();
add_category_hint( N_("Video"), NULL, VLC_FALSE );
add_bool( "directx-on-top", 0, NULL, ON_TOP_TEXT, ON_TOP_LONGTEXT, VLC_FALSE );
add_bool( "directx-hw-yuv", 1, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT, VLC_TRUE );
add_bool( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT, VLC_TRUE );
add_bool( "directx-3buffering", 1, NULL, TRIPLEBUF_TEXT, TRIPLEBUF_LONGTEXT, VLC_TRUE );
......@@ -221,12 +218,12 @@ static int OpenVideo( vlc_object_t *p_this )
}
/* Add a variable to indicate if the window should be on top of others */
var_Create( p_vout, "directx-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
text.psz_string = _("Always on top");
var_Change( p_vout, "directx-on-top", VLC_VAR_SETTEXT, &text, NULL );
var_Get( p_vout, "directx-on-top", &val );
var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL );
var_Get( p_vout, "video-on-top", &val );
p_vout->p_sys->b_on_top_change = val.b_bool;
var_AddCallback( p_vout, "directx-on-top", OnTopCallback, NULL );
var_AddCallback( p_vout, "video-on-top", OnTopCallback, NULL );
return VLC_SUCCESS;
......@@ -343,7 +340,7 @@ static void CloseVideo( vlc_object_t *p_this )
msg_Dbg( p_vout, "CloseVideo" );
var_Destroy( p_vout, "directx-on-top" );
var_Destroy( p_vout, "video-on-top" );
if( p_vout->p_sys->p_event )
{
......@@ -483,7 +480,7 @@ static int Manage( vout_thread_t *p_vout )
vlc_value_t val;
HMENU hMenu = GetSystemMenu( p_vout->p_sys->hwnd, FALSE );
var_Get( p_vout, "directx-on-top", &val );
var_Get( p_vout, "video-on-top", &val );
/* Set the window on top if necessary */
if( val.b_bool && !( GetWindowLong( p_vout->p_sys->hwnd, GWL_EXSTYLE )
......
......@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.30 2003/11/20 17:48:44 gbazin Exp $
* $Id: events.c,v 1.31 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -646,11 +646,11 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
msg_Dbg( p_vout, "WinProc WM_SYSCOMMAND: IDM_TOGGLE_ON_TOP");
/* Get the current value... */
if( var_Get( p_vout, "directx-on-top", &val ) < 0 )
if( var_Get( p_vout, "video-on-top", &val ) < 0 )
return 0;
/* ...and change it */
val.b_bool = !val.b_bool;
var_Set( p_vout, "directx-on-top", val );
var_Set( p_vout, "video-on-top", val );
return 0;
break;
}
......
......@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.39 2003/12/04 16:02:54 sam Exp $
* $Id: xcommon.c,v 1.40 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -119,9 +119,12 @@ static void SetPalette ( vout_thread_t *,
#endif
static void TestNetWMSupport( vout_thread_t * );
static int ConvertKey( int );
/* Object variables callbacks */
static int OnTopCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
/*****************************************************************************
* Activate: allocate X11 video thread output method
*****************************************************************************
......@@ -132,7 +135,9 @@ static int ConvertKey( int );
int E_(Activate) ( vlc_object_t *p_this )
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
char * psz_display;
char * psz_display;
vlc_value_t val, text;
#ifdef MODULE_NAME_IS_xvideo
char * psz_chroma;
vlc_fourcc_t i_chroma = 0;
......@@ -276,6 +281,15 @@ int E_(Activate) ( vlc_object_t *p_this )
TestNetWMSupport( p_vout );
/* Add a variable to indicate if the window should be on top of others */
var_Create( p_vout, "video-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
text.psz_string = _("Always on top");
var_Change( p_vout, "video-on-top", VLC_VAR_SETTEXT, &text, NULL );
var_AddCallback( p_vout, "video-on-top", OnTopCallback, NULL );
/* Trigger a callback right now */
var_Get( p_vout, "video-on-top", &val );
var_Set( p_vout, "video-on-top", val );
return VLC_SUCCESS;
}
......@@ -2182,3 +2196,35 @@ static int ConvertKey( int i_key )
return 0;
}
/*****************************************************************************
* object variables callbacks: a bunch of object variables are used by the
* interfaces to interact with the vout.
*****************************************************************************/
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;
if( p_vout->p_sys->b_net_wm_state_stays_on_top )
{
XClientMessageEvent event;
memset( &event, 0, sizeof( XClientMessageEvent ) );
event.type = ClientMessage;
event.message_type = p_vout->p_sys->net_wm_state;
event.display = p_vout->p_sys->p_display;
event.window = p_vout->p_sys->p_win->base_window;
event.format = 32;
event.data.l[ 0 ] = newval.b_bool; /* set property */
event.data.l[ 1 ] = p_vout->p_sys->net_wm_state_stays_on_top;
XSendEvent( p_vout->p_sys->p_display,
DefaultRootWindow( p_vout->p_sys->p_display ),
False, SubstructureRedirectMask,
(XEvent*)&event );
}
return VLC_SUCCESS;
}
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.113 2003/12/07 20:48:21 hartman Exp $
* $Id: libvlc.h,v 1.114 2003/12/08 19:50:22 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -221,6 +221,10 @@ static char *ppsz_language_text[] =
"If enabled, VLC will try to take advantage of the overlay capabilities " \
"of your graphics card.")
#define VIDEO_ON_TOP_TEXT N_("Always on top")
#define VIDEO_ON_TOP_LONGTEXT N_("Always place the video window on top of " \
"other windows" )
#define SPUMARGIN_TEXT N_("Force SPU position")
#define SPUMARGIN_LONGTEXT N_( \
"You can use this option to place the subtitles under the movie, " \
......@@ -664,6 +668,8 @@ vlc_module_begin();
#ifndef SYS_DARWIN
add_bool( "overlay", 1, NULL, OVERLAY_TEXT, OVERLAY_LONGTEXT, VLC_TRUE );
#endif
add_bool( "video-on-top", 0, NULL, VIDEO_ON_TOP_TEXT, VIDEO_ON_TOP_LONGTEXT, VLC_FALSE );
add_integer( "spumargin", -1, NULL, SPUMARGIN_TEXT,
SPUMARGIN_LONGTEXT, VLC_TRUE );
add_bool( "osd", 1, NULL, OSD_TEXT, OSD_LONGTEXT, VLC_FALSE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment