Commit Graph

12173 Commits

Author SHA1 Message Date
Kacper Michajłow 4f1e9e34c3 demux_playlist: add --directory-filter-types 2024-08-10 23:27:40 +02:00
Kacper Michajłow c54ad6933b demux_playlist: add --autocreate-playlist-{video,audio,image}-exts 2024-08-10 23:27:40 +02:00
Dudemanguy 70fad1daa6 DOCS/man: improve explanation on how to shift notes with --pitch
Previously, this was in the rubberband filter but it gives out random
numbers without explaning where they come from. Move it to the --pitch
section instead and reword it a bit. Closes #14652.
2024-08-09 14:22:23 +00:00
Mike Will 88885c0401 audio: add pitch-shifting feature
Uses resampling in tandem with a time-stretching audio filter to
change the audio's pitch while leaving its tempo intact.
2024-08-07 22:56:17 +02:00
nanahi 9133ce7623 DOCS/man/input: document user-data/osc/margins
This property is used by the built-in OSC and some third-party OSC scripts
to indicate the margin they occupy so that other scripts such as
console.lua can use this value to position UI elements.
2024-08-06 20:28:44 +02:00
nanahi d302fe0de5 DOCS/man/input: reserve user-data/osc and user-data/mpv sub-paths
Currently user-data/osc is used for interpolation between the osc and
other internal scripts. Reserve this sub-path and also user-data/mpv
to make sure external scripts can only use these values as directed.
New internal uses of user-data should use user-data/mpv instead.
2024-08-06 20:28:44 +02:00
Kacper Michajłow 6f619d5ef4 vo_libmpv: don't steal pointer provided by the API user
It won't be TA allocated and would fail on header check. Also
documentation doesn't mention that ownership is transfered to mpv, so it
is unexpected.

This will cause existing clients of this API leak this memory, but I
doubt anyone really used it in this broken state.

Fixes: #14633
2024-08-06 20:17:35 +02:00
Kacper Michajłow 5fed12e025 win32: add Media Control support
Add support for SystemMediaTransportControls interface. This allows to
control mpv from Windows media control ui.
2024-07-29 21:38:19 +02:00
Kacper Michajłow e17b5c635e VERSION: rename to MPV_VERSION to avoid standard library header conflict
Root directory is added to include directories and `VERSION` conflicts
with `#include <version>` which is standard library header.
2024-07-29 21:38:19 +02:00
nanahi bb0932a3ad input/ipc-win: support fd:// for --input-ipc-client
This makes --input-ipc-client work on Windows.

To use this feature, a parent process needs to create a connected named pipe,
wrap the server handle in a CRT fd, and then spawn mpv as a child process
with the fd as the --input-ipc-client parameter.
The process can then communicate through the client handle.

The named pipe must be created duplex with overlapped IO and inheritable
handles.
2024-07-29 21:00:48 +02:00
nanahi 87686a80e5 DOCS/man: add more --input-ipc-client references
Mention the alternative ipc method through fd inheritance.
Also fix a grammar mistake.
2024-07-29 21:00:48 +02:00
rtldg 05b964fdec DOCS/compile-windows.md: fix MSYS2 packages
Attempting to install `git` on the `pacboy` line fails with
`error: target not found: mingw-w64-clang-x86_64-git`
so move that to another spot.

