Commit Graph

49834 Commits

Author SHA1 Message Date
sfan5 2f747341f9 Update VERSION 2022-11-12 14:54:19 +01:00
sfan5 75d938912d
Release 0.35.0 2022-11-12 14:52:40 +01:00
Dudemanguy c56d981cc6 meson: fix macos-touchbar check
Apparently, it is possible for touchbar.m to compile on non-macos
machines. Also, the disable switch didn't actually work either. Fix this
by using the require() function and making sure that Cocoa (should be
apple-only) is found in addition to the compile check passing which is
what waf does. Fixes #10847.
2022-11-11 19:47:43 +00:00
Jan Ekström 8758d96a33 github/workflows: force deletion of existing upstream python symlinks on macOS
This way each time a new Python version is installed via Homebrew
, we don't get CI failures due to the upstream Python distribution
also being installed.

Ref: actions/runner-images#6459
Ref: actions/runner-images#6507
Ref: actions/runner-images#2322
2022-11-11 21:25:03 +02:00
Niklas Haas 33136c276c vo_gpu_next: add tunable shader parameters
This is a very simple but easy way of doing it. Ideally, it would be
nice if we could also add some sort of introspection about shader
parameters at runtime, ideally exposing the entire list of parameters as
a custom property dict. But that is a lot of effort for dubious gain.

It's worth noting that, as currently implemented, re-setting
`glsl-shader-opts` to a new value doesn't reset back previously mutated
values to their defaults.
2022-11-11 13:58:35 +01:00
sfan5 ac3966184b vo_gpu: mark --gamma-factor and --gamma-auto with deprecation warnings
This was forgotten in commit 2207236aaa.
2022-11-10 16:19:37 +01:00
sfan5 175e250038 wayland, x11: fix possibly unsafe bstr usage
In practice this never led to any issues due to implementation
details of bstr_sanitize_utf8_latin1, but there's no guarantee that
a bstr is correctly null-terminated.
2022-11-10 16:19:37 +01:00
Thomas Weißschuh 2e5d0d6e07 ao_pipewire: reload ao on stream disconnect
This allows the core of mpv to know about issues in the AO.
Otherwise playback will just freeze as no more data callbacks are sent
by PipeWire.
Also it allows mpv to try to reconnect the AO or find another, working
AO.
2022-11-07 10:36:40 -08:00
Thomas Weißschuh b7cf35c9a4 ao_pipewire: explicitly remove stream hook
We want to add more logic to the stream event handler.
This logic should not be triggered during normal stream shutdown, so we
remove the listener beforehand.
2022-11-07 10:36:40 -08:00
Thomas Weißschuh bf7ade420d ao_pipewire: log generic stream errors 2022-11-07 10:36:40 -08:00
Aman Karmani 9f0381c51b Revert "ao/audiounit: include AVAudioSession buffer in latency calc"
This reverts commit 8b114e574a.
2022-11-07 18:45:55 +02:00
Aaron Boxer 00e3c90fb1 vo_dmabuf_wayland: improve error handling exporting VA surface
1. check for all error conditions when calling vaExportSurfaceHandle
2. only clean up valid descriptors
2022-11-07 16:42:01 +00:00
Aaron Boxer 259eda4e2f hwdec_vaapi: only set VADisplay resource if entire init process has succeeded
This resource is used by dmabuf_waland to decide if it should manage
vaapi buffers, so it should not be set if vaapi init has failed
2022-11-07 16:42:01 +00:00
Jan Ekström 25906514c3 github/workflows: remove seccomp disablement
Workflow virtual machines have now been updated so that moby package
contains rule for the newly added syscalls, such as 'clone3'.

Effectively reverts 64fa440c69 .
2022-11-05 23:54:27 +02:00
Jan Ekström 9087213916 github/workflows: bump linux jobs to Ubuntu 22.04 base VM
These utilize a custom docker container in any case, but this brings
us to consistency with the mingw-w64 jobs.
2022-11-05 23:54:27 +02:00
Jan Ekström f50cafd2cb github/workflows: move all build jobs to checkout V3
mingw-w64 has utilized this for a while so might as well make it
consistent.
2022-11-05 23:54:27 +02:00
Jan Ekström d525c3c6c2 github/workflows: remove xcode 13.0 to xcode 13.1 override
Thankfully, this version is no longer the default on any of the
macOS runners.

Effectively reverts a76527772e .
2022-11-05 23:54:27 +02:00
Jan Ekström 0076b51dd2 github/workflows: remove macOS 10.15 image usage
This older image has been deprecated and will be removed in December.
The images have also already had planned outages during which the CI
flow has been affected. Thus it feels like a good idea to clean
this up at this point.

