Commit Graph

51569 Commits

Author SHA1 Message Date
Mateusz Łukasik fd21e72bc1 mpv.desktop: add keywords 2023-12-04 20:34:31 +01:00
Kacper Michajłow 06e627048f image_writer: default to lossless AVIF screenshots
Also change the example to crf=23. crf=32 is pretty bad quality, don't
give users bad usage ideas.
2023-12-04 20:34:17 +01:00
Kacper Michajłow fca3e60827 image_writer: add missing mp_image_params in convert_image
Fixes chroma location for screenshots.

Also set the crop to full frame to not trip mp_image_params_equal check
if not necessary.
2023-12-04 20:34:17 +01:00
Kacper Michajłow a722194684 image_writer: print screenshot format in verbose log
It is useful information, not only for debugging.
2023-12-04 20:34:17 +01:00
Kacper Michajłow 4949cab734 image_writer: use common format selection for AVIF screenshots
--screenshot-avif-pixfmt no longer defaults to yuv420p.
2023-12-04 20:34:17 +01:00
Kacper Michajłow 8884902d8b Revert "github/workflows: install xxhash on msys2"
This reverts commit 67aa568437.
2023-12-04 09:56:27 +01:00
Kacper Michajłow dda14de13d Revert "ci/mingw: use vulkan-loader v1.3.266"
This reverts commit 9d8dfc7b49.
2023-12-04 09:56:27 +01:00
karelrooted ea0e9b74a3 meson: use subprocess-dummy.c fallback when fork func doesn't exist 2023-12-03 22:28:45 +01:00
Kacper Michajłow b323d2877a ao_wasapi: clean GUID definitions
Add ifndefs to define only when needed and remove some already defined
ones in mingw.
2023-12-03 22:24:13 +01:00
Kacper Michajłow a436af0f26 ao_wasapi: fix MP3 GUID
While CEA-861 defines MP2 as 0x5 and MP3 as 0x4, the GUIDs defined in
ksmedia.h are in reverse order.

See: https://github.com/MicrosoftDocs/windows-driver-docs/pull/3742
2023-12-03 22:24:13 +01:00
nanahi 26c6f228fe input: fix double click handling
On practically all platforms and GUI toolkits, a triggered double click
event clears the mouse input buffer so that the next click won't
trigger another double click event. mpv doesn't do this, so a third click
results in another double click event.

Fix this by resetting the double click timer after a double click event
is triggered which achieves the same effect.
2023-12-03 22:23:05 +01:00
der richter f551a9da34 mac: report modifier keys on precise scrolling
modifier keys weren't reported when using the trackpad to scroll.

Fixes #11195
2023-12-02 14:59:59 +01:00
der richter aaff9edf57 mac: fix initial window size and position when already maximized
in the case the window was already set to a maximized size via geometry
or related options (100%x100%) the maximize function would try to
maximize the window again. this reset the position and slightly
increased the size further.

to prevent this only maximize on init if we really want to maximize. in
the reverse case make a noop call by passing the current zoom state.

Fixes #11193
2023-12-02 14:58:01 +01:00
Dudemanguy 67aa568437 github/workflows: install xxhash on msys2
msys added xxhash has a makedep for libplacebo* which means we need to
install it in the CI as well if we want to build against it.

*: 07f4c34d22
2023-11-30 15:58:58 +00:00
Guido Cella 8b4a995a9d playloop: use a 16:9 ratio with --force-window
ca2b05c0fb changed the window size with --force-window and no video
tracks to be closer to 16:9, but I don't see why we shouldn't have an
actual 16:9 ratio. The advantage is that subtitles with fullscreen and
no video tracks will have the same size and position (depending on the
values of --sub-scale-with-window and --sub-use-margins) as with 16:9
videos, because there will be no (invisible) black bars.
2023-11-30 15:08:56 +00:00
sfan5 7dff735241 ci: remove dvbin from freebsd run
As it is now, the FreeBSD CI is failing because meson can't find the
dvb headers.
FreeBSD puts the relevant headers into /usr/local which is bothersome
and in fact required a workaround to be added to the Wayland detection
already (3bdf702b1d) but this should be
addressed by us adding the path to CFLAGS already.

