/*****************************************************************************
* direct3d.c: Windows Direct3D video output module
*****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2009 the VideoLAN team
*$Id$
*
* Authors: Damien Fouilleul <damienf@videolan.org>
static int OpenVideo( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- vlc_value_t val;
/* Allocate structure */
- p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
+ p_vout->p_sys = calloc( 1, sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return VLC_ENOMEM;
- memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
-
if( VLC_SUCCESS != Direct3DVoutCreate( p_vout ) )
{
msg_Err( p_vout, "Direct3D could not be initialized !");
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
- var_Get( p_vout, "video-on-top", &val );
- var_Set( p_vout, "video-on-top", val );
+ var_TriggerCallback( p_vout, "video-on-top" );
/* disable screensaver by temporarily changing system settings */
p_vout->p_sys->i_spi_lowpowertimeout = 0;
p_vout->p_sys->i_spi_powerofftimeout = 0;
p_vout->p_sys->i_spi_screensavetimeout = 0;
- var_Get( p_vout, "disable-screensaver", &val);
- if( val.b_bool ) {
+ if( var_GetBool( p_vout, "disable-screensaver" ) ) {
msg_Dbg(p_vout, "disabling screen saver");
SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
}
return VLC_SUCCESS;
- error:
+error:
CloseVideo( VLC_OBJECT(p_vout) );
return VLC_EGENERIC;
}
static int Init( vout_thread_t *p_vout )
{
int i_ret;
- vlc_value_t val;
- var_Get( p_vout, "directx-hw-yuv", &val );
- p_vout->p_sys->b_hw_yuv = val.b_bool;
+ p_vout->p_sys->b_hw_yuv = var_GetBool( p_vout, "directx-hw-yuv" );
/* Initialise Direct3D */
if( VLC_SUCCESS != Direct3DVoutOpen( p_vout ) )
/*****************************************************************************
* vout.c: Windows DirectX video output display method
*****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
HMODULE huser32;
/* Allocate structure */
- p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
+ p_vout->p_sys = calloc( 1, sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return VLC_ENOMEM;
- memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
/* Initialisations */
p_vout->pf_init = Init;
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
- var_Get( p_vout, "video-on-top", &val );
- var_Set( p_vout, "video-on-top", val );
+ var_TriggerCallback( p_vout, "video-on-top" );
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
val.psz_string = _("Wallpaper");
var_Change( p_vout, "directx-wallpaper", VLC_VAR_SETTEXT, &val, NULL );
var_AddCallback( p_vout, "directx-wallpaper", WallpaperCallback, NULL );
- var_Get( p_vout, "directx-wallpaper", &val );
- var_Set( p_vout, "directx-wallpaper", val );
+ var_TriggerCallback( p_vout, "directx-wallpaper" );
/* disable screensaver by temporarily changing system settings */
p_vout->p_sys->i_spi_lowpowertimeout = 0;
p_vout->p_sys->i_spi_powerofftimeout = 0;
p_vout->p_sys->i_spi_screensavetimeout = 0;
- var_Get( p_vout, "disable-screensaver", &val);
- if( val.b_bool ) {
+ if( var_GetBool( p_vout, "disable-screensaver" ) ) {
msg_Dbg(p_vout, "disabling screen saver");
SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);
static int Init( vout_thread_t *p_vout )
{
int i_chroma_backup;
- vlc_value_t val;
/* Get a few default parameters */
- var_Get( p_vout, "overlay", &val );
- p_vout->p_sys->b_using_overlay = val.b_bool;
- var_Get( p_vout, "directx-use-sysmem", &val );
- p_vout->p_sys->b_use_sysmem = val.b_bool;
- var_Get( p_vout, "directx-hw-yuv", &val );
- p_vout->p_sys->b_hw_yuv = val.b_bool;
- var_Get( p_vout, "directx-3buffering", &val );
- p_vout->p_sys->b_3buf_overlay = val.b_bool;
+ p_vout->p_sys->b_using_overlay = var_GetBool( p_vout, "overlay" );
+ p_vout->p_sys->b_use_sysmem = var_GetBool( p_vout, "directx-use-sysmem" );
+ p_vout->p_sys->b_hw_yuv = var_GetBool( p_vout, "directx-hw-yuv" );
+ p_vout->p_sys->b_3buf_overlay = var_GetBool( p_vout, "directx-3buffering" );
/* Initialise DirectDraw if not already done.
* We do this here because on multi-monitor systems we may have to
/*****************************************************************************
* events.c: Windows DirectX video output events handler
*****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
p_event->p_vout->fmt_in.i_y_offset;
var_Set( p_event->p_vout, "mouse-y", val );
- val.b_bool = true;
- var_Set( p_event->p_vout, "mouse-moved", val );
+ var_SetBool( p_event->p_vout, "mouse-moved", true );
}
case WM_NCMOUSEMOVE:
PostMessage( p_vout->p_sys->hwnd, WM_VLC_SHOW_MOUSE, 0, 0 );
}
- vlc_value_t val;
/* Update the object variable and trigger callback */
- val.b_bool = p_vout->b_fullscreen;
- var_Set( p_vout, "fullscreen", val );
+ var_SetBool( p_vout, "fullscreen", p_vout->b_fullscreen );
}
/*****************************************************************************
* glwin32.c: Windows OpenGL provider
*****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
static int OpenVideo( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- vlc_value_t val;
/* Allocate structure */
- p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
+ p_vout->p_sys = calloc( 1, sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return VLC_ENOMEM;
- memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
/* Initialisations */
p_vout->pf_init = Init;
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
- var_Get( p_vout, "video-on-top", &val );
- var_Set( p_vout, "video-on-top", val );
+ var_TriggerCallback( p_vout, "video-on-top" );
return VLC_SUCCESS;
/*****************************************************************************
* vout.h: Windows video output header file
*****************************************************************************
- * Copyright (C) 2001-2004 the VideoLAN team
+ * Copyright (C) 2001-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
/*****************************************************************************
* wingdi.c : Win32 / WinCE GDI video output plugin for vlc
*****************************************************************************
- * Copyright (C) 2002 the VideoLAN team
+ * Copyright (C) 2002-2009 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
static int OpenVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
- vlc_value_t val;
- p_vout->p_sys = (vout_sys_t *)malloc( sizeof(vout_sys_t) );
+ p_vout->p_sys = (vout_sys_t *)calloc( 1, sizeof(vout_sys_t) );
if( !p_vout->p_sys ) return VLC_ENOMEM;
- memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
#ifdef MODULE_NAME_IS_wingapi
/* Load GAPI */
#ifndef UNDER_CE
/* Variable to indicate if the window should be on top of others */
/* Trigger a callback right now */
- var_Get( p_vout, "video-on-top", &val );
- var_Set( p_vout, "video-on-top", val );
+ var_TriggerCallback( p_vout, "video-on-top" );
/* disable screensaver by temporarily changing system settings */
p_vout->p_sys->i_spi_lowpowertimeout = 0;
p_vout->p_sys->i_spi_powerofftimeout = 0;
p_vout->p_sys->i_spi_screensavetimeout = 0;
- var_Get( p_vout, "disable-screensaver", &val);
- if( val.b_bool ) {
+ if( var_GetBool( p_vout, "disable-screensaver" ) ) {
msg_Dbg(p_vout, "disabling screen saver");
SystemParametersInfo(SPI_GETLOWPOWERTIMEOUT,
0, &(p_vout->p_sys->i_spi_lowpowertimeout), 0);