Commit Graph
100 Commits
Author SHA1 Message Date
Kacper Michajłow 0c883fbe03 w32_common: update DWM corners state in when toggling fullscreen
Fixes: #17653
2026-04-03 00:07:29 +02:00
Kacper Michajłow bed0f49729 osc.lua: show window controls in idle 2026-04-01 16:07:27 +02:00
Kacper Michajłow 39302caae4 osc.lua: use window title for window controls from mpv core 2026-04-01 16:07:27 +02:00
Kacper Michajłow 40db14f85b vo_gpu_next: add few cpu timers 2026-04-01 15:20:11 +02:00
Kacper Michajłow 7757064bdd vo_gpu_next: add sw upload time to stats
Also fix lingering hw map stats.
2026-04-01 15:20:11 +02:00
Kacper Michajłow 4f9f1ffaf3 meson: build mpv.com with -Os
LLVM even in freestanding build required memset/memcpy/memmove to be
implemented. We don't use them directly but the calls are generated from
the code, which are later optimized away. Since this suppose to be small
utility application, we can always optimize it.

Fixes: #17664
2026-03-28 23:22:09 +01:00
Kacper Michajłow 793ab6dcb0 options: target-gamut now accepts custom CIE xy primaries
Fixes: #17633
2026-03-25 02:01:03 +01:00
Kacper Michajłow eda0e0b093 w32_common: latch force position until it is actually applied
In case we are in fullscreen, we might not apply it right away.
2026-03-25 01:42:12 +01:00
Kacper Michajłow ef7bced028 osc.lua: make title wider in floating layout
We don't put anything else on title line, so we don't need reserved
space as with other layouts.
2026-03-24 19:24:49 +01:00
Kacper Michajłow f42480d0cc w32_common: fix Windows 10 workaround for initial window pos
Restores hack from 3d4170b81b to work
again.

Fixes: 7466a9f9f3
2026-03-24 00:50:08 +01:00
Kacper Michajłow e757931859 af_scaletempo: limit options to resonable range
This fixes multiple overflows when passing huge values. Which causes
either invalid memory accesses when memory allocations are wrong size or
huge allocations leading to OOM.

Reported by: Trail of Bits
2026-03-23 23:34:20 +01:00
Kacper Michajłow ed534eb7f5 vo_gpu_next: add stereo osd support
Duplicate OSD/Subtitles for left and right eye.

Fixes: #12462
2026-03-23 23:16:32 +01:00
Kacper Michajłow 7466a9f9f3 video/out/win_state: don't move window when force-window-position=no
When force-window-position=no place window on requested position only on
init (when VO requests `force_pos`), except that keep existing
position on auto resizes.

This applies to both user provided geometry and default center
position.

Fixes: #17588
2026-03-23 15:05:01 +01:00
Kacper Michajłow 5df1681c48 vo_gpu_next: add timer for hwdec frame mapping
With `--d3d11va-zero-copy=no` (default), we do the GPU-GPU copy of the
frame, add this time to the stats.
2026-03-23 15:04:11 +01:00
Kacper Michajłow 7ec8a7e9b1 vd_lavc: ensure decoder state is valid after reinit
This fixes dynamic hwdec switching, which would often fails, because
hw decoder were feed data without context, which caused decoding errors,
which in turn disabled hwdec.

command.c does queue_seek() after decoder reinit, but it may already be
too late, by the time seek to keyframe finishes.

Fix this, by just discarding the data until we have safe point to start
decoding again. Limit this only for hwdec to avoid formats that may not
have ffmpeg parser and not give us keyframe information and limit to 96
frames, just as safety to not lock the player, but this shouldn't happen
in practice.

This should also fix cases, when media file is cut in a way that would
cause decoding errors at the start.

Fixes: #17484
2026-03-23 13:29:59 +01:00
Kacper Michajłow 9339a68dfb demux_lavf: mark packets with keyframe for wrapped avframes too 2026-03-23 13:29:59 +01:00
Kacper Michajłow c798884163 w32_common: respect C{X,Y}MIN system metrics
Fixes: #8440
2026-03-21 23:31:15 +01:00
Kacper Michajłow a380190a41 w32_common: fix handling of WM_SIZING
Fixes some corner cases when resizing window with keep aspect ratio
enabled. Limit correctly window to working area, also after adjusting
aspect ratio to avoid unexpected resizes and window not staying in
position. Use integer math to have consistent rounding, to avoid window
"drifting".

