Commit Graph

50240 Commits

Author SHA1 Message Date
quietvoid 1808f264b3 mp_image: always add AV_FRAME_DATA_DOVI_METADATA when present
As the Dolby Vision metadata is only supported for vo_gpu_next, the check
whether to use the metadata is now handled by `mp_map_dovi_metadata_to_pl`.

It doesn't hurt to keep the metadata in `mp_image`, and might be useful to
library users.
2023-04-10 05:18:58 -04:00
sfan5 9a8b31707e ci: add a workflow that lints commit messages 2023-04-08 17:08:57 +02:00
Dudemanguy 7ae7fc0112 auto_profiles: try to distinguish invalid properties better
6e4a76db08 attemped to reject invalid
properties and print an error for users so they actually know that
something is going wrong. This worked by simply checking if the property
not found error is returned, but it is actually perfectly possible for a
property to not be found (different than being unavailable just to be
clear here) at first and then show up later. An example would be
user-data which can be created at any time. It's also possible with
subproperties of things like track-list where a new track could be added
later.

In light of this, let's soften the error checking logic here with a
simple trick. mpv already keeps track of all toplevel properties and it
can be easily retrieved with the "property-list" property, so just cache
that. When we get a property not found error, instead of rejecting it,
try to match it something in the property-list first. If we have a
match, then consider the property valid and allow the script to behavior
normally. If not, we reject it. This approach means property names that
are obviously wrong like "fake-property-here" will reliably get rejected
and something like "user-data/test" works as usual. The downside is that
errors in the subproperty level are not caught, so something like
"track-list/0/fake-property" would still be considered valid and the
user gets no warning that this won't work. We'll just accept the
compromise and hope this isn't too common.

Fixes #11550.
2023-04-07 01:48:55 +00:00
Guido Cella 41372c5e1f auto_profiles.lua: apply profiles when conditions are truthy
Instead of erroring when values returned by profile-cond expressions
aren't booleans, apply the relative profiles as long as the return
values are truthy. This allows shortening conditions like

profile-cond=path:match('foo') ~= nil

to

profile-cond=path:match('foo')
2023-04-05 18:32:18 +00:00
Christoph Heinrich b7ffe0d16e osc: skip rendering when osd_dimensions are 0
The idle logo could appear on the left side of the window for a split
second after starting.
That is because when osd dimensions can be reported as 0 at the very beginning.
Since the width gets calculated based on a fixed height and the aspect ratio,
which is 0, that results in a width of 0 until the next update.
2023-04-05 17:14:43 +00:00
Kacper Michajłow 9feeb324ed win32: follow Windows settings and update dark mode state
Microsoft documented how to enable dark mode for title bar:

https://learn.microsoft.com/windows/apps/desktop/modernize/apply-windows-themes
https://learn.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute

Documentation says to set the DWMWA_USE_IMMERSIVE_DARK_MODE attribute to
TRUE to honor dark mode for the window, FALSE to always use light mode.
While in fact setting it to TRUE causes dark mode to be always enabled,
regardless of the settings. Since it is quite unlikely that it will be
fixed, just use UxTheme API to check if dark mode should be applied and
while at it enable it fully. Ideally this function should only call the
DwmSetWindowAttribute(), but it just doesn't work as documented.

