Commit Graph

51969 Commits

Author SHA1 Message Date
nanahi ea33d52a4a wayland_common: always use the current geometry for prepare_resize
In the xdg_toplevel_configure handler, in some cases the geometry is
not equal to the width and height in the event. This can happen
when runtime geometry change is requested (a new size is set),
or in the case of wl->state_change || width == 0 || height == 0
(the old size is used).

However, prepare_resize always uses the width and height in the event
and not the corrected geometry here. This causes
xdg_surface_set_window_geometry using the wrong value resulting in
wrong size of window decoration. Amusingly, the debug message right
above it uses the correct size.

Fix this by using the updated geometry size instead. Since now all
prepare_resize have parameters of 0, the width and height parameters
are no longer needed.

Fixes: 828dd65ef8
2024-03-17 14:59:26 +00:00
nanahi 25ae54dd84 x11_common: unmaximize window on runtime geometry change
8e793bde78 made that changing geometry
while maximized has no effect until the window is unmaximazed. However,
this behavior is inconsistent with setting window-scale on all of win32,
wayland, and x11, which always unmaximizes the window and sets the
window size.

Since setting geometry is conceptually similar to setting window-scale
(both change the window size), they should have the same behavior.
If not fullscreen, unmaximize window on runtime geometry change to
keep the behavior consistent with window-scale.
2024-03-17 14:59:26 +00:00
nanahi 4370dc0cb6 win32: support runtime geometry update
Similar to other platforms. Also make sure that the x/y positions are set
on geometry update.
2024-03-17 14:59:26 +00:00
nanahi f236e249a4 x11_common: fix window x/y position when updating geometry on runtime
Currently, setting geometry on runtime only changes the window size
but not the position. This is because reset_size is only set if
the window size is changed, and vo_x11_highlevel_resize doesn't set
the window position without force_window_position enabled. Fix this
by setting the related flags and perform a window move when
geometry is updated.

Fixes 8e793bde78.
2024-03-17 14:59:26 +00:00
Kacper Michajłow 83da97f955 github/issue_template: add note about --profile=fast and --hwdec 2024-03-17 14:59:08 +00:00
Kacper Michajłow 7265bde26a gpu-next: add support for --dither-depth=auto
On supported APIs.
Fixes: https://github.com/mpv-player/mpv/issues/11862
2024-03-17 14:28:00 +01:00
Kacper Michajłow 16e3d7dca6 d3d11: get real on the wire bits per color channel 2024-03-17 14:28:00 +01:00
Kacper Michajłow 2b0c7b1aa4 d3d11: add mp_get_dxgi_output_desc 2024-03-17 14:28:00 +01:00
der richter 3afcaeb71a mac/view: optimise drag and drop event handling 2024-03-16 15:29:27 +01:00
der richter 2a36ed9abd mac/input: optimise scroll wheel event handling 2024-03-16 15:29:27 +01:00
der richter a4eddf742d mac/input: move scroll wheel event handling into input helper 2024-03-16 15:29:27 +01:00
der richter 9a4c673dd7 mac/input: optimise mouse movement enabled check 2024-03-16 15:29:27 +01:00
der richter 53722a4082 mac/input: fix switched mouse forward and back button 2024-03-16 15:29:27 +01:00
der richter db4eac140d mac/input: move mouse event handling into input helper 2024-03-16 15:29:27 +01:00
Vilius ab419a6660 ao_coreaudio: stop audio unit after idle timeout
Commit 39f7f83 changed ao_driver.reset to use AudioUnitReset instead of
AudioOutputUnitStop. The problem with calling AudioOutputUnitStop was
that AudioOutputUnitStart takes a significant amount of time after a
stop when a wireless audio device is being used. This resulted in
lagging that was noticeable to users during seeking and short
pause/resume cycles. Switching to AudioUnitReset eliminated this
lagging.

However with the switch to AudioUnitReset the macOS daemon coreaudiod
continued to consume CPU time and did not release a powerd assertion
that it created on behalf of mpv, preventing macOS from sleeping.

This commit will change ao_coreaudio.reset to call AudioOutputUnitStop
after a delay if playback has not resumed. This preserves the faster
restart of playback for seeking and short pause/resume cycles and avoids
preventing sleep and needless CPU consumption.

Fixes #11617

The code changes were authored by @orion1vi and @lhc70000.

