Commit Graph

11954 Commits

Author SHA1 Message Date
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
1nsane000 38a8e9bcba options: add --deinterlace-field-parity option
Previously there was no way to specify the field order of interlaced videos
when deinterlacing with inbuilt filters. Lavfi deinterlacers seemed to prefer
top field order while inbuilt ones (vdpaupp, vavpp, d3d11vpp) seemed to prefer
bottom field order. The default "auto" option should work exactly as before
while specifying either "tff" or "bff" should force the specified field order
2024-03-04 17:41:40 -08:00
psykose c8f1c822dc DOCS/options: fix Vulkan typo 2024-03-02 12:55:49 +01:00
nanahi 9d03b83a6c command: add begin-vo-dragging command
This command initializes a vo dragging request for VOs that implement
the new VOCTRL_BEGIN_DRAGGING voctrl. This allows scripts to begin vo
dragging for any button press event.
2024-03-01 18:25:12 +01:00
Dudemanguy 4560d93bf0 Revert "player: add ao-volume option, to set the system volume at startup"
Ended up being a bad idea. As a property, this inherently has more
functionality and the tradeoff of being able to do --ao-volume wasn't
worth it.

This reverts commit 58ed620c06.
2024-03-01 09:20:15 -06:00
nanahi 64627855be DOCS/options: clarify --sub-blur and --osd-blur options
Clarify that these options only apply to the font borders,
not to the texts themselves.
2024-02-27 08:36:56 +01:00
Dudemanguy bc4003d219 vo_gpu_next: add --border-background option
Allow for setting the border background independently from the
background option.
2024-02-26 16:46:00 +00:00
Dudemanguy c72c47204d vo_gpu/vo_gpu_next: rework --alpha into --background option
The --alpha option currently covers two related but different concepts:
whether or not to ignore the alpha component and possibly blending it
with a background. Because of the way the option currently works, it is
impossible to have a transparent window (which requires setting
--alpha=yes) while blending it with the background at the same time. To
solve this, let's rework it so it it superseded by the background
option.

--background controls what kind of background to set for the image if
possible. It can be blended with the set background color, with tiles,
or not blended at all (the last one is still broken on X11/mesa except
for GLX, *sigh*). In this new paradigm, --alpha=no has no real purpose
because you can simply set the background to color and whatever color
you want for exactly the same effect. So the option is removed. Instead,
the hint set by windowing backends (i.e. setting
ra_ctx->opts.want_alpha) can by done with the --background option.

As an aside, the colors in vo_gpu are currently bugged due to not
pre-multiplying the alpha and it seems no one ever noticed. The next
commit fixes that. vo_gpu_next support happens latter since it requires
new things from libplacebo.

Fixes #9615.
2024-02-26 16:46:00 +00:00
Dudemanguy c774b5f517 player: rename --background to --background-color
This better represents what it actually does. --background will be used
for another, related option in the next commit.
2024-02-26 16:46:00 +00:00
Guido Cella 09f6f28cc2 osd_libass: update the OSD bar's dent and border size
Make the OSD bar markers bigger so we can default to a smaller,
better-looking border size, without sacrificing markers' visibility.
2024-02-26 16:01:21 +00:00
dokur0chan 1a194e149c DOCS/options: make --scale documentation more consistent
Beef up the barebones description for the Mitchell filter and make it
consistent with the other --scale examples. In addition to this, make
some wording changes to make the language in the documentation a bit
more unified.

Before this change it was pretty obvious that multiple authors
contributed to this part of the manual (at completely different
timeframes), so the language was somewhat disjointed. The Mitchell
description was also not very helpful.
2024-02-26 15:58:34 +00:00
nanahi f493922e30 DOCS: move ALSA option documentation to ao.rst
All other ao options are documented there so make ALSA the same.
Also remove the (Linux only) wording since some systems (e.g. FreeBSD)
provide compatibility layer for it.
2024-02-26 15:36:37 +00:00
nanahi 3afc1678ba DOCS/options: clarify the impact of --audio-buffer
While making this larger do make audio filters react slower, it doesn't
always make softvol react slower. This is because the softvol reaction
speed is related to the ao buffer size which on many systems have an
upper limit, typically much lower than 200 ms. In this case the softvol
won't react slower. Change the wording to clarify this.
2024-02-26 15:36:37 +00:00
nanahi 0b4b6746b4 DOCS/options: remove lavrresample reference
lavrresample is removed in c8b8fe9981.
The replacement is the internal swresample filter.
2024-02-26 15:36:37 +00:00
nanahi 897d6249ee DOCS/options: remove --alsa-device
This option was removed in 809d160c1e.
2024-02-26 15:36:37 +00:00
nanahi d49dd78e7f DOCS/ao: update SDL ao version reference
This hasn't been true since 1dcf511376.
2024-02-26 15:36:37 +00:00
David Vaughan 0cc269de55 DOCS: add `insert` commands and args to interface-changes 2024-02-26 02:03:21 +00:00
David Vaughan c678033c1d input/player: add loadfile/loadlist insert-at command 2024-02-26 02:03:21 +00:00
David Vaughan a8a314b829 input: add insert-next support for drag-and-drop
This commit adds a DND_INSERT_NEXT action option for drag-and-drop,
allows for selecting it through the --drag-and-drop=insert-next option,
and adds the necessary plumbing to make that happen when something is
dragged onto the player.
2024-02-26 02:03:21 +00:00
David Vaughan 432256e5d2 player: add loadlist insert-next commands
Analogous changes to the previous commit ("add loadfile insert-next commands"),
but for the `loadlist` command.

This allows us to insert a new playlist next in the current playlist,
rather than just appending it to the end.
2024-02-26 02:03:21 +00:00