Commit Graph

50417 Commits

Author SHA1 Message Date
Dudemanguy c31e145e1f DOCS/options: mention default value of cursor-autohide
Closes #11358.
2023-03-01 23:17:33 -06:00
Dudemanguy 7bd528dbeb DOCS/options: clarify hidpi-window-scale description
It's enabled by default everywhere. The sentences about macOS is
misleading and may imply it's disabled by default on the other
platforms.
2023-03-01 23:13:57 -06:00
Dudemanguy c993d5c0ce player: add --auto-window-resize option
mpv's window resizing logic always automatically resized the window
whenever the video resolution changed (i.e. advancing forward in a
playlist). This simply introduces the option to make this behavior
configurable. Every windowing backend would need to implement this
behavior in their code since a reconfigure event must always be a
resize. The params of the frame changed so you either have to resize the
window to the new size of the params or make the params the same size as
the window. This commit implements it for wayland, win32, and x11.
2023-03-02 02:55:36 +00:00
Dudemanguy cd02b5ccf6 ra: assert when using params with dimensions
This came up in #9828. According to the header comments, creating a 1D
ra_tex requires height and depth to be set to 1. For a 2D texture, it
requires depth be set to 1. There were a couple of spots in mpv's code
where this wasn't being followed. Although there was no known bug from
this, the rest of the code works like this so it was a good idea to go
ahead and sync it up. As a followup, let's just add some simple asserts
to ra.c to enforce this so it doesn't go unnoticed in the future.
2023-03-02 02:08:39 +00:00
Frédéric Brière 779d4f99a7 sub: add --sub-fonts-dir and --osd-fonts-dir options
These options make it possible to specify the directory that will be
passed to ass_set_fonts_dir(), akin to VLC's `--ssa-fontsdir` and
FFmpeg's `fontsdir`.

Fixes #8338
2023-03-01 02:09:46 +00:00
Daniel van Vugt 022790a2b4 wayland: request frame callbacks on the topmost surface
Which is wl->video_surface for vo_dmabuf_wayland.

Listening on wl->surface results in freezes if it is occluded and
culled by the compositor. Which mutter does, and the wl_surface::frame
spec warns about:

> A server should avoid signaling the frame callbacks if the
> surface is not visible in any way, e.g. the surface is off-screen,
> or completely obscured by other opaque surfaces.
2023-02-28 15:07:14 +00:00
Daniel van Vugt 1f493b7671 wayland: deduplicate and cache detection of dmabuf-wayland 2023-02-28 15:07:14 +00:00
Ray Smith 8a43fc0e9a wayland: use bool type for alpha framebuffer tracking
ra_ctx_opts.want_alpha and vo_wayland_set_opaque_region's alpha
argument are only used as bool but both are ints. Particularly for the
function argument, passing a 0 or 1 is confusing - at first glance it
looks like you're specifying an alpha value of 0 or 1.

Since they're only used as bools, make them bools.
2023-02-28 14:53:32 +00:00
msoxzw 8006ff6cf6 vo_gpu: d3d11_helpers: prefer DXGI_SWAP_EFFECT_FLIP_DISCARD if possible
Similar to libplacebo[1], DXGI_SWAP_EFFECT_FLIP_DISCARD is used instead
of DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL starting with Windows 10.

[1]: https://github.com/haasn/libplacebo/blob/master/src/d3d11/swapchain.c
2023-02-28 14:41:33 +00:00
averne 3e351a41e2 vf_gpu: initialize depth=1 on target textures
According to internal documentation, 2D textures should have d=1.
This fixes the correctness of the API usage, not any bug.
2023-02-28 14:13:55 +00:00
averne 4fbc3ad399 video: initialize depth=1 on screenshot textures
According to internal documentation, 2D textures should have d=1.
This fixes the correctness of the API usage, not any bug.
2023-02-28 14:13:55 +00:00
Martin Eesmaa 0426f4b107 external_files: recognize jxl and avif files as cover art 2023-02-27 17:50:46 +00:00
Dudemanguy c5d1230517 {console,ytdl_hook}: use the platform property
The console.lua check is still kind of dumb since we check an
environment variable to distinguish between wayland and x11, but
otherwise it should be better in theory.
2023-02-27 17:13:21 +00:00
Dudemanguy 80feac62f1 command: add platform property
This returns the value of the target OS that mpv was built on as
reported by the build system. It is quite conceivable that script
writers and API users would need to make OS-dependent choices in some
cases. Such people end up writing boilerplate/hacks to guess what OS
they are on. Assuming you trust the build system (if you don't, we're in
really deep trouble), then mpv actually knows exactly what OS it was
built on. Simply take this information at configuration time, make it a
define, and let mp_property_platform return the value.

