Commit Graph

51307 Commits

Author SHA1 Message Date
Dudemanguy 86b498ecc0 player: remove shared-script-properties property
This property was never encouraged. The manual even stated that "You
should avoid using it, unless you absolutely have to." Since we now have
user-data which is superior in every single way and replaces this,
delete this property. The manual also has threatened people for years
with the line "It's a makeshift solution which could go away any time
(for example, when a better solution becomes available)." We were nice
and deprecated it in 1d00aee8e1 for a
while to give script authors some time to update. Let's remove it for
good now.
2023-11-22 16:29:43 +00:00
Kacper Michajłow 5220725ca5 vo: add params mutex
This mostly is added to resolve player command synchronization with VO
thread discussed in 477a0f83.

The current uses does not necessarily need this as they are all managed
by playloop. But for future use with other params that will be handy.

Those params are mostly to observe current state of VO and does not
necessarly need to be locked along with frame drawing, that changes the
params once at the end.
2023-11-22 11:51:46 +01:00
Kacper Michajłow 67deebc5b5 vaapi: add support for vaapi-win32
Only vaapi-copy variant as nothing can map D3D12 resources currently.

And even if we would add resource sharing to D3D11 it would invoke copy
at some point, so there is no point really. Maybe in the future when
libplacebo get smarter about resource sharing on Windows, but practical
advantages are really small. I've tested it with Vulkan <-> D3D11
sharing and GPU <-> GPU copy is still invoked. Better than CPU memcpy,
something for the future.
2023-11-22 11:43:20 +01:00
Kacper Michajłow 73eecdb415 vaapi: pass module into create()
Useful for logging
2023-11-22 11:43:20 +01:00
Kacper Michajłow 66e3b53eb9 d3d11: expose mp_get_dxgi_adapter and mp_dxgi_validate_adapter
To be able to reuse them in other parts of code.
2023-11-22 11:43:20 +01:00
Kacper Michajłow eb7ba44acf d3d11: rename d3d11 adapter to DXGI adapter
There is nothing d3d11 about those adapters.
2023-11-22 11:43:20 +01:00
sfan5 2a57a6ee4f Update VERSION 2023-11-21 19:52:23 +01:00
sfan5 818ce7c51a
Release 0.37.0 2023-11-21 19:47:46 +01:00
Kacper Michajłow 5a12015c4b vo_gpu_next: reduce number of requested frames from VO
Up to 2x playback rate is the most we can offer currently. Should work
fine for most kernels with radius <= 2.

This avoids limitation of hwdecs number of frames in-flight.

Fixes: #12927
2023-11-21 01:33:10 +00:00
der richter 48455a9403 mac: title bar fix 1px none covered video at top
there is 1px border at the top of the window that is not covered by our
title bar and the video below is visible. this broke in some newer macOS
version even so the calculation of size and position of the title bar is
still correct. add 1px the the height of the title bar to cover up the
unwanted border.
2023-11-20 23:16:43 +01:00
der richter eb71aa059a mac: add rotation menubar entries 2023-11-20 23:16:43 +01:00
der richter 947800ceb8 mac: fix reporting of left wheel and right wheel scrolling
left wheel and right wheel was swapped. this was copied from the old
cocoa backend. a delta <0 is a right scroll, >0 is a left scroll.

Fixes #12899
2023-11-20 23:16:43 +01:00
sfan5 bcdc5c40e7 command: add missing null check to event handler
Unclear if there are other situations but at least using --force-media-title
this can be called without a playing file, causing a segfault.

fixes: 34a04d0567
2023-11-20 22:01:34 +01:00
Niklas Haas 8faa0abae8 DOCS/options: admonish users for touching --3dlut-size
The "auto" logic is vastly better than setting a specific size. This
option amounts to "allow users to shoot themselves in the foot" flag,
given that the vast majority of ICC profiles in the wild are fine on
17x17x17 or even smaller 3DLUTs.

Setting stupidly high --3dlut-size is the main source of ICC-related
slow startup issues, and there is absolutely no conceivably benefit to
going above the defaults except for pixel peeping and chasing tiny PSNR
increments.
2023-11-20 17:32:40 +01:00
Niklas Haas d40e623fd5 vo_gpu_next: bump ICC cache size limit to 20 MB
These are less likely to be modified from run to run, and with the
avoidance of redundant re-saving we can get away with a larger size.

