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:
wm4
2016-07-15 11:54:44 +02:00
parent 4a4a9f3302
commit 85488f6892
6 changed files with 22 additions and 26 deletions

View File

@@ -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()");