0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
Commit Graph

51839 Commits

Author SHA1 Message Date
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
Kacper Michajłow
05c8d5a93a csputils: add missing PL_COLOR_SYSTEM names 2024-03-09 05:58:52 +00:00
Kacper Michajłow
391261f757 mp_image: add mp_image_params_static_equal for finer comparision
In case of dynamic HDR metadata is present.
2024-03-09 05:58:52 +00:00
Dudemanguy
120b0ac412 wayland: always rescale geometry if in a fullscreen/maximized state
This should only be a problem during initialization. If in a
multi-monitor setup, mpv guesses the wrong scale value and the user
passes --fs, the scaled size will be wrong and you have to unfullscreen
and fullscreen again to fix it. This is because rescale geometry won't
do anything if the value of hidpi-window-scale is false (the default) so
the geometry is never rescaled to the correct value thus the wrong size.
Normally, mpv will just correct itself after subsequent events occur but
because it is considered a locked size (as it should be), we avoid doing
any other resizing events thus it never gets corrected. Fix this by just
always rescaling the geometry in the locked size case. It shouldn't
matter elsewhere because mpv will always have the correct scale value
and the possibility of having the wrong one is only possible on startup.

Fixes ded181f642
2024-03-09 04:27:29 +00:00
Dudemanguy
414ddbd628 filters/f_lavfi: rename channellayout to ch_layout
To better match upstream naming.
2024-03-08 22:55:37 +00:00
Dudemanguy
9ef614d6a3 swresample: stop using deprecated {in,out}_channel_layout options
These options were deprecated with the addition of the channel layout
API about a couple of years ago*. Unfortunately, we never saw the
deprecation messages so it went unnoticed until they were completely
removed with the recent major version bump. Fix this by setting
in_chlayout and out_chlayout instead if we have AV_CHANNEL_LAYOUT.

Fixes #13662.

*: 8a5896ec1f
2024-03-08 22:55:37 +00:00
Dudemanguy
78447c4b91 filters/f_lavfi: handle removed AV_OPT_TYPE_CHANNEL_LAYOUT
See: 65ddc74988
2024-03-07 22:03:55 +00:00
Dudemanguy
62b1bad755 ad_spdif: handle const buf pointee in avio_alloc_context
ffmpeg recently changed this field to be const which causes our CI to
fail on newer versions.

See: 2a68d945cd
2024-03-07 22:03:55 +00:00
David Knaack
68fbdc88d2 osxbundle: avoid running codesign with deprecated --deep argument
`--deep` is deprecated as of macos 13.0.
It is also not supported by alternative `codesign`
implementations like
[sigtool](https://github.com/thefloweringash/sigtool).

Related: https://github.com/NixOS/nixpkgs/pull/270691
2024-03-07 20:43:30 +01:00
Kacper Michajłow
580bc69d0c vo_gpu_next: infer target parameters
This allows us to read them back.
2024-03-07 21:12:12 +02:00
Kacper Michajłow
fc5d533a66 vo_gpu_next: add support for video-target-params 2024-03-07 21:12:12 +02:00
Kacper Michajłow
da3bfc96e9 vo: add video-target-params property 2024-03-07 21:12:12 +02:00
Kacper Michajłow
a6f661b5c7 player/command: fix video-params/[average-bpp, alpha] when hw decoding
Need to check hw_subfmt for real values.
2024-03-07 21:12:12 +02:00
Kacper Michajłow
d471f2902e mp_image: add imgfmt_name to mp_image_params
Convenience to override name if imgfmt is not set.

Allows to create mp_image_params without setting imgfmt. Will be useful
for the next change where mp_imgfmt is not available. This is workaround
that will be remved once all codebase switches to pl_fmt.
2024-03-07 21:12:12 +02:00
owl0w1
0d33394955 meson: remove main function from libmpv build
Only include a main function in cplayer build, not libmpv build. This shaves off 40 bytes from libmpv build.
2024-03-07 14:20:44 +01:00
der richter
a13a674363 osxbundle: activate Game Mode with App bundle
mpv isn't really a game and categorising our App bundle as game seems
counterintuitive. though as a video player it does have some
similarities, possibly needing considerably CPU and GPU resources and
low presentation latencies.

the macOS Game Mode promises exactly that, it gives App the highest
priority access to CPU and GPU resources and lowers usage for background
tasks.

sadly the Game Mode can only be activated by categorising the App as a
game and that is only possible with an App bundle and not as a command
line tool.
2024-03-07 01:16:32 +01:00
der richter
8a37f0f693 mac/menu: add explicit menu type instead of an inferred type
with the use of an explicit type we can removed inferred type checks
like separators/services menu by name or menus by sub configs.
2024-03-07 01:03:52 +01:00
der richter
16ea688115 mac/menu: make menu creation recursive to allow nested submenus
also makes menu creation cleaner and more obvious.
2024-03-07 01:03:52 +01:00
der richter
4eb58f6ea7 mac/menu: move conditional Bundle menu items into config
only add the "Show log File…" menu item config when invoked from the
bundle, instead of testing on menu item creation. this is similar to the
touch bar menu items now.
2024-03-07 01:03:52 +01:00
der richter
73e494a237 mac/menu: keep track of menu items with dynamic actions
keeping track of the dynamic menu items lets us directly access them by
key. we don't need to search in the config array for the right config
and menu item.
2024-03-07 01:03:52 +01:00
der richter
8d4329a710 mac/menu: merge file and url config properties
a file path is basically an URL. both are also handled as URL objects
in our code.
2024-03-07 01:03:52 +01:00
der richter
46a9e8c130 mac/menu: properly guard playlist array access 2024-03-07 01:03:52 +01:00
der richter
30eab4b933 mac/menu: attach menu config to menu item for direct access
add a config property to the menu items, so we don't need to search in
the config array for the right config.
2024-03-07 01:03:52 +01:00
der richter
95d08df7a7 mac/menu: replace app.command usage with event.command 2024-03-07 01:03:52 +01:00
der richter
37990597c7 mac/menu: fix touch bar menu item
the check broke when the runtime check was removed, eg the menu item was
never added to the menu. since we only add the menu item to the config
when touch bar support is available the check is completely unnecessary.
2024-03-07 01:03:52 +01:00
der richter
035906dad5 mac/menu: rename Preferences to Settings for consistency with macOS 2024-03-07 01:03:52 +01:00
der richter
ad0573ff8e mac/menu: remove duplicate key assignment Undo/Zoom
this key is already assigned to Undo.
2024-03-07 01:03:52 +01:00
der richter
eadd85a6ac mac/menu: optimise loading files function
don't save files in a temporary array and use an in place mapping.
2024-03-07 01:03:52 +01:00
der richter
cb807ff063 mac/menu: replace deprecated openFile() usage 2024-03-07 01:03:52 +01:00
der richter
996ec6feca mac/menu: remove unnecessary alert config fields and alert
the config folder is created by mpv if it does not exist, so the last
alert is unnecessary.

also change config path priority.
2024-03-07 01:03:52 +01:00
der richter
fe35baa88e mac/menu: rewrite menu bar in swift 2024-03-07 01:03:52 +01:00