[MPlayer-dev-eng] Writing a brand new D3D video output to fix Vista Aero disabling

Georgi Petrov gogothebee at gmail.com
Tue Jun 3 23:39:07 CEST 2008


Thanks guys :)

Actually my experience with DirectX is zero (NULL) as well as windows
programming as a whole. I had to figure out how to do proper linking
and everything else. I started from scratch, but now 3 days later I
already have initialized window with D3D context inside ready to
display video. Everything is set up and the only thing that's left is
to start rendering frames inside. I know that I've not implemented
anything and this is a quick hack, but it turned out that it's not
that hard.

Actually using D3D just to display some video is not very complicated
in the end. The most difficult stuff is my zero knowledge of color
spaces and my nonexistent vision of how U, V and so on planes are
arranged in the memory.

Btw I have one problem with the OpenGL driver - no matter what options
I use, when I move the window on my second display (TVOUT), it seems
like it's rendered with 20 fps or so. The picture is choppy. It plays
ok on my primary screen.

About D3D  version 9 and compatibility in long term - I thing that
exactly this is the most compatible video render in XP/Vista. As I
said using DirectDraw (overlay) has those issues:

1. A problem with more than one video on XP. At least on my Geforce 4
440MX and my present Geforce 7600GS.
2. Aero is shutting down on Vista.
3. Moving other windows above the video make those windows look wired
(chroma keying).
4. Overlays are not modern anymore. In a composited desktop you can't
expect to have some region of the screen, where you can draw directly
anything you want. Everything should be relayed through DWM. D3D is
just a convenient and supported way to do it. DirectDraw is not.

There may be more. D3D render fixes all those problems. I'm sure that
in the next Windows DirectDraw won't be supported anymore, but this is
far, far away.

As somebody pointed out, newer video cards scale down overlay HW. A quoute:

"The nVidia GeForce 8800 series cards including the 8800GT and 8800GTS
now only support a single texture overlay on the primary monitor.
Therefore they cannot properly support more than one video playback
using hardware acceleration, regardless of the platform."

Ha ha - hardware acceleration through overlay not, but through well
working interface like Direct3D - you can have as many videos WITH
hardware acceleration as you want. This is my point. Imagine - what
would you do with your shiny new 8800GT if you don't have D3D video
out? Watch only one video on your 4000$ PC? I doubt it. The user would
just switch to another player, who doesn't have this limitation. And
we don't want that of course :)

This trend will continue and the next nVidia/ATI hardware won't have
overlay at all. Now on Windows guess which interface is supported
best? DirectX! OpenGL "works", but as you see - I'm having issues with
it. No offense to the Reimar, who developed the plugin, but you know -
it's Windows and MS's interfaces are always treated the best.

So, from compatibility perspective I see Direct3D 9 as the best we
could do on Windows.

Any steps ahead are unnecessary for this time being. In the future and
I mean 5+ years EVR may be interesting renderer. We have support in
Vista through .NET 3.0. I suppose that all future MS OS'es / apps will
be based more and more on .NET, so may be we can skip EVR for now, but
in a couple of years there might not be "Windows" as we know it
anymore, but more like .NET OS all in managed code. Then EVR renderer
will make sense.

Looking around everybody else has D3D output. I don't see a single
other player without support for it on windows except MPlayer based
ones. This is a shame I'm trying to fix :)

So the bottom line is - we shall see after I complete the driver. We
will perform measurements, check compatibility, stability, support and
anything else and I think that especially on Vista this will turn out
to be the ultimate video out. Not because I wrote it or something
stupid like that. Just because of the facts :)



More information about the MPlayer-dev-eng mailing list