`video_mp_image_pool.c` fails to build due to libavutil right now
because of missing vulkan headers so install those with `pacboy`.
(also improved in https://github.com/mpv-player/mpv/pull/14610 )

Simplify package lists since pacboy doesn't require `:p` anymore.
2024-07-29 20:59:22 +02:00
Guido Cella 6107112b32 player: don't decrement --ab-loop-count=N and add remaining-ab-loops
Follow up to the previous commit. Stop decreasing --ab-loop-count=N on
each iteration so it is preserved across different loops. In particular
it is preserved between different files without adding it to
--reset-on-next-file. Add a property to expose the remaning A-B loop
count instead.

The current behavior of --ab-loop-count=N is even worse than --loop-file
since it also doesn't reset when defining a new A-B loop in the same
file. Defining it has no effect after --ab-loop-count has decreased to
0, and this can't be fixed by adding it to --reset-on-next-file. This
commit also resets remaining-ab-loops every time --ab-loop-a and
--ab-loop-b are set to fix this.
2024-07-26 20:09:19 +02:00
Guido Cella f411f3145b player: don't decrement --loop-file=N and add remaining-file-loops
This stops decreasing numerical values of --loop-file on each iteration
so that loop-file=N loops every playlist entry without having to add
--loop-file to --reset-on-next-file.

The current behavior confuses users as seen in:

https://github.com/mpv-player/mpv/issues/2481
https://github.com/mpv-player/mpv/issues/5943
https://github.com/mpv-player/mpv/issues/11291
https://github.com/mpv-player/mpv/issues/13860
https://www.reddit.com/r/mpv/comments/rcwnrw/looping_each_file_n_times_in_a_playlist/

Also options are supposed to reflect the value configured by the user
and not change on their own.

A remaining-file-loops property is exposed as a replacement to check how
many loops are left.
2024-07-26 20:09:19 +02:00
Guido Cella d384a6b793 external_files: allow specifying --cover-art-whitelist filenames
Fixes https://github.com/mpv-player/mpv/discussions/14520.
2024-07-23 14:12:11 +00:00
llyyr e509ec0aaf DOCS/options: remove misdirection in `sub-color`
ARGB is in fact _not_ like web color. It's easy to skim over the
actual hexadecimal provided in the next sentence and just assume mpv
understands RGBA after reading the words "web colors"
2024-07-19 15:56:29 +02:00
nanahi b59ac04db9 DOCS/man/options: clarify subtitle scale options
The current documentation of sub-scale-by-window and sub-scale-with-window
doesn't sufficiently convey what these options do exactly. Specifically,
the described effects of disabling one option is only true when the other
option is not disabled. The "clarification" of sub-scale-with-window option
only adds more confusion, when the effect of that option is already told
in more detail before (it scaled with window instead of video).

Clarify this by listing the effects of all combinations of these options.
2024-07-18 23:03:02 +02:00
Guido Cella 8110bdac6d command: remove deprecated packet-*-bitrate properties
These have been deprecated for 9 years so it's fine to remove them.

Using the replacement properties like video-bitrate in stats.lua will
convert big enough bitrates to Mbps.
2024-07-18 22:52:35 +02:00
Kacper Michajłow bbbade7052 DOCS/input: fix filter name without label 2024-07-14 01:17:32 +02:00
Misaki Kasumi f2e7146cb1 sub: add (sub/osd)-border-style; renaming sub options 2024-07-12 20:17:38 +00:00
holdingsllc 18b557c1c7 DOCS/input: fix "does does" typo 2024-07-10 19:16:38 +00:00
Guido Cella 49afdb9365 console.lua: remove the scale script-opt
This is redundant because you can set font_size and border_size to have
the same effect.
2024-07-04 22:24:10 +00:00
Guido Cella dc523b137f video/out/gpu/context: convert --gpu-api to object settings list
This follows up 96e1f1dfa5 which converted --gpu-context, and has the
same advantages as listed there.

Unlike with --gpu-context auto can be used anywhere in the list, e.g.
--gpu-api=d3d11,auto works.

I wanted to use the list of GPU contexts as the description in
get_type_desc(), but there is no talloc context to allocate it to, so I
set a print_help_list to print them. The APIs go before the contexts so
that etc/_mpv.zsh doesn't try to complete the contexts.
2024-07-04 22:23:17 +00:00
Dudemanguy 68a1a3879c wayland: add a --wayland-present option
Mainly for debugging. It might be handy to disable presentation feedback
on wayland to make sure something isn't going wrong with the
calculations somewhere.
2024-06-28 03:33:16 +00:00
der richter 88db2d0b61 mac/menu: add option to disable default shortcuts
Fixes #14305
2024-06-25 20:14:38 +02:00
Dudemanguy 111571bd05 options: remove some options with .deprecation_message
In both cases, setting these options did nothing other than give you a
warning that they may be removed in the future. Remove them now.
2024-06-25 02:18:58 +00:00
Dudemanguy 6e3d90d72a options: remove some deprecated OPT_REPLACED option mapping
These were all deprecated in mpv 0.37.0 or earlier and are not
considered common enough options to warrant keeping the deprecated
mapping longer. Since demux_cue had only a single option in it, the
entire option substract is removed. This can be readded later if someone
wants to introduce a specific option to it again.
2024-06-25 02:18:58 +00:00
Guido Cella f7c1461053 DOCS/input: document undocumented track-list sub-properties 2024-06-24 12:52:36 +00:00
Dudemanguy 23ecfa9845 options: remove deprecated auto choice for --mute
Since 995c47da9a, setting --mute=auto has
been equivalent to --mute=no. It was formally documented later in
79e20ff485. This is an old legacy relic
and the auto choice popping up during auto completion could be confusing
to users who aren't aware of the history. Remove it for good and convert
the option to a proper boolean.
2024-06-21 21:29:33 +02:00
Dudemanguy bab9b2cf4e player/command: alias playback-time to time-pos
Since 7fc4bac29f, playback-time and
time-pos will now always have exactly the same values. Both properties
are commonly used, so just make playback-time an alias for
time-pos and document it.
2024-06-20 13:07:41 +00:00
Kacper Michajłow b3b542af51 m_options: limit list entries to 100
Limit list entries to 100. obj_settings_list is not designed to hold
more items, and it quickly starts taking ages to add all items. 100 is
more than enough.

Fixes 30s timeout on OSS-Fuzz and generally fixes possible DoS on mpv.
2024-06-18 03:11:14 +02:00
Crend King c9ea2798a4 osc.lua: add script message to show up the OSC
Add a way to briefly show the OSC, which is useful to check file name,
playback progress and time left, etc.

Fix issue #3826
2024-06-16 01:23:38 +02:00
Crend King 6031a0e173 vf_vapoursynth: upgrade to VapourSynth API v4
VapourSynth introduced their version 4 API in R55, 3 years ago. mpv is
still using the deprecated version 3. I think it is good to migrate
before VapourSynth completely removes it.

The most impacted area is the video format. Previously we have a fixed
table of supported formats, each represented by an integer. In v4, the
integer is replaced by pointer to the full struct of the format.

Second, the way to create video filter is changed. Previously caller
needs to supply a "initialization" callback to `createFilter()`, which
sets up video info etc. In v4, video info is prepared first, passed to
the `createVideoFilter2()` and we get back the node.

Also, previously mpv was using the `fmSerial` filter mode, which means
VapourSynth 1) can only request one frame from mpv at a time, and 2) the
order of frames requested must be sequential. I propose to change it to
the parallel request mode, which requests multiple frames at a time in
semi random order. The reasons are, for 1), the get frame function,
`infiltGetFrame()`, unlocks the mutex during output image generation,
thus can benefit from parallel requests. For 2) thanks to the frame
buffer, unordered frame requests are acceptable. Just make sure the
buffer is large enough.

