Commit Graph

51819 Commits

Author SHA1 Message Date
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
der richter bbbd6e272c mac/app: remove unused function 2024-03-07 01:03:52 +01:00
Dudemanguy 4179d58389 github/workflows: generate html and pdf in docs job as well
Not sure if this is particularly useful, but we might as well generate
these as well. Also use the docutils wrapper since that's what the meson
build does.
2024-03-06 22:49:07 +00:00
savoury1 f532f3f38f DOCS/man/input.rst: fix incorrect syntax
Some incorrect syntax is used in DOCS/man/input.rst with c678033c1d
causing failure of PDF manual generation with rst2pdf. There are single
rather than double back-ticks for insert-at and insert-at-play so this
is fixed and a couple of typos are also corrected with this commit.
2024-03-06 22:34:05 +00:00
der richter 68c61fd89f mac/vulkan: directly retrieve current render size without caching
the render size cached in ctx->vo->dwidth/dheight can be outdated in
some circumstances at the time the context needs resizing. instead use
the current render size.
2024-03-06 23:37:32 +02:00
der richter 6016423427 mac/vulkan: workaround for MoltenVK problem that causes flicker
MoltenVK itself tries to work around a supposedly Metal problem that
itself causes flicker, black screens or broken rendering. it sets the
drawableSize to 1x1 to forcefully complete the presentation. though if
1x1 resolution frame is presented it causes a visual flicker or rather
a solid coloured frame. it causes even more problems since sometimes it
does not reset the drawableSize to the proper resolution and keeps
rendering everything in 1x1.

work around this workaround by discarding drawableSize that are <=1 in
any direction.

Fixes #13505
2024-03-06 23:37:32 +02:00
Kacper Michajłow 665a472098 github/workflows: update actions/upload-artifact to v4 2024-03-05 19:48:14 +01:00
Dudemanguy 83bad548d2 ad_spdif: handle deprecated FF_PROFILE_* definitions
See: 8238bc0b5e
2024-03-05 19:04:11 +01:00
nanahi 9c03b7569b wayland_common: fix pointer serial conflict
c2129c18f8 saves the button down serial to
pointer_serial of the seat so that it can be used for window dragging
later. However, this overwrites the serial saved at the enter event.
Since the serial in wl_pointer_set_cursor must be the latest
wl_pointer_enter serial number sent to the client, if a button down
serial overwrites that, setting cursor no longer works until the cursor
enters the window next time.

Fix this by using separate serials for these two types of events.
2024-03-05 17:35:04 +01:00
1nsane000 03bfd797f6 video/filter: add field order support for built in deinterlacers
refqueue gets the field of the frame from mp_image which almost always(if not
always) assumes bottom field order first. By default this behavior should not
change but specifying the field order should bypass this.
2024-03-04 17:41:40 -08:00
1nsane000 5b52d44972 f_auto_filters: pass field parity to lavfi bwdif deinterlacers
Since all of them(software, vulkan, cuda) already have a built in parity
parameter
2024-03-04 17:41:40 -08:00
1nsane000 38a8e9bcba options: add --deinterlace-field-parity option
Previously there was no way to specify the field order of interlaced videos
when deinterlacing with inbuilt filters. Lavfi deinterlacers seemed to prefer
top field order while inbuilt ones (vdpaupp, vavpp, d3d11vpp) seemed to prefer
bottom field order. The default "auto" option should work exactly as before
while specifying either "tff" or "bff" should force the specified field order
2024-03-04 17:41:40 -08:00
Dudemanguy c1029aaa82 wayland: fix missing lround in cursor surface
Missed in f0a6578259.
2024-03-04 22:42:46 +01:00
Dudemanguy 781f78fb3a wayland: guess the first hidpi frame better
It's been a longstanding issue in wayland* that the first frame on a
hidpi screen will have wrong scaling. A well behaved client immediately
corrects this, but it's noticeable and also can affect window placement
due to the way resizng works. Preferred scale from the fractional
protocol and preferred buffer scale can actually solve this problem. It
depends on compositors mostly, but one could simply send the event
before the client maps its surface so it knows what the correct scale is
in the first place. I'm not sure if any compositors currently behave
like this (sway seems to still require the client to render before
sending any scaling information at least), but it makes to sense to
account for this possibility.

*: https://gitlab.freedesktop.org/wayland/wayland/-/issues/133
2024-03-04 22:42:46 +01:00
Dudemanguy 9ac791c329 Revert "player: reset av state on speed changes"
Ended up being too flawed and caused trouble in other areas. There's
other approaches to trying to solve the issue this meant to address in
the works that should be better, so let's wait on that. Fixes #13613 and
fixes #13622.

This reverts commit e3af545421.
2024-03-03 16:27:59 -06:00
Dudemanguy d10cebec13 player/video: subtract frame_time from delay when ao_chain starts audio
This seems more robust than relying on the audio status to actually be
playing. For files where there is no audio or the audio start is
delayed, this guards against that but it allows the subtraction to
always occur otherwise on normal files with audio.
2024-03-03 16:24:28 -06:00
Dudemanguy 60abbb424b player/audio: also adjust apts by audio speed in audio_start_ao
Fixes 7051e94e4b
2024-03-03 16:24:17 -06:00
Dudemanguy b08822b8ce test/test_utils: add mp_msg_set_max_level stub
Needed since the previous commit.
2024-03-03 15:15:51 -06:00
nanahi 385031ae2d ci/mingw: update dependency versions 2024-03-03 16:43:02 +01:00
nanahi 7d31db9e45 ci/mingw: add dav1d decoder
ffmpeg has built-in decoders for almost all common formats, except AV1.
dav1d allows the CI build to play AV1 videos without a hwdec-capable GPU.
2024-03-03 16:43:02 +01:00
nanahi a81212836d ci/mingw: enable nvdec
Install the nv-codec-headers to enable nvdec for ffmpeg.
This allows the CI build to enable hwdec on opengl and vulkan contexts.
2024-03-03 16:43:02 +01:00