Ref: actions/runner-images#5583
2022-11-05 23:54:27 +02:00
Oneric c416a38ef2 sd_ass: never mangle colours on RGB video
It turns out, even xy-VSFilter and XySubFilter do not
mangle colours if the video is native RGB regardless of
the sub's YCbCr header. libass' docs were also updated
to reflect this.
2022-11-05 09:32:05 -04:00
Dudemanguy c5b258b490 meson: move dmabuf-wayland specific files under the right check
This doesn't need to be under the generic wayland check, but the
dmabuf-wayland one. Matches the waf build.
2022-11-03 17:29:48 -05:00
Dudemanguy 2c53fb6a2b gpu/context: properly guard wldmabuf context
This should only be added if the build has dmabuf-wayland enabled. This
fixes #10828.
2022-11-03 17:24:09 -05:00
Christoph Heinrich 445a3561d3 console: add history deduplication
Deduplicate history like the fish shell. So for example
entering "cmd 1" then "cmd 2" then "cmd 3" then "cmd 1"
would result in a history of
[cmd 2][cmd 3][cmd 1]
instead of
[cmd 1][cmd 2][cmd 3][cmd 1]

Adds a function `history_add` to replace directly adding to history.
Adds an option `history_dedup` to activate the deduplication.
Defaults to on.
2022-11-03 13:30:58 +01:00
Dudemanguy 806dddc7d9 github/workflows: remove pip usage in mingw CI
This was only needed because the mingw CI used to run on Ubuntu 20.04
which had a version of meson too old for mpv. This hasn't been the case
since we switched to 22.04 in f7164fcfac
and can now just use the package manager version.
2022-11-02 21:03:29 +02:00
Niklas Haas 6acb7db9fa vo_gpu_next: set background transparency
Fixes: https://github.com/mpv-player/mpv/issues/10815
2022-11-01 19:09:40 +01:00
sfan5 7f5bcd7244 ci: upload resulting binary of mingw64 build 2022-11-01 16:30:59 +01:00
sfan5 f67a56b830 ci/mingw64: refresh build scripts
- newer library versions
- use libplacebo submodules
- prefer meson where possible
- fix minor details
2022-11-01 16:30:59 +01:00
Christoph Heinrich 1a633a6cbc ytdl_hook: reverse order of tracks
Only matters when configuring ytdl_hook with `all_formats=yes`.

So far the tracks were ordered from worst to best quality.

Web players with quality selection always show the highest quality
option at the top. Since tracks are usually listed with the first
track at the top, that should also be the highest quality one.

yt-dlp/youtube-dl sorts it's formats from worst to best.
Iterate in reverse to get best track first.
2022-11-01 09:54:33 -04:00
Leo Izen 3875312e41 demux/codec_tags: support more WAVEFORMATEXTENSIBLE tags
This patch adds support for two extra WAVEFORMATEXTENSIBLE GUID tags
that can appear inside RIFF headers. It also adds support for extra
codec IDs that may appear as their own unique wSubFormats inside RIFF
headers, such as ATRAC9 inside matroska, as one example.

