Commit b6b1bef8 authored by Sam Hocevar's avatar Sam Hocevar

* ./mozilla/vlcshell.cpp: fixed the Mozilla plugin's target drawable.

  * ./modules/video_output/directx/directx.c, ./modules/video_output/x11/x11.c,
    ./modules/video_output/x11/xvideo.c: removed the drawable configuration
    variables which are now deprecated.
parent 79264035
......@@ -2,7 +2,7 @@
* vout.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: directx.c,v 1.11 2003/02/01 09:40:50 babal Exp $
* $Id: directx.c,v 1.12 2003/02/01 18:54:10 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -102,17 +102,12 @@ static int DirectXGetSurfaceDesc ( vout_thread_t *p_vout, picture_t *p_pic );
"isn't recommended as usually using video memory allows to benefit from " \
"more hardware acceleration (like rescaling or YUV->RGB conversions). " \
"This option doesn't have any effect when using overlays." )
#define WINDOW_TEXT N_("specify an existing window")
#define WINDOW_LONGTEXT N_( \
"Specify a window to use instead of opening a new one. This option is " \
"DANGEROUS, use with care." )
vlc_module_begin();
add_category_hint( N_("Video"), NULL );
add_bool( "directx-on-top", 0, NULL, ON_TOP_TEXT, ON_TOP_LONGTEXT );
add_bool( "directx-hw-yuv", 1, NULL, HW_YUV_TEXT, HW_YUV_LONGTEXT );
add_bool( "directx-use-sysmem", 0, NULL, SYSMEM_TEXT, SYSMEM_LONGTEXT );
add_integer( "directx-window", 0, NULL, WINDOW_TEXT, WINDOW_LONGTEXT );
set_description( _("DirectX video module") );
set_capability( "video output", 100 );
add_shortcut( "directx" );
......
......@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.10 2003/01/27 01:42:19 ipkiss Exp $
* $Id: events.c,v 1.11 2003/02/01 18:54:10 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -280,6 +280,8 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
HMENU hMenu;
RECT rect_window;
vlc_value_t val;
msg_Dbg( p_vout, "DirectXCreateWindow" );
/* Get this module's instance */
......@@ -323,8 +325,9 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
ReleaseDC( NULL, hdc );
/* If an external window was specified, we'll draw in it. */
var_Get( p_vout->p_vlc, "drawable", &val );
p_vout->p_sys->hparent = p_vout->p_sys->hwnd =
(void*)(ptrdiff_t)config_GetInt( p_vout, "directx-window" );
val.i_int ? (void*)(ptrdiff_t) val.i_int : NULL;
if( p_vout->p_sys->hparent )
{
......
......@@ -2,7 +2,7 @@
* x11.c : X11 plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: x11.c,v 1.2 2002/08/26 09:12:46 sam Exp $
* $Id: x11.c,v 1.3 2003/02/01 18:54:10 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -54,11 +54,6 @@ extern void E_(Deactivate) ( vlc_object_t * );
"Specify the X11 hardware display you want to use. By default vlc will " \
"use the value of the DISPLAY environment variable.")
#define DRAWABLE_TEXT N_("X11 drawable")
#define DRAWABLE_LONGTEXT N_( \
"Specify a X11 drawable to use instead of opening a new window. This " \
"option is DANGEROUS, use with care.")
#define SHM_TEXT N_("use shared memory")
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between vlc and the X server.")
......@@ -67,7 +62,6 @@ vlc_module_begin();
add_category_hint( N_("X11"), NULL );
add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT );
add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT );
add_integer( "x11-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT );
#ifdef HAVE_SYS_SHM_H
add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT );
#endif
......
......@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.12 2003/01/28 16:57:28 sam Exp $
* $Id: xcommon.c,v 1.13 2003/02/01 18:54:10 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -111,7 +111,8 @@ static void XVideoReleasePort( vout_thread_t *, int );
#endif
#ifdef MODULE_NAME_IS_x11
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
static void SetPalette ( vout_thread_t *,
uint16_t *, uint16_t *, uint16_t * );
#endif
/*****************************************************************************
......@@ -822,6 +823,7 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
vlc_bool_t b_configure_notify;
vlc_bool_t b_map_notify;
vlc_value_t val;
long long int i_drawable;
/* Prepare window manager hints and properties */
......@@ -840,10 +842,10 @@ static int CreateWindow( vout_thread_t *p_vout, x11_window_t *p_win )
xwindow_attributes.event_mask = ExposureMask | StructureNotifyMask;
/* Check whether someone provided us with a window ID */
i_drawable = p_vout->b_fullscreen ?
-1 : config_GetInt( p_vout, MODULE_STRING "-drawable");
var_Get( p_vout->p_vlc, "drawable", &val );
i_drawable = p_vout->b_fullscreen ? 0 : val.i_int;
if( i_drawable == -1 )
if( !i_drawable )
{
p_win->b_owned = VLC_TRUE;
......@@ -1424,10 +1426,13 @@ static void EnableXScreenSaver( vout_thread_t *p_vout )
int dummy;
#endif
XSetScreenSaver( p_vout->p_sys->p_display, p_vout->p_sys->i_ss_timeout,
p_vout->p_sys->i_ss_interval,
p_vout->p_sys->i_ss_blanking,
p_vout->p_sys->i_ss_exposure );
if( p_vout->p_sys->i_ss_timeout )
{
XSetScreenSaver( p_vout->p_sys->p_display, p_vout->p_sys->i_ss_timeout,
p_vout->p_sys->i_ss_interval,
p_vout->p_sys->i_ss_blanking,
p_vout->p_sys->i_ss_exposure );
}
/* Restore DPMS settings */
#ifdef DPMSINFO_IN_DPMS_H
......@@ -1459,10 +1464,13 @@ static void DisableXScreenSaver( vout_thread_t *p_vout )
&p_vout->p_sys->i_ss_exposure );
/* Disable screen saver */
XSetScreenSaver( p_vout->p_sys->p_display, 0,
p_vout->p_sys->i_ss_interval,
p_vout->p_sys->i_ss_blanking,
p_vout->p_sys->i_ss_exposure );
if( p_vout->p_sys->i_ss_timeout )
{
XSetScreenSaver( p_vout->p_sys->p_display, 0,
p_vout->p_sys->i_ss_interval,
p_vout->p_sys->i_ss_blanking,
p_vout->p_sys->i_ss_exposure );
}
/* Disable DPMS */
#ifdef DPMSINFO_IN_DPMS_H
......@@ -2027,7 +2035,8 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
static void SetPalette( vout_thread_t *p_vout, u16 *red, u16 *green, u16 *blue )
static void SetPalette( vout_thread_t *p_vout,
uint16_t *red, uint16_t *green, uint16_t *blue )
{
int i;
XColor p_colors[255];
......
......@@ -2,7 +2,7 @@
* xvideo.c : Xvideo plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xvideo.c,v 1.2 2002/08/26 09:12:46 sam Exp $
* $Id: xvideo.c,v 1.3 2003/02/01 18:54:10 sam Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -65,11 +65,6 @@ extern void E_(Deactivate) ( vlc_object_t * );
"Force the XVideo renderer to use a specific chroma format instead of " \
"trying to improve performances by using the most efficient one.")
#define DRAWABLE_TEXT N_("X11 drawable")
#define DRAWABLE_LONGTEXT N_( \
"Specify a X11 drawable to use instead of opening a new window. This " \
"option is DANGEROUS, use with care.")
#define SHM_TEXT N_("use shared memory")
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between vlc and the X server.")
......@@ -80,7 +75,6 @@ vlc_module_begin();
add_integer( "xvideo-adaptor", -1, NULL, ADAPTOR_TEXT, ADAPTOR_LONGTEXT );
add_bool( "xvideo-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT );
add_string( "xvideo-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT );
add_integer( "xvideo-drawable", -1, NULL, DRAWABLE_TEXT, DRAWABLE_LONGTEXT );
#ifdef HAVE_SYS_SHM_H
add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT );
#endif
......
......@@ -2,7 +2,7 @@
* vlcplugin.cpp: a VideoLAN Client plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcplugin.cpp,v 1.2 2002/09/30 11:05:41 sam Exp $
* $Id: vlcplugin.cpp,v 1.3 2003/02/01 18:54:10 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -36,7 +36,7 @@
*****************************************************************************/
VlcPlugin::VlcPlugin( NPP instance )
{
p_instance = instance;
p_instance = instance;
p_peer = NULL;
}
......@@ -71,11 +71,11 @@ VlcIntf* VlcPlugin::GetPeer()
if( !p_peer )
{
p_peer = new VlcPeer( this );
if( p_peer == NULL )
if( p_peer == NULL )
{
return NULL;
}
NS_ADDREF( p_peer );
}
......@@ -113,6 +113,6 @@ void VlcPlugin::SetFileName(const char * filename)
fclose (fh);
fprintf(stderr, "File loaded\n");
#endif
return;
return;
}
......@@ -2,7 +2,7 @@
* vlcshell.c: a VideoLAN Client plugin for Mozilla
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlcshell.cpp,v 1.8 2003/01/28 16:57:28 sam Exp $
* $Id: vlcshell.cpp,v 1.9 2003/02/01 18:54:10 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -289,7 +289,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
{
p_plugin->psz_target = argv[i];
}
#if USE_LIBVLC
else if( !strcmp( argn[i], "loop" ) )
{
......@@ -359,11 +359,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
/* FIXME: this cast sucks */
value.i_int = (int) (ptrdiff_t) (void *) window->window;
VLC_Set( p_plugin->i_vlc, "conf::x11-drawable", value );
VLC_Set( p_plugin->i_vlc, "conf::xvideo-drawable", value );
value.i_int = (int) (ptrdiff_t) (void *) window->window;
VLC_Set( p_plugin->i_vlc, "conf::directx-window", value );
VLC_Set( p_plugin->i_vlc, "drawable", value );
#endif
/*
......@@ -469,7 +465,7 @@ NPError NPP_NewStream( NPP instance, NPMIMEType type, NPStream *stream,
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
#endif
fprintf(stderr, "NPP_NewStream - FILE mode !!\n");
/* fprintf(stderr, "NPP_NewStream - FILE mode !!\n"); */
/* We want a *filename* ! */
*stype = NP_ASFILE;
......@@ -495,7 +491,7 @@ int32 NPP_WriteReady( NPP instance, NPStream *stream )
{
VlcPlugin* p_plugin;
fprintf(stderr, "NPP_WriteReady\n");
/* fprintf(stderr, "NPP_WriteReady\n"); */
if (instance != NULL)
{
......@@ -514,7 +510,7 @@ int32 NPP_WriteReady( NPP instance, NPStream *stream )
int32 NPP_Write( NPP instance, NPStream *stream, int32 offset,
int32 len, void *buffer )
{
fprintf(stderr, "NPP_Write %i\n", (int)len);
/* fprintf(stderr, "NPP_Write %i\n", (int)len); */
if( instance != NULL )
{
......@@ -543,13 +539,13 @@ void NPP_StreamAsFile( NPP instance, NPStream *stream, const char* fname )
return;
}
fprintf(stderr, "NPP_StreamAsFile %s\n", fname);
/* fprintf(stderr, "NPP_StreamAsFile %s\n", fname); */
#if USE_LIBVLC
/* VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata; */
VlcPlugin* p_plugin = (VlcPlugin*)instance->pdata;
/* VLC_AddTarget( p_plugin->i_vlc, fname,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );*/
VLC_AddTarget( p_plugin->i_vlc, fname,
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
#endif
}
......
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