Third, the way VapourSynth scripting environment works change. In v4,
the scripting API is operated through struct pointer, much like the
exist `vsapi` pointer. The "finalize" function is also no longer needed.
2024-06-14 00:25:18 +02:00
nanahi d2bd77ada0 stats.lua: display file tags
This adds file tags to display along with the title, including
album/artist etc. for music, and series etc. for some videos.
The list of tags to display is identical to the tags printed to
the terminal and is controlled by the --display-tags option.

To filter out overlength tags (such as long comments and lyrics) and
files with too many tags, add file_tag_max_length and file_tag_max_count
options so that tags longer than this length are not displayed, and only
the first few tags are displayed.

Also makes tags show on page 5 only.
2024-06-09 00:58:48 +02:00
nanahi 828ffc0c8f DOCS/interface-changes: fix formatting 2024-06-08 23:08:43 +02:00
nanahi 20bd4483b1 DOCS/contribute.md: require interface change begin with type
This makes interface changes appear sorted with the types of changes,
making it easier for users to find breaking changes among all changes.
2024-06-08 23:08:43 +02:00
Kacper Michajłow 73e779a1ee stats.lua: add page 5 for currently selected tracks information 2024-06-08 23:06:22 +02:00
nanahi f8f47d06f4 osc.lua: add option to use display fps for update interval
If the display fps is unavailable, use the tick_delay as a fallback.
2024-06-08 13:46:11 +02:00
nanahi 6337bc27ff osc.lua: add option to make rendering smoother
OSC rendering used to be smooth (up to OSD rendering fps) before
48f906249e, but after that commit the
frame duration is hardcoded to 30 ms. This is too high and results in
choppy OSC rendering, which is very noticeable with the progress bar
while moving mouse over it or playing a short 60 fps video.

This makes the duration an option so that it can be decreased to make
OSC rendering smoother.
2024-06-08 13:46:11 +02:00
Misaki Kasumi c55ff4176c opengl: add --egl-output-format 2024-06-08 10:23:32 +02:00
Misaki Kasumi cd74f8f7c5 opengl: add --egl-config-id 2024-06-08 10:23:32 +02:00
Crend King fe709c986b vf_vapoursynth: add parameter to pass arbitrary string to script
Currently the vapoursynth video filter does not accept any argument for
passing arbitrary user data. This limits what the VS script can do.

Ideally, the vapoursynth filter has an user-data parameter that contain
string value. mpv passes that value to the VS script just like
container_fps and others. Once the VS script gets the data, it can do
all sorts of data extraction and transformation.

Another benefit is that instead of mpv always have to catch up to user
needs for this filter, with this users can just pass whatever needed
themselves, thus becomes more future-proof.

Fixes #14214
2024-06-08 03:13:41 +02:00
Guido Cella dc998560aa options: add --osd-playlist-entry
Allow configuring whether to print the media-title, the filename or both
(as `<title> (<filename>)`) in show-text ${playlist}, the OSC playlist
and in the playlist selector.

Showing only titles hides information when files are badly tagged, or
when it hides the track numbers of album songs. But showing filenames is
not as useful as titles e.g. when playing URLs with media titles. This
option lets the user choose which one to show, or show both if switching
is inconvenient.

The OSC's playlist_media_title script-opt is removed because this option
is better since it works everywhere after configuring it once.

Closes #11653.

Also show the full URLs of playlist entries instead of their basenames
in osc.lua and select.lua, consistently with mp_property_playlist().

For simplicity, this just checks if entries contain :// instead of
replicating all of mp_is_url().

Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
2024-06-08 01:43:15 +02:00
Crend King d53aa6d3e2 DOCS/compile-windows.md: improve Windows build documentation
Currently the documentation for building on Windows, specifically the
"Native Compilation with Clang (Windows SDK Build)" route, could use a
few minor improvement to make the development onboarding experience more
smoothly.

Fixes #14214
2024-06-08 01:15:56 +02:00
nanahi eeb8e6e451 defaults.lua: handle canceled key bindings
There is a subtle behavior difference for built-in/input.conf key bindings
and key bindings registered by scripts: when a key binding is canceled
(e.g. a mouse button is bound to a command, is pressed down, and then
another key is pressed which is bound to another command), the command is
not invoked if the binding is built-in/input.conf, but is invoked if it's
registered by scripts, because it's handled with a different mechanism,
which gives no way for scripts to detect this.

Fix this by using the newly available canceled flag to detect this.
If a key binding is canceled, the callback is now not invoked unless
the key binding is registered with the complex option. In this situation,
the callback is invoked with the canceled state available so that scripts
can detect and handle this situation.
2024-06-06 23:38:39 +03:00
nanahi 5fcbe1c417 command: add canceled state to key-binding client message
This allows libmpv clients to know whether the key binding is canceled
and thus should normally be ignored.
2024-06-06 23:38:39 +03:00
Kacper Michajłow 112fa549be DOCS/compile-windows.md: update Windows compilation documentation
General update. Removed MXE as it is not supported, doesn't support
libplacebo and in general it doesn't do anything useful which native
Meson cannot do already.
2024-06-05 19:17:49 +02:00
nanahi 49b5e6d042 input: un-hardcode VO dragging
This adds the --input-builtin-dragging option, which allows the built-in
dragging behavior to be disabled. This allows scripts to implement custom
dragging behavior with left button down events and begin-vo-dragging
command, which could only be done for other mouse buttons before.
2024-06-04 12:41:51 +02:00
nanahi a6683ea3c9 input: implement VO dragging deadzone
This adds the --input-dragging-deadzone option, which adds a deadzone
for the built-in VO deagging. This prevents accidental VO dragging.
2024-06-04 12:41:51 +02:00
nanahi 23d9c8dc6a DOCS/man/options.rst: remove DVD menu reference for --input-cursor
Not supported anymore.
2024-06-04 12:41:51 +02:00
llyyr 7aaa7b221f input.conf: change 'u' binding to cycle between 'force' and default 2024-05-29 17:48:50 +00:00
llyyr de8bce33ed options: make sub-ass-override default to 'scale'
Previous commit changed the semantics of 'yes', so change the default to
scale to prevent unexpected user facing changes
2024-05-29 17:48:50 +00:00
llyyr f37691a156 options: move sub-ass-override 'scale' above 'force'
Also make it an enum for clarity

