Commit Graph

53330 Commits

Author SHA1 Message Date
der richter
7e519397a1 options: note that --gamma-auto is only implemented on vo=gpu 2024-11-30 02:32:39 +01:00
der richter
dec0d02f9f vo_gpu: undeprecate --gamma-factor
deprecated since 0.35 in ac39661 and 2207236.
2024-11-30 02:32:39 +01:00
moi15moi
a283f66ede sd_ass: add application/x-font-otf to font_mimetypes 2024-11-28 17:35:22 +01:00
Kacper Michajłow
6ea2cd72ec vf_format: fix format=dolbyvision=no metadata stripping
If p->colormatrix is 0 if not set by user, so it would always override
_orig parameters with Dolby Vision ones and restore that erroneously.

Fixes: e2365bfece
2024-11-28 17:33:31 +01:00
Kacper Michajłow
4ff9f50b6b player/clipboard/clipboard: don't include global.h in header
This header should not be included except when really needed.

Fixes: e1d30c4c5a
2024-11-28 00:45:27 +01:00
nanahi
7899a28699 defaults.js: support custom arg in mp.add_key_binding() 2024-11-27 20:40:41 +01:00
nanahi
06670298b3 defaults.lua: support custom arg in mp.add_key_binding()
The information is available in the table.
2024-11-27 20:40:41 +01:00
nanahi
0874f81b31 command: add custom arg for script-binding
This allows passing arbitrary information in the script-binding
command. The content is available as a new message argument.
2024-11-27 20:40:41 +01:00
nanahi
aeb637b33b DOCS/man/input.rst: document that WHEEL_* are scalable
This documents the scalable keys (currently WHEEL_*) and notes
how the keys work with scalable commands. Mention touch pad
as a common source of scalable input source.
2024-11-27 20:40:41 +01:00
nanahi
0d6c979220 DOCS/man/input.rst: document the scalable commands 2024-11-27 20:40:41 +01:00
nanahi
62e434ac7f input/cmd: add comment for scalable and is_ignore 2024-11-27 20:40:41 +01:00
nanahi
5fd4bfb4a0 defaults.js: support scalable mp.add_key_binding() 2024-11-27 20:40:41 +01:00
nanahi
e3e22de2ca defaults.lua: support scalable mp.add_key_binding()
For complex key bindings, the table now contains a new member
of the current key scale. mp.add_key_binding() now accepts the
scalable flag to make the binding scalable.
2024-11-27 20:40:41 +01:00
nanahi
34571e7882 command: make script-binding command scalable
script-binding command is currently not scalable, so script
registered key bindings also cannot be scalable, unlink input.conf
bindings.

This makes script-binding command scalable so that it's possible to
define scalable key bindings in scripts. It now calls script-message
command with an extra argument with the scale of the key.
2024-11-27 20:40:41 +01:00
nanahi
b97e3b9e4b DOCS: add clipboard documentations 2024-11-27 20:31:41 +01:00
nanahi
510d634b5b console.lua: use native clipboard property on win32 and wayland
Since native clipboard is implemented on win32 and wayland,
use the clipboard property instead.

This fixes the problems with commandline implementations of clipboard:
- On win32, the powershell implementation is complex, and it can take
  several seconds to run for the first time.
- On wayland, it requires wl-paste to be installed, which isn't always
  available. It also works poorly on GNOME.
2024-11-27 20:31:41 +01:00
nanahi
d9f30cc079 video/out/wayland_common: support clipboard monitoring
Works by notifying property update when clipboard content is
updated.
2024-11-27 20:31:41 +01:00
nanahi
593d437dae command: notify-property command
Since VOCTRL is not suitable for frequent data query
(see 477a0f8318 for details),
it's not suitable to be used by the VO clipboard backend.
Instead, since the VO does the clipboard monitoring by itself,
it can notify the player when the clipboard is updated.