Co-authored-by: Collider LI <lhc199652@gmail.com>
2024-03-16 15:00:46 +01:00
bptato 801306acdf stream: enable caching for sockets, pipes and FIFOs
This is useful e.g. when the caller dup2's a socket into stdin, or
passes a socket/pipe as /dev/fd/{fd}, because it is impossible to seek
on sockets and pipes.
2024-03-16 13:41:24 +01:00
sfan5 830f6ccd6b vo_{drm,wlshm}: make query_format checks more correct
We're using mp_sws here, so we should ask it for format support
and not the underlying library (usually swscale) directly.
2024-03-16 13:27:34 +01:00
sfan5 aa75a0e9d2 vo_drm: add support for YUYV format
As the first aligned format this required a fix to reconfig().

Adding the other component-swapped formats in this group would be trivial
but I checked the DRM database [1] and no driver exists that supports
one of those but not YUYV and this is quite fringe as-is, so I opted not to.

[1] <https://drmdb.emersion.fr/formats>
2024-03-16 13:27:34 +01:00
sfan5 bc8038cffd vo_{drm,wlshm,x11}: add support for video-target-params 2024-03-16 13:27:34 +01:00
sfan5 2893b7d0f5 vo: move target_params into responsibility of VO
The VO generic code tries to be helpful and resets this after
each reconfig. However for the simpler VOs the target params
are constant after a reconfig or even for the entire lifetime.
So it's clearly better to let the VO decide.

This also allows the VO to use a static buffer instead.
2024-03-16 13:27:34 +01:00
sfan5 44f54357ca context_drm_egl: log fallback correctly
Currently a theoretical concern because we handle all existing formats.
2024-03-16 13:27:34 +01:00
sfan5 6b452788c4 vo_drm: add support for BGR formats 2024-03-16 13:27:34 +01:00
sfan5 93a5059e8c vo_drm: use native matching pixel format for XRGB2101010 2024-03-16 13:27:34 +01:00
der richter 474e213f52 mac/input: add missing special keys 2024-03-14 23:33:15 +01:00
der richter 556cb7d6a4 mac/input: add simplified mp_keymap init 2024-03-14 23:33:15 +01:00
der richter 4d8ea338de mac/input: remove wrongly mapped modifier keys 2024-03-14 23:33:15 +01:00
der richter 3ef3bbf93d mac/event: move key event handling to input helper and optimise it 2024-03-14 23:33:15 +01:00
der richter 5482eecb8a mac/input: define AltGr mask as static NSEvent.ModifierFlags variable
this makes it possible to properly test for those modifiers in a proper
swift like way.
2024-03-14 23:33:15 +01:00
der richter 18fb71498b mac/events: remove redundant functions and optimise input helper usage
some redundant functions that jump through hoops.
2024-03-14 23:33:15 +01:00
der richter 055e9cd93e mac/helper: move input ctx related functionality into new input helper
also make functions thread safe.
2024-03-14 23:33:15 +01:00
der richter f3e5fea4f5 mac/events: move input ctx related functionality into new input helper
preparation for mac/events cleanup and single responsibility principle.
all functions are thread safe.
2024-03-14 23:33:15 +01:00
Dudemanguy 5dd2d19519 wayland_common: move WAYLAND_DISPLAY check above vo_wayland_state init
Segfaults otherwise on uninit because some objects are created while
others are not. Move it to the very top since the purpose of this is to
skip wayland initialization entirely while autoprobing.

Fixes f6f1721101.
2024-03-13 20:23:10 -05:00
nanahi f6f1721101 wayland_common: require WAYLAND_DISPLAY to be set for initialization
Currently, Wayland is above X11 and DRM in probe order. The success
of automatic probing depends on the fact that unsuitable backends
would fail to initialize. For example, X11 backend (which uses Xlib)
fails to initialize if DISPLAY environment variable is not set, so
starting mpv in VT console will pick the DRM backend as expected,
even when an X server is running in another VT.

However, libwayland-client used by the Wayland backend has the
"helpful" behavior of falling back to "wayland-0" if WAYLAND_DISPLAY
is not set. This breaks autoprobing if mpv is started from X server
or VT console while a running Wayland compositor running in another
VT (or even running as an X client) is using "wayland-0" for protocol
socket name: mpv will start playing in the Wayland compsitor instead
of using the X11 or DRM backends.

