Commit eff9d25c authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx/*: first try at multimonitor support (untested).

* src/video_output/video_output.c: small change to allow the directx plugin to destroy/recreate picture buffers on the fly.
parent 658d4d7a
......@@ -2,7 +2,7 @@
* video_output.h : video output thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.106 2003/12/09 19:15:03 yoann Exp $
* $Id: video_output.h,v 1.107 2003/12/11 23:12:46 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -177,6 +177,8 @@ struct vout_thread_t
#define VOUT_DEPTH_CHANGE 0x0400
/** change chroma tables */
#define VOUT_CHROMA_CHANGE 0x0800
/** change/recreate picture buffers */
#define VOUT_PICTURE_BUFFERS_CHANGE 0x1000
/**@}*/
/* Alignment flags */
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* events.c: Windows DirectX video output events handler
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: events.c,v 1.31 2003/12/08 19:50:22 gbazin Exp $
* $Id: events.c,v 1.32 2003/12/11 23:12:46 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -269,7 +269,6 @@ void DirectXEventThread( event_thread_t *p_event )
static int DirectXCreateWindow( vout_thread_t *p_vout )
{
HINSTANCE hInstance;
HDC hdc;
HMENU hMenu;
RECT rect_window;
......@@ -280,17 +279,6 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
/* Get this module's instance */
hInstance = GetModuleHandle(NULL);
/* Get the current size of the display and its colour depth */
hdc = GetDC( NULL );
p_vout->p_sys->rect_display.right = GetDeviceCaps( hdc, HORZRES );
p_vout->p_sys->rect_display.bottom = GetDeviceCaps( hdc, VERTRES );
p_vout->p_sys->i_display_depth = GetDeviceCaps( hdc, BITSPIXEL );
msg_Dbg( p_vout, "screen dimensions %ix%i colour depth %i",
p_vout->p_sys->rect_display.right,
p_vout->p_sys->rect_display.bottom,
p_vout->p_sys->i_display_depth );
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 =
......@@ -502,13 +490,16 @@ void DirectXUpdateRects( vout_thread_t *p_vout, vlc_bool_t b_force )
rect_dest.top = point.y + i_y;
rect_dest.bottom = rect_dest.top + i_height;
/* UpdateOverlay directdraw function doesn't automatically clip to the
* display size so we need to do it otherwise it will fail */
/* Clip the destination window */
IntersectRect( &rect_dest_clipped, &rect_dest,
&p_vout->p_sys->rect_display );
if( !IntersectRect( &rect_dest_clipped, &rect_dest,
&p_vout->p_sys->rect_display ) )
{
SetRectEmpty( &rect_src_clipped );
return;
}
#if 0
msg_Dbg( p_vout, "DirectXUpdateRects image_dst_clipped coords:"
......@@ -550,18 +541,8 @@ void DirectXUpdateRects( vout_thread_t *p_vout, vlc_bool_t b_force )
rect_src_clipped.right, rect_src_clipped.bottom );
#endif
/* Signal the size change */
if( !p_vout->p_sys->p_event->b_die )
{
if( p_vout->p_sys->b_using_overlay )
{
DirectXUpdateOverlay( p_vout );
}
else
{
p_vout->p_sys->i_changes |= VOUT_SIZE_CHANGE;
}
}
/* Signal the change in size/position */
p_vout->p_sys->i_changes |= DX_POSITION_CHANGE;
#undef rect_src
#undef rect_src_clipped
......
......@@ -2,7 +2,7 @@
* vout.h: Windows DirectX video output header file
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout.h,v 1.9 2003/11/20 17:48:44 gbazin Exp $
* $Id: vout.h,v 1.10 2003/12/11 23:12:46 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -51,6 +51,12 @@ struct vout_sys_t
HWND hparent; /* Handle of the parent window */
WNDPROC pf_wndproc; /* Window handling callback */
/* Multi-monitor support */
HMONITOR hmonitor; /* handle of the current monitor */
GUID *p_display_driver;
HMONITOR (WINAPI* MonitorFromWindow)( HWND, DWORD );
BOOL (WINAPI* GetMonitorInfo)( HMONITOR, LPMONITORINFO );
vlc_bool_t b_using_overlay; /* Are we using an overlay surface */
vlc_bool_t b_use_sysmem; /* Should we use system memory for surfaces */
vlc_bool_t b_hw_yuv; /* Should we use hardware YUV->RGB conversions */
......@@ -121,3 +127,4 @@ void DirectXUpdateRects ( vout_thread_t *p_vout, vlc_bool_t b_force );
#define WM_VLC_CREATE_VIDEO_WIN WM_APP + 1
#define WM_VLC_DESTROY_VIDEO_WIN WM_APP + 2
#define IDM_TOGGLE_ON_TOP WM_USER + 1
#define DX_POSITION_CHANGE 0x1000
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.241 2003/11/26 08:18:09 gbazin Exp $
* $Id: video_output.c,v 1.242 2003/12/11 23:12:46 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -1008,6 +1008,31 @@ static void RunThread( vout_thread_t *p_vout)
p_vout->chroma.p_module->pf_activate( VLC_OBJECT(p_vout) );
}
}
if( p_vout->i_changes & VOUT_PICTURE_BUFFERS_CHANGE )
{
/* This happens when the picture buffers need to be recreated.
* This is useful on multimonitor displays for instance.
*
* Warning: This only works when the vout creates only 1 picture
* buffer!! */
p_vout->i_changes &= ~VOUT_PICTURE_BUFFERS_CHANGE;
if( !p_vout->b_direct )
{
module_Unneed( p_vout, p_vout->chroma.p_module );
}
vlc_mutex_lock( &p_vout->picture_lock );
p_vout->pf_end( p_vout );
I_OUTPUTPICTURES = I_RENDERPICTURES = 0;
p_vout->b_error = InitThread( p_vout );
vlc_mutex_unlock( &p_vout->picture_lock );
}
}
/*
......
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