[MPlayer-dev-eng] [PATCH] - No Reset of D3D device on resize

Georgi Petrov gogothebee at gmail.com
Fri Dec 12 10:38:46 CET 2008


>> Don't you think that allocating backbuffer with the size of the
>> current screen isn't the perfect solution?
>
> As I said, no. The movie window can be larger than the screen size.
> E.g. when someone plays one of the HD videos on e.g. one of those EEE
> PCs the current screen is 1024x600 but the video window is 1920x1080,
> and the backbuffer must be as large as the window.

Then the backbuffer must be equal to the largest of the two - the
movie itself or the window where it's presented. On each resize we
should check if the new dimensions are larger than the already
allocated backbuffer.

> and the backbuffer must be as large as the window.

The whole idea to have backbuffer as large as possible is to enable
smooth upsize of this window. E.g. to have a viewpin always as a
subset of the allocated backbuffer. What will happen if we have
backbuffer equal to the window and the user upsize it? We'll have to
do a Reset just as we do now. downsizing isn't a problem, because we
can change the viewpin to reflect the change without changing the
backbuffer (which would require Reset).

So the point is to have the backbuffer be as large as possible in
order to fit all possible window sizes. We can make it as large as all
attached displays combined, but this would require too much memory
IMHO. So - we need a balance. We can always grow the backbuffer when
the new window size is larger than the current backbuffer (by doing
Reset).

My suggestion:

1. Initialize MPlayer. Set the backbuffer to the size of the current
screen or the size of all screens in case of xinerama.

2. Read the movie dimensions. If they happen to be larger than the
allocated backbuffer size (window larger than current screen and no
xinerama enabled), do a Reset and grow the backbuffer to the new
dimensions.

3. Play the movie.

4. On each downsize, don't do Reset, but just adjust the viewpin to
match the new smaller size and be a subset of the allocated
backbuffer.

5. On each upsize, adjust the viewpin to match the new larger size,
but do a check if the new size is larger than the currently allocted
backbuffer. If so, do a Reset with the new larger dimensions, if not -
don't do a Reset and just readjust the viewpin.



> Also -xineramascreen -2 will go to fullscreen on _all_ connected
> displays.
>
>> What about OSD textures? I suppose they are with the same size as the current viewpin?
>
> This is the size of be backbuffer where things are rendered _into_, it
> has nothing to do with the size of the things that are rendered,
> and OSD size still varies only with window size.
> _______________________________________________
> 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