[vaapi] av_hwframe_map with AV_PIX_FMT_PRIME_FD calls vaExportSurfaceHandle, but not vaSyncSurface
|Reported by:||goffioul||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
When mapping a VA-API frame with av_hwframe_map and AV_PIX_FMT_PRIME_FD, vaExportSurfaceHandle is called to create the file descriptor, but it does not call vaSyncSurface. As a result, mmap'ing the file descriptor and reading from it may not yield correct result and lead to tearing artefact.
Technically, the client app could probably call vaSyncSurface itself, but that would require accessing internals of ffmpeg, e.g. to access the VA display. It would be cleaner if the VA-API bits were entirely managed by ffmpeg.