Commit Graph
100 Commits
Author SHA1 Message Date
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
Kacper Michajłow dc5145c01d win32/menu: resolve system menu identity crisis
Don't reset system menu state, when menu data is empty, just disable the
items as needed. Fixes erratic behavior of system menu.

Fixes: 861908c70f
Fixes: #17290
2026-01-24 15:55:07 +01:00
Kacper Michajłow 3c09473327 Revert "ci/win32: manually install cmake to fix cpu detection issue"
No longer needed, upstream images has been fixed already.

This reverts commit e612f419f3.
2026-01-24 15:29:17 +01:00
Kacper Michajłow b5abb065a2 wayland_common: remove pl_color_space_infer
Common layer should alter target params anymore, it's on specific VO to
set correct params. Also this should be noop anyway, after
dmabuf_wayland fix in previous commits.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 43824e793b mp_image: call pl_color_space_infer in guess_csp
This will do a little bit more than only setting max_luma. Also will
fallback to bt.709/bt.1886, but that's fine. We would do it anyway
later.

If params goes through guess_csp, they shouldn't have "unknown" fields
anymore.
2026-01-24 14:08:08 +01:00
Kacper Michajłow 9dd598def8 vo_dmabuf_wayland: ensure target params consistency 2026-01-24 14:08:08 +01:00
Kacper Michajłow 9c6a3c06ec vo_kitty: add missing sequence end on unint
Fixes: #16299
2026-01-24 09:09:44 +01:00
Kacper Michajłow 32a164cc01 DOCS/man/mpv: reference low-latency profile in network example
It makes more sense in this context, than `fast` profile.
2026-01-23 05:18:14 +01:00
Kacper Michajłow 11b2004b91 vo_gpu{,_next}: fix overriding scaling parameters for inherited kernels
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.
2026-01-23 05:18:14 +01:00
Kacper Michajłow 6e54aa328d builtin.conf: enable antiringing in high quality profile
General consensus is that ortho scalers antiring while fast is not that
good, let's use it in high-quality profile only.
2026-01-22 00:10:48 +01:00
Kacper Michajłow f4db102a2e osdep/language-win: remove use of GetSystemPreferredUILanguages
The system preferred language is the language used during Windows
install. It doesn't have much purpose except that it is the backend
language for core Windows internals. All user facing dialogs and text
should follow the user preferred language, as this is what the user
selected and uses on daily basis.

It makes no sense to include system language in track selection.
2026-01-21 04:39:54 +01:00
Kacper Michajłow 5f6d5b3b7e ci/msys2: add build with -ftrivial-auto-var-init
Just to catch uninitialized variables early. Build all three                                                                                          unint/zero/pattern to compare the results between them and we don't                                                                                   accidentally depend on implicit initialization in tests.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 5fbd1caee2 ci/msys2: build also clang64 without ASAN
To cross compare results on basic build.
2026-01-18 12:59:16 +01:00
Kacper Michajłow 1db89a546a Revert "ci/build-msys2.sh: disable pdf-build for clangarm64"
This reverts commit 25aa402f1d.
2026-01-18 12:59:16 +01:00
Kacper Michajłow a339fe58b5 osdep/language-win: fix use of GetUserPreferredUILanguages()
Commit baf2fd2f28 fixed this for 2nd call
to GetSystemPreferredUILanguages(), but apparently regressed the 1st
call, duh.

To retrieve the size both buffer has to be NULL and size 0.

Memory has a lot of zeros, because it has been working quite
consistently on CI.
2026-01-18 11:09:00 +01:00
Kacper Michajłow 9483d6e12f ci: cancel pr jobs after new push
github.head_ref is only defined for pull_request event, so only those
will be grouped, the rest will fallback to unique run_id, so we neither
cancel them or serialize.
2026-01-10 02:48:15 +01:00
Kacper Michajłow 3d980d8ecc w32_common: release all input when entering context menu 2026-01-09 20:16:23 +01:00
Kacper Michajłow 2b50cecf86 w32_common: defer context menu update to WM_INITMENU
This avoids issues when menu-data property is updated while context menu
is open.
2026-01-09 20:15:48 +01:00
Kacper Michajłow e75a174743 ci/win32: add subrandr
Wrap subrandr build process into meson custom target.

