summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | | | | | It turns out that it's generally more useful to look up hwdecs by image format, rather than device type. In the situations where we need to find one, we generally know the image format we're dealing with. Doing this avoids us having to create mappings from image format to device type. The most significant part of this change is filling in the image format for the various hw interops. There is a hw_imgfmt field today today, but only a couple of the interops fill it in, and that seems to be because we've never actually used this piece of metadata before. Well, now we have a good use for it.
* demux_lavf: extract is_image functionGuido Cella2022-09-201-8/+13
|
* demux_lavf: detect avif imagesGuido Cella2022-09-201-1/+2
| | | | | Detect avif files with 1 frame as images. This works because AV1 videos and AVIF animations have nb_frames 0 or > 1.
* DOCS/man/options.rst: replace some legacy single-hyphen syntaxLeo Izen2022-09-201-3/+3
| | | | | Replace some occurrences of ``-option`` with ``--option`` to coincide with the current option sytnax.
* vo_gpu_next: support error diffusion ditheringNiklas Haas2022-09-201-6/+14
| | | | One step closer to vo_gpu_next feature parity with vo_gpu!
* sub: use Unicode linebreaking for non-ASS subs and OSDOneric2022-09-192-1/+7
| | | | | | | | | | | | ASS must only automatically break at ASCII spaces (\x20), but other subtitle formats might expect more breaking oppurtinities. Especially non-ASS subs in scripts, which typically do not use (ASCII) spaces to seperate words, like e.g. CJK, might overflow the screen if the conversion didn't insert additional linebreaks (ffmpeg does not). Thus try to enable Unicode linebreaking for converted subs and the OSD if libass is new enough. The feature may still be unavailable at runtime if libass wasn't build with Unicode linebreaking support.
* ao_audiounit: get the channel layout from the AU itselfrcombs2022-09-151-13/+77
| | | | | | | Fixes 5.1/7.1 output mapping on tvOS 16, and also makes the AC3-layout hack unnecessary. Also adds some diagnostic log messages.
* mac: avoid unnecessary unsafe conversions; fixes crash in debug buildsrcombs2022-09-142-22/+14
| | | | | | | | | | | | | | | Previously, running a debug build of mpv would crash with this output when preinit() at vo_libmpv.c:732 calls control(vo, VOCTRL_PREINIT, NULL): Swift/Optional.swift:247: Fatal error: unsafelyUnwrapped of nil optional This comes from this line of code: var data = UnsafeMutableRawPointer.init(bitPattern: 0).unsafelyUnwrapped Unsafely unwrapping a UnsafeMutableRawPointer.init has always been UB, but the Swift runtime began asserting on it in debug builds a couple macOS versions ago.
* TOOLS/lua/autoload: add `m2ts` extensionDeadNews2022-09-141-1/+1
| | | | * `.m2ts` used for the Blu-ray disc container file format
* ytdl_hook: simplify exclude option parsingChristoph Heinrich2022-09-141-5/+2
| | | | | The parsing used to be unnecessarily complicated, now it's easier to read and understand.
* vo_gpu_next: only require full pixel byte alignmentNiklas Haas2022-09-121-3/+3
| | | | | The current code also rejects e.g. rgb30, even though this format is perfectly valid, because it only checks for alignment of the used bits.
* vo_gpu_next: implement ICC 3DLUT cachingNiklas Haas2022-09-121-0/+65
| | | | | | | Relies on a new upstream API for adding save/load callbacks to the ICC 3DLUT generation parameters. Closes: https://github.com/mpv-player/mpv/issues/10252
* vo_gpu_next: use correct pixel size when mapping formatsNiklas Haas2022-09-121-1/+1
| | | | | `total_bits` may be less than the true pixel stride (`bpp`) for formats which contain extra ignored components (e.g. rgb0).
* ao_pipewire: listen to hotplug eventsThomas Weißschuh2022-09-111-1/+100
|
* ao_pipewire: use proper hotplug init APIsThomas Weißschuh2022-09-111-8/+13
|
* ao_pipewire: create is_sink_node helperThomas Weißschuh2022-09-111-8/+16
|
* audio: list devices for all AOs with hotplug_initThomas Weißschuh2022-09-111-4/+7
| | | | | | | | | | | | | | Previously we would only call list_devs() on available AOs if an AO *did not* have a hotplug_init() callback or for the first one that *did* have it. This is problematic when multiple fully functional hotplug-capable AOs are available. The second one would not be able to contribute discovered devices. This problem prevents ao_pipewire from introducing full hotplug support with hotplug_init().
* audio: try to use playback AO as hotplug AO firstThomas Weißschuh2022-09-114-10/+26
| | | | | | | | | | | | | | | | | | | | | When a platform has multiple valid AOs that can provide hotplug events we should try to use the one that also provides playback. Concretely this will help when introducing hotplug support for ao_pipewire. Currently ao_pulse is probed by ao_hotplug_get_device_list() before ao_pipewire and on the common setups where both AOs could work pulse will be selected for hotplug handling. This means that hotplug_init() of ao_pipewire will never be called and list_devs() has to do its own initialization. But if ao_pulse is non-functional or not compiled-in suddenly ao_pipewire *must* implement hotplug_init() for hotplugging events to work for all. Also if the hotplug ao_pulse connects to a PulseAudio instance that is not emulated by the same PipeWire instance as the playback ao_pipewire the hotplug events are useless.
* ta: increase size of names printedThomas Weißschuh2022-09-111-1/+1
| | | | | | | 30 characters are not a lot. Also when the name is calculated from the allocation site the line number will be the at the end of the name, so truncating it is especially inconvenient.
* ao_pipewire: handle AOCONTROL_UPDATE_MEDIA_ROLEThomas Weißschuh2022-09-101-2/+22
|
* audio: add AOCONTROL_UPDATE_MEDIA_ROLEThomas Weißschuh2022-09-104-0/+37
| | | | | | This is used to notify an AO about the type of media that is being played. Either a movie or music.
* ao_pipewire: fix indentThomas Weißschuh2022-09-101-7/+7
|
* repack: add repacker for ccc16x16 formatsPhilip Langdale2022-09-101-9/+12
| | | | | | | | | | | | I'm adding support in ffmpeg for the XV36 format which will be used by VAAPI for 12bit 4:4:4 content. It's an undefined-alpha channel variant of Y412 which is itself a 12bit+4bits padding variant of Y416. We currently have a repacker for full four channel cccc16, and for three channel ccc16, but nothing for ccc16x16 with the undefined alpha channel. It's simple enough to add one using the existing macros.
* mpv.metainfo.xml: add XDG appstream metadata manifestVitaly Zaitsev2022-09-093-0/+34
|
* DOCS: Mention "mono" audio channels optionCairn2022-09-091-3/+3
|
* DOCS/libmpv: fix typo in linkage section257924312022-09-031-1/+1
|
* w32: fix typo in F23 mappingThomas Weißschuh2022-09-031-1/+1
|
* vo_gpu_next: fix typo affecting --target-trc optionTillmann Karras2022-09-021-1/+1
|
* macos: add support for F13-F20 keysThomas Weißschuh2022-09-021-0/+3
|
* w32: add support for F13-F24 keysThomas Weißschuh2022-09-021-0/+4
| | | | Fixes #10595
* x11: add support for F13-F24 keysThomas Weißschuh2022-09-021-0/+4
|
* wayland: add support for F13-F24 keysThomas Weißschuh2022-09-021-0/+6
|
* input: add function keys F13-F24Thomas Weißschuh2022-09-021-0/+12
|
* ad_lavc: strip non-normalized floatsNiklas Haas2022-09-023-0/+35
| | | | | | | `opus` codec likes returning denormalized floats in some cases, causing wacky issues. Fixes #10290
* vo_gpu_next: display subtitles without video streamNiklas Haas2022-08-311-1/+2
| | | | Fixes https://github.com/mpv-player/mpv/issues/10594
* DOCS/options: update vd-lavc-skiploopfilter, skipidct and related descriptionssfan52022-08-311-5/+7
| | | | Cross-checked the current functionality of these with the FFmpeg source.
* DOCS/mpv: remove spaces at EOL, ensure 80 colsAvi Halachmi (:avih)2022-08-291-4/+5
| | | | These are fixes for the previous commit.
* DOCS/mpv: added COMMAND INTERFACE refs to INTERACTIVE CONTROLenly12022-08-291-3/+5
| | | | Added COMMAND INTERFACE references to make it easier for new users.
* ao_pipewire: for_each_sink(): report errorsThomas Weißschuh2022-08-281-9/+32
|
* meson: fix condition for enabling vaapi-eglOwen Rafferty2022-08-271-1/+1
|
* meson: fix libplacebo checkNiklas Haas2022-08-261-1/+1
| | | | | | Missing waf quivalent, and doesn't necessarily output a good error message. But I might as well submit this rather than sitting on it unnecessarily.
* audio: fix lack of reinitialization on format change with pull AOsPhilip Langdale2022-08-231-0/+1
| | | | | | | | | | | | uau did some investigation and noticed that we do not send a wakeup event when we encounter end-of-stream in ao_read_data(), in contrast to the equivalent logic for push AOs in ao_play_data(). Inserting that wakeup fixes the original problem of lack of reinitialization on a format change without the problems we saw with the previous attempted fix. Fixes #10566
* player/audio: remove explicit drain on EOFPhilip Langdale2022-08-231-2/+0
| | | | | | | | | | | | | | | We have previously had a problem where pull AOs (such as pipewire) would not reinitialize on a format change when going between two audio-only files. In such a situation, playback would stop after the first file. We initially attempted to fix this by explicitly draining on EOF, which solves that problem but introduces a blocking step where we don't actually want one, breaking gapless audio, and causing dropped frames at the end of playback for files with video in them too. So, let's undo these changes and do something better in the next commit.
* ao_pipewire: make sure not to exceed the available bufferThomas Weißschuh2022-08-211-1/+1
| | | | | | | | | | The error description in #10545 could indicate that we are overflowing we are corrupting the buffer metadata ourselves through out-of-bound writes. This check is also present in pw-cat so it seems to be expected for b->requested to exceed the actual available buffer space. Potential fix for #10545
* audio: don't try to drain non-existent AOThomas Weißschuh2022-08-211-1/+2
| | | | | | | | 52aed495cb ("audio: drain ao on EOF") introduced logic to drain an AO when EOF of the input has been reached. When no AO however is present this leads to a NULL-dereference. Fixes #10556
* vo_gpu_next: pass GL get_proc_addr pointer to libplaceboNiklas Haas2022-08-193-0/+11
| | | | | | | | | | | | | | | | | Facing down the multitude of ways to somehow wrangle the get_fn pointer out of the GL environment and into libplacebo, I decided the easiest is to just store it inside the GL struct itself. The lifetime of this get_fn function is a bit murky, since it's not clear on whether or not it survives the VO init call (especially in the case of the GL render API, which explicitly states that parameters do not need to survive the call they're passed to), so just add a disclaimer. (It's fine for us to use like this because `gpu_ctx_create` is still part of VO init) Closes https://code.videolan.org/videolan/libplacebo/-/issues/216
* ao_pipewire: test on FreeBSDThomas Weißschuh2022-08-182-0/+3
|
* mpv.desktop: add RIST protocol to desktop entryThe-head-obamid2022-08-181-1/+1
|
* osxbundle: add RIST protocol support to app metadataThe-head-obamid2022-08-181-0/+1
|
* stream_lavf: enable RIST protocol support via ffmpegThe-head-obamid2022-08-181-1/+1
|
* ao_pipewire: restructure logic a bitThomas Weißschuh2022-08-171-4/+3
|
* ao_pipewire: only try to read requested dataThomas Weißschuh2022-08-171-0/+4
|
* ao_pipewire: report all available info about chunkThomas Weißschuh2022-08-171-1/+5
| | | | | This allows the audio server better to make sense of the data instead of having to use heuristics.
* ytdl_hook: improve track detectionChristoph Heinrich2022-08-171-13/+12
| | | | | | | | | | | | | | | | Every format that was not detected as a video format was added to the audio tracks. This resulted in e.g. YouTube storyboards from ending up in the list of audio tracks. Now formats that are already known to be neither video formats nor audio formats, will also not end up in any track list. Formats where it is unknown if they are video or audio get added to tracks if `force_all_formats` is used, otherwise only formats that are known to contain video or audio become video or audio tracks respectively. https://github.com/yt-dlp/yt-dlp/issues/4373#issuecomment-1186637357
* misc/random: add xoshiro random number implementationLeo Izen2022-08-178-5/+124
| | | | | | | Add xoshiro as a PRNG implementation instead of relying on srand() and rand() from the C standard library. This, in particular, lets us avoid platform-defined behavior with respect to threading.
*