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

Georgi Petrov gogothebee at gmail.com
Sun Jun 1 13:50:22 CEST 2008


Thanks guys, I've already started. Today my first task is to compile
with VS2008 a simple D3D app that only initializes the library,
because I've never did such thing before.

Now I read vo_tga, vo_directx, vo_gl and soon I'll have some questions.

libvo.txt seems like a real mess, but it's a starting point after all :)

>-vo gl:yuv=2 definitely will work with ATI, and I think it works with
>Intel, too (though I have not tested personally).

I'll investigate further when I have at least partially working D3D
implementation. When it comes to vo_gl and vo_directx, at least I
already know where to ask my questions :)



>Making D3D the default AFAICT means dropping support for GeForce 3 and
>anything similarly old/weak without doing yuv->rgb in software.
>It certainly is an option, though it may be better to either leave such
>decisions to others (e.g. smplayer not defaults to vo gl on Vista it
>seems - unfortunately with slow settings) or extend the way the default
>vo is selected to make better decisions (e.g. adding a get_score
>function and trying the vos in order of the score they returned).
>There is also the question which D3D version you intend to use and if
>and how a generic MPlayer build can still run on Win9x.

Hmm, this doesn't sound good. I think that the best option is to
implement (if this is not already done) HW/OS detection and in case of
Vista for example, default to D3D. On XP and lower default to
DirectDraw. About dropping anything lower than Geforce 3 - do you mean
that only HW supporting DX8 and upwards can use D3D for video output?
For example - if we take a Geforce 4 MX440 (DX7 card), does it mean
that it won't support DirectX 9 Surface, which is needed for our
driver to work? I'm completely new to DirectX programming and I'll
experiment as much as I can. At least I have many friends with
different classes of video cards and I can borrow them for a while :)

>What kind of card is that? The newer (PCIe) cards at least on Linux only
>support a kind of emulated overlay that has none of these problems, it
>has only an arbitrary limit of 32 simultaneous videos (unfortunately, it
>does not support setting of hue/saturation/contrast/brightness/gamma,
>though this seems more like a driver than hardware limitation).

This is on Geforce 7600GS. On XP the overlay is not emulated when
dealing with DirectDraw7. It's very real. I think that Geforce 8xxx
(DX10 class) doesn't have HW overlay anymore and use sharders.

In XP when using DirectDraw7 happens exactly this - you have ONE
overlay and the first video takes it. It can be even configured to be
displayed on the TVOUT scaled up automatically. Every video afterward
doesn't get overlay.

In Vista when I launch video through DirectDraw7 and move it to the
second video out (the TVOUT), the whole windows is green and the video
doesn't appear on the TV. It's actually impossible to watch the video
on the second display!!!!! When using VLC with D3D video out, no such
thing happens - if I move the window to the second display (the TV),
it works.

My objective is to write as general purpose driver as possible and
still with the best performance/compatibility. As far as I understand:

- performance wise we don't lose anything compared to DirectDraw7
- compatibility wise we may loose video cards before DX8. This should
be checked first.
- compatibility wise we gain support for Vista Aero as well as more
than one HW overlay
- may be gain/lose more






On Sun, Jun 1, 2008 at 2:22 PM, Reimar Döffinger
<Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> On Sat, May 31, 2008 at 03:41:24AM +0300, Georgi Petrov wrote:
>> Do you mean that with ATi hardware/drivers -vo gl:yuy=1 doesn't work
>> at all? If it doesn't, that's one of the other reasons I want to
>> develop D3D driver - because it's supported for sure even in the most
>> retarded drivers for Vista (nothing against ATi. I mean something like
>> SiS if they are still alive...).
>
> -vo gl:yuv=2 definitely will work with ATI, and I think it works with
> Intel, too (though I have not tested personally).
> A big problem with Vista is that enabling vsync seems to eat up 10% CPU
> in some kernel driver.
> Since vsync is not needed with Aero enabled, you should try
> -vo gl:yuv=2:force-pbo:swapinterval=0  (for ATI cards you will also need
> to add ati-hack, this is probably due to yet another driver bug).
>
>> VLC's D3D module doesn't use VMR as well as far as I can
>> understand the source code.
>
> Not using VMR (or is that only since EVR or whatever the next version is
> called) also means you do not get on-GPU deinterlacing, no advanced scaling
> (unless you write your own scalers) etc.
>
>> Once I have working D3D module and the performance is as expected on
>> par with the -vo directx's current DirectDraw, I supposse that it
>> would make sense after extensive testing to make it the default
>> drawing mode for Windows, because DirectDraw is dying from my
>> perspective. It doesn't hurt Windows XP, but for Vista it's a real
>> pain.
>
> Making D3D the default AFAICT means dropping support for GeForce 3 and
> anything similarly old/weak without doing yuv->rgb in software.
> It certainly is an option, though it may be better to either leave such
> decisions to others (e.g. smplayer not defaults to vo gl on Vista it
> seems - unfortunately with slow settings) or extend the way the default
> vo is selected to make better decisions (e.g. adding a get_score
> function and trying the vos in order of the score they returned).
> There is also the question which D3D version you intend to use and if
> and how a generic MPlayer build can still run on Win9x.
>
>> Also - if I'm not mistaken DirectDraw offers HW accelerated overlay
>> only for the FIRST player instance. Every other MPlayer instance
>> doesn't get HW overlay (because it's only one available) and the video
>> looks terrible. Especially upscaled. Try it - launch MPlayer, then
>> launch another instance with another video (both instances using -vo
>> directx) and observe the second one's quality. If you can't tell the
>> difference, hit "f" for full screen and enjoy terrible quality :)
>>
>> This is all related to XP. In Vista the second video doesn't work at
>> all! It's all green (colorkey) and nothing happens :)
>
> What kind of card is that? The newer (PCIe) cards at least on Linux only
> support a kind of emulated overlay that has none of these problems, it
> has only an arbitrary limit of 32 simultaneous videos (unfortunately, it
> does not support setting of hue/saturation/contrast/brightness/gamma,
> though this seems more like a driver than hardware limitation).
>
> Greetings,
> Reimar Döffinger
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>


More information about the MPlayer-dev-eng mailing list