Meson's custom target allow only file output (without path component),
so additionall copy step is added to get the library. Dummy stamp file
is used to connect custom target to dependency, the file is actually not
created, so target will be called each time, but it's fine, because
cargo will resolve it's own dependencies this way and build if needed.

This is glued only for static lib, this is what we need for our CI
script.
2026-01-06 13:58:11 +01:00
Kacper Michajłow 273f1db49e player/loadfile: indent file metadata if it is multiline
And sanitize a bit.
2026-01-06 13:57:21 +01:00
Kacper Michajłow 6c160f1aa8 common/msg: allow only SGR sequence in terminal output
Sanitize the remaining control codes to mitigate malicious files or
scripts that could manipulate the terminal in unintended ways, such as
clearing the screen or changing the terminal title. While the
surface-level impact may seem minimal, control codes can be a vector for
exploiting vulnerabilities in the terminal emulator itself. This can
occur without user interaction, since file tags are displayed by default
in mpv.

Reported by: zefr0x
2026-01-06 13:57:21 +01:00
Kacper Michajłow 72efbfd009 version.h.in: bump copyright year 2026-01-01 13:26:59 +01:00
Kacper Michajłow f57c5ca422 ci/win32: upload pdb separately
The job id is now in the artifact filename, so we can identify the
matching pdb file.
2025-12-31 02:04:15 +01:00
Kacper Michajłow afa090317b ci: make artifact names more descriptive
Add git hash, job id and avoid double zipping.
2025-12-31 02:04:15 +01:00
Kacper Michajłow c0d989c839 sub/sd_sbr: check runtime version 2025-12-24 19:01:40 +01:00
Kacper Michajłow 5c80b876db ci/msys2: enable subrandr on clang64
Implib issue has been fixed upstream.

See: https://github.com/afishhh/subrandr/commit/d26a1536bd15fb2c3dbf7866b855fe674a7363bb
2025-12-24 13:38:38 +01:00
Kacper Michajłow 6dff941c71 ci/{win32,mingw64,msys2}: add amf-headers 2025-12-23 07:06:34 +01:00
Kacper Michajłow cb1b6a54f2 video/filter/vf_amf: add AMD Frame Rate Conversion filter
D3D11 only for now. Documentation says that only D3D11 and D3D12 is
supported, but it looks like Vulkan is possible too. But I realized this
after implementing this version. Vulan may be added later.

Fixes: #16613
2025-12-23 07:06:34 +01:00
Kacper Michajłow e72807e7a0 mp_image_pool: set D3D11 BindFlags for all hw frame pools
It's always needed, not only in d3d11vpp.
2025-12-23 07:06:34 +01:00
Kacper Michajłow 670a266475 ci/build-linux-old: remove custom libplacebo build
Alpine 3.21 has libplacebo 6.338.2, we can use that.
2025-12-22 17:30:05 +00:00
Kacper Michajłow 604b43184f ci/linux-ffmpeg-6-1: add wayland-protocols
Bump Alpine to 3.21. It still on ffmpeg 6.1, but has newer Wayland
components that we want to test.
2025-12-22 17:30:05 +00:00
Kacper Michajłow b95846a28c meson: check wayland-scanner version
At least 1.23 is needed for 1.38 protocols. Also check other Wayland
deps to be 1.23, they are likely bundled at the same version as scanner
anyway.
2025-12-22 17:30:05 +00:00
Kacper Michajłow f011d73d5f wayland_common: suppress unused function warning on older protocols 2025-12-22 17:30:05 +00:00
Kacper Michajłow 5820906024 vo: limit manual redraws to estimated display fps 2025-12-22 11:14:58 +01:00
Kacper Michajłow c0433f064e vf_format: deprecate --vf=format=sig-peak 2025-12-22 10:19:38 +01:00
Kacper Michajłow efc44d05ff vo: trigger manual redraws at most at slightly over display fps
This is workaround for some windowing platforms that break when they get
too many present requests.

