Commit Graph
54151 Commits
Author SHA1 Message Date
Dudemanguy 4ee4444b68 options/path: fix a lie in comment
During the original PR, that was true but mp_normalize_path was changed
in 0755edb327 to allow NULL talloc_ctx.
Deleting the comment was forgotten since it was never true when the
commits were merged, so do it now.
2025-07-16 13:42:38 +00:00
Thomas Hebb 036fae317c sub/lavc_conv: prevent corruption after switching WebM WebVTT subs
WebVTT subtitles in WebM require special logic, and we signal that using
the "webvtt-webm" codec name, which is not part of FFmpeg. That worked
fine until commit 94859997b8 ("sub: update codec info") added a call
to mp_codec_info_from_av(), which overwrites our codec name with
FFmpeg's the first time the subtitle decoder is initialized. As a
result, WebM WebVTT subtitles are currently not rendered correctly after
switching subtitle tracks. Fix the issue by resetting the codec name
after calling mp_codec_info_from_av().
2025-07-16 13:41:54 +00:00
Thomas Hebb 6c720f0f49 sub/lavc_conv: remove unneeded strdup
We originally took the codec name as a separate parameter, making this
talloc_strdup() good hygiene. But since commit 73779a8c70
("sub/lavc_conv: take sd context as a parameter for lavc_conv_create"),
we take the name from the sd context, whose other fields we already
reference. So it should be safe just to copy the pointer like we do in
sub/sd_lavc.c.
2025-07-16 13:41:54 +00:00
Kacper Michajłow dd2cccec19 sub/ass_mp: revert some unwanted changes
We want to add padding around the whole bitmap, not within it. Smaller
parts are rendered onto bigger bitmap. Remove leftover padding code.

Fixes: e2fc75434e
2025-07-16 01:49:29 +02:00
Kacper Michajłow 7d3870b7f8 DOCS/man/options: add a note about MAINPRESUB and gpu-next 2025-07-16 00:12:45 +02:00
Kacper Michajłow 2da63bb4eb vo_gpu_next: reduce fp conversions in overlay color
This is cosmetic, shouldn't matter in practice.
2025-07-16 00:12:45 +02:00
Kacper Michajłow 3a7a027f44 vo_gpu_next: add support for blend-subtitles=video
Render subs and video resolution. Important for performance of some
heavy typesetting.
2025-07-16 00:12:45 +02:00
Kacper Michajłow e2fc75434e sub/ass_mp: add missing padding for ass packer
This ensures it is safe to sample packed image with bilinear filtering.
2025-07-16 00:12:45 +02:00
Kacper Michajłow 55043cb5c8 vo_gpu_next: don't do partial updates on hint luminance
This ensures that we don't mix maxCLL if target already has max_luma.
This can be opt-in with mode=source and manual target-peak override. No
need to merge to much things.
2025-07-16 00:09:49 +02:00
Dudemanguy 5c4c27e6b1 m_option: remove unneeded legacy syntax parsing
This code got shuffled around over the years but fundamentally it was
first introduced in 2c22fcd350 to fix a
parsing issue with specifically the af and vf options. Syntax like af*
and vf* used to be valid and this was part of dealing with that case.
Later 50008adf4a completely changed this
and ripped out support for the wildcard behavior. But these few lines to
deal with the special case were never removed. The token splitting has
been unnecessary for years and is confusing, so clean this up and
finally remove it.
2025-07-15 18:06:14 +00:00
Dudemanguy 2763390c15 input/cmd: use m_option_set_node_or_string
Like the previous commit, this has a conditional that matches exactly
what this helper function is supposed to do. For logging reasons, we
can't completely remove the val->format comparison, but it can be
simplified to be cleaner.
2025-07-15 18:06:14 +00:00
Dudemanguy 04ca4fd1ed m_config_frontend: use m_option_set_node_or_string
There is a usage of m_option_parse which exactly mirrors the intention
of the helper function m_option_set_node_or_string. Instead of
duplicating the logic, just call the m_option_set_node_or_string
instead.
2025-07-15 18:06:14 +00:00
Dudemanguy 024628eb4b m_option: change m_option_set_node_or_string to accept bstr directly
It's easier for potential callers of this to convert char to bstr than
vice versa. Internally, the function uses bstr anyway so just eliminate
the conversion and let callers do it. The next commit will add another
caller of this where the bstr param is preferable.
2025-07-15 18:06:14 +00:00
Dudemanguy fdbea0fe66 vo_dmabuf_wayland: don't set HDR metadata on SDR transfers
This probably didn't do anything previously, but technically SDR
transfers could theoretically have HDR metadata and we would set them.
This isn't worth supporting so skip this step for SDR.
2025-07-15 01:22:41 +00:00
Dudemanguy 699054cfd9 vo_dmabuf_wayland: use pl_color_space_infer on HDR transfers
vo_gpu_next already does this. If we have HDR, try to fill out any
missing values before doing validation.
2025-07-15 01:22:41 +00:00
Dudemanguy 8f9a10fd45 vo_dmabuf_wayland: tighten up hdr metadata sanity checking
1a70de259d added some sanity checking to
these values to avoid throwing a protocol error (which are fatal) since
the wayland protocol is very strict about the ranges of these values.
Let's tighten up the checks just a little bit to be on the safe side. If
the min_luma is not less than max_luma, consider this a hard error. We
won't set any hdr metadata at all if this happens. For max_fall and
max_cll, we leave mostly the same as before where the value gets set to
0 if it doesn't pass the wayland protocol specification. For the case
where max_fall is greater than max_cll, consider this invalid and set
both values to 0.
2025-07-15 01:22:41 +00:00
nanahi 86e884bc4a video/out/gpu/video: fix target colorspace for redrawed frames
Fixes oversaturation when pause/redrawn with Windows HDR mode on.
2025-07-15 01:42:21 +02:00
Dudemanguy 1fbf1e1d91 encode: simplify all initial blocking logic for encoding
0ab3184526 introduced most of the stuff
being removed here. The idea is that when doing encoding the core should
wait until everything is initialized. This is true, but the old
implementation is overly complicated and confusing. What we need is for
both the AO to be initialized and the VO to be reconfigured for encoding
to start. Because of the way initialization works, the VO reconfig
always happens first. Changing the order in playloop would of course
break this assumption, but we can trust that nobody would arbitrarily do
that. So all that needs to be done here is that write_video should wait
until the AO is up before pushing frames. And that only applies in
encoding mode and if there is a selected audio stream in the first
place. This is a simple check.

