[MPlayer-dev-eng] Direct3D OSD discussion

Jim Hauxwell james at dattrax.co.uk
Fri Nov 28 09:32:24 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Diego Biurrun wrote:
> On Wed, Nov 26, 2008 at 07:26:10PM +0000, Jim Hauxwell wrote:
>> Diego Biurrun wrote:
>>> On Wed, Nov 26, 2008 at 07:56:18AM +0000, Jim Hauxwell wrote:
>>>>> This patch is broken and does not apply.  I suspect Windows linebreaks.
>>>> Sorry, my mistake.  Visual Studio had decided to add CR/LF to all the
>>>> lines and svn diff doesn't take this into account.
>>>>
>>>> New, smaller patch file
>>>>
>>>> --- libvo/vo_direct3d.c	(revision 28034)
>>>> +++ libvo/vo_direct3d.c	(working copy)
>>>> @@ -71,8 +71,14 @@
>>>>      IDirect3DSurface9 *d3d_surface; /**< Offscreen Direct3D Surface. MPlayer
>>>>                                      renders inside it. Uses colorspace
>>>>                                      priv->movie_src_fmt */
>>>> +	IDirect3DTexture9 *d3d_texture_osd; /**< Direct3D Texture. Uses RGBA */
>>>> +	IDirect3DTexture9 *d3d_texture_system; /**< Direct3D Texture. System memory
>>>> +										     cant lock a normal texture. Uses RGBA */
>>> Do not add tabs to a file without tabs
>> Done
> 
> No.

Should now be no tabs

> 
>>>> @@ -180,6 +207,25 @@
>>>> +	/* kill the VB and the texture */
>>>> +	if (priv->d3d_texture_osd != NULL)
>>>> +	{
>>> Respect the coding style of the file, keep braces on the same line as
>>> the if.
>> Done
> 
> No.

Again, I don't know how those slipped through

> 
>> --- libvo/vo_direct3d.c	(revision 28042)
>> +++ libvo/vo_direct3d.c	(working copy)
>> @@ -71,8 +72,14 @@
>> +    IDirect3DTexture9 *d3d_texture_osd; /**< Direct3D Texture. Uses RGBA */
>> +    IDirect3DTexture9 *d3d_texture_system; /**< Direct3D Texture. System memory
>> +                                    cant lock a normal texture. Uses RGBA */
> 
> cannot

spelling!!! arrrgg

> 
>> @@ -101,6 +108,22 @@
>>  
>> +#define OSD_TEXTURE_SIZE 1024   /* as this is a texture, it can be a different size to the movie */
> 
> than the movie
> 
>> @@ -264,6 +308,50 @@
>>  
>> +    /* create OSD */
>> +    if (FAILED (IDirect3DDevice9_CreateTexture(
>> +        priv->d3d_device, OSD_TEXTURE_SIZE, OSD_TEXTURE_SIZE, 1, D3DUSAGE_DYNAMIC,
>> +        D3DFMT_A8L8, D3DPOOL_SYSTEMMEM, &priv->d3d_texture_system, NULL))) {
>> +        mp_msg(MSGT_VO,MSGL_ERR,
>> +        "<vo_direct3d><INFO>IDirect3DDevice9_CreateTexture Failed (d3d_texture_system).\n");
> 
> random indentation, same below

I've altered it, but I just copied mine from the

    if (FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(
         priv->d3d_device, priv->src_width, priv->src_height,
         priv->movie_src_fmt, D3DPOOL_DEFAULT, &priv->d3d_surface, NULL))) {
        mp_msg(MSGT_VO,MSGL_ERR,
        "<vo_direct3d><INFO>IDirect3D9_CreateOffscreenPlainSurface
Failed.\n");
        return 0;
    }

which is already in svn.  To your case this has broken indentation.


> 
>> +    memcpy( vertices, osd_quad_vb, sizeof(osd_quad_vb) );
> 
> No other function call in the file has spaces around the parentheses.

Fixed

> 
>> +    /* populate the Y with the correct coordinate */
> 
> "the Y"?
> 
>> @@ -672,3 +753,133 @@
>> +
>> +    for (y=0; y < h; y++) {
>> +        register unsigned short *dst = (unsigned short*) dstbase;
>> +        register int x;
>> +        for(x=0; x < w; x++) {
>> +            if(srca[x])
> 
> You have spaces after if and for in other places.
> 
>> +        src+=srcstride;
>> +        srca+=srcstride;
>> +        dstbase+=dststride;

fixed

> 
> This would be more readable aligned and with spaces around the
> operators.
> 
>> +        if (FAILED (IDirect3DTexture9_LockRect(priv->d3d_texture_system, 0,
>> +                                   &locked_rect, NULL, 0))) {
> 
> random indentation

fixed

> 
>> +        if (FAILED(IDirect3DDevice9_EndScene(priv->d3d_device))) {
>> +           mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>EndScene failed\n");
>> +           return;
> 
> 3 space indentation

A cut and paste from the other place lock is used. That has also got a 3
space indentation and made it into svn by mistake.

> 
> Diego
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkvrJgACgkQhrNWoHjgI1AEuwCfVqkpqeSXKhG+WEoWlkc1cePB
fIUAn2iVRSXK0dNBj+A6YGuzQJN9o6J8
=jBI/
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff11.diff
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081128/2ebb4753/attachment.asc>


More information about the MPlayer-dev-eng mailing list