Commit Graph

50632 Commits

Author SHA1 Message Date
Kacper Michajłow ce79976498 win32: don't ignore --screen and --fs-screen
Fixes: 57ba77fc73
Fixes: #12220
2023-08-23 15:37:41 +02:00
James Cuzella 3916871101 DOCS/mpv: document ZOOMIN & ZOOMOUT multimedia keys
Document default key mappings for ZoomIn & ZoomOut:

    ZOOMIN    add video-zoom   0.1
    ZOOMOUT   add video-zoom  -0.1
2023-08-23 15:37:02 +02:00
James Cuzella fa378249dd input: add new keys: Back, Tools, ZoomIn, ZoomOut
These were the only keys missing to support mapping all keycodes on a
[popular RF Remote][1] used with Linux HTPC apps.

Note that X11/XWayland + xkbcomp still warns about keycodes > 255, due
to the 8-bit limit in Xorg but `mpv` on Wayland is able to handle these.
For X11 users, there are [a couple options][2]:

- [Gianni Ceccarelli's patched `xf86-input-evdev`][3]
- [Use udev hwdb to map scancodes to keycodes][4]

[1]: https://www.mythtv.org/wiki/Air_mouse_rf_remote
[2]: https://unix.stackexchange.com/a/436233/7688
[3]: https://www.thenautilus.net/SW/xf86-input-evdev/
[4]: https://wiki.archlinux.org/title/Map_scancodes_to_keycodes
2023-08-23 15:37:02 +02:00
Niklas Haas af9b53f3a3 vo_gpu_next: move line to correct location (cosmetic) 2023-08-21 19:50:20 +02:00
Niklas Haas 32ee937afa vo_gpu_next: correctly handle GAMUT_AUTO
Fixes: https://github.com/mpv-player/mpv/issues/12208
2023-08-21 19:49:59 +02:00
sfan5 76b1d282a5 ci/mingw: disable vulkan for 32-bit build
There's some cdecl / stdcall linking nonsense breaking the build
which I'm not inclined to debug this Sunday at all.
32-bit is not important anyway, so just disable it there.

On the plus side the new functional structure makes this very painless.
2023-08-21 16:43:38 +02:00
sfan5 c936377e34 ci/mingw: don't include useless DLLs in artifact 2023-08-21 16:43:38 +02:00
sfan5 b11b602312 ci/mingw: refactor build script into functions 2023-08-21 16:43:38 +02:00
sfan5 654ccb3c2c ci/mingw: enable more ffmpeg features
If someone wants to use the CI artifacts for day-to-day usage
or even for certain tests it can be useful to take screenshots
and use e.g. DShow (--disable-devices option), so enable those.
2023-08-21 16:43:38 +02:00
sfan5 aed8d6f552 ci/mingw: add necessary deps and enable vulkan 2023-08-21 16:43:38 +02:00
sfan5 9b9409196b ci/mingw: move functional test to workflow
Arguably the better place for this as it provides fine-grained feedback.
2023-08-21 16:43:38 +02:00
sfan5 c7342bbd5a ci/mingw: update dependency versions 2023-08-21 16:43:38 +02:00
Niklas Haas ef4c6dfcf5 vo_gpu_next: reword error message on empty screenshot
This can happen under perfectly legitimate circumstances if no file is
loaded yet.
2023-08-21 13:43:20 +02:00
Dudemanguy 3422e5e1e8 DOCS/options: clarify the video-pan-x/y example
1fa6669bc0 misinterpreted the example and
changed the pixel value from 128 to 168 (thinking that it meant pixels
after scaling), but likely the original calculation was correct because
the line specifically says "of the source video". This is just confusing
not really useful information so instead change the example to a more
common resolution (1920x1080) and remove any references to the source
video resolution. Also mention video-pan-y while we're at it.
2023-08-20 19:02:31 -05:00
Kacper Michajłow 7d6f9e3739 aspect: change --video-pan-x/y to be relative to the destination rect
It makes it more usable to virtually move dst rect instead of scaled
src.

The issue with the latter is that it is affected by video-zoom
paramters. For example if we do `--video-pan-x=-0.5` in normal case it
will move video -50%, but if we apply video-zoom/scale the video will
float towards the middle in unintuitive way. Extreme case is when one do
--video-zoom-x=0.01, now it is impossible to move video unless you
specify huge video-pan-x value, but it is limited to [-3, 3]. So you
cannot do anything.

With this changes regardless of video scale/zoom, video-pan will keep
center of scaled video in one place.
2023-08-20 23:15:48 +00:00
Kacper Michajłow 56ec3ea9f6 aspect: don't allow scaled_src_size be 0
It doesn't make sense to have zero here and it breaks, logic below.
Width was still campled to 1, but with broken offset.

This fixes things like video-scale-x=0
2023-08-20 23:15:48 +00:00
Kacper Michajłow 1fa6669bc0 DOCS/options: fix typo in video-pan-x example
Width of the video would fill fully display at this resolution, so
moving it 168px to the left, would hide also 168px.
2023-08-20 23:15:48 +00:00
sfan5 ecbaf34701 meson: rename all features with underscores
The convention is to use dashes.
2023-08-20 21:13:37 +00:00
sfan5 88d0383a26 context_drm_egl: remove references to VAAPI in error messages
VAAPI is not the only hwdec that won't work when the render node
isn't available.
2023-08-20 20:55:57 +02:00
sfan5 d15f11a9f7 context_drm_egl: more correctness fixes for uninit procedure
- uninit gl before the VO
- destroy EGL surface before context: reverse of the creation order.
  I also checked other code which doesn't even call this and leaves
  it up to eglTerminate, which frees everything anyway. But this
  seems more correct since we're destroying the gbm surface afterwards.
- check against at EGL_NO_DISPLAY instead of 0: there is probably no
  EGL implementation where this makes a difference, it is more correct
  regardless
- remove pointless eglDestroyContext call
- check render_fd before close
2023-08-20 20:55:57 +02:00
sfan5 817c281c7c Revert "ao/pulse: implement period_size"
This is why you don't merge three year old contributions
without checking that they're even applicable anymore.

This reverts commit 5a94c86029.
2023-08-20 20:49:10 +02:00
Zenos 57ba77fc73 w32_common: try to get the monitor from the window bounds 2023-08-20 20:39:05 +02:00
Zenos da965906ef w32_common: don't fit to screen when VO_WIN_FORCE_POS is set 2023-08-20 20:39:05 +02:00
Nicolas F 5a94c86029 ao/pulse: implement period_size
The idea behind period_size is that it's the minimum amount of data
that your audio subsystem wants to fetch.

For PulseAudio, this is given by the minreq buffer attribute, which
is in bytes for all channels. Hence the divisions.
2023-08-20 20:31:24 +02:00
Nicolas F 9ba8b921cf ao/jack: set device_buffer to JACK buffer size
This change sets the device_buffer member of the ao struct for
the JACK ao to whatever value we read during init.

While JACK allows changing the audio buffer size on-the-fly
(you can do this for example through DBus), having it somehow
reconfigure the entire audio buffer logic of mpv that depends
on device_buffer in some way when that happens only leads to
audio dropout and weird code. device_buffer's role is mostly for
prebuffer from what I understand, which means that simply setting
it to its current value in the init function is fine.
2023-08-20 20:30:53 +02:00
Jan Ekström 68276e2672 demux_mf: utilize stdbool bool for if a format specifier was bad
It is not an iterator, thus while the ++ is completely correct,
it is somewhat weird.
2023-08-20 20:25:28 +02:00
Jan Ekström 034eeaa8d7 demux_mf: early exit with the '%%' case 2023-08-20 20:25:28 +02:00
mwalmer f88ed14168 win32_common: fixes minimized window being focused on launch
mpv was taking focus when being started with "--window-minimized=yes". This change stops mpv from taking focus when this option is used.

Resolves: #9641
2023-08-20 20:21:14 +02:00
rim f2453b60ee ao_oss: add "spdif" passthrough support for high bitrate codecs (e.g. Dolby Atmos, DTS-HD, etc.) over HDMI
In addition to the patch, appropriate additions to the mpv.conf file
will of course be needed for this to work. For example on my system:

audio-device=oss//dev/dsp4
audio-spdif=ac3,dts,dts-hd,eac3,truehd

   This has been tested using recent FreeBSD-13.1-stable, using external
surround processors (both a Trinnov Altitude 16 and an LG OLED that
supports Dolby Atmos, and connected with HDMI to an NVidia RTX 2070).

Author and tester: David G Lawrence <dg1007@dglawrence.com>
2023-08-20 20:02:40 +02:00
llyyr bf1e1a7961 drm_common: skip cards that don't have connected outputs
It's possible for systems to have multiple cards, and the first capable
card to not have a connected output. Skip such cards and continue
iterating until we find one with a connected output.
2023-08-20 19:59:36 +02:00
Philip Langdale d2074fee0a meson: remove redundant libplacebo version check for Vulkan interop
With the bump of the required base libplacebo version, we no longer
need to do an additional check for Vulkan interop - it will always be
new enough.
2023-08-19 21:16:20 -07:00
Dudemanguy f7151932df x11: set sizehint for fs-screen and fs-screen-name
Without doing this, --fs --fs-screen=1 wouldn't actually end up on the
desired screen since the sizehint was never sent. Also check the
screen-name variants for an empty string as well so the option can
properly "undo" itself (not sure if this has any practical effect).
2023-08-20 02:01:39 +00:00
Dudemanguy 200992f90c x11: remove xinerama and refactor window geometry
mpv mixes xinerama and randr usage together which gets kind of
confusing and is also pretty stupid. Xinerama is completely unneccesary
today since randr can do everything it can do and much more. Remove it.
This reworks a lot of the window/geometry handling stuff to be centered
completely around xrandr_display plus some other tweaks to the geometry
handling. An important concept is that current_icc_screen is changed
into current_screen and used more generously since it is useful for
things besides just icc profiles.
2023-08-20 02:01:39 +00:00
Dudemanguy a0038504a3 x11: require randr 1.4
There really is no reason to not just hard require randr 1.4. xorg added
1.4 support in 2012 and someone somehow using an xorg server older than
that today surely has several other problems.
2023-08-20 02:01:39 +00:00
Arthur Williams 19384e07e4 context_drm_egl: don't free egl properties if they are null
If we failed to create a gbm surface, we would call drm_egl_uninit
to free up any state we had allocated. However, we would segfault if we
tried to cleanup properties there were never initialized. Null checks
have been added to guard against this.
2023-08-20 00:29:57 +02:00
Niklas Haas 2791eb64e8 vo_gpu_next: correctly clear removed hooks
Before d208284, this was implicitly reset back to 0 at the start of
every update_options(). But we no longer explicitly reset par->params,
so we need to do it manually here for the hooks.

Fixes: https://github.com/mpv-player/mpv/issues/12203
2023-08-19 23:39:25 +02:00
Dudemanguy 725b631ec3 sd_lavc: use SUB_GAP_THRESHOLD for overlaps/gaps
It turns out this already exists for sd_ass and is being used there. We
can make use of this arbitrary threshold instead for overlapping
subtitle durations to avoid the weird flashing behavior with some
pgs subtitles.
2023-08-19 15:18:12 +00:00
Dudemanguy 72e4178503 Revert "sub/sd_lavc: don't check endpts when getting subs"
This reverts commit 02a80f850b. Bad idea.
This causes subs to stay on the screen too long in some cases. Let's try
something else to fix the problem.
2023-08-19 15:18:12 +00:00
Niklas Haas 7ae4396ea5 vo_gpu_next: fix typo in video_screenshot()
Undefined behavior (bad initializer). Somehow didn't trigger a warning
on my end...

Fixes: a8192eda6c
2023-08-19 16:03:09 +02:00
Niklas Haas a8192eda6c vo_gpu_next: add --libplacebo-opts
To help test not-yet-exposed options, and for debugging purposes.
2023-08-19 14:12:24 +02:00
Niklas Haas 40b6afcfca vo_gpu_next: don't re-set frame_mixer
This is already set by map_scaler, just disable it if unwanted.
2023-08-19 14:12:24 +02:00
Niklas Haas 47f756d64b vo_gpu_next: move allow_delayed to move appropriate place
No need to override this so late in the general (non-screenshot) code.
2023-08-19 14:12:24 +02:00
Niklas Haas d2082841df vo_gpu_next: switch to new pl_options system
With a backwards compatibility shim for older versions of libplacebo in
which we simply define the relevant subset of this struct ourselves and
initialize it to known-good values, to be able to continue using our
options assigning code.

It's worth pointing out that our use of scalers deviates from how
pl_options was intended to be used, as a consequence of backwards
compatibility with pre-308 versions of libplacebo. But this should work
fine in practice, since we don't care about serializing these custom
scalers correctly. Users can still override them using the built-in
pl_options scalers when loading custom scalers via --libplacebo-options.
(To be added in the next commit)
2023-08-19 14:12:24 +02:00
Christoph Heinrich 4eedb8710c TOOLS/lua/autoload: Enable run-time updates of options
additional_*_exts get parsed and saved as sets in the options themselves
2023-08-19 04:00:25 +00:00
sunpenghao f6fc6cfd35 TOOLS/lua/autoload: may specify loading only one type of files
Under the current file loading logic, a video file and an external
audio track next to it will both be added to the playlist, which
most users don't wish to happen. Having an option that tells the
script to load only one type of files (video, audio, or image)
can avoid this problem. It may also come in handy for people who
have different types of files mixed in a folder but wish to consume
only one type of media at a time.
2023-08-19 04:00:25 +00:00
Niklas Haas 152a95f215 vo_gpu_next: fix leak of --icc-profile-auto on uninit
This was already correctly freed when acquiring a new profile, but never
freed on uninit. Fix by reparenting the profile onto `p`, which is what
vo_gpu also does.
2023-08-18 19:07:39 +02:00
Niklas Haas f97584cadc vo_gpu_next: drop redundant PL_HAVE_LCMS check
This header is installed unconditionally starting with libplacebo
v4.208.0, so we are safe to remove the check.
2023-08-18 16:40:44 +02:00
Niklas Haas ac4c88b7c1 ci: update freebsd to latest release channel
Instead of `quarterly`, to get access to recent packages.
2023-08-18 16:39:57 +02:00
Niklas Haas edca26381f ci: disable libplacebo in msys2 build
Blocked upstream.

See-Also: https://github.com/msys2/MINGW-packages/pull/17974
2023-08-18 16:39:57 +02:00
Kacper Michajłow f274ff2f2b vo_gpu_next: use pl_dispatch_info_move to avoid useless data copy
Instead copy the data on-demand when VOCTRL_PERFORMANCE_DATA is
requested.
2023-08-18 16:39:57 +02:00