With that in place, all of this extra junk can be dropped. We don't need
special booleans or events for the simple task of making sure the AO and
VO are both up.
2025-07-14 22:09:49 +00:00
Jens Peters ff595049e9 docs: document tablet pad properties 2025-07-14 22:07:24 +00:00
Jens Peters 0fbf20f057 wayland: expose tablet pad buttons to input system
Expose all buttons state to the Client-API for usage in e.g. lua.
2025-07-14 22:07:24 +00:00
Jens Peters 4d12a60be2 docs: document tablet input 2025-07-14 22:07:24 +00:00
Jens Peters db60145c2d wayland: move tablet tool handling to mpv input system
Upgrade tablet input to first class citizen similar like
touch input, but more simple since use case for now is
mouse emulation only.

Keep state for coordinates and in-proximity.
Introduce property for disabling tablet input.
Introduce Client-API property `tablet-pos`.
2025-07-14 22:07:24 +00:00
Jens Peters 43a030452c wayland: add tablet tool handlers for tap, motion and button
Just simple mouse emulation for now.
2025-07-14 22:07:24 +00:00
Jens Peters 992cb27529 wayland: set tablet tool cursors
Always update the pointer cursor and all tablet tool cursors together.
Also ensure a visible cursor on proximity-in.
2025-07-14 22:07:24 +00:00
Jens Peters 7177976dc5 wayland: wire tablet pad group listener
This ensures that tablet pad objects that belong to a group,
thus rings and strips, are all properly destroyed on removal
or shutdown.

