Commit Graph

52977 Commits

Author SHA1 Message Date
Nathan Ruiz 44a296be97 ci/lint: add flake8-commas check 2024-10-06 22:15:08 +02:00
Nathan Ruiz c6903f9963 ci/lint: add isort checks 2024-10-06 22:15:08 +02:00
Nathan Ruiz 416035a174 ci/lint: check for pep8 naming convention 2024-10-06 22:15:08 +02:00
Nathan Ruiz 1562895af7 ci/lint: add pyupgrade check 2024-10-06 22:15:08 +02:00
Nathan Ruiz 8a82882d5e ci/lint: ensure double quotes are used in python 2024-10-06 22:15:08 +02:00
Nathan Ruiz e5a383a525 ci/lint: enable pyflakes and pycodestyle checks
This change required some minor rework to make the code conform to the
following:
- Restrict line length to 88 character
- Use spaces rather than tabs (only affect ci/lint-commit-msg.py)
- Use f-strings rather than % formatting or `str.format()`
2024-10-06 22:15:08 +02:00
Nathan Ruiz bee3598ba6 ci/lint: add python linting
Enabled the ruff python linter in CI, and resolved the issues that were
detected by it. Ruff was used due to it's faster checking compared with
other linters like pylint. This was added to resolve the python linting
request in #13608.
2024-10-06 22:15:08 +02:00
nanahi f46975c2d2 mp_image: restore dovi metadata before converting to AVFrame
They should be passed as side data instead.
2024-10-06 22:01:37 +02:00
nanahi e2365bfece vf_format: set original params when converting format
Otherwise it will restore to a format before vf_format conversion when
restoring params. Only do this when the out format isn't dolbyvision.
2024-10-06 22:01:37 +02:00
nanahi e35a559ce1 mp_image: only restore params when image is dolbyvision
Should be no need to do so otherwise.
2024-10-06 22:01:37 +02:00
nanahi 9b571a7aa7 mp_image: copy params before dovi mapping for mp_image_copy_attributes
It currently doesn't copy original params before mapping, resulting in
wrong colors when some video filters are used, e.g. d3d11vpp=scale.
2024-10-06 22:01:37 +02:00
der richter 7bd612ee66 mac: remove unnecessary window size change check
this is already done in the updateSize method of the window.

also fixes an issue where the size wasn't properly changed, even though
the new and old size were different. the unfsContentFrame should have
been checked instead of the pixel representation of the same frame.
2024-10-06 21:53:08 +02:00
der richter c5324cc483 DOCS/input: clarify display-names naming on macOS
this was meant to refer to round brackets and not square brackets.
2024-10-06 21:53:08 +02:00
der richter 94d034ed99 mac/swift: fix typo in mpv_event_id string representation
this didn't break anything but might be confusing in log outputs.
2024-10-06 21:53:08 +02:00
der richter 20b7f96ab3 meson: error out when swift unavailable or disabled and cplayer enabled
without swift mpv as a standalone app is unusable on macOS, since the
cocoa main main loop doesn't exists. furthermore most of the other
needed functionalities like video outputs, contexts, platform features,
etc are also missing.

without swift mpv is really only usable as libmpv.
2024-10-06 21:52:35 +02:00
der richter 2fb8b00ac9 mac/app: fix building with swift disabled
Fixes #14931
2024-10-06 21:52:35 +02:00
Kacper Michajłow f7a895e7c1 docs: remove stray newlines 2024-10-06 21:51:59 +02:00
Kacper Michajłow 1b08e8b08e ci/{openbsd,win32}: bump FFmpeg to 7.1 2024-10-06 21:51:12 +02:00
Kacper Michajłow 9d55c5bcaf ci/msys2: removed unused clang32 reference 2024-10-06 21:50:59 +02:00
Kacper Michajłow 28bc58a3e8 Revert "ci/msys2: disable some features for 32-bit build"
No longer needed after 232919336d.

