Commit Graph

50162 Commits

Author SHA1 Message Date
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
Thomas Weißschuh c0ca5f1a37 ao_pipewire: use realtime scheduling for data thread
By making the data thread realtime it is able to serve requests faster
and more reliable reducing crackling in certain situations.

As the mpv callbacks that are running on the data thread are all
non-blocking and very short this should be safe.

The same mechanism is also used by pw-cat and the alsa plugin shipped by
pipewire.
2023-03-05 11:23:01 -08:00
rcombs 291e05ec1a loadfile: strongly prefer that all streams are from the same program
In raw OTA MPEGTS, different programs can be entirely different virtual channels.
In web streams, different programs can be different variant bitrates,
so using streams from different programs can waste large amounts of bandwidth.
2023-03-03 23:54:46 -06:00
rcombs b2a021d891 command: expose hls-bitrate and program-id as track-list subproperties 2023-03-03 23:54:46 -06:00
rcombs 46199c02a0 loadfile: report hls_bitrate and program_id in struct track 2023-03-03 23:54:46 -06:00
rcombs ad60753bce demux: propagate hls_bitrate and program_id in generated caption tracks 2023-03-03 23:54:46 -06:00
rcombs c39e332e50 demux_lavf: report program_id
This can be useful in stream selection.
2023-03-03 23:54:46 -06:00
Christoph Heinrich 362256edbc ytdl_hook: only log error when no fallback url available
An error indicates that something doesn't work, but as long as a
safe url is available, playback is still expected to work.

Thus reduce logging level of MP4 DASH without fragments message and
add a new error message for when there is no safe url available either.

Also adds a missing space.
2023-03-03 23:02:13 +00:00
Christoph Heinrich 94c189dae7 ytdl_hook: init fragment requires other fragments
With dash the first fragment was always considered an init fragment if
there wasn't a duration. However that only makes sense when there are
also other fragments, so check if there are other fragments in addition
to the lack of a duration.
2023-03-03 23:02:13 +00:00
Dudemanguy 296d40dc6f vo: fix race condition with redraw requests
There is a very subtle race in vo that can manifest itself on pause
events. In the renderloop, render_frame, unsurprisingly, does the heavy
lifting of actually queuing up and flipping the frames. This is called
during normal playback. Sometimes various parts of the player can make a
redraw request which will latter trigger another render of the frame
later down in the loop (do_redraw). Because these requests can happen at
essentially anytime, sometimes the redraw request will happen *before*
do_redraw and it'll be caught in render_frame. When this happens,
the existing render_frame run works perfectly fine as a redraw so it
clears out the request which is sensible. Normally this is all locked of
course, but there's one catch. render_frame has to unlock itself when
propagating down into specific VOs/backends. That's what causes this
bug.

While render_frame is unlocked, other parts of the player can send
redraw requests which will cause in->request_redraw to become true. The
logic in the code always clears out this parameter after a successful
render, but this isn't correct. When in->request_become becomes true in
the middle of render_frame, there needs to be one more draw afterwards
to reflect whatever actually changed (usually the OSD). Instead, this
gets simply discarded. If you rapidly spam pause while rendering things
to the OSD at the same time, it's possible to for the last render to
be behind a frame and appear as if your osd event was ignored.

Once you realize what is happening, the fix is quite simple. Just store
the initial value of in->request_redraw before the unlock step. After we
do the render step and unlock again, only set in->request_redraw to
false if there was an initial redraw request. We just finished doing a
redraw, so it is safe to clear. Otherwise, leave in->request_redraw
alone. If it is initially false, then it will still be false and nothing
changes. However if it updated to true in the middle of the rendering,
this value is now preserved so we can go and call do_redraw later and
show what that last frame was meant to be when you pause. One
unfortunate thing about this design is that it is technically possible
for other internal things in vo to update during that unlocked period.
Hopefully, that doesn't actually happen and only redraw requests work
like this.

Fixes #8172 and #8350.
2023-03-02 22:09:10 +00:00
Dudemanguy e82d9045a4 ci: separate meson tests and reorganize build steps
Instead of running the test directly in the build script, we can make a
separate step in the workflow so it looks a little prettier. For running
the actual tests, we skip mingw since they will never be run (cross
compiled). Additionally, improve the github workflow logic a bit so that
way logs on failure are only shown when that specific step fails. The
freebsd job still has to be less elegant since it's in a weird vm
thingy.

