1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 12:17:12 +00:00
Commit Graph

52950 Commits

Author SHA1 Message Date
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
Kacper Michajłow
4c19df1ded msg: print format string on format errors 2024-09-29 16:06:25 +02:00
Kacper Michajłow
96006fa97b bstr: don't abort on format error in bstr_xappend_vasprintf
Most of the time it is recoverable error, and it makes no sense to
abort here.
2024-09-29 16:06:25 +02:00
Kacper Michajłow
2c2755992d bstr: use vsnprintf with a proper size of 0 instead of a 1-sized buffer
There is no need for that, use of 0 size is well defined.
2024-09-29 16:06:25 +02:00
Misaki Kasumi
c3d9243a3e ao_coreaudio: fix nan in ca_get_device_latency_ns 2024-09-28 14:15:55 +02:00
Andreas Klauer
c365e2f7b1 misc/random: seed using libavutil/random_seed
When starting multiple processes of `mpv --shuffle` in parallel,
sometimes the random seed happens to be identical, so files are
played in the same random order.

mp_rand_seed(0) now uses a random seed provided by libavutil,
and only falls back to time in case of failure.
2024-09-28 14:11:56 +02:00
nanahi
53f2619dbd options: force --ab-loop-count and --loop-file notification
Since f411f3145b, these properties
no longer change with each loop. This however caused a regression
on the behavior of resetting loop count by resetting these
properties.

Previously, after the loop count is decreased, it is possible to
reset these properties back their original values and thus reset
the remaining loop count. Currently, because setting properties
has no effect if the new value is the same as the existing value
(which no longer changes), resetting these properties does nothing,
and remaining-*-loops (which are read-only) remain unchanged.
There is no way to reset them other than temporarily setting them
to a different value, which is awkward.

Fortunately, this can be fixed by marking these properties as
force_update, which always notifies changes when being set.
2024-09-26 22:48:52 +02:00
Guido Cella
69ced646f8 lua: remove unused #define mp_lua_len
This is unused since 548ef07864 and 7f91e2684e.
2024-09-26 16:45:08 +02:00
Dudemanguy
d54e8c3f40 demux_mkv: drop image probing down to 10000 blocks
It turns out that probing too many blocks is bad. I did not attempt to
go through all the logic but reading that many blocks causes the
demux_reader_state have some pretty funny values which then makes the
playloop think it needs to buffer for cache. It's probably fixable...
but seems hard admittedly so I'll be lazy. Just take out a magnitude off
the probing down to 10000. These seems to be more than sufficient. The
sample in #13975 where we had the opposite issue only needs somewhere
between 1700 and 1750 blocks to be properly detected. Crudely looking
at the demuxer values, 10000 here doesn't appear to alter anything
meaningfully so it does not have the "too many blocks problem".
Hopefully this is a perfect medium? Further improvements to the probe
can always be added later. Or maybe we decide this is all a giant
mistake and delete it. Fixes #14924.
2024-09-26 02:55:35 +00:00
Kacper Michajłow
c9f3fa33a6 demux_mkv: add missing color repr init
Fixes: 66e451f4e6
2024-09-25 19:35:21 +02:00
Dudemanguy
92e97d239e meson: replace vector code compile check with function attribute check
Makes it a nice one liner.
2024-09-24 22:16:59 +00:00
Dudemanguy
b52a67dde2 meson: bump required version to 1.3.0
Newer meson versions added support for features that mpv has been using
for a long time. Annoying fallbacks were left in place to not break old
versions but ideally everyone should be using the newer build features.
Both the latest ubuntu LTS and debian stable (in backports) have 1.5.0
in their repos, so go ahead and bump the version so we can drop some old
code and let developers use newer meson features if applicable.
2024-09-24 22:16:59 +00:00
Kacper Michajłow
1c55d600ab stats.lua: add timecode display 2024-09-24 19:47:42 +02:00
llyyr
d33bcc51a7 command: add video-frame-info/{gop,smpte,estimated-smpte}-timecode
Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-09-24 19:47:42 +02:00
nanahi
3863221246 input: skip BOM properly
Key names are already required be UTF-8 like everything else
in mpv other than media file formats which support other encodings.
stream_skip_bom is the wrong function for this, since it also skips
UTF-16 BOM.
2024-09-24 19:22:47 +02:00
nanahi
b08cab7a6c DOCS/man/mpv.rst: clarify configuration files should be UTF-8
mpv only supports UTF-8 for configuration files. Other ASCII-compatible
encodings may "work" to some limited extent, but strings likely won't
as many places assume that all internal strings are UTF-8.
2024-09-24 19:22:47 +02:00
Kacper Michajłow
2a1485772b console.lua: clear terminal msg after changing to OSD display 2024-09-24 19:21:00 +02:00
Kacper Michajłow
2c5928e518 vf_d3d11vpp: remove unnecessary compatibility defines 2024-09-24 00:21:19 +02:00
Kacper Michajłow
d650b3a5a3 d3d11_helpers: remove not needed compatibility define 2024-09-24 00:21:19 +02:00
Kacper Michajłow
e7e759cdfd opengl/context_dxinterop: remove unnecessary compatibility defines
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
a73c73255b osdep/timer-win32: remove unnecessary compatibility defines
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
01383c606c osdep/terminal-win: remove unnecessary compatibility defines
No longer neeeded after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
4ad3db855a osdep/main-fn-win: remove unnecessary compatibility defines
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
7746942a55 win32: remove pathcch compatibility code
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
1a3e3a0c98 w32_common: remove backward compatibility code
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
Kacper Michajłow
c6a8b6852c win32: remove dxgi debug checks
No longer needed after 9f8b4b38c9.
2024-09-24 00:21:19 +02:00
llyyr
e538c7f413 player/main: guard smtc.h include 2024-09-23 22:13:51 +02:00
Dudemanguy
2bd1e78701 build: ensure HAVE_WIN32_SMTC is always defined
It makes sense to only descend into the subdirectory meson build file on
windows, but we should always make sure HAVE_WIN32_SMTC is 0 for other
platforms. Otherwise, it gets unneccesarily awkward to work with.
2024-09-23 22:13:51 +02:00