summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wayland: clean wp_presentation_feedback in discard callback to avoid leakAaron Boxer2022-10-261-0/+2
|
* build_image_converter - use full image format list to create hw_uploadAaron Boxer2022-10-261-20/+21
| | | | currently we only try for the first format in the list
* mp_imgfmt: move DRMPRIME format to end of enumAaron Boxer2022-10-261-1/+1
| | | | | | | dmabuf-wayland vo supports both DRMPRIME and VAAPI formats. If upload filter is needed, we want to try VAAPI hwdec first since most users will be using VAAPI, and there is a several second delay when DRMPRIME hwdec is tried and fails.
* DOCS: document E to cycle through EditionsLeo Izen2022-10-241-0/+3
| | | | | | Pushing E (aka Shift+e) cycles through Editions for containers that support editions, such as Matroska, although this feature was not documented before this commit.
* ao: promote ao_pipewireThomas Weißschuh2022-10-241-3/+3
| | | | | | The AO is feature-complete now. As PipeWire also provides compatibility with PulseAudio, ALSA and Jack we should put it before those for the autodetection to work.
* ao_pipewire: test for session to contain audio sinksThomas Weißschuh2022-10-241-0/+22
| | | | | | | | | | | | The pure presence of PipeWire does not mean that it is actually driving the audio session. For example it could only be meant for video. Currently there is no proper API to detect this (see [0]), so we check for the presence of audio sinks. As soon as a proper API exists, we should use that. [0] https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1835
* ao_pipewire: init_boilerplate(): simplify errorhandlingThomas Weißschuh2022-10-241-7/+3
|
* TOOLS/lua/autoload: fix incorrect duplicate file loading behaviordyphire2022-10-241-9/+14
| | | | | | | This will correctly avoid the duplicate file loading when the playlist changes due to shuffle playback or append new files. Fixes https://github.com/mpv-player/mpv/issues/8575
* audio/format: fix Type 'struct entry' has incompatible definitions in ↵Cœur2022-10-231-4/+4
| | | | | | different translation units `struct entry` already exists from <search.h>, so the one we declare in audio/format.c needs to be named differently
* vo_gpu/hwdec: add NULL check for legacy_namePhilip Langdale2022-10-221-1/+1
|
* hwdec_aimagereader: fix incorrect return valuessfan52022-10-221-2/+2
|
* demux_mkv: add AVS2 and AVS3 to tag listNicolas F2022-10-211-0/+2
| | | | | | | Add support for playing back AVS2 and AVS3 video streams inside mkv containers if ffmpeg was compiled with avs2/avs3 support. Fixes: #10695
* wscript: remove some bogus configure optionsDudemanguy2022-10-171-2/+2
| | | | | | | | | It turns out that wayland-scanner and wayland-protocols are both exposed as configure options in waf meaning you can --enable/--disable them at configure time. This is pretty nonsensical. If you want to control wayland in the build, you should just use --enable-/--disable-wayland. wayland-scanner and wayland-protocols should just be typical checks like in the meson build.
* demux_mf: add support for QOI, PHM and HDR imagesPaul B Mahol2022-10-151-0/+3
|
* f_hwtransfer: allow hw uploads to implicitly convert formatsPhilip Langdale2022-10-151-26/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | vaapi allows for implicit conversion on upload, which has some relevance as the set of supported source formats is larger than the set of displayable formats. In theory, this allows for offloading the conversion to the GPU - if you have any confidence in the hardware and/or driver's ability to do the conversion. Today, we actually track the 'input' and 'output' upload formats separately all the way up until the point we do a check as to whether the original source format is an accepted 'output' format and then reject it if it is not. This means that we're essentially ignoring all the work we did to track those 'input' formats in the first place. But it also means that it's a simple change to compare against the 'input' format instead. The logic is already in place to do best format selection on both sides. I imagine that if I read through the history here, wm4 tried to implement all of this properly and then gave up in disgust after seeing vaapi mangle various conversions. This is particularly interesting for vo-dmabuf-wayland where it is only possible to display the subset of valid vaapi formats that are supported by the compositor, yet all playback has to go through vaapi. Users will then be able to take advantage of all possible vaapi formats to avoid having to do software format conversion.
* f_hwtransfer: accept non-power-of-2 hw uploadsPhilip Langdale2022-10-151-5/+0
| | | | | This works fine for me on vaapi, cuda and vulkan. Why did we have this restriction in there? Worst case, the hwdec_interop will reject it.
* hwdec/dmabuf_interop_gl: work-around implicit rgba swizzlingPhilip Langdale2022-10-151-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | This has been a long standing problem that I think was the root cause for wm4's vaapi shitlist. As DRM explicit supports all possible rgba orderings, but OpenGL only guarantees support for 'rgba8', something has to happen to support import of dmabufs with non-native ordering. Although undocumented, it appears that somewhere in the import on the GL side, the ordering is swizzled to rgba - which makes sense as that's the only way to be able to support importing all the different formats. But we didn't know this, and we do our own swizzling based on the original imgfmt - which matches the drm format. So we get double swizzling and messed up colours. As there is no way for us to express that the GL swizzle happened to the rest of mpv, the easiest thing to do is fudge the format to the natural ordering so the GL doesn't change anything, then our swizzling will do the right thing in the end. Note that this change doesn't handle 0rgb and 0bgr because they seem to be affected by some additional feature/bug that is mangling the ordering somewhere that equally affects Vulkan interop. That could be a vaapi driver bug or something going on in ffmpeg.
* f_hwtransfer: get rid of the shit listPhilip Langdale2022-10-151-46/+0
| | | | | | | | | | | | | | | | | | | | | | | | | A few years ago, wm4 got sufficiently annoyed with how vaapi image format support was being discovered that he flipped the table and introduced the shit list (which just included vaapi) to hard-code the set of supported formats. While that might have been necessary at the time, I haven't been able to find a situation where the true list of supported formats was unsafe to use. We filter down the list based on what the vo reports - and the vo is already doing a thorough testing of formats, and if a format makes it through that gauntlet, it does actually work. Interestingly, as far as I can tell, the hwdec_vaapi probing code was already good enough at the time (also written by wm4), so perhaps the key difference here is that the driver side of things has improved. I dug into this because of the support for the 422/444 high bit depth vaapi formats I added to ffmpeg. These are obviously not in the hard coded list today, but they work fine. Finally, although it's positioned as a vaapi thing, it's really just Intel specific, as the AMD vaapi driver has never exposed support for anything except the formats used by the decoder/encoder profiles.
* hwdec/vaapi: improve probing of supported sw formatsPhilip Langdale2022-10-151-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic around trying to establish what formats are supported by vaapi is confusing, and it turns out that we've been doing it wrong. Up until now, we've been going through the list of decoding profile endpoints and checking the formats declared in those profiles to build our list. However, the set of formats that the vaapi driver can actually support is potentially a superset of those supported by any given profile endpoint. This master list is exposed by libavutil via the av_hwframe_transfer_get_formats() function, and so we should use that list as our starting point. Perhaps surprisingly, this change actually removes no code, because we still want the logic that enumerates endpoints and finds supported formats for endpoints. We need this because we must have at least one known sw format to initialise the hwframe_ctx with. Additionally, while in the general case, av_hwframe_transfer_get_formats can return different formats depending on what format you initialise the hwframe_ctx with, I happen to have read the libavutil code, and it doesn't care, so we just need to call it once, we know we'll get back all known formats. In practice, with an Intel vaapi driver, this will result in us supporting a handful of extra formats for hwuploads - particularly yuv420p (so no need to convert to nv12 first) and various orderings of rgb(a).
* vo_gpu_next: fix crash on uninit after startup failurercombs2022-10-141-1/+1
|
* sd_ass: improve handling of subtitles with unknown durationVincentVerdynanta2022-10-121-3/+7
| | | | | | | | | Commit 740b701 introduced handling for subtitles with unknown duration, but it came with a minor flaw where a track event that shares identical start time with following track event will has its Duration value set to 0, we don't want this to happen since it will prevent simultaneous rendering of multiple track events. This commit aims to address this issue.
* DOCS: fix minor typo with keep-open descriptionLeo Izen2022-10-121-1/+1
| | | | | Fix a minor typo in the description of --keep-open in DOCS/man/options.rst
* draw_bmp: fix out of bounds access in mark_rectShreesh Adiga2022-10-111-3/+3
| | | | | | When the width is exactly a multiple of SLICE_W (currently 256), heap buffer overflow is reported by Address Sanitizer. So adjust the maximum index for the line array accordingly.
* vo_gpu/hwdec: rename and introduce legacy names for some interopsPhilip Langdale2022-10-119-21/+36
| | | | | | | | | | | | We've had some annoying names for interops, which we can't simply rename because that would break config files and command lines. So we need to put a little more effort in and add a concept of legacy names that allow us to continue loading them, but with a warning. The two I'm renaming here are: * vaapi-egl -> vaapi (vaapi works with Vulkan too) * drmprime-drm -> drmprime-overlay (actually describes what it does) * cuda-nvdec -> cuda (cuda interop is not nvdec specific)
* x11: fix --on-all-workspaces optionodnar-dev2022-10-111-13/+34
| | | | mpv set _NET_WM_DESKTOP to 0xFFFFFFFF, which behaves differently with each window manager. Instead, set the window property to STICKY, and let the window managers deal with it.
* vo_gpu_next: vulkan: libplacebo: unify log prefixNiklas Haas2022-10-095-8/+5
| | | | | | | | | | | | | | | | | | The new status quo is simple: all messages coming from libplacebo are marked "vo/gpu{-next}/libplacebo", regardless of the backend API (vulkan vs opengl/d3d11). Messages coming from mpv's internal vulkan code will continue to come from "vo/gpu{-next}/vulkan", and messages coming from the vo module itself will be marked "vo/gpu{-next}". This is significantly better than the old status quo of vulkan messages coming from "vo/gpu{-next}/vulkan/libplacebo" whereas opengl/d3d11 messages simply came from "vo/gpu{-next}", even when those messages originated from libplacebo. (It's worth noting that the the destructor for the log is redundant because it's attached to the ctx which is freed on uninit anyway)
* github/workflows: explicitly install Xinerama on FreeBSDJan Ekström2022-10-091-0/+1
| | | | | Apparently an implicit dependency on it through one of the otherwise installed packages is no longer there.
* x11: fix a couple of memory leaksDudemanguy2022-10-081-0/+2
| | | | | | | | | | | Managed to go completely unnoticed for months (who was the bad person that introduced these*). Fairly self-explanatory. After getting ProviderInfo from randr, we need to free it. The other one is pretty bad because it leaked every frame (ouch). It turns out that you're supposed to free any event data after you cast a generic event to an XGenericEventCookie. Free that as well. *: It was me.
* ao_pipewire: allow specification of remote nameThomas Weißschuh2022-10-062-2/+15
|
* ao_pipewire: small cleanups and restructringThomas Weißschuh2022-10-061-7/+9
| | | | | | * Remove unneeded braces. * Don't use non-standard %m in printf. * Organize struct priv a bit.
* osc: scale rendered aspect ratio with window aspect ratioChristoph Heinrich2022-10-061-3/+7
| | | | | The logo stays centered better and it doesn't distort anymore due to a recent change in libass https://github.com/libass/libass/pull/645
* wayland: correctly handle non-CLOCK_MONOTONIC clocksDudemanguy2022-10-066-13/+21
| | | | | | | | | | | | | The wayland presentation time code currently always assumes that only CLOCK_MONOTONIC can be used. There is a naive attempt to ignore clocks other than CLOCK_MONOTONIC, but the logic is actually totally wrong and the timestamps would be used anyway. Fix this by checking a use_present bool (similar to use_present in xorg) which is set to true if we receive a valid clock in the clockid event. Additionally, allow CLOCK_MONOTONIC_RAW as a valid clockid. In practice, it should be the same as CLOCK_MONOTONIC for us (ntp/adjustime difference wouldn't matter). Since this is a linux-specific clock, add a define for it if it is not found.
* vulkan: remove --vulkan-disable-eventsNiklas Haas2022-10-053-8/+2
| | | | | | This has had no effect since libplacebo v4.192.0, and was deprecated upstream a year ago. No deprecation period in mpv is justified by this being a debug / work-around option.
* vo: hwdec_aimagereader: add missing image format specifiersfan52022-10-031-0/+1
| | | | This is required since e50db4292795de511531e764d7e609c1a37a204f, but was missed during the merge.
* vo_gpu: hwdec: add Android hwdec utilizing AImageReadersfan52022-10-028-4/+427
|
* DOCS: deprecate --gamma-factor and --gamma-autoLeo Izen2022-10-012-14/+4
| | | | | | | | Removed the outdated information about environmental brightness with respect to --gamma-factor, and mention that the option is deprecated and subject to future removal. Also deprecated the --gamma-auto option as it relies on the same outdated way of doing things.
* vo_gpu_next: respect --blend-subtitles=<yes/no>Niklas Haas2022-09-291-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | This brings vo_gpu_next's behavior more in line with vo_gpu. Currently, the status quo was that `vo_gpu_next` generated subtitles with the full resolution of the dst crop, even though practical limitations of libplacebo meant that such subtitles inevitably got cut off at the video boundaries. This was actually a worse status quo than `vo_gpu`, which simply constrained subtitles to the video dimensions to prevent these issues. With this change, the behavior is the same as `vo_gpu`, which has the exact same problem w.r.t interpolation. Users are back to choosing between --blend-subtitles=yes and not having subtitles in margins, and using --blend-subtitles=no and not having subtitle interpolation. There are different pros and cons to each approach, and I still ultimately plan on allowing libplacebo to interpolate subtitles even in the black bars, to solve this issue once and for all. But for now, let's not let perfect be the enemy of good. No attempt is made to implement `--blend-subs=video`, which I consider deprecated. Fixes: https://github.com/mpv-player/mpv/issues/10272
* ao_pipewire: don't try to lock nonexistent loopThomas Weißschuh2022-09-281-2/+3
|
* ao_pipewire: use target.objectThomas Weißschuh2022-09-281-39/+2
| | | | | | | Specifying the id of the target node during stream connect is deprecated. Instead the property target.object should be used to link by target serial or name. Using the name allows us to drop a bunch of custom code.
* mp_image: strip DoVi metadata that requires an ELNiklas Haas2022-09-281-2/+12
| | | | | | We can't support this. Better strip it than partially apply. Fixes: #9831
* manpage: document bt.2390 parameterNiklas Haas2022-09-281-0/+4
| | | | Closes #9788
* vo_gpu_next: fix screenshots of rotated sourcesNiklas Haas2022-09-271-3/+6
| | | | | | | I actually don't quite understand why this is needed, since in theory we should already be doing the rotation as part of applying the crop. But I guess that code doesn't quite work. This is the only way it works, so it's probably correct. (And note that `vo_gpu` does the same internally)
* DOCS/man/vf.rst : replace the outdated syntaxhooke0072022-09-271-1/+1
| | | | | `get_core()` had been deprecated for several years and totally removed since vapoursynth R55 API4.
* vo_gpu_next: use static assert for array sizeNiklas Haas2022-09-271-1/+1
| | | | This is used in other places in the code, so it should be fine.
* vo_gpu_next: update render_info for upstream API changeNiklas Haas2022-09-261-11/+14
| | | | | | This fixes an issue where blend stages with multiple passes got overwritten by later passes, with only the final pass (typically the overlayp pass) actually being shown.
* vo_gpu_next: implement --video-output-levelsNiklas Haas2022-09-251-0/+4
| | | | This was ignored as an oversight.
* TOOLS/lua/autoload: add various extra file extensionsLeo Izen2022-09-231-4/+6
| | | | | Add to autoload.lua several extra file extensions that are unambiguously for media files.
* TOOLS/lua/autoload: alphebatize auto-loaded file extensionsLeo Izen2022-09-231-3/+4
| | | | | | Alphabetizing the extensions cleans up the code and makes it less ambiguous where newer extensions should be added. The video line also was wrapped to 72 characters for cleanliness.
* ytdl_hook: use subtitle `name` as title if availableChristoph Heinrich2022-09-231-1/+2
| | | | | So far the `ext` was always used as the title, but `name` is more appropriate when it's available.
* af_scaletempo2: fix crash when the number of channels increasesPeter DeLong2022-09-231-5/+4
| | | | | | | | | | | | | | | | When af_scaletempo2.c:process() detects a format change, it goes back through mp_scaletempo2_init() to reinitialize everything. However, mp_scaletempo2.input_buffer is not necessarily reallocated due to a check in af_scaletempo2_internals.c:resize_input_buffer(). This is a problem if the number of audio channels increases, since without reallocating, the buffer for the new channel(s) will at best point to NULL, and at worst uninitialized memory. Since resize_input_buffer() is only called from two places, pull size check out into mp_scaletempo2_fill_input_buffer(). This allows each caller to decide whether they want to resize or not. We could be smarter about when to reallocate, but that would add a lot of machinery for a case I don't expect to be hit often in practice.
* build: update waf to 2.0.24sfan52022-09-211-3/+3
|
* f_hwtransfer: mp_image_pool: support HW -> HW mappingPhilip Langdale2022-09-217-4/+80
| | | | | | | | | | | | | | | | Certain combinations of hardware formats require the use of hwmap to transfer frames between the formats, rather than hwupload, which will fail if attempted. To keep the usage of vf_format for HW -> HW transfers as intuitive as possible, we should detect these cases and do the map operation instead of uploading. For now, the relevant cases are moving between VAAPI and Vulkan, and VAAPI and DRM Prime, in both directions. I have introduced the IMGFMT entry for Vulkan here so that I can put in the complete mapping table. It's actually not useless, as you can map to Vulkan, use a Vulkan filter and then map back to VAAPI for display output.
* f_autoconvert: f_hwtransfer: support HW -> HW uploadsPhilip Langdale2022-09-213-20/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically, HW -> HW uploads did not exist, so the current code assumes they will never happen. But as part of introducing Vulkan support into ffmpeg, we added HW -> HW support to enable transfers between Vulkan and CUDA. Today, that means you can use the lavfi hwupload filter with the correct configuration (and previous changes in this series) but it would be more convenient to enable HW -> HW in the format filter so that the transfers can be done more intuitively: ``` --vf=format=fmt=cuda ``` and ``` --vf=format=fmt=vulkan ``` Most of the work here is skipping logic that is specific to SW -> HW uploads doing format conversion. There is no ability to do inline conversion when moving between HW formats, so the format must be mutually understood to begin with. Additional work needs to be done to enable transfers between VAAPI and Vulkan which uses mapping, rather than uploads. I'll tackle that in the next change.
* filters: lavfi: allow hwdec_interop selection for filtersPhilip Langdale2022-09-2110-28/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today, lavfi filters are provided a hw_device from the first hwdec_interop that was loaded, regardless of whether it's the right one or not. In most situations where a hardware based filter is used, we need more control over the device. In this change, a `hwdec_interop` option is added to the lavfi wrapper filter configuration and this is used to pick the correct hw_device to inject into the filter or graph (in the case of a graph, all filters get the same device). Note that this requires the use of the explicit lavfi syntax to allow for the extra configuration. eg: ``` mpv --vf=hwupload ``` becomes ``` mpv --vf=lavfi=[hwupload]:hwdec_interop=cuda-nvdec ``` or ``` mpv --vf=lavfi-bridge=[hwupload]:hwdec_interop=cuda-nvdec ```
* filters: support loading new hwdec_interops from filtersPhilip Langdale2022-09-213-8/+8
| | | | | | | | | | | | | | | | | | | | If we want to be able to handle conversion between hw formats in filter chains, then we need to be able to load hwdec_interops from filters, as the VO is only ever going to initialise one interop, based on its configuration. That means that in almost all situations, only one of the required interops will be loaded at the time the filter is initialised. The existing code has some assumptions that new hwdec_interops will not be loaded after the vo has picked one to use. This change fixes two instances: * Refusing to load a new hwdec_interop if there is at least one loaded already. * Not recalculating the set of formats known to the autoconvert filter when a new output format shows up. This leads to autoconvert not knowing that a new format is supported when the hwdec interop is lazily loaded.
* vo: hwdec: do hwdec interop lookup by image formatPhilip Langdale2022-09-2118-53/+33
| | | | | | | | | | | | |<