With a more minimal example the detection works fine in my FreeBSD VM.
I'm at my wits end debugging this so just disable it for now.
2023-11-29 20:36:37 +01:00
sfan5 c69e3415d2 meson: enable dvbin by default again
This was disabled by default in 99cef59fc9 (from 2017)
due to build issues with old kernel headers.
Whatever was considered old at that time will be ancient now
and with the last commit there should be no isses auto-detecting it.
2023-11-29 20:36:37 +01:00
sfan5 67b75a3b34 meson: fix check for dvbin availability 2023-11-29 20:36:37 +01:00
Dudemanguy c7d8e155d2 ci/tumbleweed: don't enable shaderc
It only ever had any real affect on windows so with the previous build
change, enabling it cannot work.
2023-11-28 21:47:13 +00:00
Dudemanguy 60a31a8a28 build: only directly link shaderc and spirv-cross on windows
See 1b035402a6. This is only relevant if
you are using d3d11 on --vo=gpu which is windows-only. For all other
platforms, vulkan uses libplacebo which uses shaderc. mpv itself doesn't
need it in those cases.
2023-11-28 21:47:13 +00:00
Dudemanguy 8f1f188bd6 vo_gpu: fix ra_fbo stack-use-after-scope
281b1d8999 introduced a stack use after
scope because dest_fbo can be reassigned a new pointer and then be used
by pass_draw_to_screen outside of that scope where the pointer is no
longer valid. Fix this by rearranging the variables so the assignment is
done in the same scope as the pass_draw_to_screen call instead.
2023-11-28 18:47:05 +00:00
Kacper Michajłow 2bcdf591fd common/av_log: use bstr for log callback
- don't use 4KiB stack array
- keep one bstr allocation for lifetime of the log
- avoid dummy strlen
2023-11-28 10:46:16 +01:00
Kacper Michajłow 0262ec3829 vo_kitty: init all fields of struct sigaction before using it 2023-11-28 10:46:16 +01:00
Kacper Michajłow e27eb3dead ra_pl: add missing initializer 2023-11-28 10:46:16 +01:00
Kacper Michajłow cb29cbe1ba ao_sndio: remove duplicated condition 2023-11-28 10:46:16 +01:00
Kacper Michajłow d5222ece6b vo: don't pass VADRMPRIMESurfaceDescriptor by value 2023-11-28 10:46:16 +01:00
Kacper Michajłow f2fdea9921 wayland: simplify reading data
- read directly to bstr
- use talloc for OOM checks
- don't parent temporary allocation
- don't check for NULL buffer after already writting to it
2023-11-28 10:46:16 +01:00
Kacper Michajłow 4e84ea22d7 mp_image: remove local params copy from mp_image_setfmt
No longer needed after 079f67268f.
2023-11-28 10:46:16 +01:00
Kacper Michajłow 92c81e9666 ta: inline OOM checks
It makes no sense to force function call for simple check.
2023-11-28 10:46:16 +01:00
Kacper Michajłow 50bc9dd523 player/command: don't pass mp_image_params by value 2023-11-28 10:46:16 +01:00
Kacper Michajłow c78f0237ef vo_gpu: don't pass gl_user_shader_hook by value 2023-11-28 10:46:16 +01:00
Kacper Michajłow 3b1cb5d6aa vo_gpu: don't pass mp_pass_perf by value 2023-11-28 10:46:16 +01:00
Kacper Michajłow 281b1d8999 vo_gpu: don't pass ra_fbo by value
Make it easier on compiler, no need to alloca and copy things around.
2023-11-28 10:46:16 +01:00
Dudemanguy f7402ff466 Reapply "osdep/meson: add libplacebo include dir to swift compile"
It's not actually related to libplacebo wrap stuff and the swift compile
command needs this to get the right libplacebo include path.

This reverts commit b9d392ecd9.
2023-11-27 15:00:35 -06:00
Dudemanguy b9d392ecd9 Revert "osdep/meson: add libplacebo include dir to swift compile"
This is not needed since we removed the libplacebo wrap not too long
after this commit.

