[vlc-devel] [PATCH v2 07/19] opengl: compute the picture placement when we are using it
Steve Lhomme
robux4 at ycbcr.xyz
Wed Aug 26 08:41:08 CEST 2020
On 2020-08-25 16:43, Alexandre Janniaux wrote:
> Hi,
>
> It means that the place will be computed at each display
> instead of - in the average case - once.
That's not the case. When VOUT_DISPLAY_CHANGE_xxx are received they set
the place_changed flag to true. That flag is reset once the next picture
is displayed. If you receive 100 VOUT_DISPLAY_CHANGE_xxx events it will
still be computed once when the next picture is displayed.
It will not be recomputed until a new VOUT_DISPLAY_CHANGE_xxx comes.
So if anything, the place is computed less often. Not more.
> I don't really care about this, but it was refused when
> I suggested the change like this.
>
> Regards,
> --
> Alexandre Janniaux
> Videolabs
>
> On Tue, Aug 25, 2020 at 04:20:20PM +0200, Steve Lhomme wrote:
>> ---
>> modules/video_output/opengl/display.c | 16 +++++-----------
>> 1 file changed, 5 insertions(+), 11 deletions(-)
>>
>> diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
>> index 58f0cdc388f..e3c1320960e 100644
>> --- a/modules/video_output/opengl/display.c
>> +++ b/modules/video_output/opengl/display.c
>> @@ -72,7 +72,6 @@ struct vout_display_sys_t
>> {
>> vout_display_opengl_t *vgl;
>> vlc_gl_t *gl;
>> - vout_display_place_t place;
>> bool place_changed;
>> };
>>
>> @@ -194,10 +193,12 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic)
>> {
>> if (sys->place_changed)
>> {
>> - float window_ar = (float)sys->place.width / sys->place.height;
>> + vout_display_place_t place;
>> + vout_display_PlacePicture(&place, &vd->source, vd->cfg, VOUT_ORIGIN_BOTTOM_LEFT);
>> + float window_ar = (float)place.width / place.height;
>> vout_display_opengl_SetWindowAspectRatio(sys->vgl, window_ar);
>> - vout_display_opengl_Viewport(sys->vgl, sys->place.x, sys->place.y,
>> - sys->place.width, sys->place.height);
>> + vout_display_opengl_Viewport(sys->vgl, place.x, place.y,
>> + place.width, place.height);
>> sys->place_changed = false;
>> }
>>
>> @@ -221,10 +222,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
>> case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
>> case VOUT_DISPLAY_CHANGE_ZOOM:
>> {
>> - vout_display_cfg_t cfg = *vd->cfg;
>> - const video_format_t *src = &vd->source;
>> -
>> - vout_display_PlacePicture(&sys->place, src, &cfg, VOUT_ORIGIN_BOTTOM_LEFT);
>> sys->place_changed = true;
>> vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height);
>> return VLC_SUCCESS;
>> @@ -233,9 +230,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
>> case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
>> case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
>> {
>> - vout_display_cfg_t cfg = *vd->cfg;
>> -
>> - vout_display_PlacePicture(&sys->place, &vd->source, &cfg, VOUT_ORIGIN_BOTTOM_LEFT);
>> sys->place_changed = true;
>> return VLC_SUCCESS;
>> }
>> --
>> 2.26.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list