Fixes: #8728
2026-03-21 23:31:15 +01:00
Kacper Michajłow 6c9105380c w32_common: set max window track size 2026-03-21 23:31:15 +01:00
Kacper Michajłow 3d4170b81b w32_common: force DWMWA_EXTENDED_FRAME_BOUNDS to work on init
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so
show it off-screen to get correct values.

Fixes: https://github.com/mpv-player/mpv/pull/16127#issuecomment-4063603866
2026-03-17 10:13:34 +01:00
Kacper Michajłow 53f7c6e9dd w32_common: add missing title bar height calc back
I've lost this piece of code when doing rebases or testing. This is
needed to correctly calc maximized window size.
2026-03-17 10:13:34 +01:00
Kacper Michajłow d12f2ce19c hwdec_vulkan: guard deprecated AVVulkanDeviceContext.lock/unlock_queue
libavutil deprecated AVVulkanDeviceContext.lock/unlock_queue without
replacement [1]. This prevents us from using queue locking, as those
callback will be removed in lavu. Set those callbacks as long as they
are still present, they will be noop in libplacebo with
`VK_KHR_internally_synchronized_queues`.

It's unclear what will happen to devices that do not support
`VK_KHR_internally_synchronized_queues` when the lock/unlock_queue
callbacks are removed.

[1] https://code.ffmpeg.org/FFmpeg/FFmpeg/commit/c102e89448a06d9920920923a4008fee3db4ea37
2026-03-15 17:45:49 +01:00
Kacper Michajłow 44f06c6dd0 osc.lua: fix typo
oops...

Fixes: 6bf5a6ca7c
2026-03-13 20:12:53 +01:00
Kacper Michajłow 88e741a019 osc.lua: use fluent icons by default for floating layout
Floating layout is more rounded comparet to square bar layout, so fluent
icons are better match here.
2026-03-13 19:16:47 +01:00
Kacper Michajłow 6bf5a6ca7c osc.lua: add floating layout 2026-03-13 19:16:47 +01:00
Kacper Michajłow 8bf384fe6d osc.lua: add osc-icon_style option 2026-03-13 19:14:39 +01:00
Kacper Michajłow 1d7d6c2719 mpv-osd-symbols: add some Fluent UI System Icons to mpv font
This uses Fluent UI System Icons [1] as a source for icons. The glyps
are generated using `TOOLS/gen-fluent-glyphs.py` script, which downloads
Icon and convert for our mpv font to use. Glyphs are vendored in our
repository to avoid external dependency.

Script could be extended to add more icons/variants easily, currently
only filled version are imported.

[1] https://github.com/microsoft/fluentui-system-icons
2026-03-13 19:14:39 +01:00
Kacper Michajłow fbdaddf968 w32_common: refactor window resizing
Fixes lots of issues with current window resizing and window style
modifications.
2026-03-13 15:13:31 +01:00
Kacper Michajłow df4736df26 win32: remove SC_RESTORE handling
It doesn't seem to be neeeded anymore.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 6be1e3f2b9 win32: don't override fs user option
We don't support other ways of fullscreening.

Fixes: #16119
2026-03-13 15:13:31 +01:00
Kacper Michajłow c804e55dbe win32: change resize window event logs to trace 2026-03-13 15:13:31 +01:00
Kacper Michajłow a34ecb5284 video/out/win_state: allow internal size constraint for window_geometry
Will be useful to limit the size directly based on platform requirement.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 8142c831f0 video/out/win_state: pass opts as argument
Options may be at different state when caller is using it's own cached
copy. This makes opts consistent in usage.
2026-03-13 15:13:31 +01:00
Kacper Michajłow 27b0979b6b osc.lua: set sub_margins to no
Subtitles are complex subsystem, let's leave the choice to move them
with margin on user.
2026-03-13 15:10:21 +01:00
Kacper Michajłow 0f37c2abef osc.lua: use dedicated options to control SUB/OSD offset
There is concern that with certain user options or script the value of
`{sub,osd}-margin-y` value may be persisted or overwrite user option
when it's changed while OSD is visible and offset is applied.