Fixes #10757.
2022-11-01 09:52:27 -04:00
Lynne d555ae9571 wayland_common: always zero out presentation context when destroying it
A desync between the feedback and the feedback in the context
still happens when closing a hidden surface.
2022-10-31 20:46:29 -05:00
Dudemanguy 5fa3bca863 wayland: correct braindead comment (no-op)
I was confused in d3a28f12c9 why it
actually even worked, but after not being stupid, it's quite obviously
just a dangling pointer. The reason it only happens with
wp_presentation_feedback is because the object and listener actually
created in frame_callback not the presentation events itself (for vsync
timing reasons). So it is possible to free the object, but not
immediately recreate it again before quitting (unlike with the frame
callback). The actual comment is moved into feedback_presented (which is
first) but as of this commit it doesn't have the NULL setting logic
(that's the next one).
2022-10-31 20:45:56 -05:00
Dudemanguy d3a28f12c9 wayland: hack around presentation_feedback weirdness
964692ad4c added some code to destroy
presentation_feedback we get in the presentation_discarded event. This
is the correct thing to do since the compositor could send us this
instead of feedback_presented. Without that change, mutter could
potentially leak memory on every frame.

Unfortunately, life is not so simple and wlroots and weston act
differently. These compositors only send one presentation_discarded
event if the mpv window is hidden. Not on every single missed frame like
mutter. Now in theory this shouldn't matter, but it also turns out that
mpv attempts to free the presentation feedback twice if you quit it
while it is hidden away (on weston and wlroots compositors only). The
inital wp_presentation_feedback_destroy in feedback_discarded fires, but
then the function goes off again in vo_wayland_uninit because
wl->feedback is apparently not NULL for some reason. Possibly, this is
some race condition but we can't just get rid of what's in
feedback_discarded since mutter needs this line. Instead, just hack it
by explicitly setting wl->feedback to NULL in feedback_discarded after we
destroy the presentation feedback. Some valgrind testing in mutter,
sway, and weston shows that this works correctly on all of those
compositors with various combinations of mpv being visible or not while
quitting. feedback_presented doesn't appear to exhibit this behavior so
we just leave that as-is.
2022-10-30 14:23:55 +00:00
Dudemanguy 667222dffa wayland: free dmabuf_feedback object
666cb91cf1 added dmabuf_feedback, but it
was never actually free'd on uninit. Because this function requires
wayland protocols 1.24, we have to wrap it in an #if. Also throw in some
minor cosmetic changes in here.
2022-10-30 14:23:55 +00:00
Philip Langdale 8ba4ace1f6 test: update to reflect that Vulkan is a generic format again
In the previous change, I removed the explicit mapping for Vulkan, so
it now shows up as [GENERIC].
2022-10-29 19:18:43 -07:00
Philip Langdale 48bb17549c filters/f_hwtransfer: remove VAAPI <-> Vulkan mapping for now
This mapping isn't actually relevant until we have the Vulkan interop
merged, and it requires a newer version of libavutil than our minimum
requirement. So I'm going to remove it from master and put it in the
interop PR.

Fixes #10813
2022-10-29 18:49:46 -07:00
Dudemanguy f594482451 build: add an additional check for wayland-protocols 1.24
666cb91cf1 added support for v4 of the
dmabuf protocol. This was meant to be optional and the fallback support
for the old v2 (dates back to 2017[0] well before the 1.15
wayland-protocol version we depend on) was maintained. However, v4 added
several new functions and structs that of course aren't defined in old
protocol versions so naturally this breaks the build on those systems.
Since this is just a niche feature and not really critical to overall
wayland support in mpv, just give in and add another check in the build
system and #if out the newer stuff in wayland_common. v4 of linux-dmabuf
depends on wayland protocols 1-24[1], so go ahead and make that our new
check. Fixes #10807.

[0]: a840b3634a
[1]: 8a5cd28a0e
2022-10-29 20:41:20 +00:00
Dudemanguy a9e1905a4a meson: add more hardcoded values to configuration
mpv has a CONFIGURATION define which is defined at configure time in
both build systems and printed out when you use verbose flags. In waf,
this is line is exactly what the user passes on cli at configure time.
In meson, there's currently no way to do that (someone did recently open
up a PR that would make this possible), so we just hardcode the prefix
and call it a day. This is a bit of a tangent, but the build also
copies waf and sets an optimize variable (true or false) that is also
printed out on verbose output. For waf, this makes some sense because
the build has a specific --optimize option (internally all it does is
pass -O2). In meson, optimizing is a built-in option and we just set
anything that's not -O0 as "optimize". Furthermore, there is a new
optimization option added in meson 0.64 called "plain" which passes no
flags at all* so this logic would need to be updated to account for
this.

In retrospect, this is all just stupid though. optimization is not a
boolean value and there's no real use for treating it like one just
because that's what waf does. Let's remove it from the features array.
Instead, we can expose this information in the CONFIGURATION variable
along with the prefix option so we know exactly what optimization was
used in the compiled executable. For good measure, let's also throw in
buildtype since it's related.

*: a590cfde0c
2022-10-29 17:55:33 +00:00
Dudemanguy 0fa5bfae24 meson: use 'dl' instead of 'libdl' in find_library
Meson's master branch helpfully prints out a warning here now saying
that "find_library('libdl') starting in "lib" only works by accident
and is not portable". We'll go ahead and trust them and instead change
this to dl which works with no issues.
2022-10-29 17:55:33 +00:00
Dudemanguy 6ebc4928c5 ci: use meson setup build instead of meson build
The old "meson build" build command was actually deprecated a few months
ago*. It turns out that you're supposed to use "meson setup build"
instead which has been around for years. Go ahead and be a good citizen
and update this in the CI. Also replace any mention of "meson build"
with "meson setup build" in the documentation as well and change the one
random hardcoded string we have in meson.build to "meson configure
build" (might as well).

