if( winVer.dwMajorVersion > 5 )
{
/* Windows Vista or above, make this module the default */
- _got_vista_or_above = VLC_TRUE;
+ _got_vista_or_above = VLC_TRUE;
return 150;
}
}
#endif
/*****************************************************************************
- * CUSTOMVERTEX:
+ * CUSTOMVERTEX:
*****************************************************************************
*****************************************************************************/
-typedef struct
+typedef struct
{
- FLOAT x,y,z; // vertex untransformed position
+ FLOAT x,y,z; // vertex untransformed position
FLOAT rhw; // eye distance
D3DCOLOR diffuse; // diffuse color
FLOAT tu, tv; // texture relative coordinates
Display(p_vout, p_pic);
/*
- ** Video window is initially hidden, show it now since we got a
+ ** Video window is initially hidden, show it now since we got a
** picture to show.
*/
- SetWindowPos( p_vout->p_sys->hvideownd, 0, 0, 0, 0, 0,
+ SetWindowPos( p_vout->p_sys->hvideownd, 0, 0, 0, 0, 0,
SWP_ASYNCWINDOWPOS|
SWP_FRAMECHANGED|
SWP_SHOWWINDOW|
}
/*****************************************************************************
- * DirectD3DVoutCreate: Initialize and instance of Direct3D9
+ * DirectD3DVoutCreate: Initialize and instance of Direct3D9
*****************************************************************************
* This function initialize Direct3D and analyze available resources from
* default adapter.
D3DCREATE_SOFTWARE_VERTEXPROCESSING|
D3DCREATE_MULTITHREADED,
&d3dpp, &p_d3ddev );
- if( FAILED(hr) )
+ if( FAILED(hr) )
{
msg_Err(p_vout, "Could not create the D3D device! (hr=0x%lX)", hr);
return VLC_EGENERIC;
}
/*****************************************************************************
- * DirectD3DClose: release the Direct3D9 device
+ * DirectD3DClose: release the Direct3D9 device
*****************************************************************************/
static void Direct3DVoutClose( vout_thread_t *p_vout )
{
IDirect3DDevice9_Release(p_vout->p_sys->p_d3ddev);
p_vout->p_sys->p_d3ddev = NULL;
}
-
+
p_vout->p_sys->hmonitor = NULL;
}
/*****************************************************************************
- * DirectD3DClose: reset the Direct3D9 device
+ * DirectD3DClose: reset the Direct3D9 device
*****************************************************************************
* All resources must be deallocated before the reset occur, they will be
* realllocated once the reset has been performed successfully
//if( p_vout->p_sys->b_hw_yuv && ! _got_vista_or_above )
if( p_vout->p_sys->b_hw_yuv )
{
- /* it sounds like vista does not support YUV surfaces at all */
+ /* it sounds like vista does not support YUV surfaces at all */
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
*/
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ 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'):
{
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ 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'):
{
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ D3DFMT_X1R5G5B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '1', '6'):
{
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ D3DFMT_R5G6B5 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '2', '4'):
{
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ D3DFMT_R8G8B8, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
case VLC_FOURCC('R', 'V', '3', '2'):
{
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ D3DFMT_A8R8G8B8, D3DFMT_X8R8G8B8 };
return Direct3DVoutSelectFormat(p_vout, target, formats, sizeof(formats)/sizeof(D3DFORMAT));
}
if( SUCCEEDED(hr))
{
/*
- ** some professional cards could use some advanced pixel format as default,
+ ** some professional cards could use some advanced pixel format as default,
** make sure we stick with chromas that we can handle internally
*/
switch( d3ddm.Format )
default:
{
/* if we fall here, that probably means that we need to render some YUV format */
- static const D3DFORMAT formats[] =
+ static const D3DFORMAT formats[] =
{ 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));
D3DFORMAT format;
HRESULT hr;
size_t c;
- // if vout is already running, use current chroma, otherwise choose from upstream
+ // 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;
** 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) )
{
{
LPDIRECT3DSURFACE9 p_d3dsurf;
- picture_t *p_pic = p_vout->p_picture+c;
+ picture_t *p_pic = p_vout->p_picture+c;
- hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_d3ddev,
+ hr = IDirect3DDevice9_CreateOffscreenPlainSurface(p_d3ddev,
p_vout->render.i_width,
p_vout->render.i_height,
format,
/* fill surface with black color */
IDirect3DDevice9_ColorFill(p_d3ddev, p_d3dsurf, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0) );
-
+
/* assign surface to internal structure */
p_pic->p_sys = (void *)p_d3dsurf;
}
/*****************************************************************************
- * Direct3DVoutReleasePictures: destroy a picture vector
+ * Direct3DVoutReleasePictures: destroy a picture vector
*****************************************************************************
* release all video resources used for pictures
*****************************************************************************/
size_t c;
for( c=0; c<i_num_pics; ++c )
{
- picture_t *p_pic = p_vout->p_picture+c;
+ picture_t *p_pic = p_vout->p_picture+c;
if( p_pic->p_sys )
{
LPDIRECT3DSURFACE9 p_d3dsurf = (LPDIRECT3DSURFACE9)p_pic->p_sys;
** for performance reason, texture format is identical to backbuffer
** which would usually be a RGB format
*/
- hr = IDirect3DDevice9_CreateTexture(p_d3ddev,
+ hr = IDirect3DDevice9_CreateTexture(p_d3ddev,
p_vout->render.i_width,
p_vout->render.i_height,
1,
- D3DUSAGE_RENDERTARGET,
+ D3DUSAGE_RENDERTARGET,
p_vout->p_sys->bbFormat,
D3DPOOL_DEFAULT,
- &p_d3dtex,
+ &p_d3dtex,
NULL);
if( FAILED(hr))
{
p_vout->p_sys->p_d3dtex = p_d3dtex;
p_vout->p_sys->p_d3dvtc = p_d3dvtc;
- // Texture coordinates outside the range [0.0, 1.0] are set
+ // Texture coordinates outside the range [0.0, 1.0] are set
// 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);
HRESULT hr;
float f_width, f_height;
- // check if device is still available
+ // check if device is still available
hr = IDirect3DDevice9_TestCooperativeLevel(p_d3ddev);
if( FAILED(hr) )
{