summaryrefslogtreecommitdiffstats
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* 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 Boxer2022-10-261-0/+9
| | | | | | | | | | | | | Wayland VO that can display images from either vaapi or drm hwdec The PR adds the following changes: 1. a context_wldmabuf context with no gl dependencies 2. no-op ra_wldmabuf and dmabuf_interop_wldmabuf objects no-op because there is no need to map/unmap the drmprime buffer, and there is no need to manage any textures. Tested on both x86_64 and rk3399 AArch64
* vo_gpu/hwdec: rename and introduce legacy names for some interopsPhilip Langdale2022-10-111-1/+1
| | | | | | | | | | | | 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)
* vo_gpu: hwdec: add Android hwdec utilizing AImageReadersfan52022-10-021-0/+9
|
* mpv.metainfo.xml: add XDG appstream metadata manifestVitaly Zaitsev2022-09-091-0/+1
|
* 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.
* misc/random: add xoshiro random number implementationLeo Izen2022-08-171-0/+1
| | | | | | | 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.
* meson: fix the build-date optionDudemanguy2022-08-161-1/+1
| | | | Rewrites are hard.
* meson: fix building without glDudemanguy2022-08-151-0/+1
| | | | This needs to be unconditionally added.
* meson: consistently use feature['foo']Dudemanguy2022-08-151-267/+246
| | | | | | | | | | Since the previous commit introduced the notion of a features dictionary that conveniently tells us whether or not to use a feature in a simple yes/no, we can make use of this everywhere in the build. Instead of doing something like 'if foo.()', change it to 'if feature['foo'] instead. This enforces a consistent standard instead of having a lot of different possible combinations of booleans that may or may not do something.
* meson: refactor generating config.hDudemanguy2022-08-151-412/+239
| | | | | | | | | | | | | | mpv has a ton of defines that are generated during building. Previously, the meson build just had this as a big giant wall of text that manually set each one but we can do this smarter. Instead, change the "features" object to a dictionary and have it hold the name of the feature and its value (true/false on whether it is enabled). Then at the end, just loop through it and reformat the name of the feature so it becomes HAVE_FEATURE. A side effect of this is that a lot of extra defines are generated that aren't actually used in the code, but the waf build worked like this for years anyway. A nice result of this is that the use of foo['use'] internally can be completely eliminated and replaced with feature['foo'] instead when needed.
* meson: reduce dictionary usageDudemanguy2022-08-151-98/+61
| | | | | | | The build was a bit overzealous with using dictionaries. These are fine for when the feature checking is more complicated, but there's no point in having them for the simplier things. This also eliminates the usage of the 'name' key completely.
* meson: add comment clarifying windows-internal-pthreadsDudemanguy2022-08-151-0/+5
|
* drm_common: remove hard dependency on drmIsKMS()sfan52022-08-111-0/+10
| | | | | | ae768a1e141eb88243e46757d41ca0cada9502b4 forgot to bump the required libdrm version however Debian 11 just barely misses the requirement, which is a good reason not to require it unconditionally anyway.
* hwdec/drmprime: add drmprime hwdec-interopPhilip Langdale2022-08-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the confusing landscape of hardware video decoding APIs, we have had a long standing support gap for the v4l2 based APIs implemented for the various SoCs from Rockship, Amlogic, Allwinner, etc. While VAAPI is the defacto default for desktop GPUs, the developers who work on these SoCs (who are not the vendors!) have preferred to implement kernel APIs rather than maintain a userspace driver as VAAPI would require. While there are two v4l2 APIs (m2m and requests), and multiple forks of ffmpeg where support for those APIs languishes without reaching upstream, we can at least say that these APIs export frames as DRMPrime dmabufs, and that they use the ffmpeg drm hwcontext. With those two constants, it is possible for us to write a hwdec-interop without worrying about the mess underneath - for the most part. Accordingly, this change implements a hwdec-interop for any decoder that produces frames as DRMPrime dmabufs. The bulk of the heavy lifting is done by the dmabuf interop code we already had from supporting vaapi, and which I refactored for reusability in a previous set of changes. When we combine that with the fact that we can't probe for supported formats, the new code in this change is pretty simple. This change also includes the hwcontext_fns that are required for us to be able to configure the hwcontext used by `hwdec=drm-copy`. This is technically unrelated, but it seemed a good time to fill this gap. From a testing perspective, I have directly tested on a RockPRO64, while others have tested with different flavours of Rockchip and on Amlogic, providing m2m coverage. I have some other SoCs that I need to spin up to test with, but I don't expect big surprises, and when we inevitably need to account for new special cases down the line, we can do so - we won't be able to support every possible configuration blindly.
* hwdec/dmabuf_interop: use AVDRMFrameDescriptor to describe dmabufsPhilip Langdale2022-08-031-2/+22
| | | | | | | | | | | | Annoyingly, libva and libdrm use different structs to describe dmabufs and if we are going to support drmprime, we must pick one format and do some shuffling in the other case. I've decided to use AVDRMFrameDescriptor as our internal format as this removes the libva dependency from dmabuf_interop. That means that the future drmprime hwdec will be able to populate it directly and the existing hwdec_vaapi needs to copy the struct members around, but that's cheap and not a concern.
* hwdec/vaapi: rename interops to reflect more general usePhilip Langdale2022-08-031-2/+2
| | | | | | | | | | | This is the first in a series of changes that will introduce a drmprime hwdec. As our vaapi hwdec is based around exporting surfaces as drmprime dmabufs, we've actually got a lot of useful code already in place in the GL/PL interops. I'm going to reorganise and adjust this code to make the interops usable with the new hwdec as well. The first step is to rename the files and functions. There are no functional or other changes here. They will come next.
* af_rubberband: add new engine option in rubberband 3.0.0Christoph Heinrich2022-08-031-0/+1
|
* meson: fix rst2html commandJ. Dekker2022-07-051-1/+1
|
* meson: add a summary at the end of configurationDudemanguy2022-06-271-0/+11
| | | | | | | | | | The meson build does a lot of checks and if you aren't familiar with the internals of the meson.build, it may not be clear what is actually enabled and what isn't. It turns out that meson has a handy function, summary, exactly for this. This just prints a pretty summary of some notable features in the build. It's not meant to be a comprehensive list, but rather just what users are likely to care the most about (i.e. x11, vulkan, etc.)
* meson: remove pointless d3d11 dictionaryDudemanguy2022-06-201-5/+0
| | | | | | | Immediately after this, d3d11 is defined again and the rest of the meson.build uses that. Probably, this dictionary was from the original meson PR and removing it was forgotten at some point while stuff was being rewritten.
* x11: support xorg present extensionDudemanguy2022-06-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds off of present_sync which was introduced in a previous commit to support xorg's present extension in all of the X11 backends (sans vdpau) in mpv. It turns out there is an Xpresent library that integrates the xorg present extention with Xlib (which barely anyone seems to use), so this can be added without too much trouble. The workflow is to first setup the event by telling Xorg we would like to receive PresentCompleteNotify (there are others in the extension but this is the only one we really care about). After that, just call XPresentNotifyMSC after every buffer swap with a target_msc of 0. Xorg then returns the last presentation through its usual event loop and we go ahead and use that information to update mpv's values for vsync timing purposes. One theoretical weakness of this approach is that the present event is put on the same queue as the rest of the XEvents. It would be nicer for it be placed somewhere else so we could just wait on that queue without having to deal with other possible events in there. In theory, xcb could do that with special events, but it doesn't really matter in practice. Unsurprisingly, this doesn't work on NVIDIA. Well NVIDIA does actually receive presentation events, but for whatever the calculations used make timings worse which defeats the purpose. This works perfectly fine on Mesa however. Utilizing the previous commit that detects Xrandr providers, we can enable this mechanism for users that have both Mesa and not NVIDIA (to avoid messing up anyone that has a switchable graphics system or such). Patches welcome if anyone figures out how to fix this on NVIDIA. Unlike the EGL/GLX sync extensions, the present extension works with any graphics API (good for vulkan since its timing extension has been in development hell). NVIDIA also happens to have zero support for the EGL/GLX sync extensions, so we can just remove it with no loss. Only Xorg ever used it and other backends already have their own present methods. vo_vdpau VO is a special case that has its own fancying timing code in its flip_page. This presumably works well, and I have no way of testing it so just leave it as it is.
* vo: move wayland presentation to separate filesDudemanguy2022-06-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Wayland had some specific code that it used for implementing the presentation time protocol. It turns out that xorg's present extension is extremely similar, so it would be silly to duplicate this whole mess again. Factor this out to separate, independent code and introduce the mp_present struct which is used for handling the ust/msc values and some other associated values. Also, add in some helper functions so all the dirty details live specifically in present_sync. The only wayland-specific part is actually obtaining ust/msc values. Since only wayland or xorg are expected to use this, add a conditional to the build that only adds this file when either one of those are present. You may observe that sbc is completely omitted. This field existed in wayland, but was completely unused (presentation time doesn't return this). Xorg's present extension also doesn't use this so just get rid of it all together. The actual calculation is slightly altered so it is correct for our purposes. We want to get the presentation event of the last frame that was just occured (this function executes right after the buffer swap). The adjustment is to just remove the vsync_duration subtraction. Also, The overly-complicated queue approach is removed. This has no actual use in practice (on wayland or xorg). Presentation statistics are only ever used after the immediate preceding swap to update vsync timings or thrown away.
* meson: use require when checking for vdpauDudemanguy2022-06-191-2/+6
| | | | | | | | Technically this was wrong. If you passed -Dvdpau=enabled but did not have x11 (a requirement for this), the build would silently just not build the vdpau VO. The correct behavior is for it to be a hard error. Accomplish this by using the require function and making sure that x11 is indeed being used before attempting to find the library.
* meson: rearrange library dependency order to avoid crash with fontconfigCrend King2022-06-181-2/+4
| | | | | | | | | In win32 build, if libass and libfontconfig appear after libmingwex during linking, crash happens whenever fontconfig calls to opendir(). Moving them before ffmpeg makes sure they always appear first. More info on https://github.com/shinchiro/mpv-winbuild-cmake/issues/217.
* audio: add AVChannelLayout helpers to convert from/to mp_chmapJan Ekström2022-06-121-1/+10
| | | | | | | | | This is the new FFmpeg channel layout structure, which now combines channel count and layout into a single location. Only unspecified (channel count only) and native (channel layout mask based) layouts are currently supported for the initial move towards non-deprecated APIs.
* vo: add new vaapi-wayland driverAaron Boxer2022-05-241-0/+6
| | | | | | | This driver makes use of dmabuffer and viewporter interfaces to enable efficient display of vaapi surfaces, avoiding any unnecessary colour space conversion, and avoiding scaling or colour conversion using GPU shader resources.
* various: remove trailing whitespaceGuido Cella2022-05-141-1/+1
|
* meson: compile mpv.exe as a win32 gui applicationDudemanguy2022-05-051-6/+1
| | | | | | | | | | | | | | | | | Some compiler flags were passed to mpv in order to get it to build as a gui application on windows. However on the meson build, this always resulted in mpv being built as a console application. This is because the function for making executables in meson specifically has a kwarg called win_subsystem* which defaults to 'console'. That always added link arguments at the end which compiled mpv.exe as a console application. The correct thing to do is to remove all of the subsystem-related flags in the meson build and use the win_subsystem kwarg as intended by setting it to 'windows,6.0'. For mpv.com, we can remove the -Wl,--subsystem,console flag since meson will set this by default in that executable. This makes mpv.exe function correctly and open with the pseudo-gui while mpv.com acts as a console wrapper. https://github.com/mesonbuild/meson/commit/1a0603835e3c9f1047d9b7694efc996219a422e4
* build: add avcodec jpegxl dependency versionsLeo Izen2022-04-281-0/+1
| | | | | Add the libavcodec version check for AV_CODEC_ID_JPEGXL to the build system rather than to any file that references it.
* vo_gpu_next: switch to unpooled hwdec mappingNiklas Haas2022-04-111-3/+3
| | | | | | | | | | | | This makes use of the new frame acquire/release callbacks to hold on to hwdec images only as long as necessary. This should greatly improve the smoothness/efficiency of hwdec interop, by not holding on to them for longer than needed. This also avoids the need to pool hwdec mappers altogether. Should fix #10067 as well, since frames are now only mapped when we actually use them.
* hwdec_vaapi_vk: rename to vaapi_plNiklas Haas2022-03-031-8/+8
| | | | | | | | There's really nothing vulkan-specific about this hwdec wrapper, and it actually works perfectly fine with an OpenGL-based ra_pl. This is not hugely important at the time, but I still think it makes sense in case we ever decide to make vo_gpu_next wrap OpenGL contexts to ra_pl instead of exposing the underlying ra_gl.
* vo_gpu_next: remove/simplify plane flipping hacksNiklas Haas2022-02-251-3/+3
| | | | | | | | | libplacebo v198 fixed this properly by adding the ability to flip planes directly, which is done automatically by the swapchain helpers. As such, we no longer need to concern ourselves with hacky logic to flip planes using the crop. This also removes the need for the OSD coordinate hack on OpenGL.
* vo_gpu_next: refactor subtitle renderingNiklas Haas2022-02-211-3/+3
| | | | | | | | | | | | | | | Render subs at the output resolution, rather than the video resolution. Uses the new APIs found in libplacebo 197+, to allow controlling the OSD resolution even for image-attached overlays. Also fixes an issue where the overlay state did not get correctly updated while paused. To avoid regenerating the OSD / flushing the cache constantly, we keep track of OSD changes and only regenerate the OSD when the OSD state is expected to change in some way (e.g. resolution change). This requires introducing a new VOCTRL to inform the VO when the UPDATE_OSD-tagged options have changed. Fixes #9744, #9524, #9399 and #9398.
* meson: remove horrifying macos luajit hackDudemanguy2022-02-071-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | See the previous commit for the full explanation. Basically, luajit 2.0 has a bad pc file on macos that causes libmpv to fail during build. The workaround was, if the os was darwin and luajit was found, to save a full luajit dep and a partial luajit dep with the link args removed. The partial dep was used for compiling libmpv, and the full dep was used for the actual mpv executable. This worked and was needed for the CI to pass but it sucked. Since the previous commit now makes the CI grab lua 5.1, we don't need all this crap anymore. Just delete it and treat the dependency normally. This does effectively mean that building libmpv with luajit 2.0 on macOS will no longer work with the meson build. However libraries not being built correctly is not a mpv-specific issue. The waf build will succeed for some reason, but it has known issues and it would be better if it just failed honestly. An upstream developer said years ago that that macOS users should use the 2.1 branch (and there's no release of course). In any case, no macOS user should be building mpv with luajit 2.0, so we shouldn't be going out of our way to support this. https://github.com/mpv-player/mpv/issues/7512 https://github.com/LuaJIT/LuaJIT/issues/521#issuecomment-562999247
* libplacebo: bump minimum dependency to 4.157Niklas Haas2022-02-031-1/+1
| | | | | | This has been the latest stable release for about half a year now. This version in particular lets us get rid of all the deprecation warnings in the older code. (See the following commits)
* build: rename libplacebo version checkNiklas Haas2022-02-031-4/+4
| | | | | Rename from "libplacebo-v4" to "libplacebo-next" to more closely capture the intent, since this will become libplacebo v5 eventually (tm).
* meson: fix libdl existence check for *bsd systemsAndrew Krasavin2022-02-021-6/+7
|
* meson: add version check to wayland-protocolsDudemanguy2022-01-291-1/+1
| | | | | This was mistakenly left out. mpv requires at least 1.15 for the xdg-decoration protocol. This just matches the waf build.
* build: remove aviocontext bytes_read checkDudemanguy2022-01-251-8/+0
| | | | | | | | | | | | | | | | This define was always just a stopgap for that two month period (August 2021 - October 2021) where the bytes_read field in ffmpeg was completely missing. Before that time, it was a private member in a struct (which mpv used). Afterwards, it officially became public. Fortunately, the lack of this field never actually made it into a release, so it could have only possibl