Fixes: #6901
2023-04-04 20:04:57 +02:00
Kacper Michajłow 68b3239b52 d3d11: retry device creation without debug, if SDK is not available
Fixes #11512
2023-04-02 21:43:53 +03:00
Kacper Michajłow 9d120a4411 build: add check for eglext_angle.h when checking for ANGLE
This better follows the actual required bits, and makes sure that
a file not part of standard EGL headers is available, as the
handle type is part of standard EGL extensions header.
2023-04-02 21:23:48 +03:00
Kacper Michajłow 911d742817 context_angle: include eglext_angle.h explicitly
Recent MSYS update switched to using vanilla EGL headers, which doesn't
include eglext_angle.h implicitly.
2023-03-30 22:00:38 +03:00
feltcat 0f13c38e72 DOCS/input: fix typo 2023-03-30 13:57:08 +00:00
Dudemanguy 6e4a76db08 auto_profiles: check for non-existent properties
Previously, it just silently didn't do anything which is not very
intuitive. Since the lua api returns an error string, check to see if
it matches the "property not found" case and print an error message.
Additionally, don't add the fake property to the internal
cached_properties list or try to observe it. This avoids redundant
evaluate calls which will never actually succeed. We do still mark it
under watched_properties however. This avoids having to call
mp.get_property_native multiple times.
2023-03-29 13:33:57 +00:00
Alexander Seiler bdf7b5c3b8 various: fix various typos in the code base
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
2023-03-28 19:29:44 +00:00
Harri Nieminen 292a5868cb various: fix typos
Found by codespell
2023-03-28 19:29:44 +00:00
Philip Langdale 24bed9b949 demux_lavf: update to handle deprecation of `io_close`
`io_close2` was introduced as a superior replacement for `io_close` in
ffmpeg 5.0, and then deprecated in 6.0. The difference is that
`io_close2` can return errors. In our case, we're just calling through
to the original function anyway, so we don't need to do more than pass
the return value back.
2023-03-28 11:32:51 -07:00
Kacper Michajłow 6a62aa0330 ci: bump cache version to rebuild libplacebo
libplacebo-next version requirement was increased recently, need to
rebuild it to fix mingw CI builds.
2023-03-28 09:23:38 -07:00
Kacper Michajłow 21301dc12d ci/mingw: require libplacebo-next
libplacebo is build by us, so we can explicitly enable it.
2023-03-28 09:23:38 -07:00
Kacper Michajłow 10136e77a3 build: add an option to control gpu-next
Also simplify meson logic
2023-03-28 09:23:38 -07:00
Kacper Michajłow 1ea74f10a7 ci/mingw: update meson
libplacebo requires >= 0.63
2023-03-28 09:23:38 -07:00
Philip Langdale d1d0b1a8ee meson: fix libplacebo-next version comparison
Should just compare against '264'.
2023-03-26 22:01:06 -07:00
llyyr 685d9cbe5b vo_gpu_next: drop various PL_API_VER checks
We don't need these anymore now that we require PL_API_VER>=264 for
building libplacebo-next
2023-03-26 20:55:58 -07:00
llyyr 631b7d54dc wscript: bump libplacebo-next required version to 5.264
b77f88157e only bumped the version for
meson builds.
2023-03-26 20:55:58 -07:00
Philip Langdale b77f88157e meson: bump libplacebo-next required version to 5.264
This is the latest stable release, and what we should use for
libplacebo-next per haasn's recommendation.

The previous 202 version wasn't even a release.
2023-03-26 21:00:23 +02:00
cloud11665 664f197746 player/screenshot: add filename return field
DOCS/input: add screenshot return value description
2023-03-25 16:24:21 +00:00
Christoph Heinrich 34a04d0567 player: set playlist title to media title if not set already
The playlist title only got set when it was specified in the playlist
file.
If there is a title after opening a file, that should also be reflected
in the playlist.
2023-03-24 02:28:49 +00:00
Christoph Heinrich 5ddf6d479e Revert "player: set playlist title to media title if not set already"
As it turns out that approach was suboptimal.
The playlist title would only ever get set when media-title actually
gets read, which depending on the configuration and usage might never
happen.

The next commit reimplements that feature in a different way.

This reverts commit 048d4d8b75 except for
the input.rst change.
2023-03-24 02:28:49 +00:00
Thomas Weißschuh 4827fc2907 meson: rst2pdf handle dependency file 2023-03-24 02:18:39 +00:00
Thomas Weißschuh 707554324a TOOLS/docutils-wrapper: handle commands without depfile 2023-03-24 02:18:39 +00:00
Thomas Weißschuh 375e527620 TOOLS/docutils-wrapper: properly propagate failures 2023-03-24 02:18:39 +00:00
Thomas Weißschuh d6f70ef96b TOOLS/docutils-wrapper: gracefully remove non-existing files 2023-03-24 02:18:39 +00:00
Ameer Taweel 892ca9f5d9 DOCS/lua: fix typo 2023-03-21 15:49:42 +02:00
Oliver Freyermuth a45995f6b8 options: enable scripts related opts also with cplugins.
If an mpv build neither supports lua nor javascript,
but only cplugins, the scripts options are still usable
to select which cplugins to load.
2023-03-18 21:40:17 +02:00
Dudemanguy e1727553f1 test: update format refs to ffmpeg 6
Major release means new formats and failing tests so just add the new
stuff to the ref again and bump the minimum libavutil version. The last
ffmpeg commit that added a new format and is the minimum required
version for these subset of tests is referenced below.

