[MPlayer-dev-eng] [PATCH] Direct3D libvo driver

Georgi Petrov gogothebee at gmail.com
Thu Nov 13 09:15:33 CET 2008


Diego, I've fixed everything you suggested. I removed my name from
every function, as well as the date and put them in the beginning of
the file. Now all lines are less than 80 columns as well and all
functions with no parameters are declared void.

compn, direct3d is going to be always a liitle slower than directdraw.
I don't know the difference in their internal implementation, but at
least I can show you all how stupid the Direct3D API is:

When I create the Offscreen Surface with some dimensions and lock a
pointer to the surface, I can't just do one big memcpy (3 big memcpys
in case of planar colorspace), because of this:
http://msdn.microsoft.com/en-us/library/bb206357(VS.85).aspx

In brief: each horizontal line in the locked surface is in fact longer
than the width of the surface and for each line I should increment a
pointer with the real width of the line to get it pointing to the next
line. That's why in vo_directx.c you copy (for example packed mode,
because it's fewer lines) like that:

mem2agpcpy_pic(image, mpi->planes[0], w * (mpi->bpp / 8), h, dstride,
mpi->stride[0]);

And in Direct3D I copy the same image with as many memcpys as lines we
have on the screen:

pScanlineBegin = (char *) stLockedRect.pBits;
for (i = 0; i < mpi->height; i++)
{
    fast_memcpy (pScanlineBegin, mpi->planes[0] +
               (i * mpi->stride[0]), mpi->stride[0]);
    pScanlineBegin += stLockedRect.Pitch;
}

Also, -vf rotate is known to be a problem, because I've not
implemented all dimensions check for fullscreen. I still suppose that
if the movie is not a square, it's wider than it's tall. I'll fix it
very soon :)

Reimar, thanks for pointing out w32_common.c - I didn't even know
about it. I will take a look at it and will try to use as much common
code as possible.

Just one last question: how do you prefer that I reply on different
mails with questions: to everyone who asked me something or like this
one - to many people as reply to the last person? I know this question
sounds stupid, but...

I attach the modified patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: direct3d.diff
Type: application/octet-stream
Size: 97006 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081113/afc8ca94/attachment.obj>


More information about the MPlayer-dev-eng mailing list