API version 12 removes the old style of peak detection, and API version
13 adds a new algorithm to replace it. These were annoyingly not done as
a single commit, so we need to guard them separately to prevent any
failures to compile when e.g. bisecting.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This was introduced in API version 10, and refactors the tone mapping
desaturation curve into a new, more tunable algorithm that has some
different behavior. In particular, it allows us to simulate exactly the
"hollywood" style of tone mapping, so we document those special values
specifically.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This was added to the list of display primaries in libplacebo 0.5.0, but
we never added it to this list. No ifdef is needed because we already
require libplacebo >= 0.5.0 in our configure.ac.
We add it to the end of the list to avoid breaking existing vlcrc, even
though the order is less pretty this way.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This uses libplacebo's rendering helpers for all video output, on top of
the vulkan graphics API. Some notes:
- The existing fourcc/chroma helpers don't really line up with what the
libplacebo API expects, or in some cases return values that just don't
seem to make sense. I was advised against touching them for fear of
breaking the rest of VLC - so we add our own helpers that give us the
information in the format we need for libplacebo.
- Not all libplacebo options are mapped. There's no ability to create
custom filter functions (which libplacebo/mpv support), and there's
also no support for ICC profiles / 3DLUTs (which libplacebo supports)
nor for the new color blindness simulation parameters in libplacebo
v0.6. We also don't map the VLC brightness/hue/gamma/etc. options to
the libplacebo structs - we could do it for free as part of the video
decode matrix, rather than needing to insert a CPU filter for it.
- How to create the vulkan surface will depend on the platform (much
like in opengl), so we move context, surface and device creation into
a single module (`vulkan/surface.c`) which will be conditionally
compiled depending on the platform in order to provide support for
multiple surfaces side-by-side (e.g. x11 and wayland). This does mean
that the context/device-related options end up being separate per
platform, but OTOH this is not that bad since different platforms
might want different e.g. swapchain modes (an example being wayland,
which can make better use of mailbox rather than fifo).
- libplacebo doesn't have a "configure" step, instead all rendering
parameters are fully dynamic. So we could call UpdateParams() in our
module at any point in time when the config values change.
Unfortunately, there's no easy way for us to find out when this is the
case, so right now changing the vulkan module options requires a
module reinit to take effect. In theory we could change this. (As an
aside: calling var_Inherit* per frame does work to get us the changes
in "realtime", as soon as the user clicks "save", but this may block
for arbitrary amounts of time so I was advised against doing it)
Due to the new functions, structs and enum members used, the minimum
libplacebo version has been bumped up to v0.5.0. In theory we could also
try and support v0.4.0 with some #ifdefs, but v0.5.0 has been out for
several months now so it should be a safe requirement.
This is in preparation for a new vout based on libplacebo, for which
reusing these shared helpers with OpenGL will make sense.
Apart from moving stuff around, this commit only has minor changes
(changed define names in some places, minor rewording of some options).