479747645f
2023-03-15 00:25:11 +02:00
Dudemanguy c7395970df github/workflows: fix failure conditions
It turns out that you actually have to add failure() to each condition
otherwise a default status check of success() is applied (thanks
github). Looks redundant but whatever. Thanks to @kasper93 for actually
reading the documentation.
2023-03-15 00:25:11 +02:00
Jan Ekström 1313f287e5 common/av_common: clean up mp_lavc_set_extradata
It no longer has any users, as the last ones (subtitle decoders)
were switched to mp_set_avctx_codec_headers.
2023-03-14 23:59:47 +02:00
Jan Ekström 9f5d7d5932 sub/sd_lavc: properly fill avctx with codecpar values at init
Similar reasons as with the previous commit touching lavc_conv,
as well as this being the last location where mp_lavc_set_extradata
being utilized.
2023-03-14 23:59:47 +02:00
Jan Ekström e20b645611 sub/lavc_conv: properly fill avctx with codecpar values at init
This way we receive such minor details as the profile (necessary for
ARIB captions, among others) during init. This enables decoders
to switch between ARIB caption profile A and profile C streams.
2023-03-14 23:59:47 +02:00
Jan Ekström ef7b711bed common/av_common: constify mp_codec_params related getters
They should not be modifying the argument, so clearly marking it
as const makes sure we don't do it in the future as well as allows
for read-only optimizations.
2023-03-14 23:59:47 +02:00
rcombs 0da0acdae8 demux_mkv: support ARIB captions 2023-03-14 22:32:40 +02:00
rcombs 3eb2dfe2eb player/command: fix mem leak in user-data property; closes #11436 2023-03-13 22:49:51 -04:00
llyyr 3a2f8d42ab vo_gpu_next: compatibility with libplacebo v6.265
libplacebo v6.265.0 removed v4 deprecations. We already require
PL_API_VER >= 202, so we don't need to wrap
pl_tex_transfer_params.row_pitch around a conditional, which exists
since PL_API_VER >= 168. However, pl_source_frame.duration does not exist until
PL_API_VER >= 219, so we should use a conditional directive.
2023-03-13 20:09:06 +01:00
Dudemanguy 9880b06a37 wayland: make wayland-edge-pixels-pointer default to 16
10 is ludicrously small. How did no one on an CSD compositor complain
about this?
2023-03-08 14:06:22 +00:00
Dudemanguy b313a242c2 wayland: use correct x/y coordinates for the cursor
While adding fractional scale support, the coordinates for wayland
changed to always include the scaling parameter. The pointer stuff
actually did too. However, the check_for_resize function used the
unscaled, local surface coordinates. Likely, it was neccesary at the
time since wl->geometry used to report unscaled coordinates. In light of
that, we can just simply use mouse_x/y instead for this function to make
it work correctly with the right/bottom edges. mouse_unscaled becomes
completely unneccesary, so just drop it.

Some minor style changes included just because.
2023-03-08 14:06:22 +00:00
Christoph Heinrich 855b619cc9 screenshot: fix segfault when taking a screenshot without video
Also a style change to exit early when nothing can be done anymore.
2023-03-07 14:36:52 +00:00
Christoph Heinrich 31160ff941 wayland: fix client side resize
`xdg_toplevel_decoration` exists on SSD compositors independent of if
there is a border or not, so resizing didn't work on those.
Checking the border option makes more sense and also works on such
compositors.
2023-03-07 00:16:18 +00:00
Niklas Haas dcc9bc5dea vo_gpu_next: compatibility with PL_API_VER >= 254
This field was renamed/moved to a different params struct.
2023-03-06 21:35:10 +01:00
Leo Izen 4defd8bb27 vo_gpu_next: use inverse mapping functions to tag screenshots
Screenshots using the hardware renderer should now include color tags
that map directly from the libplacebo tags, so the if/else logic only
needs to be included once.
2023-03-05 22:37:05 -05:00
Leo Izen 8217b186f6 video/out/placebo/utils: add mappings from pl enums to mpv enums
mp_trc_to_pl, mp_prim_to_pl, and mp_levels_to_pl have forward but not
inverse mappings. This commit adds mp_trc_from_pl, mp_prim_from_pl, and
mp_levels_from_pl inverse mapping functions, which just map the enums
in the other direction.
2023-03-05 22:37:05 -05:00
Leo Izen 34ed2ac225 video: add missing libplacebo colorspace enums
Add some missing libplacebo primaries and transfer enums to mpv's enum
constant tables, and update the functions that convert between the two.
2023-03-05 22:37:05 -05:00
Kacper Michajłow 22e3264652 mp_image: assert if src and dst are different in copy_attributes
It doesn't make sense to call this function on same image and the code
is not safe to do so.
2023-03-05 22:36:56 +02:00
Kacper Michajłow 2a7122ac41 mp_image: copy side data in mp_image_copy_attributes
This fixes HDR10 and HDR10+ metadata usage in vo_gpu_next when hwdec
copy variant is used.
2023-03-05 22:36:56 +02:00