Similar to DISPLAY for X server, We should consider exporting
WAYLAND_DISPLAY to child processes the responsibility of Wayland
compositors, and any compositor not doing this should be considered
broken. Thus we now require WAYLAND_DISPLAY to be set for the
backend initialization to succeed to make sure that autoprobing
works as intended.
2024-03-13 22:39:43 +00:00
Dudemanguy 38b5dcb441 vo_gpu/vo_gpu_next: fix transparency in glx
It seems that GLX requires us to explicitly set opts.want alpha before
ra_ctx_create is called. b7fd232524
rearranged the function calls in a way made this not work. Fix this by
rearranging it again so the value is set before ra_ctx is created.
2024-03-13 22:39:31 +00:00
Robert Kopaczewski fbf3ae5a84 meson: fix ios-gl hwdec build 2024-03-12 14:36:30 +00:00
nanahi 27fb4c474f vo_gpu: fix broken chroma plane for rotated semi-planar formats
For image formats with 2 or more chroma planes such as YU12, there is
a plane merging pass for these planes calling finish_pass_tex which
does a format conversion. After this conversion, the cscale shader
afterwards works properly.

However, for image formats with only 1 chroma plane (semi-planar formats),
including NV12 and P010, this merging pass is never called, which breaks
the cscale shader afterwards if the video is rotated with subsampled
chroma.

Fix this by adding an explicit conversion pass if this situation is
detected after the pre-scale hooks, so if there are shaders hooking on
CHROMA (like the deband filter) and the conversion is done by pass_hook
already, this conversion won't be called.
2024-03-11 21:29:57 +01:00
llyyr 084a8782e3 path: don't load any files if --no-config is passed
`--no-config` should prevent loading any user files, whether it be
config, cache, watch_later state etc. This functionality was changed by
df758880e2 because internally `--no-config` is equivalent to passing
`--config-dir=""` which resulted in cache and state being auto-detected
even if `--no-config` was passed.

Fixes: df758880e2 ("path: don't override "cache" and "state" paths with configdir")
2024-03-11 21:29:46 +01:00
nanahi 0e5aa216b8 DOCS/tech-overview.txt: add builtin.conf to etc/ description
builtin.conf is compiled into mpv binary as the default config.
2024-03-11 21:01:01 +01:00
nanahi 656c2e33d4 DOCS/tech-overview.txt: update for merged pull/push glue code
b83bdd1d17 merged the glue code for the
two types of audio APIs.
2024-03-11 21:01:01 +01:00
nanahi 2ea12464be DOCS/tech-overview.txt: add vo_gpu_next reference
vo_gpu_next also can pick a windowing system at runtime.
2024-03-11 21:01:01 +01:00
nanahi 73e08043d2 DOCS/tech-overview.txt: add a section for the new filter framework
76276c9210 introduced a generic filtering
framework which replaced the separate video and audio filter chains.
Additionally, 6d36fad83c and
76e7e78ce9 made the decoder wrappers
a filter.
Add a new section to document this, and corrrect the outdated
audio/video decoder and filter info.
2024-03-11 21:01:01 +01:00
nanahi c254cf42cb DOCS/tech-overview.txt: update for removed stream inputs
stream_tv.c was removed in b30e85508a.
stream_dvd.c was removed in 6229404985
and replaced by stream_dvdnav.c.
2024-03-11 21:01:01 +01:00
nanahi 7cb6185576 DOCS/tech-overview.txt: update for split m_config.c/h
Since eb381cbd4b split the file into
m_config_core.h and m_config_frontend.h, the statements here are no
longer true. Correct them the current usage.
2024-03-11 21:01:01 +01:00
nanahi 7b784b9b76 DOCS/tech-overview.txt: fix function/member/header names
Just to be exact.
2024-03-11 21:01:01 +01:00
Alex Mitzsch 1bf821ebdc ad_spdif: update deprecated FF_PROFILE_DTS_HD_HRA definition
One deprecated FF_PROFILE_DTS_HD_HRA definition was left unaltered - fix that.
2024-03-10 20:59:20 +01:00
der richter 94e5a0ffb2 options: remove trailing whitespaces 2024-03-10 14:53:07 +01:00
der richter 0ec385bc76 options: remove --focus-on-open and add --focus-on
replaces the old focus-on-open option with a more generic focus-on
options that can be extended.

adjust the only platform that uses that option.

Fixes #8337
2024-03-10 14:53:07 +01:00
Kacper Michajłow a56d8ff184 stats.lua: display video parameters after filtering 2024-03-09 05:58:52 +00:00
Kacper Michajłow 024edb2991 vf_format: add hdr10plus sub-parameter to format video filter 2024-03-09 05:58:52 +00:00
Kacper Michajłow d9c1e9bc5c mp_image: add Dolby Vision metadata mapping
Remove side-loading metadata in vo_gpu_next.c and remove unneded
side-data duplication.
2024-03-09 05:58:52 +00:00