Fixes: #17082
2025-12-21 11:30:31 +01:00
Kacper Michajłow a310a65d35 vo: put vo states into union
They won't be used together. Could be refactored to put them into priv,
but for now, let's avoid doing bigger refactor.
2025-12-19 18:08:20 +01:00
Kacper Michajłow 93b68d7fe2 meson: remove png icons from win32 resource depend
They are not used, everything is already packed in mpv-icon.ico.
2025-12-19 18:08:20 +01:00
Kacper Michajłow c35e10c2da vo: remove unused configs from context 2025-12-19 18:08:20 +01:00
Kacper Michajłow 6739fd490b filters/f_decoder_wrapper: reinit decoder on audio-spdif opt change
Fixes: #17072
2025-12-18 13:07:13 +01:00
Kacper Michajłow 122abdfec3 video/out/aspect: don't overflow intermediate values in scaling calc
This fixes calculation of scaling bounds with extreme video zoom levels.

Fixes: https://github.com/mpv-player/mpv/discussions/17123
2025-12-15 01:46:40 +01:00
Kacper Michajłow 5d89f15e97 video/out/gpu/hwdec: load native D3D RA hwdec drivers first
There is no reason to load EGL/VAAPI first as it would fail in default gpu
context/api anyway, on Windows.
2025-12-14 13:42:22 +01:00
Kacper Michajłow 95c7599c41 ci/win32: downgrade meson to 1.9.2
1.10.0 fails to build cmake projects.

See: https://github.com/mesonbuild/meson/issues/15360
2025-12-08 22:23:08 +01:00
Kacper Michajłow 72dbcf119a ci: update some github actions 2025-11-30 17:50:10 +01:00
Kacper Michajłow 23f9381b80 mp_image: add ycgco-{re,ro} support
Fixes: #17077
2025-11-28 18:28:06 +01:00
Kacper Michajłow 9a85ae3ee0 m_option: be more resilent to new enum additions
Unfortunately we don't have control over libplacebo and cannot
synchronize such changes, so just return `<unknown>` to be forward
compatible with any possible changed.

Note that this should be updated ASAP to support new values.
2025-11-28 18:28:06 +01:00
Kacper Michajłow 52525dceb8 demux: clear packet pool when upper memory limit is lowered
This clears packets from the pool, that would never be reused under new
settings. Note that depending on demuxer state this clears only unused
packets, in some cases demuxer may still hold more packets than the new
limit. Fox example demuxer doesn't forcefully clear forward cache when
reducing the size.

Also keep packet pool, even if current file is not cached, this is
useful for all sorts of things and may be useful for next file.

This act only on user options values, regardless of internal demuxer
caching state, which can vary depending on track type or source.
2025-11-20 20:35:00 +01:00
Kacper Michajłow 701201b13c ci/win32: bump ffmpeg to 8.0 2025-11-15 17:08:47 +01:00
Kacper Michajłow 0f5fafdaad osdep/compiler: fix typo in MP_ASSERT_UNREACHABLE 2025-11-15 01:25:37 +01:00
Kacper Michajłow 83cedd1074 meson: define WINICONV_CONST to strip const from win-iconv 2025-11-15 01:25:37 +01:00
Kacper Michajłow 4489ef54d9 ci/win32: fix aom CRT type to be consistent with the rest of the build 2025-11-15 01:25:37 +01:00
Kacper Michajłow a21e47c45d ao_pipewire: fix mapping of wide channels 2025-11-14 21:41:15 +01:00
Kacper Michajłow 867e808f6c ci/openbsd: update to 7.8
Update to cross-platform-actions 0.30.0.
2025-11-14 21:41:07 +01:00
Kacper Michajłow bbafb74880 vo_gpu_next: limit min_luma to 1000:1 contrast ratio in SDR mode 2025-11-07 02:42:42 +01:00