summaryrefslogtreecommitdiffstats
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* Revert "vo_gpu_next: use pl_dispatch_info_move to avoid useless data copy"sfan52023-07-231-2/+2
| | | | | | | | We wanted to preserve the libplacebo v5.264.0 requirement for gpu_next for this release, since this is the what most Linux distributions are shipping. The VLC 3 <-> libplacebo v6 situation is an additional reason distros are not likely to ship the newest libplacebo release soon. This reverts commit b73d96776cfee61f88bf60b27315baab32a2115d.
* build: make dmabuf-wayland a build option and require drmDudemanguy2023-07-141-8/+12
| | | | | | | It makes more sense as an option at this point. Also libdrm is not optional at all. You have to get a drm format and modifier for this to even work (the VO will just fail without DRM). Just hard require it and remove the guards. vaapi can remain optional.
* vo_gpu_next: use pl_dispatch_info_move to avoid useless data copyKacper Michajłow2023-07-021-2/+2
| | | | | Instead copy the data on-demand when VOCTRL_PERFORMANCE_DATA is requested.
* video/image_writer: add avif screenshot supportcloud116652023-07-011-0/+1
| | | | | | | | | | Notes: - converts the (image) write() api to filenames, because using avio with FILE* is a pain. - adds more debug logs for screenshots. build: rename av1 dependency to avif_muxer wscript: unify lavf dependency with meson
* osdep: add mp_get_user_langsrcombs2023-06-251-1/+4
|
* osdep: move cfstr<->cstr conversions to a new apple_utils.c filercombs2023-06-251-1/+2
|
* misc: add language-matching utilitiesrcombs2023-06-251-0/+1
|
* ao_pipewire: bump dependency to 0.3.48Thomas Weißschuh2023-06-211-1/+1
| | | | | | | | Now that Debian 12 is release bump the minium required version to what is provided in Ubuntu Jammy (22.04). The same as has been done for the wayland dependencies. Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
* wayland: bump wayland-protocols to 1.25Dudemanguy2023-06-161-1/+1
| | | | | 1.27 would have been nicer but ubuntu 22.04 is on 1.25 so we'll just compromise.
* wayland: bump required version to 1.20Dudemanguy2023-06-161-2/+2
| | | | This lets us remove some ifdefs.
* hwdec_cuda: bump required headers version for timeline semaphoresPhilip Langdale2023-06-041-1/+1
| | | | | | | | We're moving to using timeline semaphores for synchronisation between cuda and vulkan. It's only required with libplacebo-next right now, but eventually our baseline libplacebo requirement will increase, so we will need new enough nvidia headers that include the necessary declarations.
* hwdec_vulkan: check for the correct libplacebo versionPhilip Langdale2023-05-291-2/+2
| | | | It's 6.278, rather than 5.278.
* hwdec_vulkan: simplify requirement checks for Vulkan interopPhilip Langdale2023-05-291-4/+3
| | | | | | | | | | | | | I originally wrote this trying to avoid doing an explicit version check on the headers, but it just makes things more confusing, and the requirements harder to understand. So, Vulkan interop now takes a dependency on the header release where they finalised the video decode headers. VK_EXT_descriptor_buffer was added in 1.3.235, so that's covered as well. Along the way I fixed a bug in the waf build where it was depending on libplacebo-next instead of libplacebo-decode.
* hwdec_vulkan: add Vulkan HW InteropPhilip Langdale2023-05-281-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan Video Decoding has finally become a reality, as it's now showing up in shipping drivers, and the ffmpeg support has been merged. With that in mind, this change introduces HW interop support for ffmpeg Vulkan frames. The implementation is functionally complete - it can display frames produced by hardware decoding, and it can work with ffmpeg vulkan filters. There are still various caveats due to gaps and bugs in drivers, so YMMV, as always. Primary testing has been done on Intel, AMD, and nvidia hardware on Linux with basic Windows testing on nvidia. Notable caveats: * Due to driver bugs, video decoding on nvidia does not work right now, unless you use the Vulkan Beta driver. It can be worked around, but requires ffmpeg changes that are not considered acceptable to merge. * Even if those work-arounds are applied, Vulkan filters will not work on video that was decoded by Vulkan, due to additional bugs in the nvidia drivers. The filters do work correctly on content decoded some other way, and then uploaded to Vulkan (eg: Decode with nvdec, upload with --vf=format=vulkan) * Vulkan filters can only be used with drivers that support VK_EXT_descriptor_buffer which doesn't include Intel ANV as yet. There is an MR outstanding for this. * When dealing with 1080p content, there may be some visual distortion in the bottom lines of frames due to chroma scaling incorporating the extra hidden lines at the bottom of the frame (1080p content is actually stored as 1088 lines), depending on the hardware/driver combination and the scaling algorithm. This cannot be easily addressed as the mechanical fix for it violates the Vulkan spec, and probably requires a spec change to resolve properly. All of these caveats will be fixed in either drivers or ffmpeg, and so will not require mpv changes (unless something unexpected happens) If you want to run on nvidia with the non-beta drivers, you can this ffmpeg tree with the work-around patches: * https://github.com/philipl/FFmpeg/tree/vulkan-nvidia-workarounds
* vo_dmabuf_wayland: rewrite around wl_listDudemanguy2023-05-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_dmabuf_wayland worked by allocating entries to a pool and then having a lot of complex logic dealing with releasing buffers, pending entries, etc. along with some other not so nice things. Instead, we can rewrite this logic so that the wl_buffers created by the imported dmabuf is instead stored in a linked list, wl_list. We can simply append our buffers to the list when needed and destroy everything at the end. On every frame, we can check the ids of our surfaces and reuse existing buffers, so in practice there will only ever be a handful at a time. Some other small changes were made in an attempt to organize the vaapi/drmprime code a little better as well. An important change is to always enforce at least a minimum number of buffers. Certain formats would not make enough unique buffers, and this results in flickering/artifacts occuring. The old way to attempt to deal with this was to clear out all the existing buffers and remake them, but this gets complicated and also didn't always work. An easy solution to this is just create more buffers which appears to solve this problem. The actual number needed is not really based on anything solid, but 8 is a reasonable number to create for the lifetime of a file and it seems to do the trick. Additionally, seeking/loading new files can result in flicker artificts due to buffers being reused when they shouldn't. When that happens, we flip a bool so all the buffers get destroyed in draw_frame to avoid any visual glitches.
* osdep: separate out macos paths from path-unix.cDudemanguy2023-05-091-2/+7
| | | | | | | | | | | macOS really has completely different path conventions that mpv doesn't take into account and it treats it just like any other old unix-like system. This means mpv enforces certain conventions on it (like all the XDG stuff) that doesn't really apply. Since we'd like to use more of this but at the same time not distrupt mac users even more, let's just copy and paste the current code to a new file, update the build and call it a day. This way, the paths of these two platforms can more freely diverge.
* meson: bump required version to 0.62Dudemanguy2023-05-021-10/+6
| | | | | This lets us use meson's custom dl dependency as well as the version method when checking rst2pdf's version.
* meson: use the new build_options methodDudemanguy2023-04-111-6/+9
| | | | | | | | This finally allows us to put any user defined options into the CONFIGURATION variable like what waf does. The arbitrary hardcoded fallback is left in place for old meson versions. Also update the documentation in regards to the mpv-configuration variable to be relevant to meson.
* win32: follow Windows settings and update dark mode stateKacper Michajłow2023-04-041-0/+1
| | | | | | | | | | | | | | | | | 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
* build: add check for eglext_angle.h when checking for ANGLEKacper Michajłow2023-04-021-3/+8
| | | | | | 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.
* build: add an option to control gpu-nextKacper Michajłow2023-03-281-10/+10
| | | | Also simplify meson logic
* meson: fix libplacebo-next version comparisonPhilip Langdale2023-03-261-1/+1
| | | | Should just compare against '264'.
* meson: bump libplacebo-next required version to 5.264Philip Langdale2023-03-261-3/+3
| | | | | | | 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.
* meson: rst2pdf handle dependency fileThomas Weißschuh2023-03-241-1/+11
|
* test: integrate unittests with mesonDudemanguy2023-03-021-14/+16
| | | | | | | | | | | | 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.
* player: remove unittest optionDudemanguy2023-03-021-17/+0
| | | | | | | | | 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.
* zimg: add ZIMG_TRANSFER_ST428 mappingKacper Michajłow2023-03-021-0/+1
|
* command: add platform propertyDudemanguy2023-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This returns the value of the target OS that mpv was built on as reported by the build system. It is quite conceivable that script writers and API users would need to make OS-dependent choices in some cases. Such people end up writing boilerplate/hacks to guess what OS they are on. Assuming you trust the build system (if you don't, we're in really deep trouble), then mpv actually knows exactly what OS it was built on. Simply take this information at configuration time, make it a define, and let mp_property_platform return the value. Note that mpv has two build systems (waf and meson), so the names of the detected OSes may not be exactly the same. Since meson is the newer build system, the value of this property follows meson's naming conventions*. In the waf build, there is a small function to map known naming deviations to match meson (i.e. changing "win32" to "windows"). waf's documentation is a nightmare to follow, but it seems to simply take the output of sys.platform in python and strip away any trailing numbers if they exist (exception being win32 and os2)*. *: https://mesonbuild.com/Reference-tables.html#operating-system-names *: https://waf.io/apidocs/Utils.html#waflib.Utils.unversioned_sys_platform
* Vulkan: add configure check for VK_KHR_display extensionrcombs2023-02-201-1/+7
| | | | This allows building directly against ICDs that don't implement this extension.
* meson: move vector check inside of meson.buildDudemanguy2023-02-021-3/+5
| | | | | It's three lines. There's no real reason to have this as a separate file when we've removed every other compile check sourced from outside files.
* meson: check macos touchbar with has_headerDudemanguy2023-02-021-2/+2
|
* meson: check pthread provider with has_functionDudemanguy2023-02-021-10/+10
| | | | | Previously, we did this doing code fragments, but we can be a bit more clever and use has_function as well as the platform we're on.
* meson: replace check_header with has_headerDudemanguy2023-01-311-2/+2
| | | | | | | | It turns out that there's a has_header check, and we should actually be using that instead. We only care here if the header actually exists so the pre-processor check is all that is needed. check_header depends on what arguments the user passes among other things. That makes it more complicated than necessary for our purposes.
* meson: actually use -Werror=format-securityDudemanguy2023-01-311-1/+1
| | | | | | We tested for this flag, but never added -Wformat in addition to -Werror=format-security. The latter was silently ignored and actually did nothing.
* meson: add missing library dep for egl_angle_lib checkKacper Michajłow2023-01-281-0/+5
|
* meson: reuse libmpv objects for cplayerThomas Weißschuh2023-01-261-10/+13
| | | | | | | When building both cplayer and libmpv in the same build previously all sources were built twice. By reusing the objects from libmpv in cplayer we can thus save 50% percent of the build steps.
* meson: skip some unneeded macos-specific checksDudemanguy2023-01-201-23/+24
| | | | | A couple of programs were always unconditionally searched for, but we don't have to do this if we're not on darwin.
* meson: drop feature plain-glThomas Weißschuh2023-01-191-2/+1
|
* meson: limit vaapi checksThomas Weißschuh2023-01-191-3/+3
|
* meson: don't add libmpv and cplayer features to conf_dataThomas Weißschuh2023-01-191-3/+4
| | | | | | | Core code should not use these features as it would mean that a libmpv build could change an mpv executable and vice-versa. Also changing one of them should not force a full recompile of the other one through a change to config.h.
* meson: remove dependency from libmpv to plain-glThomas Weißschuh2023-01-191-2/+2
| | | | | | | | The libmpv feature should not have any impact on the built core code. Otherwise a mpv executable compiled in a build together with libmpv has different features than one from a build without. The gl feature doesn't hurt, so always enable it.
* meson: add simple test executable for libmpvThomas Weißschuh2023-01-191-0/+3
| | | | This can be used to make sure that the built libmpv is functional.
* TOOLS/docutils-wrapper: make executable + alphabetizeDudemanguy2023-01-131-1/+1
| | | | | | I should have caught this during review but the feature was too cool and I didn't really pay attention (sorry). For consistency with the rest of the scripts here.
* meson: also search for rst2html with .py extensionIonen Wolkens2023-01-131-1/+1
| | | | | This allows using rst2html.py from docutils if present, this was already done for rst2man.py (unneeded for rst2pdf).
* meson: dynamically compute dependencies for manpage and html buildThomas Weißschuh2023-01-081-2/+12
| | | | | | | | | This allows us to rebuild the manpages and html documentation only when necessary. It is not necessary to manually keep the list of dependencies up to date. Unfortunately rst2pdf does not yet support this feature, see https://github.com/rst2pdf/rst2pdf/issues/1108
* build: add configure test for POSIX shm for the sake of vo_kittysfan52022-12-261-0/+5
| | | | Android's POSIX coverage is pretty sketchy but not like we have a choice.
* vo_kitty: Introduce modern sixel alternativeMia Herkt2022-12-211-0/+1
| | | | | | | | | | | | | See https://sw.kovidgoyal.net/kitty/graphics-protocol/ This makes no attempt at querying terminal features or handling terminal errors, as it would require mpv to pass the response codes from the terminal to the vo instead of interpreting them as keystrokes made by the user and acting very unpredictably. Tested with kitty and konsole. Fixes #9605
* ffmpeg: increase minimum required version to 4.4Philip Langdale2022-12-011-7/+7
| | | | | | | | | Now that 0.35 has been released, we can consider increasing our minimum required ffmpeg version. Currently, we think 4.4 is the most recent version we can move to (from the current requirement of 4.0). This allows us to remove a few conditionals. There are more that we won't be able to remove unless we move further up to 5.1.
* meson: fix stdatomic detection on bsdDudemanguy2022-11-221-3/+4
| | | | | | | BSDs use compiler-rt instead of libatomic for atomic types. In this case, we can handle it similar to how dl is detected. Check for the library (allowing for it to fail), and then check for a header symbol while linking latomic. Fixes #10906.
* meson: unbreak dl check on BSDs without libdlDudemanguy2022-11-201-1/+1
| | | | | | Regression from 1835dfc05c8298262dbf8e08a31d61bbfecdb30b. The actual libdl dependency is not always required for the function symbol check. Fixes #10901.
* meson: prepend MPV_CONFDIR path with prefixDudemanguy2022-11-191-1/+1
| | | | | | | | | | | | | | Meson uses the sysconfdir option for setting the global config directory. This conveniently defaults to /etc if the prefix is set to /usr which is nice for linux distros. BSDs tend to use /usr/local which causes this value to become 'etc' by default which is not an absolute path so you would need to set something like -Dsysconfdir=/usr/local/etc as well in the configuration step. It turns out we can have our cake and eat it too by just joining the paths of prefix and sysconfdir together. In the case where -Dprefix=/usr, this still results in /etc/mpv as the path since the path joining logic just drops the leading '/usr/'. For the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This fixes #10882.
* meson: fix macos-touchbar checkDudemanguy2022-11-111-9/+5
| | | | | | | | Apparently, it is possible for touchbar.m to compile on non-macos machines. Also, the disable switch didn't actually work either. Fix this by using the require() function and making sure that Cocoa (should be apple-only) is found in addition to the compile check passing which is what waf does. Fixes #10847.
* meson: move dmabuf-wayland specific files under the right checkDudemanguy2022-11-031-3/+3
| | | | | This doesn't need to be under the generic wayland check, but the dmabuf-wayland one. Matches the waf build.
* meson: add more hardcoded values to configurationDudemanguy2022-10-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | mpv has a CONFIGURATION define which is defined at configure time in both build systems and printed out when you use verbose flags. In waf, this is line is exactly what the user passes on cli at configure time. In meson, there's currently no way to do that (someone did recently open up a PR that would make this possible), so we just hardcode the prefix and call it a day. This is a bit of a tangent, but the build also copies waf and sets an optimize variable (true or false) that is also printed out on verbose output. For waf, this makes some sense because the build has a specific --optimize option (internally all it does is pass -O2). In meson, optimizing is a built-in option and we just set anything that's not -O0 as "optimize". Furthermore, there is a new optimization option added in meson 0.64 called "plain" which passes no flags at all* so this logic would need to be updated to account for this. In retrospect, this is all just stupid though. optimization is not a boolean value and there's no real use for treating it like one just because that's what waf does. Let's remove it from the features array. Instead, we can expose this information in the CONFIGURATION variable along with the prefix option so we know exactly what optimization was used in the compiled executable. For good measure, let's also throw in buildtype since it's related. *: https://github.com/mesonbuild/meson/commit/a590cfde0cf719c637b75e4784be0c0ae60e3b1f
* meson: use 'dl' instead of 'libdl' in find_libraryDudemanguy2022-10-291-1/+1
| | | | | | | Meson's master branch helpfully prints out a warning here now saying that "find_library('libdl') starting in "lib" only works by accident and is not portable". We'll go ahead and trust them and instead change this to dl which works with no issues.
* ci: use meson setup build instead of meson buildDudemanguy2022-10-291-1/+1
| | | | | | | | | | | | The old "meson build" build command was actually deprecated a few months ago*. It turns out that you're supposed to use "meson setup build" instead which has been around for years. Go ahead and be a good citizen and update this in the CI. Also replace any mention of "meson build" with "meson setup build" in the documentation as well and change the one random hardcoded string we have in meson.build to "meson configure build" (might as well). *: https://github.com/mesonbuild/meson/commit/3c7ab542c0c4770241eae149b0d4cd8de329aee0
* ao_pipewire: compatibility for libpipewire 0.3.19Thomas Weißschuh2022-10-261-1/+1
|
* vo_vaapi_wayland: remove, as it is superceded by vo_dmabuf_waylandAaron Boxer2022-10-261-5/+0
|
* vo_dmabuf_wayland: wayland VO displaying dmabuf buffersAaron Boxer