[vlc-devel] [PATCH v2 01/19] display: specify if vout_display_PlacePicture() alignment is top/bottom-left

Steve Lhomme robux4 at ycbcr.xyz
Wed Aug 26 09:08:39 CEST 2020


On 2020-08-26 8:50, Steve Lhomme wrote:
> On 2020-08-25 17:17, Romain Vimont wrote:
>> On Tue, Aug 25, 2020 at 04:20:14PM +0200, Steve Lhomme wrote:
>>> For OpenGL the picture alignment must be computed from the 
>>> bottom-left, whereas
>>> all other modules align from top-left.
>>
>> IMO, the core should not be aware of any "internal" vflip by the vout.
> 
> I'm not sure what you mean by "be aware". The 
> vout_display_PlacePicture() function is in the core. But the core itself 
> doesn't know anything about the orientation/origin of the display. This 
> state is private to the display module(s).
> 
>> It should just request the alignment it wants, and the vout handles it.
> 
> This is what is done and is not changed.
> 
>>> This was handled internally by OpenGL modules, but for center vertical
>>> alignment on odd vertical dimensions, it may round to the same value 
>>> regardless
>>> of the display coordinate system, which is incorrect.
>>
>> What is rounded to the same value in that case?
> 
> You have a 1000x4 video. You want it aligned to the bottom in a 1000x7 
> window.
> In the core/top-left-origin case, the placement is (0,3).
> In the opengl/bottom-left-origin, the placement is (0,4).

Uh, sorry. The rounding issue is only when using the center alignment.

So a 1000x4 video in a 1000x7 video, with the current code we have:
- in the core/top-left-origin case, the centered placement is (0,1).
- in the opengl/bottom-left-origin, the centered placement is (0,1).

This is what the core expects to be displayed
^
|
|
|xxxxxxxxxxx
|xxxxxxxxxxx
|xxxxxxxxxxx
|xxxxxxxxxxx
|
+----------->


This is what OpenGL will display with the rounding mismatch
+----------->
|
|xxxxxxxxxxx
|xxxxxxxxxxx
|xxxxxxxxxxx
|
|
|
v


More information about the vlc-devel mailing list