Commit Graph

1149 Commits

Author SHA1 Message Date
Kacper Michajłow 8c26c0c1e9 TOOLS/matroska.py: plumb some type hints to make new mypy happy
We don't use strict mode still, so only few are typed.
2026-05-07 14:29:04 +02:00
Kacper Michajłow ed99433277 TOOLS/dylib_unhell.py: simplify the otool output processing
There is no need to pipe things through shell and grep/awk, python is
perfectly fine word processor. This makes it simpler to reason what is
extracted and from where and also makes the script faster as we spawn
only single process directly, not shell with multiple children.
2026-04-26 01:19:27 +02:00
Kacper Michajłow c865008e65 mpv-osd-symbols: center fluent icons only vertically
Makes it nicer for speaker icon to not move around on different volume
levels. Also remove scaling, it was not needed.

This required to rewrite the exclamation mark drawing code, made it look
similar to old icon now.
2026-04-16 19:03:47 +02:00
nanahi b0f9279824 TOOLS/lua/command-test.lua: use _name key for mp.command_native 2026-04-06 18:33:20 +02: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
nanahi ba30c8c175 player/loadfile: add on_loaded hook
Currently, there is no hook which happens when the playback actually
starts. The on_preloaded hook is insufficient for many cases, as many
track information are unavailable at that stage. This makes it impossible
to act on certain track metadata before the media is shown to the user,
so the user will see the media before action for a brief moment before the
properties are notified and options are changed.

This adds the on_loaded hook which allows the mentioned information
available.
2026-03-08 13:07:05 +01:00
Simon Bruder 534b2d2ea6 {demux,player}: expose original and commentary track flags
Those flags were added to the Matroska specification together with the
already implemented hearing-impaired and visual-impaired flags.

They allow specifying whether a track is a commentary track or in the
original language without relying on the free-form track name, which
makes consistent tagging and parsing by machines easier.

Ref: https://github.com/ietf-wg-cellar/matroska-specification/pull/447
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-original-flag
Ref: https://www.rfc-editor.org/rfc/rfc9559#name-commentary-flag
2026-02-20 20:31:04 +01:00
der richter f93df58a8e osxbundle: add new macOS 26 compatible App icon
generated with the Icon Composer project:

actool ./icon.icon \
  --compile ./ \
  --app-icon icon \
  --enable-on-demand-resources NO \
  --development-region en \
  --target-device mac \
  --platform macosx \
  --include-all-app-icons \
  --minimum-deployment-target 10.15 \
  --output-partial-info-plist /dev/null \
  --standalone-icon-behavior all

actool will generate an Assets.car file which is compatible with all the
new Theme variants of macOS 26 (default, dark, monochrome, tinted, etc).
it also generates an old icns file as a fallback, only default style.

since the new Assets.car file can't be used from cocoa directly, without
using private APIs, we still use the icns file when used from CLI.
this also means that from CLI only the default icon is used and the
macOS theming doesn't have any effect.

the macOS theming mechanism only works with the bundle and a Assets.car
file. all icons are generated on the fly depending on the Theme. this
generation has no public API and the mechanism would need to be
replicated by hand. to replicate this behaviour at least three different
icns would need to be generated, tinting needs to be implemented,
several system events need to be subscribed, and this wouldn't guarantee
the same look as the system mechanism. also none of the tools make it
possible to generate macOS 26 compatible icns file, besides for the
default file, since it at least is missing the necessary padding.
2025-12-21 11:48:52 +01:00
der richter 1b9998a620 osxbundle: make bundle category configurable and default to video
in a13a674363 we set the default category
for the bundle to games, to get certain benefits like better rendering
timing, better bluetooth latency, better threading, etc (bundle only).

though this also prevents low power modes and wrongly categories the app
for spotlight search etc.

set the default category to video and add an option to set the category
to games if one wishes to.
2025-11-05 19:23:26 +01:00
ckath 8364b122ee TOOLS/lua/autoload.lua: stop initial file from being added twice
this happened right after going to the next file
2025-11-04 20:53:35 +01:00
Alex James 0a606d9e18 osxbundle: read version from version.h
osxbundle.py currently reads the version number from MPV_VERSION, while
Meson first tries git describe before falling back to MPV_VERSION.
Update osxbundle.py to try reading the version number from version.h
before falling back to MPV_VERSION. This ensures that the version number
in the bundle matches the output of mpv --version.
2025-11-01 14:41:18 +01:00
nanahi 8410f3157d TOOLS/lua/test-hooks.lua: drop sleep amount suffix
Not POSIX.
2025-10-27 20:00:59 +01:00
LordMZTE f9d4e19888 TOOLS/lua/gamma-auto: update on timer when on Linux
The Linux implementation of ambient-light is not observable.
2025-10-15 21:59:42 +02:00
Jan Ekström d837c43656 {demux_mkv,TOOLS/matroska}: map, expose hearing/visual impaired flags
Were brought up recently in the user channel, and seemed like an
easy enough win. Unfortunately `sh_stream` currently lacks other
fields, so the rest of the flags will be added as the player's
functionality gets extended further.

Ref: https://datatracker.ietf.org/doc/rfc9559/
2025-09-11 19:25:12 +03:00
Guido Cella efb70d7f27 TOOLS/lua/autocrop.lua: don't error if hwdec-current is nil
hwdec-current can be either "no" or nil.