This is the right order in terms of both destructiveness and also the
total number of --sub-* options applied.
2024-05-29 17:48:50 +00:00
Dudemanguy 42181a8769 DOCS/input: clarify the difference between audio-pts and time-pos
In light of the changes in the recent commits.
2024-05-29 13:48:40 +00:00
nanahi 43136b603a DOCS/man: replace legacy option syntax usage
They are replaced by --option=value.
2024-05-24 17:57:43 +00:00
qadzek 0dd6321c51 DOCS/man/console.rst: remove extraneous words 2024-05-21 16:02:03 +02:00
Guido Cella 76ad8efe39 DOCS/options: --sub-scale-by-window doesn't affect ASS subtitles 2024-05-20 21:04:19 +02:00
nanahi 85b3a6e567 {stats,osc}.lua: respect --osd-scale-by-window by default
This lets these scripts scale the elements with OSD by default.
2024-05-20 18:29:44 +02:00
nanahi 1f29d037a0 stats.lua: add add auto value to vidscale option
This adds auto to vidscale script option, which lets the scale be
inherited from OSD --osd-scale-by-window option.
2024-05-20 18:29:44 +02:00
nanahi 0c74199a8f osc.lua: add auto value to vidscale option
This adds auto to vidscale script option, which lets the scale be
inherited from OSD --osd-scale-by-window option.
2024-05-20 18:29:44 +02:00
nanahi e61911c513 DOCS/man/options.rst: recommend --osd-scale-by-window for UI scale
This recommends querying the value of this option when drawing UI elements.
This allows a greater level of consistency by using a single flag which
already controls the scaling behavior of the OSD to control the behavior
of all scripts.

Also fix a capitalization nearby.
2024-05-20 18:29:44 +02:00
nanahi 4ad1fa28b4 DOCS/interface-changes.rst: document loadfile breaking change 2024-05-20 18:07:38 +02:00
nanahi 8143779e24 DOCS/man/input.rst: document breaking change of loadfile index argument
As an instance of "extraordinary circumstances", such incompatibility
must be extensively documented.
2024-05-20 18:07:38 +02:00
nanahi d890f369df DOCS/man: note that default autoprobe order is unrealiable
The default values for --ao, --vo, --gpu-api, --gpu-context change from
time to time, but some libmpv clients rely on the existing autoprobe order
and breaks as a result when the value changes. This specifies that the
default autoprobe order should not be relied upon.
2024-05-20 18:07:38 +02:00
nanahi 46dbaff961 DOCS/compatibility.rst: add requirement when changing default values
Documented default values are relied upon by scripts, so changing these
values can casuse incompatible changes. This makes documenting them
required.
2024-05-20 18:07:38 +02:00
nanahi eb38c3cb87 DOCS/compatibility.rst: add provision for dealing with severe breakages
Currently there is no policy on what should be done when an immediate,
severe breakage happens for "important/often used parts", which can cause
serious concerns especially if such changes remain obscured.

This adds a provision for this kind of incompatible changes under
"extraordinary circumstances", which allows for the breaking change to happen
if there is a critical reason to do so. Such changes must be extensively
documented, and should be avoided as much as possible.
2024-05-20 18:07:38 +02:00
nanahi c489f34060 DOCS/compatibility.rst: require more details about breaking changes
Currently incompatible changes are not clearly outlined in the related
documentations, such as interface-changes.rst. The impacts and suggested
actions to address the compatibility concerns also rarely exist.

This adds a requirement to include these information for incompatible
changes, so that such changes are clearly conveyed to the users, with
suggested actions to minimize the impacts of such changes.
2024-05-20 18:07:38 +02:00
nanahi c5c68333e9 DOCS/compatibility.rst: fix formatting 2024-05-20 18:07:38 +02:00
nanahi bc5863a631 input/cmd: add nonrepeatable prefix
This allows forcing certain commands to be non-repeatable, e.g. volume.
2024-05-20 17:47:01 +02:00
Guido Cella 61f72bd512 select.lua: add this script
This adds script messages to select playlist entries, tracks, chapters,
subtitle lines, bindings and properties using the newly introduced
mp.input.select().

This fully closes #13964.
2024-05-12 23:13:48 +02:00
Guido Cella 367a6b561a console.lua: close when pressing enter with input.select
When you select an item, due to the submit handler being called
asynchronously, the default item list is redrawn before the console
closes, which is jarring. Fix this by always closing the console as soon
as enter is pressed, as keeping it open is unlikely to be useful with a
fuzzy selector (unlike with input.get() where it can be used e.g. to
implement a Lua REPL). If desired we can later add a close_on_submit
flag defaulting to true.