This is enough to save 10 3DLUTs at typical sizes.
2023-11-20 17:32:40 +01:00
Niklas Haas 47eae92c46 DOCS/options: reword cache options
D3D11 is actually the main platform that suffers from slow shader
compilation, typical Vulkan/GL drivers are either very fast to begin
with, or already internally cache.
2023-11-20 17:32:40 +01:00
Niklas Haas 70db887553 vo_gpu_next: don't re-save unmodified cache
Backwards compatibility wrapper can be bumped once sufficient libplacebo
version is a minimum dependency.

See-Also: https://github.com/mpv-player/mpv/pull/12902
2023-11-20 17:32:40 +01:00
Niklas Haas e62dac8338 vo_gpu_next: dramatically simplify cache code
I have no idea why this code is such a convoluted mess of options and
possibilities. First of all, why is dumping both caches to a single file
even a supported use case? Why is the cache path generated multiple
times, once for saving and once for loading, instead of just generated
once and stored? Why even create a pl_cache if you're not going to
save/load it? Why so much code duplication?

I don't know. But I rewrote it in a way that makes far more sense to me.
2023-11-20 17:32:40 +01:00
Kacper Michajłow 6e161ff13f vo_direct3d: remove redundant condition
talloc_free is safe to call with NULL.
2023-11-18 23:55:28 +00:00
Kacper Michajłow 4d8c074431 opengl/context: remove duplicated conditions 2023-11-18 23:55:28 +00:00
Kacper Michajłow df28e87ae9 ra_d3d11: fix off by one check 2023-11-18 23:55:28 +00:00
Kacper Michajłow 1b28b94585 vo: add missing return variable assignment 2023-11-18 23:55:28 +00:00
Kacper Michajłow d30432ea31 win32: don't jump over variable init with goto
Those variables are accessed after jump.
2023-11-18 23:55:28 +00:00
Kacper Michajłow 4449f38c17 various: add some missing error checks 2023-11-18 23:55:28 +00:00
Kacper Michajłow 9456b2f6e9 demux: add missing NULL check
It is assigned to NULL above is !stream.
2023-11-18 23:55:28 +00:00
Kacper Michajłow 7d7276e384 common/msg: remove redundant check
It is already strcmp above, so cannot be NULL.
2023-11-18 23:55:28 +00:00
Kacper Michajłow fd0e2af1f2 ao_wasapi: add missing comma in strings array 2023-11-18 23:55:28 +00:00
Kacper Michajłow 8dbc84dc16 vo_gpu_next: disable drift compensation for screenshots
This change prevents unwanted adjustments. Generally, screenshots
shouldn't invoke pl_queue_update, as this action could cull the already
mapped frames in the queue.
2023-11-18 22:54:29 +00:00
Kacper Michajłow ba5071a7ef vo_gpu_next: add validation for invalid pl_queue usage
This is mainly for debugging purposes, as it should't happen in normal
use. If it does, it needs fixing.
2023-11-18 22:54:29 +00:00
Kacper Michajłow fe748e54f1 vo_gpu_next: set frame duration if provided by VO 2023-11-18 22:54:29 +00:00
Kacper Michajłow bd1ac498bb vo_gpu_next: interpolate only if display_synced or a still frame
If !display_synced, some values may not be correct or zeroed. Therefore,
it makes no sense to interpolate in this case.

For a non-moving frame, we always want to show an uninterpolated frame.
2023-11-18 22:54:29 +00:00
Kacper Michajłow 4dcf2d1385 vo_gpu_next: request more frames to account for anti aliasing
libplacebo requires additional frames when VPS is lower than FPS and
anti-aliasing is enabled. Supports up to a 1/4 ratio. VO has a limit of
10 frames, so in practice, not many more can fit.