Fix this by using dedicated option.
2026-03-13 15:10:21 +01:00
Kacper Michajłow d83931aa61 ci: add dependabot to update actions for us 2026-03-12 16:08:15 +01:00
Kacper Michajłow 79bf5d2684 osc.lua: increase deadzoneszie to 0.75
This allows to retain deadzone in the middle of the screen when both top
and bottom bars are enabled. We also doesn't have to show bars that
early before moving mouse down.
2026-03-12 00:02:41 +01:00
Kacper Michajłow 3b66428152 osc.lua: fix window controls showing in fullscreen
If `no-border` or `no-title-bar` was used, window controls would enable
also in fullscreen, this was inconsistent, as window decorations are not
visible ragardless of those options in fullscreen mode.
2026-03-12 00:02:17 +01:00
Kacper Michajłow 24500c5e27 f_decoder_wrapper: fix decoder name/desc allocation parent
Those strings has to be owned by mp_codec_params, not decoder wrapper
priv.

Our assumption is that we set those strings here once on decoder init
and they will not be changes during the life time of the
mp_codec_params, hence why we need to make sure they are not deallocated
too soon, in case they happen to be in use.

Fixes, use after free in some cases, when tracks are deselected.
2026-03-11 00:20:22 +01:00
Kacper Michajłow 7b2feb9429 osc.lua: add osd-margin option
Fixes: #17539
2026-03-10 19:45:03 +01:00
Kacper Michajłow e1e6eb8b6e osc.lua: add sub-margin option 2026-03-10 19:45:03 +01:00
Kacper Michajłow aa8966a50f osc.lua: add dynamic_margins option 2026-03-10 19:45:03 +01:00
Kacper Michajłow d4625c7db6 osc.lua: fix always visibility 2026-03-10 19:45:03 +01:00
Kacper Michajłow 32a690b8bd DOCS/man/osc: fix boxvideo description 2026-03-10 19:45:03 +01:00
Kacper Michajłow 85f9e6f274 vf_d3d11vpp: allow more future/past frames
Apparently some video processors request 15-20 future frames.

Fixes: https://github.com/mpv-player/mpv/pull/17413#issuecomment-4032784635
2026-03-10 18:30:10 +01:00
Kacper Michajłow 88ac54b95d osc.lua: hide osc or wc when leaving its area
Those zones use input sections, but in OSC we allow them to overlap. So,
we might switch to the other section, after which point we won't get
mouse_leave event that would hide the bar for the other section.

This makes hidding/showing WC and OSC more consistent.
2026-03-10 08:56:23 +01:00
Kacper Michajłow 3ff7b04790 player/command: don't send mouse move event on mouse leave request 2026-03-10 08:56:23 +01:00
Kacper Michajłow cbecfb4046 wayland_common: add scRGB support 2026-03-09 12:00:33 +01:00
Kacper Michajłow 14508544ea wayland_common: keep unaltered hint params for changed check
This avoids trying to set params on every frames, if they were modified
by the set color itself.
2026-03-09 10:18:30 +01:00
Kacper Michajłow be2336fcb3 wayland_common: warn on not supported color representation 2026-03-09 10:18:30 +01:00
Kacper Michajłow 040eb5b656 vo_dmabuf_wayland: add BT.2100 mapping 2026-03-09 10:18:30 +01:00
Kacper Michajłow 218be8d93a vo_dmabuf_wayland: use color parameters prepared in reconfig
Those has Dolby Vision metadata stripped and have all parameters
correctly guessed.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 63f3d1731a video/out/opengl/context_wayland: export preferred colorspace 2026-03-09 10:18:30 +01:00
Kacper Michajłow 012d9baa22 vo_wlshm: use image params after conversion 2026-03-09 10:18:30 +01:00
Kacper Michajłow 66dcb2ba7b wayland_common: set luminances
This fixes --target-trc=linear output and makes our output luminance
ranges more explicit.
2026-03-09 10:18:30 +01:00
Kacper Michajłow fe9f917d8e vo_gpu_next: set color directly using Wayland protocol
Wayland color managment is not really flexible to be usable with Vulkan
color spaces, so set it directly.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 2417d17c81 wayland_common: only bind color surface when actually used
This is required, because other modules like Vulkan may need to use it,
and only single color surface is allowed in Wayland.
2026-03-09 10:18:30 +01:00
Kacper Michajłow 4a815734e3 player/playloop: clear demux packet pool on idle
Packet pool is useful to avoid work and additional allocations when
switching files, going to idle should free the pool as those packets may
not be used for some time.

Fixes: #17525
2026-03-09 08:54:53 +01:00
Kacper Michajłow 396bf65ec5 select.lua: fix crash on user_profiles sort
The list is filtered, so we need to not use index of the input.