This reverts commit 883a45fa3e.
2024-10-06 21:50:59 +02:00
Kacper Michajłow 51c613bbcd README.md: reference nasm instead of yasm
yasm is no longer supported by FFmpeg.

See: 2f888fb99e
2024-10-06 18:24:48 +02:00
Kacper Michajłow 3e74b1176e d3d11_helpers: remove leftover variables 2024-10-06 18:24:33 +02:00
Dudemanguy 232919336d github/workflows: drop clang32
It's being dropped upstream* and recently lua51 was removed along with
luajit*. mingw32 already covers 32-bit support, and it's not like we're
in dire need of this so just remove it.

*: 89521b9f8d
*: 947a8592ca
2024-10-06 16:04:55 +00:00
der richter 9791c6d178 mac/common: don't unconditionally move the window on geometry changes 2024-10-05 18:40:11 +00:00
Dudemanguy 2fa87117e0 x11: don't unconditionally move the window on geometry changes
With the pieces set in place with the previous changes, we can implement
the desired behavior. The trick here is that we do want to force
centering the window when mpv first initially starts and the window size
is not known yet. This can be done by simply checking
x11->pseudo_mapped. The other change is to just look if we have the
VO_WIN_FORCE_POS flag and feed that to highlevel resize.
2024-10-05 18:40:11 +00:00
Dudemanguy e01eab4385 win_state: move window centering to vo_calc_window_geometry
c4e8c36071 made any usage of --geometry
implicitly center the window on the screen after a resize even if the
user did not pass any x/y arguments to the option. At the time, this was
probably wanted since --geometry was primarily a startup option and
likely the window wouldn't be centered on x11 without moving
coordinates. Times have changed since then and we support full runtime
--geometry changes on all the relevant platforms but it comes with this
automatic window centering behavior (except on wayland of course hah).

It's better to make such window centering optional and user controllable
since it is entirely reasonable that someone wants --geometry=50% to
just resize and not move anything. It's already trivial for a person
that does want to move the window to just add their coordinates to the
--geometry command so there's no reason to continue to force this
behavior since it is less flexible.

Instead, move the window centering stuff out of m_geometry_apply into
vo_calc_window_geometry. We give the power to the caller to whether or
not to force centering the window here and all usage of the function is
updated to simply call it with false for now. Additionally,
--force-window-position being set will also center the window like
before. All that is left is for the windowing code to take advantage of
this. See subsequent commits.
2024-10-05 18:40:11 +00:00
Dudemanguy 8b30a2386f win_state: remove redundant vo_calc_window_geometry functions
There's really no reason to have all these extra variants. It's not like
this is public API. Collapse it all into one vo_calc_window_geometry
function and callers can simply just pass the appropriate parameters to
get the same behavior as before. I'm about to edit this function again
in a future commit and I really don't want to make a
vo_calc_window_geometry4 for this so let's clean it up.
2024-10-05 18:40:11 +00:00
Guido Cella 493cab7efc stats.lua: allow keybindings to toggle the display of a specific page
This lets you define bindings like h script-binding
stats/display-page-4-toggle. Requested in #14966.
2024-10-04 21:13:29 +03:00
Guido Cella be814e3753 stats.lua: scroll keybindings while filtering them
console.lua binds up and down to navigate its history. Add a private
flag to mp.input.get to instruct console.lua not to bind up and down, so
you can use them to scroll the keybindings page while filtering
keybindings.

If it is requested, this can be replaced with an argument to input.get
to not bind arbitrary keys.

Fixes #14966.
2024-10-04 21:13:29 +03:00
Guido Cella b3f8464fa9 input.lua,defaults.js: don't hardcode mp.input arguments
Pass everything in the tables passed by mp.input callers to console.lua
so new flags can be added without modifying these clients.

