[vlc-commits] [Git][videolan/vlc][master] hw: vaapi: allocate surfaces at the size of the pictures
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Nov 19 05:13:21 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
111e0791 by Alexandre Janniaux at 2026-11-19T00:13:17+01:00
hw: vaapi: allocate surfaces at the size of the pictures
vlc_vaapi_PoolNew() was allocating only the visible size as surface
size, whereas the pictures wrapping those surfaces inherited the
provided fmt and kept the size and visible size from the format.
It means that:
- with VAAPI filter, the padding could be squeezed into the output
image by the filter since it's using whole surfaces
- with the upload converter, it was writing into the padding from the
driver or after, since it writes i_width x i_height
- with the download converter, it could try reading outside of the
surface too since it's using i_width x i_height when vaDeriveImage
fails.
We should allocate the same size given that filters should keep the
sizes stable anyway.
It was written this way in a520cc788015fc24389d4bf38c236910ff790616 but
previous code was using vaCreateSurfaces(i_width, i_height). It was
invisible from 18ecb04eae68934ba3d302783451562a936d512e until commit
08cbeca2b732d8dcd3ae698a378cdfee5071a0c3 which let ffmpeg allocate the
surfaces, as now they were using a different size than visible size on
the VLC side, leading to the VAAPI filter issue.
To ensure that format doesn't change, we should keep the same format as
upstream decoder and thus keep the i_width / i_height instead of
switching again to i_visible_width / i_visible_height in the decoder.
- - - - -
1 changed file:
- modules/hw/vaapi/vlc_vaapi.c
Changes:
=====================================
modules/hw/vaapi/vlc_vaapi.c
=====================================
@@ -516,7 +516,7 @@ vlc_vaapi_PoolNew(vlc_object_t *o, vlc_video_context *vctx,
picture_t *pics[count];
VA_CALL(o, vaCreateSurfaces, dpy, va_rt_format,
- fmt->i_visible_width, fmt->i_visible_height,
+ fmt->i_width, fmt->i_height,
instance->render_targets, instance->num_render_targets,
fourcc_attribs, 1);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/111e07914aa737940c089a43dcda400cc2b1014a
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/111e07914aa737940c089a43dcda400cc2b1014a
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list