Fixes: Lua error: attempt to compare string with nil
2026-03-08 11:50:08 +01:00
Kacper Michajłow a205e95efb ci/win32: change from choco to winget
Chocolatey is unstable recently, let's try winget.
2026-03-07 12:30:51 +01:00
Kacper Michajłow 289bcb9e13 Revert "ci/win32: downgrade meson to 1.9.2"
This reverts commit 95c7599c41.
2026-03-07 12:30:51 +01:00
Kacper Michajłow debfdf9402 ci/win32: pre-generate SPIRV-Tools build-version.in
Work around meson's cmake module not supporting OBJECT_DEPENDS [1],
which broke the build after SPIRV-Tools removed the explicit
spirv-tools-build-version target [2].

[1] https://github.com/mesonbuild/meson/issues/9062
[2] https://github.com/KhronosGroup/SPIRV-Tools/commit/54ad621f6e3fa758c1b80981489fcf0b62d2b752
2026-03-07 12:30:51 +01:00
Kacper Michajłow 9548ec5531 osc.lua: avoid use of goto
For Lua 5.1 compatibility.
2026-03-07 07:28:13 +01:00
Kacper Michajłow f9190e57f9 vo_gpu_next: add scRGB support
Fixes: #17076
2026-03-06 16:17:58 +01:00
Kacper Michajłow 74e8cee80d vo_gpu_next: always clip hdr.prim to container primaries
It may happen that .hdr.prim is set from display properties and exceeds
.primaries. This would make gamut mapping work incorrectly.
2026-03-06 16:17:58 +01:00
Kacper Michajłow 45019b21bf osc.lua: clean areas autohide
Fixes some corner cases with showing/hiding zones.
2026-03-05 16:34:22 +01:00
Kacper Michajłow eda3b89278 osc.lua: make top/bottom bar show independently on mouse proximity
Controlled by `windowcontrols_independent` opt.
2026-03-05 12:44:11 +01:00
Kacper Michajłow c55bdc3282 video/out/gpu: signal correctly if set_color is supported
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
2026-03-02 02:04:36 +01:00
Kacper Michajłow 3511e467e7 vo_gpu_next: use typed variable for alpha 2026-02-28 13:32:19 +01:00
Kacper Michajłow 2e8520311c vo_gpu_next: fix rgb range in Wayland hint
Fixes: 9d2da2567c
Fixes: #17479
2026-02-28 13:32:19 +01:00
Kacper Michajłow e54cee1b23 player/command: apply expand-properties modifier also for string lists 2026-02-27 20:18:42 +01:00
Kacper Michajłow ae119448b2 m_option: remove duplicated code for float/double range check
The float version was missing "default" case. This fixes options with
M_OPT_DEFAULT_NAN.

Fixes: 0e7f9c3
Fixes: #17436
2026-02-24 19:41:53 +01:00
Kacper Michajłow 250d6056c3 ci/win32: update runners to windows-2025-vs2026 2026-02-21 01:36:35 +01:00
Kacper Michajłow 5159300ba3 ci/win32: use vswhere to find Visual Studio 2026-02-21 01:36:35 +01:00
Kacper Michajłow f7ad4a5f8f vf_d3d11vpp: set output format for NVIDIA RTX Video HDR
It outputs RGB tone mapped image, set params accordingly.

