Follow-up to #17926, addressing the four additional instances flagged
by @garoto:
- DOCS/man/options.rst: "output size size is limited" -> "output size is limited"
- DOCS/man/input.rst: "Called after after a file" -> "Called after a file"
- video/out/gpu/video.c: "target target that needs to be written" -> "target that needs to be written"
- video/out/x11_common.c: "enable DPMS only we we disabled it before" -> "enable DPMS only if we disabled it before"
(this one wasn't a pure duplicate — the first "we" was a typo for "if"; the comment now matches the conditional on the line above)
can occur when a user shader sets a hook texture with more
components than supported. e.g overwriting LUMA with 3
component.
this does create a massive log spam when triggered, but that
seems consistent with the existing resize/realign error case.
Closes: https://github.com/mpv-player/mpv/issues/9863
strchr() can return NULL when no newline is found. Computing end + 1
before the null check on end is undefined behaviour per C11 6.5.6.
Move the next assignment inside the else branch to avoid the UB.
pass_upload_image currently stores the logical dimensions, which
in case of vulkan decoding may not match the physical one (e.g
1088 for 1080p). this mismatch results in glitches when using
polar scalers.
fix this by using the actual texture dimensions for hwdec plane
sizes.
Fixes: https://github.com/mpv-player/mpv/issues/14944
set_color conceptually is a swapchain command, but in Wayland it's
implemented in ra_ctx, so we have one jump of indirection. Having
`set_color` defined for context_vulkan doesn't mean that all ra contexts
support it. Add a bool to mitigate this.
This could be structured differently, but should be fine.
Fixes: #17487
Anything related color management gets complex and there is a lot of
platform-specific code that gets called in relation to this. Currently,
this stuff gets called in various places in the render loop which mostly
works but it's prone to "off by 1 frame" errors and also isn't clean.
Introduce this helper to hopefully unify all this kind of stuff under
one umbrella. For integration with vo_gpu_next, this needs to be called
before flip_page and we should stop abusing target_params for this
purpose. The next couple of commits will implement this in two places.
This was originally added way back when specifically for drm so it can
play nice with libplacebo for HDR. This is pretty ugly though and a bit
hacky. There's a better way to integrate this with target_csp. So drop
the pass_colorspace stuff in this commit and we'll change the
implementation in the next commit.
This allows to use DXGI enums for color spaces, which supports PQ
transfers and so on. Old D3D11_VIDEO_PROCESSOR_COLOR_SPACE is limited
and doesn't support HDR formats.
If `{d,c}scale` is not specified the scaling kernel is inherited from
`scale`. This made all `{c,d}scale-*` options not work, as they were
silently ignored.
This commits inherits scale options, only if `{c,d}scale` options were
not adjusted in the config.
We want to have symmetry on the input and output. Also outputting sRGB
encoded image to gamma 2.2 display is clipping blacks. 2.2 displays are
more common and are reference sRGB display, which is what we should
target.
OLEDs report min luminance of 0.0002 nits, while we couldn't set this
with options due to limit. Set limit, so that we cannot exceed the hdr
black value used in libplacebo in worst case scenario of target peak 10
nits.
Also cache last dxgi output, to avoid enumerating outputs, this is done
on every frame and we want to minimize impact of it.
While at it refactor and split loading libraries.
Instead of using IDXGISwapChain::GetContainingOutput create new DXGI
interface on each query. This may not be as efficient, but it solves the
issue where metadata is not updated after changing display settings.
DXGI caches parameters on swapchain creation and never updates it.
Also refactor it so it can be used from other contexts.
Note that DXGI is not D3D11, it's mixed in mpv code, may be cleaned in
the future.
Currently we check AV_FRAME_DATA_DISPLAYMATRIX for its rotation factor
but not for its flip factor, which could happen with some input files.
This commit adds and autovflip filter, which is applied before the
autorotate filter to flip vertically before rotating. It also changes
the displaymatrix reading code to output to mp_image->params.vflip so
it can be autoinserted as necessary.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
These were separate for some reason which makes no sense and is really
annoying if you want to use something that's in the vk version and not
the gl one or vice versa. As a bonus, these now get to live right above
the ra_swapchain definition which is more convenient.