This adds an internal notify-property command so that VOs
can notify player when the clipboard is updated, so that clipboard
monitoring works.
2024-11-27 20:31:41 +01:00
nanahi
625900687e clipboard-win: implement clipboard monitoring
This uses GetClipboardSequenceNumber() to detect clipboard
content changes. Clipboard Format Listener is a better way to
do this according to MS docs, but sequence number works and
the listener requires creating a dedicated thread and HWND
for monitoring, so I will save it for a later time.
2024-11-27 20:31:41 +01:00
nanahi
1d36f7be05 clipboard: add clipboard monitoring API
This adds a clipboard monitoring API for backends which use polling
to monitor clipboard updates. --clipboard-monitor option can turn
clipboard monitoring on and off at runtime.
2024-11-27 20:31:41 +01:00
nanahi
dcde47e15b clipboard-win: add Windows clipboard backend
This adds a Windows clipboard backend. This doesn't depend on
VO, so it can be used even when no video window is created.
2024-11-27 20:31:41 +01:00
nanahi
d47ce38e20 video/out/wayland_common: implement VOCTRL_GET_CLIPBOARD
This adds support for VOCTRL_GET_CLIPBOARD which makes the VO
clipboard backend be able to get clipboard content for Wayland.
2024-11-27 20:31:41 +01:00
nanahi
b93d3046e2 video/out/wayland_common: implement clipboard support
Clipboard contents are available as selection data offers under
Wayland. The offer can become invalid at any time, so request the
text format content immediately when an offer is received,
and cache the content for later use.
2024-11-27 20:31:41 +01:00
nanahi
fa3a167347 video/out/wayland_common: generalize check_fd 2024-11-27 20:31:41 +01:00
nanahi
23b8fb3d9c clipboard-vo: implement VO clipboard backend
This adds a generic VO clipboard backend based on VOCTRLs
to get and set clipboard data.
2024-11-27 20:31:41 +01:00
nanahi
240ebd6ad3 vo: add VOCTRL_GET/SET_CLIPBOARD
This adds VOCTRLs needed for VO-based clipboard backend.
2024-11-27 20:31:41 +01:00
nanahi
6e848a0b3c command: add clipboard property
This adds clipboard property which uses the clipboard
API to get and set clipboard contents. Currently only
clipboard text is implemented, but this can be extended in
the future to cover primary selection and other formats.
2024-11-27 20:31:41 +01:00
nanahi
e1d30c4c5a clipboard: add clipboard API
This adds a clipboard API with multiple backend and format support.
--clipboard-enable option can be toggled at runtime to turn native
clipboard on and off.
2024-11-27 20:31:41 +01:00
llyyr
af82f7cf29 DOCS/interface-changes: specify that new additions have to be listed
This has been happening for a while now apparently, so change it to
accurately reflect reality. I chose the next release as the point to
formally make this change, because I was under the impression that we
didn't have to list new options so I never did it and there may be
others like that too.
2024-11-27 20:28:51 +01:00
Kacper Michajłow
15ea3728a5 osc.lua: show file and track info on title left-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
92a98f1ce2 osc.lua: cycle sub/audio down on shift+L-click / middle-click 2024-11-27 20:26:06 +01:00
Kacper Michajłow
62db90634e osc.lua: cycle sub/audio on left-click, select on right-click 2024-11-27 20:26:06 +01:00
der richter
639ef09807 mac: implement VOCTRL_BEGIN_DRAGGING
this removes the old isMovableByWindowBackground mechanism with the
newer performDrag(with:) function.
2024-11-27 18:48:47 +01:00
Guido Cella
f7e2a8c1cc bstr: add bstr_xappend0 2024-11-27 15:37:42 +01:00
Guido Cella
b9e6030053 command: highlight selected list items with color
Instead of printing circles in show-text ${playlist}, ${chapter-list}
and ${edition-list}, introduce --osd-selected-color and
--osd-selected-outline-color to reduce clutter, make the selected item
easier to differentiate, and have visual consistency with select.lua.

The defaults are taken from the style of the selected item in the
console. These new options are also used there, replacing the hardcoded
styles. Due to being user-configurable, selected item styles are changed
to take priority over default item styles.

The default selected style is yellow and bold. The bold (hardcoded)
allows differentiating the selected item with color blindness. There is
also a separate --osd-selected-outline-color option defaulting to black,
since without it if the user changes --osd-outline-color yellow text
becomes unreadable without a black border. --osd-selected-back-color is
omitted for now.

Text and background colors are inverted for the selected item in the
terminal. This is hardcoded, adding an option is overkill.