Fixes: #17265
2026-02-19 19:18:56 +01:00
Kacper Michajłow 43f00135ea vf_d3d11vpp: add dots to logs 2026-02-19 19:18:56 +01:00
Kacper Michajłow 568522e69e vf_d3d11vpp: use ID3D11VideoContext1 interface for setting color space
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.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 825ba4167e hwdec_d3d11va: add support for RGB formats
This will be useful for mapping RGB output from d3d11vpp tone mapping.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2aba5a7167 ra_d3d11: allow mapping rgba10_a2 format
This is needed for ra_get_imgfmt_desc() which otherwise would not allow
rgba10_a2 format, because it doesn't have all components with the same
size. However it's nativelly supported by d3d11, so we add it to special
formats, same as opengl does.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 18330cb1ed video/img_format: add repack test for new formats 2026-02-19 19:18:56 +01:00
Kacper Michajłow 54976fe147 video/img_format: add IMGFMT definitions for x2bgr10 and rgba16f
Will be useful for mapping hardware frames. We could add more formats
here, but those should be enough to allow RGB processing.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 71bc92a080 video/img_format: move IMGFMT_X2RGB10 from custom range 2026-02-19 19:18:56 +01:00
Kacper Michajłow 7b015a9846 video/img_format: remove custom rgb30 definition
It's supported in ffmpeg since 4.4, no need to keep custom code for it.
2026-02-19 19:18:56 +01:00
Kacper Michajłow 2b4b345a3a video/img_format: rename IMGFMT_RGB30 to IMGFMT_X2RGB10
It's supported in ffmpeg, so let's have naming parity.
2026-02-19 19:18:56 +01:00
Kacper Michajłow af47c1d43b vo_drm: don't define custom IMGFMT values
We should never make such mappings that are not covered by
img_formats.h.
2026-02-19 14:20:56 +01:00
Kacper Michajłow e9a3bf2ad1 vo_drm: use always little endian formats
DRM formats are little endian, unless the format is ORed with
DRM_FORMAT_BIG_ENDIAN.
2026-02-19 14:20:56 +01:00
Kacper Michajłow 73ae34e2d0 vo_drm: fix xbgr2101010 format mapping
Fixes: 6b452788c4
2026-02-19 14:20:56 +01:00
Kacper Michajłow c2c081f49a vf_d3d11vpp: use half-rate for IVTC mode
The optimal way would be to use custom rate based on telecine cadence,
but it's not supported by any driver in practice. So instead, allow
driver to field match and output with duplicated frames, which can be
removed using decimate filter.

Note that in practice all GPU vendors uses single video processor for
all deinterlacing, so IVTC will be done even if mode is not explicitly
selected. At least the field matching part, because correct rate output
is not supported. The main difference is that when selecting more we
output at video frame rate, not field rate.
2026-02-18 18:13:18 +01:00
Kacper Michajłow f571fd73a1 vf_d3d11vpp: print supported custom rates 2026-02-18 18:13:18 +01:00
Kacper Michajłow 2141fa88b3 vf_d3d11vpp: fix deinterlacing
There were multiple issues in API usage, not setting correct
OutputIndex, lying about frame field parity to make it work without
OutputIndex. Not passing reference frames which forced BOB mode always.

Fix all issues and allow forcing BLEND/BOB mode by not passing frames.
Blend mode also sets half rate output. Half rate could be separate
option too, but there is not much gain from it except for debugging
really.

Fixes: #15197
2026-02-18 18:13:18 +01:00
Kacper Michajłow 47ed5785e4 video/filter/refqueue: add mp_refqueue_output_fields 2026-02-18 18:13:18 +01:00
Kacper Michajłow db2352f69a vf_d3d11vpp: update mode selection logging 2026-02-18 18:13:18 +01:00
Kacper Michajłow 626f1344c8 vf_d3d11vpp: rename ivctc to ivtc
This was a typo. Although this changes the user option name, this
filter, especially this option, is so niche that I fix it without a
deprecation period.
2026-02-18 18:13:18 +01:00
Kacper Michajłow 4fd2600c65 d3d11: support --d3d11-output-format fully for gpu-next 2026-02-08 22:14:18 +01:00
Kacper Michajłow c9c039b7f1 d3d11: set pl_d3d11_swapchain_params.alpha_bits if alpha is needed 2026-02-08 22:14:18 +01:00
Kacper Michajłow 97867450ba osdep/w32_register: fix EstimatedSize
Move PathCchRemoveFileSpec after actually getting the file size. It must
have been swapped at some point by accident.

Also use correct unit for the size.

Fixes: #17375
2026-02-05 23:23:38 +01:00
Kacper Michajłow 54da0ba070 demux/packet_pool: unref packet early if we can do it without penalty 2026-01-28 18:40:19 +01:00
Kacper Michajłow a1ea4f3aec demux/packet_pool: always return default packet state from pop
This is not functional change, as pop() is only used in packet_create()
which already cleared the packet, but it's better to make it explcit.
2026-01-28 18:40:19 +01:00
Kacper Michajłow 3b17ab5d3b demux/packet: add demux_packet_unref helper 2026-01-28 18:40:19 +01:00
Kacper Michajłow 6136c01f95 win32/menu: add mnemonic v for mpv sub-menu
`m` is taken by `Move`, use `v` as it's closer to alt+space than `p`.
2026-01-25 15:39:20 +01:00