Note that event listeners for ring a strip are not added
since we are not (yet) interested in them and they are not
needed for proper destroy.
2025-07-14 22:07:24 +00:00
Jens Peters 549bc390e6 wayland: wire tablet pad listener
This ensures that tablet pad objects are properly destroyed on
removal or shutdown, even if we are not (yet) interested in
tablet pad events.
2025-07-14 22:07:24 +00:00
Jens Peters 0ef3b1d1bc wayland: wire tablet tool listener
Setup tablet tool events, we want to use motion, tip and
button events later.
2025-07-14 22:07:24 +00:00
Jens Peters 785540f7e9 wayland: wire tablet listener
This ensures that tablet objects are properly destroyed on
removal or shutdown, even if we are not really interested
in tablet events.
2025-07-14 22:07:24 +00:00
Jens Peters 48804a24f8 wayland: wire tablet seat listener
Tablets require their own tablet manager and tablet
seats since multiple tablets/pens can be connected to
a single seat. So this is unfortunately a lot of
wiring.
2025-07-14 22:07:24 +00:00
Jens Peters f73586ddd4 wayland: build tablet protocol unconditionally
The tablet protocol is supported in the current winimum
wayland-protocols version, so we can always build this.
Note that this is still the unstable version, once the
minimum required wayland-protocol version is 1.35, the
stable version of protocol can be included.
2025-07-14 22:07:24 +00:00
Kacper Michajłow bd2118026b ci: add rust support 2025-07-12 20:40:04 +02:00
Dudemanguy 08d7d049d1 build: install encoding-profiles.conf into the system data directory
fd4e3af740 originally started installing
it, and we've been doing it ever since then. The value of having all of
these encoding profiles predefined by default is pretty dubious since a
lot of them are pretty old ('MP4 for Nokia N900' being a shining
example) and mpv is not really a good encoding tool anyways. Let's treat
it like the other conf files in etc and install it in the data directory
for reference. If someone really uses these, they can copy the file over
locally to their mpv config directory and it'll still work fine.
2025-07-12 14:01:54 +00:00
llyyr 329c5294aa meson: remove wayland-protocol 1.39 check from top level meson.build
We do this check inside video/out/meson.build, and the subdirectory is
included before this already
2025-07-12 13:59:11 +00:00
llyyr 112f0000cb wayland: use _SINCE_VERSION instead of checking for enum constant
We can't use #ifndef with an enumerator, this would evaluate to always
be true
2025-07-11 21:54:01 -05:00
Kacper Michajłow 88f34229c6 fuzzers/common: stop after 15 events if there is not playback reset
We wait for timeout and stop fuzzing, but if there are events spammed
this timeout never fire, so instead limit the number of events after
playback reset.
2025-07-12 01:57:43 +02:00
Kacper Michajłow 84596abd83 demux_lavf: disable demuxer-lavf-o for fuzzing
This is raw option passed to lavf and can be used to inject complex
filters and so on, avoid this for fuzzing as it more fuzzing ffmpeg side
anyway and causes issues with timeouts for some big processing.
2025-07-12 01:57:43 +02:00
Kacper Michajłow f07dbb3aef demux_edl: limit to 3 parts for fuzzing
There is no need to test huge playlists, 3 elements it enough to test
parsing.
2025-07-12 01:57:43 +02:00
Kacper Michajłow fec62de298 demux: add nested demuxer depth limit
Useful for demux_edl where it is possible to have huge nested tree of
demuxers and they are added recursively, which causes stack overflow in
some cases.

Found by OSS-Fuzz.
2025-07-12 01:57:43 +02:00
llyyr d21b1f159c vo: move vo_gpu_next above vo_gpu in probe order 2025-07-12 01:34:02 +02:00
Kacper Michajłow da538f3f29 d3d11_helpers: add caching of dxgi factory until it's current
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.
2025-07-11 21:53:58 +02:00
Kacper Michajłow 0b6feb993b vo_gpu_next: add source-dynamic mode to colorspace hint 2025-07-11 21:53:58 +02:00
Kacper Michajłow 72fe8fe3ea vo_gpu_next: infer best containing primaries for raw primaries 2025-07-11 21:53:58 +02:00
Kacper Michajłow 84c9eafaa9 vo_gpu_next: override target params when pass_colorspace is used
pass_colorspace mode is special and doesn't set parameters on the
swapchain, so don't use swapchain reported parameters.
2025-07-11 21:53:58 +02:00
Kacper Michajłow c5c1477eb4 vo_gpu_next: change --target-colorspace-hint to auto by default
Auto mode will also enable hint for SDR formats if target metadata is
reported by current output context.
2025-07-11 21:53:58 +02:00
Kacper Michajłow ce076de31f vo_gpu_next: add --target-colorspace-hint-mode option
Useful to actually set target display paramters to colorspace hint.
2025-07-11 21:53:58 +02:00
Kacper Michajłow 5b1df3c5d9 command: add video-params/prim-* properies
Available if raw primaries differ than named primaries value.
2025-07-11 21:53:58 +02:00
Kacper Michajłow 8b64a5d937 video/out/vulkan/context_win: add support for getting colorspace 2025-07-11 21:53:58 +02:00
Kacper Michajłow b352fcb90a d3d11_helpers: refactor target colorspace code
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.
2025-07-11 21:53:58 +02:00
Julian Orth 39c9d1acb4 video/out/vulkan/context_wayland: implement target_csp for wayland
This implements target_csp in terms of the preferred color description
of the video surface.
2025-07-11 21:53:58 +02:00
Kacper Michajłow e72bc1fefc video/out/d3d11/context: add missing white point and max fall metadata 2025-07-11 21:53:58 +02:00