*: 3c7ab542c0
2022-10-29 17:55:33 +00:00
rcombs 89bd6ead6c ao_coreaudio: specify UTF-8 as text encoding for CFString conversions
This matches our internal expectations, as well as fixes handling
of non-ASCII device descriptions.
2022-10-29 00:00:09 +03:00
Natural-Harmonia-Gropius e5e918954f options: log profile name if there is no restore data 2022-10-28 15:48:24 +00:00
Christoph Heinrich fd91776207 console: respect the top margin shared script property
Console already respected the bottom margin to not overlap with the
bottom bar from the OSC, but it would still overlap with the window
decorations from the OSC.

Now everything is clipped above the top margin and no superfluous lines
are drawn.
2022-10-28 13:04:32 +02:00
Dudemanguy adb556bf15 vo_dmabuf_wayland: use special ra_ctx_create_by_name
vo_dmabuf_wayland has its own ra and context so it can handle all the
different hwdec correctly. Unfortunately, this API was pretty clearly
designed with vo_gpu/vo_gpu_next in mind and has a lot of concepts that
don't make sense for vo_dmabuf_wayland. We still want to bolt on a
ra_ctx, but instead let's rework the ra_ctx logic a little bit. First,
this introduces a hidden bool within the ra_ctx_fns that is used to hide
the wldmabuf context from users as an option (unlike the other usual
contexts). We also want to make sure that hidden contexts wouldn't be
autoprobed in the usual ra_ctx_create, so we be sure to skip those in
that function. Additionally, let's create a new ra_ctx_create_by_name
function which does exactly what says. It specifically selects a context
based on a passed string. This function has no probing or option logic
is simplified just for what vo_dmabuf_wayland needs. The api/context
validations functions are modified just a little bit to make sure hidden
contexts are skipped and the documentation is updated to remove this
entries. Fixes #10793.
2022-10-28 02:36:46 +00:00
Dudemanguy 31af37f877 vo_dmabuf_wayland: load all hwdecs in preinit
vo_gpu and vo_gpu_next typically load hwdec interops on demand and
vo_dmabuf_wayland naively copied this logic. This is actually wrong
however since draw_frame in the VO always inherently relies on hwdec
being fully loaded. This can lead to a race condition during startup
which happens with --force-window=immediate. Avoid this by simply always
loading all the interops. In the case of vo_dmabuf_wayland, this is not
really a big deal since there's only vaapi and drmprime to load. Also
fixes #10791 (the other half).
2022-10-28 02:36:46 +00:00
Dudemanguy 99699cd7ba wayland: always do a display_roundtrip at the end of init
We really need two roundtrips in the init function. The first one is for
running the registry and then second one is for ensuring the xdg_surface
and other potential wayland objects are configured at least once before
mpv does anything. We've been getting away with only doing the first for
a while via luck, but really we should do at least one more wait on the
compositor. Fixes #10791 (half of it).
2022-10-28 02:36:46 +00:00
Dudemanguy 0f1ae8896e github/workflows: print error logs on freebsd
Despite being run in a VM, the workflow actually copies the files back
to the host. We can then explictly print the error logs on failure in
their own separate section for visibility instead of it being hidden
within all the vm output.
2022-10-27 18:42:12 +00:00
Dudemanguy c3c1978330 ci/build-freebsd.sh: remove nonexistent option
Mistakenly added in aeb4792cb6.
2022-10-27 18:42:12 +00:00
Dave Craig 6e274dc8d8 vo_dmabuf_wayland: fix DRM builds with no VAAPI
Building on DRM platform without VAAPI broke because of misuse of
HAVE_VAAPI with #ifdef in place of #if. Also, the hwcontext_drm.h
header is not required for VAAPI builds, only DRM builds.
2022-10-27 18:41:37 +00:00
Jan Ekström bc3e96098d video/out/wayland_common: adjust decoration disagreement log level
Originally, I considered warning once to be useful for figuring
out whether the change in logic regarding resetting requested
mode actually fixed the reported issue or not, but alas not everyone
was happy with that decision. Thus the log level will always be
debug. This enables us to lose one level of indent as well as a
variable, which is always positive.

Additionally, make the message more explicit regarding what could
possibly be implied by the mismatch, as it seems like this was
not always clear.
2022-10-27 19:07:05 +03:00
Jan Ekström e0c4193ee5 video/out/wayland_common: clear decoration request even if compositor disagrees
Otherwise mpv and the compositor can end up in an eternal loop where
mpv requests one mode, and compositor tells that the mode is not
that (and will most likely not change).

Additionally, log these mismatches - first time as a warning, and
later as debug logging.
2022-10-26 22:20:31 +03:00
Jan Ekström f39e56bf5e video/out/wayland_common: don't pass a negative of border flag into ternary
Make it clear that we are passing the original requested border mode
on.
2022-10-26 22:20:31 +03:00