In Lua, callbacks have to be excluded from the argument tables to not
make utils.format_json() error, while with JSON.stringify they are
automatically omitted.
2024-10-04 21:13:29 +03:00
Guido Cella dcd681ecdd stats.lua: filter keybindings by comment
Requested in #14966.
2024-10-04 21:13:29 +03:00
Kacper Michajłow a6c363e8da f_hwtransfer: fix too aggressive preference to use direct upload format
Well, this was thinko on last minute code simplification I made. We need
to check both input and output formats.
2024-10-04 05:10:36 +02:00
Kacper Michajłow 216abbc121 bstr: add missing function docs 2024-10-04 00:45:30 +02:00
Kacper Michajłow 3fd6c31e1f f_hwtransfer: fix upload formats selection
There was mixup between upload formats and device formats. Instead of
filtering the device formats with VO constraints, upload formats were
affected. It was working, because most of the time the upload is using
the same formats. But if there is conversion on the fly needed we were
filtering wrong list of formats. Upload formats are those that can be
used to upload to the given hardware frame, conversion during upload are
allowed if possible. The main fix is in select_format() which were using
device formats as input, instead of ouptut formats and upload formats as
output, instead of input.
2024-10-04 00:10:05 +02:00
Kacper Michajłow 822daeb89f f_hwtransfer: ensure that we convert to full range rgb with scale_vaapi
Limited range rgb is evil and not supported by FFmpeg, this ensures
parity of hardware conversion with software conversion.
2024-10-04 00:06:58 +02:00
Dudemanguy 0d7b4d64a5 wayland: support multiple devices and tranches when querying formats
The multi device part is mostly theoretical, but it turns out that
plasma does send multiple tranches to the same device so we have to take
that into account. And that means taking into account multiple devices
as well. In theory, a compositor should give us tranches for any device
that will work so as long as we find a match it should be OK. This is
still technically incomplete since mpv's core wouldn't react to a device
being hotplugged.
2024-10-02 21:27:01 +00:00
Bergmann Atmet 7ca5fd2ad2 ci/mingw: pass --enable-gpl to ffmpeg's configure
A bunch of lavfi filters were presumably not available in mingw builds
because of this.

```
% grep -E '=(".+ |")gpl("| .+")$' configure
blackframe_filter_deps="gpl"
boxblur_filter_deps="gpl"
boxblur_opencl_filter_deps="opencl gpl"
colormatrix_filter_deps="gpl"
cover_rect_filter_deps="avcodec avformat gpl"
cropdetect_filter_deps="gpl"
delogo_filter_deps="gpl"
eq_filter_deps="gpl"
find_rect_filter_deps="avcodec avformat gpl"
fspp_filter_deps="gpl"
histeq_filter_deps="gpl"
hqdn3d_filter_deps="gpl"
interlace_filter_deps="gpl"
kerndeint_filter_deps="gpl"
mcdeint_filter_deps="avcodec gpl"
mpdecimate_filter_deps="gpl"
mptestsrc_filter_deps="gpl"
nnedi_filter_deps="gpl"
owdenoise_filter_deps="gpl"
perspective_filter_deps="gpl"
phase_filter_deps="gpl"
pp7_filter_deps="gpl"
pp_filter_deps="gpl postproc"
pullup_filter_deps="gpl"
repeatfields_filter_deps="gpl"
sab_filter_deps="gpl swscale"
signature_filter_deps="gpl avcodec avformat"
smartblur_filter_deps="gpl swscale"
spp_filter_deps="gpl avcodec"
stereo3d_filter_deps="gpl"
super2xsai_filter_deps="gpl"
tinterlace_filter_deps="gpl"
uspp_filter_deps="gpl avcodec"
vaguedenoiser_filter_deps="gpl"
postproc_deps="avutil gpl"
```

 Also include built postproc in dlls.

