Commit d5e8b5bb authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/directx/*: some graphics card allow the creation of...

* modules/video_output/directx/*: some graphics card allow the creation of several overlay surfaces but can only display one at a time.
parent 1cad0658
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.c: Windows DirectX video output display method * vout.c: Windows DirectX video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: directx.c,v 1.21 2003/05/25 11:31:54 gbazin Exp $ * $Id: directx.c,v 1.22 2003/09/26 16:03:21 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -344,7 +344,7 @@ static void CloseVideo( vlc_object_t *p_this ) ...@@ -344,7 +344,7 @@ static void CloseVideo( vlc_object_t *p_this )
msg_Dbg( p_vout, "CloseVideo" ); msg_Dbg( p_vout, "CloseVideo" );
var_Destroy( p_vout, "directs-on-top" ); var_Destroy( p_vout, "directx-on-top" );
DirectXCloseDisplay( p_vout ); DirectXCloseDisplay( p_vout );
DirectXCloseDDraw( p_vout ); DirectXCloseDDraw( p_vout );
...@@ -909,6 +909,20 @@ static int DirectXCreateSurface( vout_thread_t *p_vout, ...@@ -909,6 +909,20 @@ static int DirectXCreateSurface( vout_thread_t *p_vout,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
if( b_overlay )
{
/* Check the overlay is useable as some graphics cards allow creating
* several overlays but only one can be used at one time. */
p_vout->p_sys->p_current_surface = *pp_surface_final;
if( DirectXUpdateOverlay( p_vout ) != VLC_SUCCESS )
{
IDirectDrawSurface2_Release( *pp_surface_final );
*pp_surface_final = NULL;
msg_Err( p_vout, "overlay unuseable (might already be in use)" );
return VLC_EGENERIC;
}
}
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -919,7 +933,7 @@ static int DirectXCreateSurface( vout_thread_t *p_vout, ...@@ -919,7 +933,7 @@ static int DirectXCreateSurface( vout_thread_t *p_vout,
* Ususally the overlay is moved by the user and thus, by a move or resize * Ususally the overlay is moved by the user and thus, by a move or resize
* event (in Manage). * event (in Manage).
*****************************************************************************/ *****************************************************************************/
void DirectXUpdateOverlay( vout_thread_t *p_vout ) int DirectXUpdateOverlay( vout_thread_t *p_vout )
{ {
DDOVERLAYFX ddofx; DDOVERLAYFX ddofx;
DWORD dwFlags; DWORD dwFlags;
...@@ -927,7 +941,7 @@ void DirectXUpdateOverlay( vout_thread_t *p_vout ) ...@@ -927,7 +941,7 @@ void DirectXUpdateOverlay( vout_thread_t *p_vout )
if( p_vout->p_sys->p_current_surface == NULL || if( p_vout->p_sys->p_current_surface == NULL ||
!p_vout->p_sys->b_using_overlay ) !p_vout->p_sys->b_using_overlay )
return; return VLC_EGENERIC;
/* The new window dimensions should already have been computed by the /* The new window dimensions should already have been computed by the
* caller of this function */ * caller of this function */
...@@ -952,7 +966,10 @@ void DirectXUpdateOverlay( vout_thread_t *p_vout ) ...@@ -952,7 +966,10 @@ void DirectXUpdateOverlay( vout_thread_t *p_vout )
{ {
msg_Warn( p_vout, msg_Warn( p_vout,
"DirectXUpdateOverlay cannot move or resize overlay" ); "DirectXUpdateOverlay cannot move or resize overlay" );
return VLC_EGENERIC;
} }
return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
...@@ -1309,6 +1326,8 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -1309,6 +1326,8 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic,
p_pic->p->i_pixel_pitch = 2; p_pic->p->i_pixel_pitch = 2;
break; break;
case VLC_FOURCC('R','V','2','4'): case VLC_FOURCC('R','V','2','4'):
p_pic->p->i_pixel_pitch = 3;
break;
case VLC_FOURCC('R','V','3','2'): case VLC_FOURCC('R','V','3','2'):
p_pic->p->i_pixel_pitch = 4; p_pic->p->i_pixel_pitch = 4;
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: Windows DirectX video output header file * vout.h: Windows DirectX video output header file
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout.h,v 1.5 2003/05/21 13:27:25 gbazin Exp $ * $Id: vout.h,v 1.6 2003/09/26 16:03:21 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -106,7 +106,7 @@ struct picture_sys_t ...@@ -106,7 +106,7 @@ struct picture_sys_t
/***************************************************************************** /*****************************************************************************
* Prototypes from vout.c * Prototypes from vout.c
*****************************************************************************/ *****************************************************************************/
void DirectXUpdateOverlay( vout_thread_t *p_vout ); int DirectXUpdateOverlay( vout_thread_t *p_vout );
/***************************************************************************** /*****************************************************************************
* Prototypes from events.c * Prototypes from events.c
......
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