Note that mpv has two build systems (waf and meson), so the names of the
detected OSes may not be exactly the same. Since meson is the newer
build system, the value of this property follows meson's naming
conventions*. In the waf build, there is a small function to map known
naming deviations to match meson (i.e. changing "win32" to "windows").
waf's documentation is a nightmare to follow, but it seems to simply
take the output of sys.platform in python and strip away any trailing
numbers if they exist (exception being win32 and os2)*.

*: https://mesonbuild.com/Reference-tables.html#operating-system-names
*: https://waf.io/apidocs/Utils.html#waflib.Utils.unversioned_sys_platform
2023-02-27 17:13:21 +00:00
Christoph Heinrich 8ea7aa5471 ytdl_hook: don't overwrite force-media-title
ytdl_hook always set force-media-title, making users unable to force
a media-title via options.

To prevent that, check if force-media-title is already set to avoid
overwriting it.

A better solution would be to use tags like is already done for some
metadata, however that doesn't work when `all_formats=yes` is used.
See cbb8f534b0
A comment was added to hint at why it isn't done via tags.

ref.
https://github.com/mpv-player/mpv/pull/10453#issuecomment-1445277496
2023-02-27 17:07:38 +00:00
Guido Cella 42fd6f5f6f ytdl_hook.lua: make exec return a single value
This refactors exec to only return the result of the subprocess command,
and makes the rest of run_ytdl_hook use the fields of this result,
because specifying all those return values multiple times is unwieldy
now that exec is called several times, and this is easier to read
anyway.

I removed the line
err = string.format("%s returned '%d'", err, es)
altogether instead of updating the es variable, because there was no
chance of it being executed since it would only happen when
result.killed_by_us is true, but run_ytdl_hook returns early when it is.
2023-02-27 17:04:42 +00:00
Guido Cella 0772d0263c TOOLS/autocrop.lua: log a more accurate warning
This reorders some code and checks the image track-list sub-property
instead of the albumart one, so that when playing audio without enough
playtime-remaining and images, the "autocrop only works for videos."
warning is logged instead of the "Not enough time to detect crop." one.
It also avoids repeating this warning twice in the code.

As of e16d0dd15d current-tracks returns a video track even when
lavfi-complex is used, so the track-list loop in is_cropable can be
replaced with just checking current-tracks/video while still cropping
videos with lavfi-complex.
2023-02-27 17:03:38 +00:00
der richter ae6a22ddec audio: remove a duplicate clearing of a struct variable
Fixes #8301
2023-02-27 17:02:19 +00:00
Christoph Heinrich a194ddaa43 options: change parameter that was forgottin in property transition
17d91b9d4d changed the name,
but not the parameter type and cast
2023-02-27 11:21:49 +01:00
Christoph Heinrich c5265381b5 client API: reintroduce CONF_TYPE_FLAG for type conversion
Changing the CONF_TYPE_FLAG was a bad idea because mpv_node.u.flag
continues to be an int, leading to a mismatch in type sizes which can
lead to problems with memcpy().

ref. #11373

This partially reverts commit 17d91b9d4d.
2023-02-27 11:21:49 +01:00
Christoph Heinrich a265da9f25 Partially revert "options: remove OPT_FLAG"
The m_option_type_flag is still needed for the CONF_TYPE_FLAG
(next commit).

Add a comment that m_option_type_flag shouldn't be used.

ref. #11373

This partially reverts commit 07545657bf.
2023-02-27 11:21:49 +01:00
rcombs d941564d48 console: observe osc margins from user-data instead of shared-script-properties 2023-02-26 17:54:09 -06:00
rcombs 894f0c28eb osc: set values in user-data in addition to shared-script-properties 2023-02-26 17:54:09 -06:00
Christoph Heinrich 048d4d8b75 player: set playlist title to media title if not set already
The playlist title only got set when it was specified in the
playlist file.
If there is a title after opening a file, that should also be reflected
in the playlist.