Note that the internal libplacebo mixing limit is 16 frames.
2023-11-18 22:54:29 +00:00
Kacper Michajłow c8a2f8eb7f vo_gpu_next: make the first frame check less ominous
It is valid to disable interpolation on resets and when the vsync error
exceeds the duration of the frames that we have available.
2023-11-18 22:54:29 +00:00
Kacper Michajłow dc2d58b514 vo_gpu_next: remove incorrect interpolation disabling
We can possibly have all the frames needed for interpolation, even after
a reset, so there's no need to prevent that.
2023-11-18 22:54:29 +00:00
Kacper Michajłow faed191397 vo_gpu_next: fix pl_queue refill on reset
On reset, we would ignore all the frames that were seen before. This is
incorrect and would drop valid frames that should be rendered.
2023-11-18 22:54:29 +00:00
Kacper Michajłow 88fc947552 vo: pass approximate frame duration in vo_frame
This information is already there, but speed adjusted. To avoid
duplicating the calculation of frame duration, it's kept in the
vo_frame structure.
2023-11-18 22:54:29 +00:00
Kacper Michajłow d9e0ae737a vo: avoid overshooting the expected end of the frame during pause
The `current_frame` can be redrawn even if the remaining `num_vsync` is
equal to 0. In this scenario, the vsync offset would be incremented
beyond the target point.
2023-11-18 22:54:29 +00:00
Kacper Michajłow 01b4b20643 player/video: account for repeats in ideal_frame_vsync_duration
Frame repeats may occur to compensate for A/V diff. This commit ensures
a uniform distribution of vsync points based on the number of repeats.
2023-11-18 22:54:29 +00:00
nanahi 6fce181a25 vo_sdl: fix broken mouse wheel multiplier
It only registers 1 mouse wheel event per 10 physical mouse wheel clicks.
2023-11-18 21:02:17 +00:00
nanahi feae35e15d DOCS: properly document --force-window-position for sdl vo
The behavior is also the case for SDL vo, so document it.
2023-11-18 20:58:31 +00:00
Dudemanguy 77c9266975 loadfile: remove some dead code
034f75dacd removed the loop that could
cause !next to actually happen here. This code would never be executed
and is not needed.
2023-11-18 14:48:44 -06:00
Dudemanguy 69f3c70733 hwdec_vulkan: use VK_NULL_HANDLE when counting the number of images
Otherwise you can get "error: comparison between pointer and integer"
while compiling in some cases.
2023-11-18 20:46:11 +00:00
Dudemanguy cf27152991 test: update ffmpeg format refs
These tests should really be rewritten to be less stupid so they don't
break everytime ffmpeg updates its formats, but that's too much effort
right now. Bump the required libavutil version as well.

8e1ef7c38f
2023-11-18 20:46:11 +00:00
Dudemanguy 4b0f03d455 vo_gpu_next: set max cache size back down to 10 MiB
It turns out that mpv will rewrite the entire cache file on every single
quit. It's not so great since after viewing a ton of files, your cache
can grow to massive sizes and slow down quitting the player to a
noticeable amount. Turn down the max size of both caches to 10 MiB for
now as a workaround until this gets improved later.
2023-11-18 18:33:21 +00:00
rcombs ca45b71edc hwdec: support videotoolbox with libplacebo 2023-11-16 09:48:20 -08:00
der richter 62b1ce0a55 osxbundle: sign bundle with ad-hoc pseudo identity
without a developer license and the corresponding certificate we can't
sign our app bundle properly. instead use the ad-hoc pseudo identity.
there. i am not sure what restrictions we have because of that, but it's
the only way we can pseudo sign the app bundle.

Fixes #12116
2023-11-15 23:08:11 +01:00
Daniel Brookman aa8af2e66b osxbundle: remove mpv-bundle symlink to allow code signing
Apps on Apple silicon have to be codesigned to run, but you can't
codesign bundles that have a symlink for the main executable.

The "mpv-bundle" symlink was used as the bundle's main executable
because it makes the execution name of the binary different.
Launch Services runs the CFBundleExecutable key from Info.plist when
launching a bundle, so by comparing the execution name to the name of
the symlink, you can check if that's how the binary was launched.

This replaces that detection method by moving the MPVBUNDLE
environmental variable into Info.plist. Launch Services will set
anything in LSEnvironment as environmental variables before launching
the bundle, so we're able to check for it instead of needing to
differentiate the execution name of the binary.

Fixes #12116
2023-11-15 23:08:11 +01:00
der richter dcb3213aa7 osxbundle: resolve relative linked dependency paths
not all dependencies are linked with an absolute path but rather are
relatively linked via @rpath or @loader_path. in those cases we have to
resolve the paths to those dependencies ourselves and change the linking
with install_name_tool to be relative to the @executable_path of the
binary within bundle.

Fixes #11897
2023-11-15 23:08:11 +01:00
Guido Cella 5362ec9ec0 zsh-completion: complete options after --help 2023-11-15 15:08:30 +00:00
Christoph Heinrich cb89c7ef89 command: notify media-title on force-media-title change
Fixes #12887
2023-11-15 14:57:32 +00:00