mpv/video/decode
wm4 f5ff2656e0 vaapi: determine surface format in decoder, not in renderer
Until now, we have made the assumption that a driver will use only 1
hardware surface format. the format is dictated by the driver (you
don't create surfaces with a specific format - you just pass a
rt_format and get a surface that will be in a specific driver-chosen
format).

In particular, the renderer created a dummy surface to probe the format,
and hoped the decoder would produce the same format. Due to a driver
bug this required a workaround to actually get the same format as the
driver did.

Change this so that the format is determined in the decoder. The format
is then passed down as hw_subfmt, which allows the renderer to configure
itself with the correct format. If the hardware surface changes its
format midstream, the renderer can be reconfigured using the normal
mechanisms.

This calls va_surface_init_subformat() each time after the decoder
returns a surface. Since libavcodec/AVFrame has no concept of sub-
formats, this is unavoidable. It creates and destroys a derived
VAImage, but this shouldn't have any bad performance effects (at
least I didn't notice any measurable effects).

Note that vaDeriveImage() failures are silently ignored as some
drivers (the vdpau wrapper) support neither vaDeriveImage, nor EGL
interop. In addition, we still probe whether we can map an image
in the EGL interop code. This is important as it's the only way
to determine whether EGL interop is supported at all. With respect
to the driver bug mentioned above, it doesn't matter which format
the test surface has.

In vf_vavpp, also remove the rt_format guessing business. I think the
existing logic was a bit meaningless anyway. It's not even a given
that vavpp produces the same rt_format for output.
2016-04-11 22:03:26 +02:00
..
d3d.c d3d: fix Windows build 2016-04-07 21:04:31 +02:00
d3d.h vd_lavc: fix codec vs. decoder confusion 2016-04-07 17:48:00 +02:00
d3d11va.c vd_lavc: let hardware decoder request delaying frames explicitly 2016-04-07 18:47:32 +02:00
dec_video.c dec_video: always redisplay cover art after a seek 2016-03-11 20:58:13 +01:00
dec_video.h Rewrite ordered chapters and timeline stuff 2016-02-15 21:04:07 +01:00
dxva2.c vd_lavc: let hardware decoder request delaying frames explicitly 2016-04-07 18:47:32 +02:00
lavc.h vd_lavc: let hardware decoder request delaying frames explicitly 2016-04-07 18:47:32 +02:00
mediacodec.c Add a mediacodec decoder hwdec wrapper 2016-03-25 21:35:59 +01:00
rpi.c vd_lavc: fix codec vs. decoder confusion 2016-04-07 17:48:00 +02:00
vaapi.c vaapi: determine surface format in decoder, not in renderer 2016-04-11 22:03:26 +02:00
vd.h video: approximate AVI timestamps via DTS handling 2016-02-11 16:14:30 +01:00
vd_lavc.c vd_lavc: let hardware decoder request delaying frames explicitly 2016-04-07 18:47:32 +02:00
vdpau.c vd_lavc: fix codec vs. decoder confusion 2016-04-07 17:48:00 +02:00
videotoolbox.c videotoolbox: change how videotoolbox format is managed 2016-04-07 19:54:58 +02:00