Not really related but the location of various build directories
(particularly waf) are corrected as well (might as well).
2023-03-02 15:45:27 +00:00
Dudemanguy 9db818279a test: integrate unittests with meson
This reworks all of mpv's unit tests so they are compiled as separate
executables (optional) and run via meson test. Because most of the tests
are dependant on mpv's internals, existing compiled objects are
leveraged to create static libs and used when necessary. As an aside, a
function was moved into video/out/gpu/utils for sanity's sake (otherwise
most of vo would have been needed). As a plus, meson multithreads
running tests automatically and also the output no longer pollutes the
source directory. There are tests that can break due to ffmpeg changes,
so they require a specific minimum libavutil version to be built.
2023-03-02 15:45:27 +00:00
Dudemanguy 6153242157 ci: use the same arguments when running the built mpv binary
A couple of places didn't have -v --no-config so just use them
everywhere.
2023-03-02 15:45:27 +00:00
Dudemanguy 3535e326dc player: remove unittest option
Since meson has its own unit testing system, let's rework mpv's tests so
they integrate nicely with this. To prepare for this, start off by
dropping the unittest option. Of course, this means that tests will no
longer be supported in the waf build at all but it will be dropped
anyway. Note that the tests option is preserved for the meson build. We
will still make use of this in the future commits.
2023-03-02 15:45:27 +00:00
Dudemanguy 3eae9d6c0f test: update ffmpeg format refs
A few formats were added recently, some were removed, and some flags
were changed. Maybe this should be better, but just update for now so
the tests stop failing.
2023-03-02 15:45:27 +00:00
Kacper Michajłow a0340ffe2d zimg: fix MP_CSP_PRIM_CIE_1931 mapping
MP_CSP_PRIM_CIE_1931 are RGB primaries, not ZIMG_PRIMARIES_ST428 which
is XYZ.
2023-03-02 09:37:06 -05:00
Kacper Michajłow 752e76ced7 zimg: add ZIMG_TRANSFER_ST428 mapping 2023-03-02 09:37:06 -05:00
Kacper Michajłow 7ceadbb3c1 zimg: set correct primaries for XYZ 2023-03-02 09:37:06 -05:00
Kacper Michajłow 2101e77d1e sws_utils: hardcode output gamma and primaries for XYZ 2023-03-02 09:37:06 -05:00
Kacper Michajłow f2fab0d8e1 mp_image: fix XYZ gamma and primaries guess 2023-03-02 09:37:06 -05:00
Kacper Michajłow 9dc4154fec vo_gpu: improve XYZ conversion
Fixes #4925
2023-03-02 09:37:06 -05:00
Kacper Michajłow 40af0893a9 mp_image: be less agressive with clearing color information 2023-03-02 09:37:06 -05:00
Kacper Michajłow 507d817f19 f_swscale: do not reset color levels to default
There is no good reason to do so, both zimg and swscale supports full
range output. If downstream something expects limited range yuv always,
it needs to be comunicated in different way.
2023-03-02 09:37:06 -05:00
Kacper Michajłow cb9ba6cb26 csputils: add MP_CSP_TRC_ST428 as defined in ST 428-1 2023-03-02 09:37:06 -05:00
Dudemanguy c31e145e1f DOCS/options: mention default value of cursor-autohide
Closes #11358.
2023-03-01 23:17:33 -06:00
Dudemanguy 7bd528dbeb DOCS/options: clarify hidpi-window-scale description
It's enabled by default everywhere. The sentences about macOS is
misleading and may imply it's disabled by default on the other
platforms.
2023-03-01 23:13:57 -06:00
Dudemanguy c993d5c0ce player: add --auto-window-resize option
mpv's window resizing logic always automatically resized the window
whenever the video resolution changed (i.e. advancing forward in a
playlist). This simply introduces the option to make this behavior
configurable. Every windowing backend would need to implement this
behavior in their code since a reconfigure event must always be a
resize. The params of the frame changed so you either have to resize the
window to the new size of the params or make the params the same size as
the window. This commit implements it for wayland, win32, and x11.
2023-03-02 02:55:36 +00:00
Dudemanguy cd02b5ccf6 ra: assert when using params with dimensions
This came up in #9828. According to the header comments, creating a 1D
ra_tex requires height and depth to be set to 1. For a 2D texture, it
requires depth be set to 1. There were a couple of spots in mpv's code
where this wasn't being followed. Although there was no known bug from
this, the rest of the code works like this so it was a good idea to go
ahead and sync it up. As a followup, let's just add some simple asserts
to ra.c to enforce this so it doesn't go unnoticed in the future.
2023-03-02 02:08:39 +00:00
Frédéric Brière 779d4f99a7 sub: add --sub-fonts-dir and --osd-fonts-dir options
These options make it possible to specify the directory that will be
passed to ass_set_fonts_dir(), akin to VLC's `--ssa-fontsdir` and
FFmpeg's `fontsdir`.

Fixes #8338
2023-03-01 02:09:46 +00:00