Fixes #16739.
2025-08-29 19:08:29 +02:00
der richter e867518bdd osxbundle: add new vulkan loader homebrew path
see https://github.com/Homebrew/homebrew-core/commit/0c6a7238e7c3457af8d2cc7a997a3d2732ab2751
2025-03-06 17:31:17 +01:00
Kacper Michajłow 48f944d21b TOOLS/umpv: add Windows support
While there are native ways to implement this in mpv itself on Windows.
We can also support this script without any problem.
2025-02-05 20:22:01 +01:00
Kacper Michajłow f9a7179f37 TOOLS/umpv: use append-play
It makes more sense to star playback if nothing is playing.
2025-02-05 20:22:01 +01:00
Kacper Michajłow dfbd60f9bb TOOLS/umpv: don't wait for mpv after it is run
We just want to start mpv, there is no need to keep umpv script alive.
2025-02-05 20:22:01 +01:00
Kacper Michajłow b870d1933a TOOLS/umpv: use builtin profile for pseudo gui options 2025-02-05 20:22:01 +01:00
Kacper Michajłow 62847c9f39 TOOLS/umpv: handle the case when mpv disappears during adding files 2025-02-05 20:22:01 +01:00
Kacper Michajłow 7372bc5f12 TOOLS/umpv: minor fixes to style and typing
Add UMPV_SOCKET_DIR for socket base dir selection and fallback to TMPDIR
as last resort.
2025-02-05 20:22:01 +01:00
Leo Izen a7357c221e TOOLS/mpv_identify.sh: handle forward slash in property names
Property names contain '-' characters, which are translated into
underscores because POSIX shell variables cannot contain hyphens.

We should do the same thing for forward slash characters (i.e. '/')
because these also cannot be present in the names of shell variables.

Fixes: #15782
2025-02-05 04:54:04 +01:00
Guido Cella e07c78f2db TOOLS/mpv-osd-symbols.sfdir: add a menu icon
Taken from the last freely licensed version of Symbola and manually
adjusted the number in the glyph file to match the adjacent arrows.

Saving sfdir with fontforge also automatically removed the O flag from 2
existing glyphs. According to
https://fontforge.org/docs/techref/sfdformat.html "O" just meant "the
character was open when last saved", so it doesn't change anything
visible.
2025-01-27 21:06:50 +01:00
Guido Cella 118ef75c27 TOOLS/mpv-osd-symbols.sfdir: document how to add icons 2025-01-27 21:06:50 +01:00
Kacper Michajłow e8fa2a7aaa TOOLS/osxbundle: fix inplace argument type 2025-01-25 02:35:54 +01:00
Kacper Michajłow 805793154d TOOLS/macos-sdk-version: check if xcodebuild is defined
Makes mypy happy.
2025-01-25 02:35:54 +01:00
Kacper Michajłow 37b513a760 TOOLS/file2string: use array of tuples to avoid unpacking strings 2025-01-25 02:35:54 +01:00
Kacper Michajłow da2880fb54 TOOLS/dylib_unhell: check regex search result 2025-01-25 02:35:54 +01:00
Kacper Michajłow 2d5c5030e5 TOOLS/stats-conv: typing fixes
To make mypy happy. PyQtGraph doesn't define types, so ignore those.
PyQt6 has types, but we use only one function from it, so to avoid
installing it, ignore it too.
2025-01-25 02:35:54 +01:00
Kacper Michajłow 59afdf2ef8 TOOLS/gen-mpv-desktop: don't overlap variable with different types 2025-01-25 02:35:54 +01:00
Kacper Michajłow 4cf914d44d TOOLS/gen-interface-changes: fix variable type mismatch 2025-01-25 02:35:54 +01:00
Kacper Michajłow 59d1dc43b9 various: fix typos 2025-01-04 15:59:49 +02:00
der richter e0f82b1a77 gamma-auto.lua: add this script as replacement for --gamma-auto
also mention this replacement for --gamma-auto.
2024-12-21 16:15:44 +01:00
Guido Cella 1b53793a4c various: convert tabs to spaces 2024-10-18 18:32:26 +02:00
Kacper Michajłow baabc291f1 build: fix dynamic generation of mpv.desktop file protocols
Running cross-compiled binaries may be possible, but the runtime
environment must be configured correctly. In some configurations, an
exe_wrapper needs to be used, and in all cases, the library path must be
set correctly for the given binary. Fortunately, Meson handles all of
this if cross-compilation is configured correctly.

Fix this by having Meson run the mpv binary directly, instead of as a
subprocess of a Python script. This ensures that the environment is
properly set for running host binaries, if possible.

Fixes: #15075
Fixes: 056b03f9ed
2024-10-14 01:56:25 +02:00
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
sfan5 5e9e756f53 TOOLS/gen-interface-changes: small usability improvement 2024-09-23 19:20:05 +02:00
Kacper Michajłow 71f2220991 meson: use relative file paths for file2string
This fixes "Generated from" comments to not include local source path in
generated files.
2024-09-21 23:39:10 +02:00
Guido Cella 284293ceb5 TOOLS/cycle-deinterlace-pullup.lua: fix removing the filter
This has been broken since b56e63e2a9 removed vf del. Replace it with vf
remove. Fixes #14881.
2024-09-19 13:38:16 +00:00
llyyr c7dce6a838 TOOLS/gen-mpv-desktop.py: set --no-config when probing protocols
Apparently for an user mpv would crash on startup if built with asan and
mpv attemps to load mpv-mpris. Just set --no-config so we don't load
anything external since this is more correct anyway.
2024-09-15 20:10:29 +02:00
llyyr dcb4b491b2 TOOLS/stats-conv: minor cleanup 2024-08-01 01:58:30 +02:00
llyyr 0c72a2f26d TOOLS/stats-conv: silence linter messages 2024-08-01 01:58:30 +02:00
llyyr f1cd59ba92 TOOLS/stats-conv: convert to pyqt6 2024-08-01 01:58:30 +02:00