Commit Graph

51377 Commits

Author SHA1 Message Date
Graham Booker 4754bd54c7 player/command: add ability to scale overlay 2023-12-08 13:37:26 +01:00
Guido Cella f886eb5678 console.lua: cycle through completions 2023-12-06 19:06:58 +00:00
Christoph Heinrich c16f868dd7 console: automatically determine the font_hw_ratio
A simplified version of the text width estimation code from uosc.

An osd_overlay is created with compute_bounds=true for measuring the
width of the lower case alphabet at what's estimated to be the largest
font size possible without clipping.

The lower case alphabet was chosen to get decent results for proportional
fonts, even if they aren't officially supported.
2023-12-06 19:06:41 +00:00
nanahi 21bd301372 DOCS/interface-changes: document renaming of MP_KEY_BACK
The navigation key is renamed to avoid conflict with MP_KEY_FORWARD.
2023-12-06 11:07:37 +01:00
nanahi 79068baf43 win32: properly handle WM_XBUTTONUP and WM_XBUTTONDOWN
According to MS documentation, an application should return TRUE from
WM_XBUTTONUP and WM_XBUTTONDOWN if it processes these messages.
DefWindowProc generates the WM_APPCOMMAND message when it processes the
WM_XBUTTONUP message, so if an application properly handles WM_XBUTTONUP
messages, extra WM_APPCOMMAND messages won't be generated.

Because mpv doesn't properly handle these messages,
WM_XBUTTONUP causes APPCOMMAND_BROWSER_BACKWARD to be generated, resulting
in duplicated keys and improper fix 438ead7a, which prevents the processing
of the appcommand from sources other than mouse clicks.

Fix this by following the documentation, and the back and forward
appcommands can be added.
2023-12-06 11:07:37 +01:00
nanahi 4c47dbe22c input: add missing forward media key
XF86Back and XF86Forward are mostly used to navigate file and web browsers
to go back/forward in history. XF86Forward isn't recognized right now,
so add it.

Because XF86AudioForward already takes the "FORWARD" name, rename the
browse keys to GO_BACK and GO_FORWARD instead.
2023-12-06 11:07:37 +01:00
Guido Cella df166997ae console.lua: simplify the condition to print to the terminal
This was a simpler fix to not print the console log to the OSD while
switching VO.
2023-12-06 10:59:40 +01:00
llyyr 562450f59e m_option: respect pathlist seperator when printing
Apparently we never did this
2023-12-04 20:35:50 +01:00
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