ref. #4780
2023-02-26 22:39:54 +00:00
Thomas Weißschuh ed5426c351 various: fix warning -Wimplicit-const-int-float-conversion 2023-02-26 16:45:07 +01:00
Thomas Weißschuh 8d67e891ab vo_gpu_next: fix warning -Wunused-function 2023-02-26 16:45:07 +01:00
Thomas Weißschuh b4ae1551e4 vo_wayland: fix warning -Wvoid-pointer-to-enum-cast 2023-02-26 16:45:07 +01:00
sfan5 5a83745316 vd_lavc: sort hwdecs without hwdevices last for autoprobing
For hwdecs without devices we can't get instant feedback during probing
whether the hwdec can possibly work or not, so we definitely want to try them last.
Independently this would also have solved the issue addressed by the previous commit.
2023-02-26 16:40:59 +01:00
sfan5 1dda09b817 vd_lavc: prioritize mediacodec for hwdec autoprobe
This fixes an issue where mpv would try mediacodec (which may not
be available depending on Android version) and pick v4l2m2m next
which ends up failing even though mediacodec-copy would have been available.
2023-02-26 16:40:59 +01:00
Thomas Weißschuh 16f0cd546d video: make csp option definitions private 2023-02-24 13:55:29 +01:00
Thomas Weißschuh fb48722234 video: make csp equalizer params float
This allows more precise adjustments.

Fixes #11316
2023-02-24 13:55:29 +01:00
sfan5 0d991eba72 vo_gpu: fix newline in log message 2023-02-24 13:33:45 +01:00
sfan5 3e85df3b2d demux: constify a struct member
Fixes a segfault when an invalid demuxer is given due to
uninitialized use of `filename` after goto.
2023-02-24 13:22:03 +01:00
Kacper Michajłow 84f6d7a97e vo_gpu_next: fix color space hint with target peak override
Fixes: #11339
2023-02-23 10:14:53 +01:00
sfan5 985a253f84 DOCS: clarify that GLX is deprecated 2023-02-22 23:25:47 +01:00
Christoph Heinrich c0807e98fb options: remove explicit initialization of integers to 0 2023-02-21 17:15:17 +00:00
Christoph Heinrich 07545657bf options: remove OPT_FLAG 2023-02-21 17:15:17 +00:00
Christoph Heinrich 17d91b9d4d options: transition properties from flag to bool 2023-02-21 17:15:17 +00:00
Christoph Heinrich 4ebfe9851c options: transition commands from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
Christoph Heinrich 91cc0d8cf6 options: transition options from OPT_FLAG to OPT_BOOL
c784820454 introduced a bool option type
as a replacement for the flag type, but didn't actually transition and
remove the flag type because it would have been too much mundane work.
2023-02-21 17:15:17 +00:00
Christoph Heinrich b9850a6e8c input: remove unused struct member 2023-02-21 17:15:17 +00:00
llyyr d0eae60d67 DOCS/client-api-changes.rst: move mpv_del_property to 0.36.0
incorrectly placed under 0.35.0 by 2cfaa820e5
2023-02-21 17:07:57 +00:00
Thomas Weißschuh 9efce6d4ae various: drop unused #include "config.h"
Most sources don't need config.h.
The inclusion only leads to lots of unneeded recompilation if the
configuration is changed.
2023-02-20 14:21:18 +00:00
Thomas Weißschuh a90355660c ao_pipewire: drop unused #include "generated/version.h" 2023-02-20 14:21:18 +00:00
rcombs d1cf89b655 Vulkan: add configure check for VK_KHR_display extension
This allows building directly against ICDs that don't implement this extension.
2023-02-20 00:05:26 -06:00
Niklas Haas 9a752e8b26 vo_gpu_next: add --tone-mapping-visualize 2023-02-19 21:01:40 +01:00
quietvoid 41ad51bda2 vo_gpu_next: parse Dolby Vision metadata for dynamic scene brightness
Improves playback for Dolby Vision video files as the metadata can be
used instead of requiring `hdr-compute-peak=yes`.
2023-02-19 20:50:37 +01:00
quietvoid 0d82afbc7f mp_image: forward AV_FRAME_DATA_DOVI_RPU_BUFFER side data
When available, and ignored if `vf=format:dolbyvision=no`.
2023-02-19 20:50:37 +01:00
Leo Izen 2955a0759c
DOCS: document JPEG XL default effort change
Document the change in 7607432127.
2023-02-18 06:16:21 -05:00
Dudemanguy e2cdc23af0 Revert "vo_dmabuf_wayland: drop support for linux-dmabuf-v2"
This was originally dropped because it was thought to be unneeded at the
time, but at least some devices (rockchip) apparently are still on old
compositors that use linux-dmabuf v2. It's not much code, and for
testing purposes it's good to have around since it's hard to test
drmprime otherwise. Some minor additions are here to support the newly
added vaapi-format mapping in v2 of the protocol.

This reverts commit a5b9d529ee.
2023-02-18 02:21:54 +00:00