Also fix a crash when pressing enter without any match.
2024-05-12 23:13:48 +02:00
Guido Cella c4b03700e1 player: add option-info/<name>/expects-file
This will allow console.lua to complete files after e.g. set
glsl-shaders <Tab>.
2024-05-12 22:29:40 +02:00
Guido Cella 4e5845ad03 osc.lua: remove scaleforcedwindow
This is unused since 4e013afd37 because the mpv logo and the "Drop files
or URLs to play here." message are shown instead of the OSC controls. It
has the adverse affect of making the OSC twice as big when playing
videos with --lavfi-complex, because that makes the video property which
osc.lua checks unavailable.
2024-05-12 21:00:38 +02:00
Kacper Michajłow aa3cf6d57b command: add dolby-vision-profile and dolby-vision-level to track-list 2024-05-10 01:26:30 +02:00
Kacper Michajłow 5009e13431 player/loadfile: match language and subcodes 2024-05-09 17:12:55 +02:00
Kacper Michajłow 65c71b1643 Revert "loadfile: use mp_match_lang_single"
This reverts commit 76009bf7a6.
2024-05-09 17:12:55 +02:00
Guido Cella 2354d876da scripting: add mp.input.select()
This allows scripts to make the user choose from a list of entries by
typing part of their text and/or by navigating them with keybindings,
like dmenu or fzf.

Closes #13964.
2024-05-07 22:34:22 +02:00
Guido Cella 6ec3e1549d command: add normalize-path command
This can be used e.g. by a bookmarking script to show normalized paths.
2024-05-05 20:29:27 +02:00
Guido Cella b6615cd474 DOCS/lua: fix some argument names
These need to coincide with the ones in command.c because they can be
specified in mp.command_native.
2024-05-05 20:29:07 +02:00
Guido Cella 67644888e7 DOCS/input: move escape-ass documentation
It should be next to expand-text and expand-path, not under Input
Commands that are Possibly Subject to Change.
2024-05-05 19:57:25 +02:00
der richter 8a61929eb8 cocoa-cb: add support for macOS color space transformation (EDR/HDR)
by default utilises the color space of the screen on which the window is
located. if a specific value is defined, it will instead be utilised.

depending on the chosen color space the macOS EDR (HDR) support is
activated and that OS's transformation (tone mapping) is used.

Fixes #7341
2024-05-05 19:02:50 +02:00
Guido Cella 1c42589ce0 DOCS/input: document sub-seek 0
Documents the functionality added by 155f7fa. Also make it clear than
can you can seek with arbitrary <skip>s instead of just 1 and -1.
2024-05-05 15:23:18 +02:00
Kacper Michajłow 427e07b93a docs: mention Cache section in sub-seek
sub-seek depends on cached range to know future subtitles, make it clear
in documentation how to control this range.
2024-05-05 15:08:20 +02:00
Aman Karmani abe8f3f9df demux: keep track of ts information per stream type
Signed-off-by: Aman Karmani <aman@tmm1.net>
2024-05-05 14:11:47 +02:00
omar a26bbbd78d OSC: implemented user configurable colors 2024-05-03 16:50:49 +02:00
nanahi 807a6d875a options: add --native-touch option
For platforms which send emulated mouse inputs for touch-unaware clients,
such as Win32 and X11, this option enables the native multitouch handling
and disables emulated mouse inputs. This enables interested scripts to
handle multitouch events while keeping compatibility with touch-unaware
scripts.
2024-05-03 16:14:03 +02:00
nanahi 77809faea1 input: add --input-touch-emulate-mouse option
This adds --input-touch-emulate-mouse option, which controls whether to
enable legacy touch handling where touch inputs are emulated as mouse
inputs. This establishes a primary touch point (the one with the lowest
index) as the emulated mouse position, and MBTN_LEFT up/down with the
appearance of the first touch point and the disappearance of the last
touch point.

This fixes some problems with touch handling on Wayland, for example
attempting to pinch results in a double click.
2024-05-03 16:14:03 +02:00
nanahi 46cca1a67f command: add touch-pos property
This adds touch-pos property, which contains the information of all
current touch points. The property has sub properties:

touch-pos/count: the number of current touch points
touch-pos/N/x,y: the position of touch point N
touch-pos/N/id: unique identifier of the touch point
2024-05-03 16:14:03 +02:00
Sebastian Ramacher ec447fd4a2 DOCS: fix spelling of environment and corresponding/corresponds 2024-05-01 14:39:52 +02:00
rcombs 99f1b2b7b4 player/command: add sub-text/ass-full sub-property
This is like sub-text/ass, but it returns a full ASS line, making it suitable for some more advanced scripting use-cases.
2024-04-27 01:19:56 +02:00
rcombs 437fff9f21 player/command: move sub-text-ass to a sub-property 2024-04-27 01:19:56 +02:00
Shreesh Adiga 4aa7588e44 DOCS/vf: update vf_gpu options 2024-04-27 01:08:22 +02:00
der richter f7a32b5f29 mac: make display-names unique to allow specific selection
the Screen property localizedName returns a none unique dynamic name
that doesn't allow a specific selection of a Screen on every OS boot.
the name consists of the vendor name and model name (eg DELL U2723QE).
if the same model display is connected to the system several times,
macOS starts to add numbers to the localizedName (eg DELL U2723QE (1)),
that may not be associated to the same Screen on every OS boot or
connecting the display. it also changes the name of the first connected
display by adding that numeration. this makes it impossible specify the
proper screen with the screen-name option every time.

to circumvent this we remove the enumeration from the name and instead
add the serial number to the display-names property. this makes the
actual Screen unique and none dynamic. furthermore the selection of a
screen by name will check for equality for the old localizedName, simple
name without enumeration, serial number and the combined name with
serial number. this makes it possible to select the screen by either of
those names and identifiers, and keeps backwards compatibility with the
old behaviour.

Examples:
localized name (System Settings name): DELL U2723QE, DELL U2723QE (1)
simple name: DELL U2723QE
serial number: 123456789
combined name: DELL U2723QE (123456789)
2024-04-24 20:35:38 +02:00
nanahi 5318522b50 DOCS/man: refer to "mp.options functions" for script config docs
Currently they refer to the OSC documentation. However,
the "mp.options functions" already documents that, is more detailed,
and does not contain false statements like "there may be no spaces around
the ``=`` or anywhere else" (the primitive parser does not care about
them, so starting a string option value with spaces is perfectly fine).

