summaryrefslogtreecommitdiffstats
path: root/TOOLS
Commit message (Collapse)AuthorAgeFilesLines
* TOOLS: add an interface-changes generator scriptDudemanguy8 days1-0/+83
| | | | | Convenience script to automatically generate interface-changes.rst based on the workflow introduced in the previous commit.
* osxbundle: avoid running `codesign` with deprecated `--deep` argumentDavid Knaack2024-03-071-1/+7
| | | | | | | | | `--deep` is deprecated as of macos 13.0. It is also not supported by alternative `codesign` implementations like [sigtool](https://github.com/thefloweringash/sigtool). Related: https://github.com/NixOS/nixpkgs/pull/270691
* osxbundle: activate Game Mode with App bundleder richter2024-03-071-0/+2
| | | | | | | | | | | | | | | mpv isn't really a game and categorising our App bundle as game seems counterintuitive. though as a video player it does have some similarities, possibly needing considerably CPU and GPU resources and low presentation latencies. the macOS Game Mode promises exactly that, it gives App the highest priority access to CPU and GPU resources and lowers usage for background tasks. sadly the Game Mode can only be activated by categorising the App as a game and that is only possible with an App bundle and not as a command line tool.
* osxbundle: fix bundling when homebrew is not installedder richter2024-02-291-1/+8
| | | | Fixes #13603
* osxbundle: use dylib script directly instead of in a subprocessder richter2024-02-242-4/+5
| | | | | | | | | | | | before errors and outputs where ignored from the subscript and the main script didn't fail nor did it output anything. with this change the script properly outputs everything to stdout and stderr. in the case the dylib script fails the whole script fails now. the main function in dylib_unhell was kept since it can still be used individually without the oscbundle script. the script had to be renamed with an underscore to make it importable.
* osxbundle: add homebrew vulkan loader location to search pathder richter2024-02-241-0/+4
|
* osxbundle: resolve loader_path on rpath retrievalder richter2024-02-241-1/+6
| | | | | rpaths can be relative to the current object folder path. resolve those paths.
* osxbundle: remove unused importder richter2024-02-241-1/+0
|
* osxbundle: fix syntax warning with python 3.12der richter2024-02-241-3/+3
|
* various: make mentions of macOS consistentder richter2024-02-211-1/+1
| | | | | change all mentions and variations of OSX, OS X, MacOSX, MacOS X, etc consistent. use the official naming macOS.
* osxbundle: add optional source path argumentder richter2024-02-201-9/+11
|
* osxbundle: remove old version retrieval fallbackder richter2024-02-201-4/+3
|
* osxbundle: bundle vulkan driver and layersder richter2024-02-201-0/+72
| | | | | | | only bundle synchronization2 layer for older vulkan/MoltenVK versions where it is needed. Fixes #13232
* f_auto_filters: change fallback deinterlace to bwdifDudemanguy2024-01-211-1/+1
| | | | | | | I don't actually deinterlace ever but allegedly this is better than yadif, and there's no real reason to not have this be the fallback deinterlace when we're not using hw frames. Also change various mentions of yadif to bwdif. Ref #12835.
* TOOLS/autocrop.lua: drop Libav mentionllyyr2024-01-201-1/+1
|
* scripting: don't observe properties with type nilGuido Cella2024-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | mp.observe_property('foo', nil, ...) calls the handler at least 2 times on each playlist change even when the property doesn't change. This is dangerous because if you haven't read observe_property's documentation in a long time this is easy to forget, and you can end up using it for handlers that are computationally expensive or that cause unintended side effects. Therefore, this commit discourages its use more explicitly in the documentation, and replaces its usages in scripts. For console.lua, observing focused with type nil leads to calling mp.osd_message('') when changing file while playing in the terminal with the console disabled. I don't notice issues from this, but it's safer to avoid it. For playlist and track-list this doesn't really matter since they trigger multiple changes on each new file anyway, but changing it can avoid encouraging people to imitate the code. One usage of none in stats.lua is kept because according to b9084dfd47 it is a hack to replicate the deprecated tick event.
* TOOLS/lua/autoload: skip loading when playback is abortedsunpenghao2024-01-201-0/+6
| | | | | | Quickly going through a directory with too many loadable files causes the autoload tasks to pile up and exiting the player will take forever. Avoid this by skipping loading when playback is aborted.
* osxbundle: sign bundle with ad-hoc pseudo identityder richter2023-11-151-0/+6
| | | | | | | | | without a developer license and the corresponding certificate we can't sign our app bundle properly. instead use the ad-hoc pseudo identity. there. i am not sure what restrictions we have because of that, but it's the only way we can pseudo sign the app bundle. Fixes #12116
* osxbundle: remove mpv-bundle symlink to allow code signingDaniel Brookman2023-11-152-7/+3
| | | | | | | | | | | | | | | | | | | Apps on Apple silicon have to be codesigned to run, but you can't codesign bundles that have a symlink for the main executable. The "mpv-bundle" symlink was used as the bundle's main executable because it makes the execution name of the binary different. Launch Services runs the CFBundleExecutable key from Info.plist when launching a bundle, so by comparing the execution name to the name of the symlink, you can check if that's how the binary was launched. This replaces that detection method by moving the MPVBUNDLE environmental variable into Info.plist. Launch Services will set anything in LSEnvironment as environmental variables before launching the bundle, so we're able to check for it instead of needing to differentiate the execution name of the binary. Fixes #12116
* osxbundle: resolve relative linked dependency pathsder richter2023-11-151-12/+63
| | | | | | | | | | not all dependencies are linked with an absolute path but rather are relatively linked via @rpath or @loader_path. in those cases we have to resolve the paths to those dependencies ourselves and change the linking with install_name_tool to be relative to the @executable_path of the binary within bundle. Fixes #11897
* TOOLS/macos-sdk-version: remove legacy sdk version retrievalder richter2023-11-101-25/+10
| | | | | | | | | | | | | | | | | | | | | | | older macOS dev tools were inconsistent with the way how SDK versions were returned, some truncated the minor versions. in those cases the SDK version had to be retrieved through the SDK build version. recently the scheme for the SDK build version changed that our heuristic for converting it to an SDK version produced wrong version strings. the stride of the minor version changed from 1 to 2, so SDK versions ended up higher than they actually were. furthermore macOS 11 was hardcoded. since Xcode 12 Apple fixed the SDK version retrieval and it is no longer truncated when using Xcode as dev tools. Xcode 12 is also the latest supported version on macOS 10.15, which is also our oldest supported version. we can remove the old SDK build version conversation and use the Xcode only tool to retrieve the SDK version in the case Xcode is used as dev tools. furthermore this als keeps support for Xcode 11 where the problem wasn't fixed yet, but is still a supported version on macOS 10.15. Fixes #9907
* meson: do the macos sdk version comparison in mesonDudemanguy2023-10-291-12/+5
| | | | | | | | Since we can no longer rely on distuils for a version comparison, let's modify the macos-sdk-version script so it returns multiple potential versions to meson. Then use meson's built-in version comparison to pick the right one instead. This avoids the complication of needing certain python packages installed since everything simply uses stdlib functions.
* TOOLS/{file2string,matroska}: drop unneeded stdout outputDudemanguy2023-10-282-12/+3
| | | | | | This was originally for the waf build, and then later writing the output to a file was added for meson. Since the waf build is no longer around anymore, remove the dead code.
* TOOLS/macos-sdk-version: use packaging instead of distutils for versionDudemanguy2023-10-271-2/+2
| | | | | | | | | Python 3.10 deprecated disutils and then removed it in 3.12. The macos sdk check uses the version compare from there, so it needs to be replaced with something else. So instead use the API from the packaging module which is also widely available and a fit replacement. Fixes #12762.
* TOOLS/autocrop.lua: disable hwdec when needed instead using -copy oneKacper Michajłow2023-10-181-4/+3
| | | | | | | This is more stable in practice. Avoids switching between possibly different hwdecs and avoids unnecessary init. Software decoding should be more stable and possibly faster overall for decoding this small portion of video needed for cropdetect.
* TOOLS/autocrop.lua: add support for detect_min_ratioKacper Michajłow2023-10-071-1/+9
| | | | This was lost in 6b963857c0
* TOOLS/autocrop.lua: simplify codeGuido Cella2023-10-071-30/+14
| | | | | Refactor code that is no longer necessary after replacing vf=crop with video-crop. There is no change in behavior.
* TOOLS/autocrop.lua: update commentGuido Cella2023-10-061-64/+44
|
* TOOLS/lua/autoload: bump the msg-level of some loggingDudemanguy2023-10-031-6/+6
| | | | | | | msg.info for when you're potentially adding hundreds of files is way too spammy and not really useful (autoload loads files, what?). Bump it up to msg.verbose. Also bump up the previously existing msg.verbose logs up to msg.debug to keep the difference in log levels. Fixes #12551.
* TOOLS/autocrop.lua: switch to auto-copy hwdec during cropdetectGuido Cella2023-09-211-0/+20
| | | | | | | I didn't set file-local-options/hwdec because you have to store the hwdec value to restore it after cropdetect anyway, and if the user manually changes hwdec after cropdetect, the new value isn't reset when changing file.
* TOOLS/autocrop.lua: cleanup timers correctlyGuido Cella2023-09-211-1/+1
| | | | | | | If you change file while cropdetect is active and you try to crop the next video, it fails with "Already cropdetecting!". This is because timers.detect_crop wasn't cleared correctly, only the timer variable local to the loop was being set to nil.
* TOOLS/autocrop.lua: use VO crop alwaysKacper Michajłow2023-09-201-47/+12
| | | | | There is no reason not to and this significantly reduces script complexity.
* options: make video-crop validation more strictKacper Michajłow2023-09-201-2/+2
|
* TOOLS/matroska.py: add PixelCrop* elementsKacper Michajłow2023-09-171-0/+4
|
* TOOLS/lua/autoload: rename local variable to lowercaseChristoph Heinrich2023-09-151-6/+6
|
* TOOLS/lua/autoload: pass extensions to recursive callChristoph Heinrich2023-09-151-1/+1
| | | | Closes #12400
* TOOLS/lua/autoload: change EXTENSIONS_TARGET to a local variabledyphire2023-09-141-3/+4
|
* TOOLS/lua/autoload: fix specify loading only one type of filesdyphire2023-09-141-1/+1
| | | | Fixes: https://github.com/mpv-player/mpv/commit/5100e7acbabd52b7ebc996e1c73df059e7664018
* TOOLS/lua/autoload: add directory_mode optionChristoph Heinrich2023-09-131-2/+14
| | | | | | This option behaves the same as the builtin one, and if it's value is anything other then recursive|lazy|ignore it will fall back on the builtin one as a sort of "auto" mode. It defaults to that auto mode.
* TOOLS/lua/autoload: add recursive directory loadingChristoph Heinrich2023-09-131-36/+63
| | | | Recursion depth has been limited to 20, the same depth the demuxer uses.
* TOOLS/lua/autoload: avoid adding entries to the playlist more then onceChristoph Heinrich2023-09-131-13/+15
| | | | | Playlist entries should be added at most once, independent of if they got added by autoload or not.
* TOOLS/lua/autoload: support directoriesChristoph Heinrich2023-09-131-8/+22
| | | | | | | | | Adds support for adding directories to the playlist in addition to files. The propertiy `directory-mode` controls if directories get added. Recursive directory loading will get added in a later commit. Directories get sorted after files to behave the same way mpv behaves when it loads directories directly.
* autocrop.lua: enable vo_crop mode by defaultKacper Michajłow2023-09-081-1/+1
| | | | | It is just better way of cropping things. Can be disabled with script-opts if needed.
* autocrop.lua: don't remove crop on startup/exitKacper Michajłow2023-09-081-1/+4
| | | | | No need to remove/clean crop unlike with filters. Allows using autocrop with auto=false and custom --video-crop.
* autocrop.lua: detect if crop is enabled based on propKacper Michajłow2023-09-081-3/+5
| | | | | Now we can have full frame crop, so to avoid checking that, just check property.
* autocrop.lua: use new --video-cropKacper Michajłow2023-08-311-0/+14
| | | | | | | Gated behind option for backward compatibility. Note that this will not magically start working with hwdec, as we do not have crop detection for hwdec.
* player/command: remove video-aspect propertyKacper Michajłow2023-08-311-1/+1
| | | | 4 years is enough of deprecation period.
* TOOLS/lua/autoload: Enable run-time updates of optionsChristoph Heinrich2023-08-191-12/+23
| | | | additional_*_exts get parsed and saved as sets in the options themselves
* TOOLS/lua/autoload: may specify loading only one type of filessunpenghao2023-08-191-3/+18
| | | | | | | | | | Under the current file loading logic, a video file and an external audio track next to it will both be added to the playlist, which most users don't wish to happen. Having an option that tells the script to load only one type of files (video, audio, or image) can avoid this problem. It may also come in handy for people who have different types of files mixed in a folder but wish to consume only one type of media at a time.
* build: remove outdated generated directoryDudemanguy2023-07-311-0/+8
| | | | | | | | | | | | | | | | This only existed as essentially a workaround for meson's behavior and to maintain compatibility with the waf build. Since waf put everything in a generated subdirectory, we had to put make a subdirectory called "generated" in the source for meson so stuff could go to the right place. Well now we don't need to do that anymore. Move the meson.build files around so they go in the appropriate place in the subdirectory of the source tree and change the paths of the headers accordingly. A couple of important things to note. 1. mpv.com now gets made in build/player/mpv.com (necessary because of a meson limitation) 2. The macos icon generation path is shortened to TOOLS/osxbundle/icon.icns.inc.
* waf: remove waf as a build systemLaserEyess2023-07-231-0/+0
| | | | | | Remove waf entirely in favor of meson as the only supported build system. Waf was officially deprecated in 0.36.0, and has not been preferred over meson since 0.35.0.
* TOOLS: remove obsolete travisCI-related scriptssfan52023-07-192-168/+0
|
* TOOLS/idet: fix some outdated cli syntaxDudemanguy2023-07-061-1/+1
| | | | | | | | d3cef97ad38fb027262a905bd82e1d3d2549aec7 changed the way the command line was parsed and syntax like "--foo value" stopped being considered valid. This old script still was using the old syntax and thus was broken. Update it to "--msg-level=ffmpeg=v" which is the recommended syntax. Fixes #11892.
* TOOLS/lua/autoload: allow extending ext sets from script-optsllyyr2023-07-061-0/+16
|
* TOOLS/lua/autoload: avoid unnecessary playlist manipulation, performanceEva2023-07-031-20/+29
| | | | | | | | | | | | | | We used to sort the playlist with playlist-move after every loadfile. Instead, append all files in order and call playlist-move once to move the only entry we don't control the position of. Don't fetch every playlist item separately, reuse native property. We used to pick up on new files added to the directory, but only when playing an entry at the edge of the playlist due to an early return. New files are now added to the playlist on every file change. This still works as expected and doesn't load duplicate files on shuffled playlists or playlists with files manually added after autoload 33% faster on average for my test directory with 1371 files.
* TOOLS/docutils-wrapper: handle commands without depfileThomas Weißschuh2023-03-241-2/+4
|
* TOOLS/docutils-wrapper: properly propagate failuresThomas Weißschuh2023-03-241-1/+4
|
* TOOLS/docutils-wrapper: gracefully remove non-existing filesThomas Weißschuh2023-03-241-2/+8
|
* TOOLS/autocrop.lua: log a more accurate warningGuido Cella2023-02-271-18/+12
| | | | | | | | | | | | | This reorders some code and checks the image track-list sub-property instead of the albumart one, so that when playing audio without enough playtime-remaining and images, the "autocrop only works for videos." warning is logged instead of the "Not enough time to detect crop." one. It also avoids repeating this warning twice in the code. As of e16d0dd15d current-tracks returns a video track even when lavfi-complex is used, so the track-list loop in is_cropable can be replaced with just checking current-tracks/video while still cropping videos with lavfi-complex.
* ci: migrate MSYS2 build to GitHub ActionsKacper Michajłow2023-01-282-78/+0
|
* TOOLS/lua/autoload: improve alphanumeric sortingChristoph Heinrich2023-01-151-4/+4
| | | | | | | | | | | | | | | Currently filenames like `EP.1.v0.1080p.mp4` do not get sorted correctly (e.g. episode 11 right after episode 1). That is caused by the `.` in front of the episode number, making it get sorted as if it were decimals. The solution is to match the whole real number or integer instead of matching the integer part and the fractional part separately. This will regress sorting of numbers with multiple commas where the length of the individual segments differs between filenames. Since those are rather uncommon, that is unlikely to be a problem (for anyone ever).
* TOOLS/docutils-wrapper: make executable + alphabetizeDudemanguy2023-01-131-0/+0
| | | | | | 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.
* TOOLS/lua/autoload: optimize performance of natural sortingChristoph Heinrich2023-01-091-5/+10
| | | | | | Formatting the string on each comparison is wasteful. Formatting strings beforehand and then comparing the already formatted ones leads to a huge performance gain.
* TOOLS/lua/autoload: further optimize the natural sortingdyphire2023-01-091-35/+19
| | | | | | | | | | | | | Commits https://github.com/mpv-player/mpv/commit/257dbdf06feb366f9eb1f96ceb7026c9365dddaa uses a algorithm of splitting strings into a table of number and string values to achieve natural sorting. This approach works well in most cases, but it does not work well in some specific scenarios. Now let's implement natural sorting with a stronger algorithm. Also fixes indentation. Ref: https://github.com/jonniek/mpv-playlistmanager/commit/3cf323f3c419af77f4141119283c1ec2911491c5 Closes https://github.com/mpv-player/mpv/issues/8969
* meson: dynamically compute dependencies for manpage and html buildThomas Weißschuh2023-01-081-0/+56
| | | | | | | | | 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
* TOOLS/umpv: support shell-quotes in $MPVsfan52023-01-071-1/+2
|
* TOOLS/umpv: prefer $XDG_RUNTIME_DIRSuperSamus2022-11-281-1/+1
|
* 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
* TOOLS/lua/autoload: add various extra file extensionsLeo Izen2022-09-231-4/+6