A disadvantage of this commit is that if you run print-text ${playlist}
with a VO, the selected style ASS is printed to the terminal (but ASS
printed in the console is interpreted). This commit avoids printing the
reset ASS sequence for non-selected items to reduce clutter in this
case.
2024-11-27 15:37:42 +01:00
Guido Cella
d54a45d075 console.lua: enable runtime updates of script-opts 2024-11-27 15:32:10 +01:00
Kacper Michajłow
ad1fb9f448 player/loadfile: prefer independent track when selecting track
Dependent tracks are supposed to be processed further and not directly
used.

For example, an HEIF tiled image tracks are meant to be stitched into a
full image before being displayed and requires special handling.

Another example would be MPEG-TS audio track tagged with mix_type=0.
Which means that the audio stream is a dependent stream and is intended
to be mixed or combined with a separate complete and independent audio
stream by the receiver.

In either case we should not directly select such tracks.
2024-11-26 11:42:48 +01:00
Kacper Michajłow
81db3446fa DOCS/man/options: mention sub-box/osd-box/box profiles 2024-11-25 17:29:47 +01:00
Guido Cella
86bbe997ce console.lua: don't append spaces after completion
After pressing Tab a space is usually appended after the suggestion, and
with the new autocompletion you have to enter a space again before
seeing the completions for the next token even when there is only 1
matching completion. Just don't append spaces and let the user manually
type 1 space after completion, which is more intuitive.
2024-11-25 16:43:14 +01:00
Guido Cella
8464ba471a console.lua: highlight the first completion in the terminal
Follow up to a0d416e94b.
2024-11-24 13:28:58 +01:00
Guido Cella
e549bf0dec console.lua: update completions after moving the cursor
...and after navigating the history.

I thought of making the new function accept the new cursor position and
set it, but it would not be clear that you're only supposed to call it
when handle_edit() is not already called.
2024-11-24 12:19:45 +01:00
Kacper Michajłow
5730c631fd player/video: update dynamic hdr params 2024-11-24 11:32:12 +01:00
Guido Cella
a0d416e94b console.lua: highlight the first completion suggestion before cycling
2f271a92de made it so that the first completion suggestion is
automatically selected when pressing Enter, if none was manually
selected. So automatically highlight the first completion in yellow to
show this.
2024-11-24 11:23:04 +01:00
Guido Cella
40724f81e1 console.lua: save commands in history after autocompletion
2f271a92de made it so that the first completion suggestion is
automatically selected when pressing enter, but that was done after
saving the command in the history. Save it to the history after
expanding it, so re-running the previous command actually works, e.g.
save "set vo gpu-next" instead of "set vo gn".
2024-11-24 11:23:04 +01:00
Kacper Michajłow
96d2c044fc mp_image: always force RGB formats to full-range RGB
It turns out mpv doesn't tag at all when doing conversions, so we just
re-tag here and hope for the best. This should be improved, but there
are many different code paths when conversion can happen, so for now
revert to previous behavior.

Fixes: 4e5cc9cf1d
2024-11-24 11:22:46 +01:00
Dudemanguy
c089aaafbe wayland: always recalculate scaling if wl->current_output is not set
If we lose the current output for any reason (unplug, turns off, etc.)
and then later it comes back, mpv should always recalculate all the
scaling stuff. The optimization to avoid needless scaling calculations
didn't consider this case and would always exit since the scaling is the
same. So just check wl->current_output's existence as well.

Fixes #15361.
2024-11-24 05:19:09 +00:00
Arcitec
2d813de6b6 DOCS/man/mpv: improve path docs and clarify config-dir path behavior
The previous documentation was pretty scary and misleading, and was
also outdated in several sections.

It was also difficult to understand some of the paragraphs.

The path documentation has now been overhauled to be much easier
to understand and to document the latest mpv behavior.
2024-11-23 22:17:30 +01:00
Guido Cella
200065cc2f options: rename --sub-ass-hinting to --sub-hinting
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00
Guido Cella
d1c2ee1c82 options: rename --sub-ass-shaper to --sub-shaper
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00
Guido Cella
3291254263 options: rename --sub-ass-line-spacing to --sub-line-spacing
Because it also affects plain text subtitles.
2024-11-23 22:17:21 +01:00