Change them to refer to "mp.options functions" and remove the redundant
section in the OSC documentation.
2024-04-21 15:26:46 +02:00
sunpenghao 503a0f184c ao_wasapi: add `--wasapi-exclusive-buffer` option
This allows users to set buffer duration in exclusive mode. We have
been using the default device period as the buffer size and it is
robust enough in most cases. However, on some devices there are
horrible glitches after a stream reset. Unfortunately, the issue is not
consistently reproducible, but using a smaller buffer size (e.g., the
minimum device period) seems to resolve the problem.

Fixes #13715.
2024-04-19 02:28:23 +02:00
Dudemanguy bd1bcc1f31 player: always notify when writing window-scale option
As described in the previous commit, update_window_scale will always
execute whenever window-scale is written even if the value doesn't
change.
2024-04-18 17:40:16 +00:00
nanahi db6b195f3f stats.lua: add option to disable scale with video size
This adds a new configuration option vidscale, which controls whether
stats display is scaled with video, similar to the option for OSC.lua.
2024-04-18 18:44:53 +02:00
nanahi d283688939 stats.lua: add option to control plot border width
This adds a new configuration option plot_bg_border_width, which
controls the border width of plots.
2024-04-18 18:44:53 +02:00
nanahi 750dec880c m_option: change confusing error messages for obj_settings_list
This option type is not used only by filter options: they're already
used by --ao, --vo, and --gpu-context. Replace the mentions of
"filter" to "item" instead, and changes some languages to improve clarity.

Also change the documentation on "Filter options" to describe what it
really is, and fix a typo.
2024-04-18 16:28:21 +02:00
nanahi e968a505d6 DOCS/man/options: mention the new priority list usage of --gpu-context
The settings list conversion means a custom priority list can now be used.
2024-04-18 16:28:21 +02:00
Shuanglei Tao fefa1b6645 DOCS/client-api-changes.rst: fix formatting 2024-04-18 16:13:57 +02:00
rcombs d3a63e16d2 command: use property_time() for sub-start and sub-end
This gives these properties the "time" type, which allows them to be pretty-printed as HH:MM:SS easily (but also still allows raw formatting using e.g. ${=sub-start}).
2024-04-18 13:11:01 +02:00
Kacper Michajłow a569c3ce0c player/command: add track-list/N/decoder 2024-04-18 01:20:32 +02:00
Guido Cella 8a4ecda940 stats.lua: filter input bindings by typing them
This lets you press / in page 4 of the stats and type a keybinding or
part of its command to filter it by using mp.input.

This works badly without a VO because both stats.lua and console.lua use
show-text and only one can be displayed at a time, but it's still better
than not having the search available at all.
2024-04-18 01:17:53 +02:00
llyyr 805577c792 sd_ass: add `sub-vsfilter-bidi-compat` to enable vsfilter bidi compat
Enable ASS_FEATURE_{WHOLE_TEXT_LAYOUT, BIDI_BRACKETS} and auto base
detection by default, and add an option to disable this if needed.

This is strictly an improvement for webvtt files as they always use
auto base detection. This _fixes_ right-to-left text rendering for
webvtt files which correctly mark rtl/ltr. Webvtt files obtained from
sources which sideload the RTL information through css also see an
improvement due to the auto detection.

Generally SRT files also want this, but some are also written to
workaround VSFilter quirks.

See also: https://github.com/mpv-player/mpv/pull/12985#issuecomment-1839565138
2024-04-18 00:14:44 +02:00
nanahi c9a53780cf DOCS: document --show-in-taskbar option 2024-04-18 00:09:09 +02:00
Guido Cella 51bd00c33a stats.lua: inherit OSD styles
Avoid having to configure both the OSD and the stats script opts when
you change the OSD options, in particular avoid having to convert colors
to BGR.

Also document the shadow options.

font_size, border_size and shadow offset defaults are kept because the
same values look much bigger in the stats than in the corresponding OSD
options.

osd-back-color is now respected without extra checks until you
explicitly set a shadow_color.
2024-04-17 23:47:55 +02:00
sunpenghao 75d899bcaf DOCS/input: minor typo correction 2024-04-17 23:46:35 +02:00
sunpenghao c70cc5b01d osc: add playlist_media_title option
Showing media titles in the playlist is pointless when sources are ill
tagged and media titles contain only garbage. Being able to opt for
file names at least gives us a choice in such cases.
2024-04-17 23:46:35 +02:00
sfan5 02254b92dd
Release 0.38.0 2024-04-17 21:18:44 +02:00
Kacper Michajłow d23f641bb3 player/command: remove codec-info and use track-list directly
Turns out that adding more medatata like HDR10+ and Dolby Vision would
produce a lot of duplication and it is better to centralize it around
the track-list property.

Fixes: e720159f72
2024-04-16 21:58:55 +02:00
Kacper Michajłow e720159f72 player/command: add video-codec-info and audio-codec-info
Adds support for extracting codec profile. Old properties are redirected
to new one and removed from docs. Likely will stay like that forever as
there is no reason to remove them.

