#endif
#include <vlc/vlc.h>
+#include <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_vout.h>
* Module descriptor
*****************************************************************************/
-static vlc_bool_t _got_vista_or_above;
+static bool _got_vista_or_above;
static int get_capability_for_osversion(void)
{
if( winVer.dwMajorVersion > 5 )
{
/* Windows Vista or above, make this module the default */
- _got_vista_or_above = VLC_TRUE;
+ _got_vista_or_above = true;
return 150;
}
}
/* Windows XP or lower, make sure this module isn't the default */
- _got_vista_or_above = VLC_FALSE;
+ _got_vista_or_above = false;
return 50;
}
set_shortname( "Direct3D" );
set_category( CAT_VIDEO );
set_subcategory( SUBCAT_VIDEO_VOUT );
- set_description( _("DirectX 3D video output") );
+ set_description( N_("DirectX 3D video output") );
set_capability( "video output", get_capability_for_osversion() );
add_shortcut( "direct3d" );
set_callbacks( OpenVideo, CloseVideo );
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
- {
- msg_Err( p_vout, "out of memory" );
return VLC_ENOMEM;
- }
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
if( VLC_SUCCESS != Direct3DVoutCreate( p_vout ) )
p_vout->p_sys->hwnd = p_vout->p_sys->hvideownd = NULL;
p_vout->p_sys->hparent = p_vout->p_sys->hfswnd = NULL;
p_vout->p_sys->i_changes = 0;
- vlc_mutex_init( p_vout, &p_vout->p_sys->lock );
+ vlc_mutex_init( &p_vout->p_sys->lock );
SetRectEmpty( &p_vout->p_sys->rect_display );
SetRectEmpty( &p_vout->p_sys->rect_parent );
p_vout->p_sys->b_cursor_hidden = 0;
p_vout->p_sys->i_lastmoved = mdate();
+ p_vout->p_sys->i_mouse_hide_timeout =
+ var_GetInteger(p_vout, "mouse-hide-timeout") * 1000;
var_Create( p_vout, "video-title", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_vout, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
vlc_object_create( p_vout, sizeof(event_thread_t) );
p_vout->p_sys->p_event->p_vout = p_vout;
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- E_(EventThread), 0, 1 ) )
+ EventThread, 0, 1 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
vlc_object_release( p_vout->p_sys->p_event );
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
p_vout->fmt_out = p_vout->fmt_in;
- E_(UpdateRects)( p_vout, VLC_TRUE );
+ UpdateRects( p_vout, true );
/* create picture pool */
p_vout->output.i_chroma = 0;
p_vout->fmt_out.i_sar_num = p_vout->fmt_in.i_sar_num;
p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
- E_(UpdateRects)( p_vout, VLC_TRUE );
+ UpdateRects( p_vout, true );
}
/* We used to call the Win32 PeekMessage function here to read the window
* Pointer change
*/
if( p_vout->b_fullscreen && !p_vout->p_sys->b_cursor_hidden &&
- (mdate() - p_vout->p_sys->i_lastmoved) > 5000000 )
+ (mdate() - p_vout->p_sys->i_lastmoved) >
+ p_vout->p_sys->i_mouse_hide_timeout )
{
POINT point;
HWND hwnd;
SWP_NOSIZE | SWP_NOMOVE );
}
- p_vout->p_sys->b_on_top_change = VLC_FALSE;
+ p_vout->p_sys->b_on_top_change = false;
}
/* Check if the event thread is still running */
}
p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE;
- p_pic->b_slow = VLC_TRUE;
+ p_pic->b_slow = true;
p_pic->pf_lock = Direct3DVoutLockSurface;
p_pic->pf_unlock = Direct3DVoutUnlockSurface;
PP_OUTPUTPICTURE[c] = p_pic;
}
/* Setup vertices */
- f_width = (float)(p_vout->output.i_width);
- f_height = (float)(p_vout->output.i_height);
+ f_width = (float)(p_vout->output.i_width) + 1;
+ f_height = (float)(p_vout->output.i_height) + 1;
p_vertices[0].x = 0.0f; // left
p_vertices[0].y = 0.0f; // top