Commit b82f84ba authored by Damien Fouilleul's avatar Damien Fouilleul

directx: backport [20153], and stay on top fix in [20028]

parent fab94230
...@@ -335,6 +335,7 @@ static int Init( vout_thread_t *p_vout ) ...@@ -335,6 +335,7 @@ static int Init( vout_thread_t *p_vout )
E_(DirectXUpdateRects)( p_vout, VLC_TRUE ); E_(DirectXUpdateRects)( p_vout, VLC_TRUE );
/* create picture pool */ /* create picture pool */
p_vout->output.i_chroma = 0;
i_ret = Direct3DVoutCreatePictures(p_vout, 1); i_ret = Direct3DVoutCreatePictures(p_vout, 1);
if( VLC_SUCCESS != i_ret ) if( VLC_SUCCESS != i_ret )
{ {
...@@ -961,16 +962,17 @@ static D3DFORMAT Direct3DVoutFindFormat(vout_thread_t *p_vout, int i_chroma, D3D ...@@ -961,16 +962,17 @@ static D3DFORMAT Direct3DVoutFindFormat(vout_thread_t *p_vout, int i_chroma, D3D
*/ */
switch( d3ddm.Format ) switch( d3ddm.Format )
{ {
case D3DFMT_R8G8B8:
case D3DFMT_X8R8G8B8: case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
case D3DFMT_R5G6B5:
case D3DFMT_X1R5G5B5:
msg_Dbg( p_vout, "defaulting to adapter pixel format"); msg_Dbg( p_vout, "defaulting to adapter pixel format");
return Direct3DVoutSelectFormat(p_vout, target, &d3ddm.Format, 1); return Direct3DVoutSelectFormat(p_vout, target, &d3ddm.Format, 1);
default: default:
{ {
/* if we fall here, that probably means that we need to render some YUV format */ /* if we fall here, that probably means that we need to render some YUV format */
static const D3DFORMAT formats[] = static const D3DFORMAT formats[] =
{ D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 }; { D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
msg_Dbg( p_vout, "defaulting to built-in pixel format"); msg_Dbg( p_vout, "defaulting to built-in pixel format");
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT)); return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
} }
...@@ -1033,6 +1035,8 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics ...@@ -1033,6 +1035,8 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics
D3DFORMAT format; D3DFORMAT format;
HRESULT hr; HRESULT hr;
size_t c; size_t c;
// if vout is already running, use current chroma, otherwise choose from upstream
int i_chroma = p_vout->output.i_chroma ? : p_vout->render.i_chroma;
I_OUTPUTPICTURES = 0; I_OUTPUTPICTURES = 0;
...@@ -1041,7 +1045,7 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics ...@@ -1041,7 +1045,7 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics
** the requested chroma which is usable by the hardware in an offscreen surface, as they ** the requested chroma which is usable by the hardware in an offscreen surface, as they
** typically support more formats than textures ** typically support more formats than textures
*/ */
format = Direct3DVoutFindFormat(p_vout, p_vout->render.i_chroma, p_vout->p_sys->bbFormat); format = Direct3DVoutFindFormat(p_vout, i_chroma, p_vout->p_sys->bbFormat);
if( VLC_SUCCESS != Direct3DVoutSetOutputFormat(p_vout, format) ) if( VLC_SUCCESS != Direct3DVoutSetOutputFormat(p_vout, format) )
{ {
msg_Err(p_vout, "surface pixel format is not supported."); msg_Err(p_vout, "surface pixel format is not supported.");
......
...@@ -996,7 +996,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -996,7 +996,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
return vout_vaControlDefault( p_vout, i_query, args ); return vout_vaControlDefault( p_vout, i_query, args );
case VOUT_SET_STAY_ON_TOP: case VOUT_SET_STAY_ON_TOP:
if( p_vout->p_sys->hparent ) if( p_vout->p_sys->hparent && !var_GetBool( p_vout, "fullscreen" ) )
return vout_ControlWindow( p_vout, return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args ); (void *)p_vout->p_sys->hparent, i_query, args );
......
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