As a effect of unification of properties between audio and video,
video-codec will now print codec (format) descriptive name, not decoder
long name as it were before. In practice this change fixes what docs
says. If you really need decoder name, use the `track-list/N/decoder-desc`.
2024-04-15 19:34:40 +02:00
nanahi a6c38b93a2 DOCS/man/mpv: correct description of F8/F9 keybinds
Previous commit fixes showing the list in the terminal, so the mentions
of it can be removed.
2024-04-10 20:47:08 +02:00
der richter ee6794225d mac/vulkan: add support for frame timing via presentation feedback 2024-04-10 19:14:20 +02:00
Kacper Michajłow 5a53fa7cad vo_tct: add --vo-tct-buffering option 2024-04-07 20:23:04 +02:00
nanahi 0f4f1bcd63 DOCS/man/vo: document vo_caca's hardcoded keybinds
This was in mplayer's documentation, don't know why this got lost.

"Fixes": 504e2336b7
2024-04-07 15:38:57 +02:00
nanahi 48ce438fae DOCS/man/options: mention the impact of --hwdec-codecs on startup time
Probing for hwdec can be very slow: on my setup (Nvidia GPU without
VP9 hwdec capability), this causes 2x hot cache startup time compared
to explicitly disabling VP9 in this list (500 ms -> 1 000 ms).

Also remove --vo=vdpau reference.
2024-04-07 15:38:57 +02:00
nanahi b1ee92ad4a DOCS/man: unify flag option descriptions
In many places, flags options have duplicate descriptions like
--break-player and --no-break-player. This is redundant since the
equivalence of this syntax to --break-player=<yes|no> is already
documented, and the =<yes|no> syntax is more in line with the syntax
of other option types.

This replaces all usage of --no-foobar with --foobar=no, and use
--foobar=<yes|no> when possible.
2024-04-07 15:38:57 +02:00
Shuanglei Tao 3c1e983351 vo: add win32 context menu support 2024-04-06 08:24:06 +02:00
nanahi 3a2a457171 DOCS/options: document key autorepeat defaults 2024-03-29 14:07:37 +01:00
Misaki Kasumi 1ed8607292 ao_avfoundation: initial avfoundation ao support 2024-03-29 13:46:59 +01:00
sfan5 7ccb1cbcd4 DOCS: update for new --pulse-latency-hacks defaults
I missed this.
fixes: 8e3737ab63
2024-03-25 22:45:58 +01:00
sfan5 8e3737ab63 ao_pulse: reenable latency hacks by default
As far as I can tell PulseAudio introduced a bug in 16.0
where if a stream is (un)paused too often the reported latency
will momentarily spike by 3000% or more. Apparently in certain cases
just pausing once and waiting can also cause this.

Save the remaining users of PA the trouble of debugging the various
obscure issues that can arise from this (desync is a harmless example)
by enabling the latency hack code again.

ref: <https://github.com/mpv-player/mpv/issues/12057>
     <https://github.com/mpv-player/mpv/issues/10333>
2024-03-24 09:58:41 +01:00
Dudemanguy 91489c9466 options: add --input-commands option
Basically a simple way to perform any command/property action from the
command line. This takes the exact same syntax as input.conf but not
including the key naturally. Potentially useful for weird properties
that don't map well to options (like ao-volume). Fixes #12353.
2024-03-21 14:48:53 +00:00
Kacper Michajłow 8708f4dc91 m_property: add `>` for fixed precision floating-point expansion
This enhancement makes it easier to create constant width property
expansions, useful for the `--term-status-msg`. Additionally, it changes
to `%f` printing with manual zero trimming, which is easier to control
than `%g`. With this method, we can directly specify precision, not just
significant numbers. This approach also avoids overly high precision for
values less than 1, which is not necessary for a generic floating-point
print function.

A new print helper function is added, which can be used with adjusted
precision for specific cases where a different default is needed. This
also unifies the code slightly.
2024-03-21 03:50:11 +01:00
Guido Cella c84bb1ce67 osc.lua: escape text
Escape all messages in osc.lua, because other than the title they
weren't being escaped at all. If for example you did mpv foo.mp4
'{\fs50}bar.mp4' and script-message osc-playlist, it would just render
the second entry as bar.mp4 in big text.

The title was escaped partially, now the escaping is complete because:

- It escapes \. Backslashes at the end of the title are escaped instead
  of being stripped, and \n, \N and \h are now printed verbatim. In
  particular, "\\n" is no longer converted to space and is printed
  verbatim instead which is more correct.
- Newlines ("\n", not the "\\n" escape sequence) are converted to spaces
  instead of rendering them and messing up the text positioning within
  the OSC.
- Spaces at the start are preserved.

Fixes #11209, fixes #11275.
2024-03-21 03:20:14 +01:00
Guido Cella d6610a5b2f command: add escape-ass
This adds a command to escape ASS tags to remove code duplication
between sub/osd_libass.c, console.lua, osc.lua, stats.lua and any user
script that calls mp.create_osd_overlay().

A command is used instead of scripting functions so that all clients can
use this and not just use Lua and JS ones.

osd_mangle_ass() also interprets osd-sym-cc and osd-ass-cc/{0,1}, but
since they use invalid UTF-8 characters there is no risk of escape-ass
users using them by accident, like with any OSD message.

Always replacing \n with \\N in mangle_ass() even when it is not called
by escape-ass doesn't seem to cause any issue, but I made it conditional
anyway to avoid changing how all OSD messages are treated unnecessarily.
2024-03-21 03:20:14 +01:00
Christoph Heinrich 0c8f3bc73c player/command: add term-size/[w,h] property
There was no way for scripts to know the current size of the terminal,
which is essintial if they want to provide a good user experience even
without a window.
2024-03-21 03:08:52 +01:00
Christoph Heinrich 777f69bee8 stats.lua: truncate long lines for the terminal
The terminal is assumed to be 80x24 in size, the new options
`term_width_limit` and `term_height_limit` can be used to overwrite
that.

