Commit 09bb05db authored by Laurent Aimar's avatar Laurent Aimar

Fixed overlay in directx regression.

parent 3b471fb3
...@@ -381,7 +381,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -381,7 +381,7 @@ static int Init( vout_thread_t *p_vout )
{ {
/* If it still didn't work then don't try to use an overlay */ /* If it still didn't work then don't try to use an overlay */
p_vout->output.i_chroma = i_chroma_backup; p_vout->output.i_chroma = i_chroma_backup;
p_vout->p_sys->b_using_overlay = 0; p_vout->p_sys->b_using_overlay = false;
msg_Warn( p_vout, "Could not initialize directx overlay" ) ; msg_Warn( p_vout, "Could not initialize directx overlay" ) ;
NewPictureVec( p_vout, p_vout->p_picture ); NewPictureVec( p_vout, p_vout->p_picture );
} }
...@@ -397,6 +397,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -397,6 +397,7 @@ static int Init( vout_thread_t *p_vout )
else else
psz_fallback = VOUT_TITLE " (software RGB DirectX output)"; psz_fallback = VOUT_TITLE " (software RGB DirectX output)";
EventThreadUpdateTitle( p_vout->p_sys->p_event, psz_fallback ); EventThreadUpdateTitle( p_vout->p_sys->p_event, psz_fallback );
EventThreadUseOverlay( p_vout->p_sys->p_event, p_vout->p_sys->b_using_overlay );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -710,13 +710,18 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message, ...@@ -710,13 +710,18 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
if( hwnd == p_event->hvideownd ) if( hwnd == p_event->hvideownd )
{ {
#ifdef MODULE_NAME_IS_directx
vlc_mutex_lock( &p_event->lock );
const bool use_overlay = p_event->use_overlay;
vlc_mutex_unlock( &p_event->lock );
#endif
switch( message ) switch( message )
{ {
#ifdef MODULE_NAME_IS_directx #ifdef MODULE_NAME_IS_directx
case WM_ERASEBKGND: case WM_ERASEBKGND:
/* For overlay, we need to erase background */ /* For overlay, we need to erase background */
return !p_event->use_overlay ? return !use_overlay ? 1 : DefWindowProc(hwnd, message, wParam, lParam);
1 : DefWindowProc(hwnd, message, wParam, lParam);
case WM_PAINT: case WM_PAINT:
/* /*
** For overlay, DefWindowProc() will erase dirty regions ** For overlay, DefWindowProc() will erase dirty regions
...@@ -725,7 +730,7 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message, ...@@ -725,7 +730,7 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
** regular interval, therefore dirty regions can be ignored ** regular interval, therefore dirty regions can be ignored
** to minimize repaint. ** to minimize repaint.
*/ */
if( !p_event->use_overlay ) if( !use_overlay )
{ {
ValidateRect(hwnd, NULL); ValidateRect(hwnd, NULL);
} }
...@@ -987,6 +992,14 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event, bool *pb_changed, ...@@ -987,6 +992,14 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event, bool *pb_changed,
p_event->wnd_cfg.height = h; p_event->wnd_cfg.height = h;
vlc_mutex_unlock( &p_event->lock ); vlc_mutex_unlock( &p_event->lock );
} }
void EventThreadUseOverlay( event_thread_t *p_event, bool b_used )
{
vlc_mutex_lock( &p_event->lock );
p_event->use_overlay = b_used;
vlc_mutex_unlock( &p_event->lock );
}
event_thread_t *EventThreadCreate( vout_thread_t *p_vout, const vout_window_cfg_t *p_wnd_cfg ) event_thread_t *EventThreadCreate( vout_thread_t *p_vout, const vout_window_cfg_t *p_wnd_cfg )
{ {
/* Create the Vout EventThread, this thread is created by us to isolate /* Create the Vout EventThread, this thread is created by us to isolate
......
...@@ -54,3 +54,4 @@ unsigned EventThreadRetreiveChanges( event_thread_t * ); ...@@ -54,3 +54,4 @@ unsigned EventThreadRetreiveChanges( event_thread_t * );
int EventThreadGetWindowStyle( event_thread_t * ); int EventThreadGetWindowStyle( event_thread_t * );
void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_changed, void EventThreadUpdateWindowPosition( event_thread_t *, bool *pb_changed,
int x, int y, int w, int h ); int x, int y, int w, int h );
void EventThreadUseOverlay( event_thread_t *, bool b_used );
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