mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
video: change hw_subfmt meaning
The hw_subfmt field roughly corresponds to the field AVHWFramesContext.sw_format in ffmpeg. The ffmpeg one is of the type AVPixelFormat (instead of the underlying hardware format), so it's a good idea to switch to this too for preparation. Now the hw_subfmt field is an mp_imgfmt instead of an opaque/API- specific number. VDPAU and Direct3D11 already used mp_imgfmt, but Videotoolbox and VAAPI had to be switched. One somewhat user-visible change is that the verbose log will now always show the hw_subfmt as image format, instead of as nonsensical number. (In the end it would be good if we could switch to AVHWFramesContext completely, but the upstream API is incomplete and doesn't cover Direct3D11 and Videotoolbox.)
This commit is contained in:
@@ -509,7 +509,7 @@ void va_surface_init_subformat(struct mp_image *mpi)
|
||||
if (status != VA_STATUS_SUCCESS)
|
||||
goto err;
|
||||
|
||||
mpi->params.hw_subfmt = va_image.format.fourcc;
|
||||
mpi->params.hw_subfmt = va_fourcc_to_imgfmt(va_image.format.fourcc);
|
||||
|
||||
status = vaDestroyImage(p->display, va_image.image_id);
|
||||
CHECK_VA_STATUS(p->ctx, "vaDestroyImage()");
|
||||
|
||||
Reference in New Issue
Block a user