Lines longer then the terminal width cause problems with scrolling
pages and need to be shortened.

The algorithm used for shortening can deal with tabs and escape
sequences, has rudimentary support for UTF-8 and runs in O(n).

avih helped in the creation of the term_ellipsis() function and split()
is also from him.
2024-03-21 03:08:52 +01:00
Dudemanguy 58363d209c DOCS: document the new way to handle interface changes
Manually editing interface-changes.rst is a giant maintenance pain that
causes merge conflicts all the time. Stop doing that nonsense and
instead have changes be written to files in DOCS/interface-changes. Also
remove that one sentence in changes.rst because it's just not true.
2024-03-20 22:38:56 +00:00
llyyr dd88701aac DOCS/options: improve wording of dither-depth 2024-03-19 19:43:08 +01:00
Kacper Michajłow 227916d5ed builtin.conf: remove debanding from the high-quality profile
Debanding is an inherently destructive process. It is not needed for
most high-quality sources and only produces an adverse smoothing effect
when applied to fine-detailed content, removing detail. It should only
be applied when necessary, either manually with the `b` keybind or with
an automatic profile.

Additionally, it is quite computationally heavy with no real benefit for
high-quality content.

By default, and especially in the high-quality profile, mpv should
preserve source detail and quality as much as possible. Additional
processing should be opt-in.
2024-03-19 09:18:49 +01:00
Kacper Michajłow 212b3863c6 input.conf: add `b` to toggle debanding 2024-03-19 09:18:49 +01:00
llyyr f914947dda vo_gpu_next: make `dither-depth=auto` mean 8 bpc for non-d3d11 SDR
Fixes the issue described in https://github.com/mpv-player/mpv/issues/11862
for SDR files for non-d3d11 gpu-api. We currently don't have a smarter
way to get the real on-the-wire bpc for other APIs, so this is the best
that can be done.
2024-03-19 09:06:01 +01:00
Guido Cella 23c988b3e1 DOCS/options: --x11-name sets the instance name, not the class's 2024-03-17 15:04:30 +00:00
Dudemanguy ccafd40ccc demux: add a format-name property
It can be useful to know the underlying format of any entry in the
track list. Only applicable to the lavf demuxer.
2024-03-17 14:59:40 +00:00
nanahi b2ce96bd35 DOCS/options: clarify --autofit-larger effect
Clarify that --autofit-larger sets the maximum size of the window.
The original wording was not written with runtime change in mind,
so the implication of "not changing size" is ambiguous.
2024-03-17 14:59:26 +00:00
sfan5 aa75a0e9d2 vo_drm: add support for YUYV format
As the first aligned format this required a fix to reconfig().

Adding the other component-swapped formats in this group would be trivial
but I checked the DRM database [1] and no driver exists that supports
one of those but not YUYV and this is quite fringe as-is, so I opted not to.

[1] <https://drmdb.emersion.fr/formats>
2024-03-16 13:27:34 +01:00
nanahi 0e5aa216b8 DOCS/tech-overview.txt: add builtin.conf to etc/ description
builtin.conf is compiled into mpv binary as the default config.
2024-03-11 21:01:01 +01:00
nanahi 656c2e33d4 DOCS/tech-overview.txt: update for merged pull/push glue code
b83bdd1d17 merged the glue code for the
two types of audio APIs.
2024-03-11 21:01:01 +01:00
nanahi 2ea12464be DOCS/tech-overview.txt: add vo_gpu_next reference
vo_gpu_next also can pick a windowing system at runtime.
2024-03-11 21:01:01 +01:00
nanahi 73e08043d2 DOCS/tech-overview.txt: add a section for the new filter framework
76276c9210 introduced a generic filtering
framework which replaced the separate video and audio filter chains.
Additionally, 6d36fad83c and
76e7e78ce9 made the decoder wrappers
a filter.
Add a new section to document this, and corrrect the outdated
audio/video decoder and filter info.
2024-03-11 21:01:01 +01:00
nanahi c254cf42cb DOCS/tech-overview.txt: update for removed stream inputs
stream_tv.c was removed in b30e85508a.
stream_dvd.c was removed in 6229404985
and replaced by stream_dvdnav.c.
2024-03-11 21:01:01 +01:00
nanahi 7cb6185576 DOCS/tech-overview.txt: update for split m_config.c/h
Since eb381cbd4b split the file into
m_config_core.h and m_config_frontend.h, the statements here are no
longer true. Correct them the current usage.
2024-03-11 21:01:01 +01:00
nanahi 7b784b9b76 DOCS/tech-overview.txt: fix function/member/header names
Just to be exact.
2024-03-11 21:01:01 +01:00
der richter 0ec385bc76 options: remove --focus-on-open and add --focus-on
replaces the old focus-on-open option with a more generic focus-on
options that can be extended.

adjust the only platform that uses that option.

Fixes #8337
2024-03-10 14:53:07 +01:00
Kacper Michajłow 024edb2991 vf_format: add hdr10plus sub-parameter to format video filter 2024-03-09 05:58:52 +00:00
Kacper Michajłow 05c8d5a93a csputils: add missing PL_COLOR_SYSTEM names 2024-03-09 05:58:52 +00:00
Kacper Michajłow da3bfc96e9 vo: add video-target-params property 2024-03-07 21:12:12 +02:00
savoury1 f532f3f38f DOCS/man/input.rst: fix incorrect syntax
Some incorrect syntax is used in DOCS/man/input.rst with c678033c1d
causing failure of PDF manual generation with rst2pdf. There are single
rather than double back-ticks for insert-at and insert-at-play so this
is fixed and a couple of typos are also corrected with this commit.
2024-03-06 22:34:05 +00:00