This reverts commit 4de76ce87a.
2023-11-27 20:44:07 +00:00
Dudemanguy 7cca2a304e ci: remove leftover libplacebo subproject options
486bb93dfa removed the wrap which made
these specific options obsolete.
2023-11-27 20:44:07 +00:00
Kacper Michajłow aea8a82478 meson: move mpv.com target after mpv.exe to avoid meson version warning
meson is able to detect blocks of code that are guarded with version
checks, but we did that in reverse order and mpv.exe was complaining.
2023-11-27 20:43:04 +00:00
nanahi facbbd1110 ci/msys2: remove libplacebo.wrap
Not needed anymore as package is updated.
2023-11-27 19:11:07 +00:00
Dudemanguy 60db198267 ci: update mpv.com path again
Hopefully for the last time. It will now be in ./build as one would
expect.
2023-11-27 18:42:19 +00:00
Dudemanguy 0ea374b1c7 meson: generate .com in the same place as the .exe if possible
Meson was pretty strict about target ids and generating the mpv.com in
the same directory as mpv.exe wasn't possible. So as a workaround we
tucked it away in a subdirectory, but that's not really intuitive at
all. Well as of meson 1.3.0, this is now possible so leverage it since
it makes way more sense. We still keep the old workaround for anyone
using older meson versions.
2023-11-27 18:42:19 +00:00
sfan5 1b035402a6 DOCS/options: clarify --spirv-compiler 2023-11-27 18:24:55 +01:00
Jan Palus 8efa6c3837 build: restrict git describe to top level source directory
fix version determination when building mpv from release tarball
extracted within another git repository
2023-11-27 15:22:22 +00:00
Guido Cella 0c4812aa72 options: add --osd-bar-border-size
Closes #1484. The default size is smaller than the previous
--osd-border-size default value of 3 with the default --osd-bar-h.
2023-11-27 15:02:28 +00:00
Guido Cella 65b5543332 DOCS/mpv: quotes in mpv.conf don't escape backslash
I don't know why I thought they did in 7798881360, but single quotes
disable escape sequences only in input.conf commands.
2023-11-27 11:20:51 +01:00
Ripose dea512ea38 options: add secondary-sub-delay
Add --secondary-sub-delay option and decouple --sub-delay from secondary
subtitles. This produces desirable behavior in most cases as secondary
and primary subtitles tracks tend to be timed independently of one
another.

This feature is implemented by turning the sub_delay field in
mp_subtitle_opts into an array of 2 floats. From here the track index is
either passed around or derived when sub_delay is needed. There are some
cases in dec_sub.c where it is possible for dec_sub.order (equivalent to
track index) to be -1. In these cases, sub_delay is inferred as 0.
2023-11-26 23:22:05 +01:00
Kacper Michajłow a3f505d4cb vaapi: bump vaapi info callback to verbose messages
The info provided for libva might be useful. Specifically on Windows it
seems to not use the error callback for what should be logged as error.

[   0.080][v][vaapi] libva: VA-API version 1.20.0
[   0.080][v][vaapi] libva: Trying to open <path>/vaon12_drv_video.dll
[   0.080][v][vaapi] libva: va_openDriver() returns -1
[   0.080][e][vaapi] Failed to initialize VAAPI: unknown libva error

As we can see only the "unknown" error is printed to the error callback
and important information is printed on the info callback. Print it to
verbose log to make it easier to find.
2023-11-26 18:19:11 +01:00
Kacper Michajłow 02aa4f5e28 vaapi: add missing NULL check
ctx->destroy_native_ctx is guarded, but this early exit was not.
2023-11-26 18:19:11 +01:00
der richter 6898d57d98 DOCS/options: remove the mention of cocoa and its removed backend
the cocoa backend was removed and all functionality is either available
on all macOS backends or explicitly only with cocoa-cb. the manual
should properly reflect that change.

also remove the last mention of the old cocoa backend.
2023-11-25 19:31:26 +01:00
der richter cc09a28d96 mac: fix a race condition when updating the window title
the title is updated on the main thread (mandatory with cocoa)
asynchronously, because otherwise it would either deadlock when done
synchronously, lead to undefined behaviour or just crashes. the problem
here is that the c string was only copied to an NSString within that
asynchronous call, which potentially would access the pointer when it
is accessed, modified or freed by another thread. it is only safe to
access this pointer as long as the control callback wasn't returned yet.

to fix this we move the copying and creation of the String from the
c string pointer outside of the asynchronous call where the conversion
of an untyped pointer to a typed pointer is done too. since the
resulting String is a copy it's safe to be used in the asynchronous
call.

also reverting ee6ad40, since the problem was most likely an SDK problem
or the very same problem as mentioned here. i retested the crash case
again und can't reproduce it anymore. using a swift String again instead
of an NSSstring.

Fixes #12935
2023-11-25 19:31:26 +01:00
der richter 3f2bc2e535 mac: fix libmpv usage without embedding
NSApp is only an Application when initialised from mpv itself. when used
via libmpv an Application is never initialised and mpv would always
immediately exit.

make the retrieval of the vo and mac options static so they can be
retrieved in all cases.

Fixes #12518
2023-11-25 19:04:07 +01:00