Signed-off-by: Bergmann Atmet <BergmannAtmet@github>
2024-10-02 15:10:55 +02:00
Dudemanguy f1865f312c vo_{dmabuf_wayland,wlshm}: use proper values with MP_ALIGN_{UP,DOWN}
Both of these VOs draw buffers in software via wl_shm to an mp_image, so
they are affected by the internals of whatever mpv does for alignment.
When wlshm was originally written, mp_sws was aligning to 16 bytes and
thus it chose this value but it was hardcoded. vo_dmabuf_wayland later
blindly copied this value. e1157cb6e8
actually changed the internal value to 64 bytes. In theory, this doesn't
probably doesn't really matter since 16 should also work in most cases,
but we might as well stop using a magic number and be consistent.

Additionally, wl_shm did some funny alignments that no other software
output did. The reasoning was apparently due to warning messages from
ffmpeg while cropping*. This was left in at the time, but I'm not able
to reproduce any such warning messages on my end when I make this match
other software VOs. Go ahead and remove the MP_MAX business and align to
the fmt x/y like the other VOs do.

*: https://github.com/mpv-player/mpv/pull/6240#discussion_r227930233
2024-10-02 02:32:49 +00:00
Kacper Michajłow 171c91623d ci/mingw: update fribidi to 1.0.16 2024-10-01 21:30:29 +02:00
Kacper Michajłow 816c17d363 ci/mingw: update harfbuzz to 10.0.1 2024-10-01 21:30:29 +02:00
Kacper Michajłow 9440ab9b88 ci/mingw: update freetype to 2.13.3
And change the mirror to working one.
2024-10-01 20:51:18 +02:00
Kacper Michajłow 7202406fe8 various: remove global.h inclusion where not needed 2024-10-01 12:23:44 +02:00
sfan5 c11239be8c options: enable handling --no-hwdec as --hwdec=no
Reusing M_OPT_ALLOW_NO has the side-effect of applying to --ab-loop-[ab],
which makes sense.
2024-09-30 11:26:13 +02:00
Guido Cella ce0452fa0d zsh-completion: fix completing --screenshot-avif-opts-*
The list options --screenshot-avif-opts and --vo-image-opts are
completed with an extra 8), e.g. --screenshot-avif-opts-add=8), because
*= in
screenshot-avif-opts=-:Key/value list (default\: usage=allintra,crf=0,cpu-used=8):
matches up to cpu-used= instead of instead of up to
screenshot-avif-opts=.

Fix this by enabling non-greedy matching.
2024-09-30 11:26:00 +02:00
Dudemanguy 344ce9200d ra_wldambuf: don't unconditionally filter out non-planar formats
4d09cde8f9 added this behavior and made
the format filtering more aggressive, but it's over correcting. The
misunderstanding on my part is that the problem was with modifiers not
with formats. There is hardware that do not have any valid modifiers
which means certain formats cannot possibly work correctly with
vo_dmabuf_wayland (broken colors etc.). Formats on the primary plane do
not require modifiers so if it happens to be a planar format, we can
accept it and possibly use mpv's autoconverter. If we do get a valid
format + modifier pair from the compositor, then we should always accept
it regardless if it is planar or not.
2024-09-30 03:12:59 +00:00
Dudemanguy 99d4dec38f wayland: rename gpu_formats to planar_formats
The old name is misleading. We do want these formats, but it is not
accurate to call them "gpu formats". Call it "planar" instead so it's
more obvious these come from drm primary planes.
2024-09-30 03:12:59 +00:00
Dudemanguy c5aa7d83ac wayland_common: fix some stray tabs
quite unfortunate
2024-09-30 03:12:59 +00:00
Kacper Michajłow 6ca3752f75 vf_d3d11vpp: add NVIDIA RTX Video HDR support
Fixes: #13352
2024-09-30 02:51:21 +02:00
nanahi ffb40ab958 video/decode/vd_lavc: fix null deref when hwdec is empty
This can happen when using --hwdec-clr.

Fixes: 9ff8c9e780
2024-09-29 22:56:40 +02:00
nanahi 151fa74806 player/external_files: fix null deref when cover-art-whitelist is empty
This can happen when using --cover-art-whitelist-clr.

Fixes: d384a6b793
2024-09-29 22:56:40 +02:00