if( winVer.dwMajorVersion > 5 )
{
/* Windows Vista or above, make this module the default */
if( winVer.dwMajorVersion > 5 )
{
/* Windows Vista or above, make this module the default */
*****************************************************************************
*****************************************************************************/
*****************************************************************************
*****************************************************************************/
FLOAT rhw; // eye distance
D3DCOLOR diffuse; // diffuse color
FLOAT tu, tv; // texture relative coordinates
FLOAT rhw; // eye distance
D3DCOLOR diffuse; // diffuse color
FLOAT tu, tv; // texture relative coordinates
- SetWindowPos( p_vout->p_sys->hvideownd, 0, 0, 0, 0, 0,
+ SetWindowPos( p_vout->p_sys->hvideownd, 0, 0, 0, 0, 0,
*****************************************************************************
* This function initialize Direct3D and analyze available resources from
* default adapter.
*****************************************************************************
* This function initialize Direct3D and analyze available resources from
* default adapter.
*****************************************************************************/
static void Direct3DVoutClose( vout_thread_t *p_vout )
{
*****************************************************************************/
static void Direct3DVoutClose( vout_thread_t *p_vout )
{
p_vout->p_sys->hmonitor = NULL;
}
/*****************************************************************************
p_vout->p_sys->hmonitor = NULL;
}
/*****************************************************************************
*****************************************************************************
* All resources must be deallocated before the reset occur, they will be
* realllocated once the reset has been performed successfully
*****************************************************************************
* All resources must be deallocated before the reset occur, they will be
* realllocated once the reset has been performed successfully
switch( i_chroma )
{
case VLC_FOURCC('U','Y','V','Y'):
switch( i_chroma )
{
case VLC_FOURCC('U','Y','V','Y'):
/* typically 3D textures don't support planar format
** fallback to packed version and use CPU for the conversion
*/
/* typically 3D textures don't support planar format
** fallback to packed version and use CPU for the conversion
*/
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('Y','U','Y','2'):
case VLC_FOURCC('Y','U','N','V'):
{
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('Y','U','Y','2'):
case VLC_FOURCC('Y','U','N','V'):
{
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
{ D3DFMT_YUY2, D3DFMT_UYVY, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
{
case VLC_FOURCC('R', 'V', '1', '5'):
{
{
case VLC_FOURCC('R', 'V', '1', '5'):
{
{ D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '1', '6'):
{
{ D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '1', '6'):
{
{ D3DFMT_R5G6B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '2', '4'):
{
{ D3DFMT_R5G6B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '2', '4'):
{
{ D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '3', '2'):
{
{ D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '3', '2'):
{
{ D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
{ D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
{ D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
msg_Dbg( p_vout, "defaulting to built-in pixel format");
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
{ D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_R5G6B5, D3DFMT_X1R5G5B5 };
msg_Dbg( p_vout, "defaulting to built-in pixel format");
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
** find the appropriate D3DFORMAT for the render chroma, the format will be the closest to
** the requested chroma which is usable by the hardware in an offscreen surface, as they
** typically support more formats than textures
** find the appropriate D3DFORMAT for the render chroma, the format will be the closest to
** the requested chroma which is usable by the hardware in an offscreen surface, as they
** typically support more formats than textures
format = Direct3DVoutFindFormat(p_vout, i_chroma, p_vout->p_sys->bbFormat);
if( VLC_SUCCESS != Direct3DVoutSetOutputFormat(p_vout, format) )
{
format = Direct3DVoutFindFormat(p_vout, i_chroma, p_vout->p_sys->bbFormat);
if( VLC_SUCCESS != Direct3DVoutSetOutputFormat(p_vout, format) )
{
/* fill surface with black color */
IDirect3DDevice9_ColorFill(p_d3ddev, p_d3dsurf, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0) );
/* fill surface with black color */
IDirect3DDevice9_ColorFill(p_d3ddev, p_d3dsurf, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0) );
*****************************************************************************
* release all video resources used for pictures
*****************************************************************************/
*****************************************************************************
* release all video resources used for pictures
*****************************************************************************/
** for performance reason, texture format is identical to backbuffer
** which would usually be a RGB format
*/
** for performance reason, texture format is identical to backbuffer
** which would usually be a RGB format
*/
// to the texture color at 0.0 or 1.0, respectively.
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
// to the texture color at 0.0 or 1.0, respectively.
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
IDirect3DDevice9_SetSamplerState(p_d3ddev, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);