mpv/player
Dudemanguy 80feac62f1 command: add platform property
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
2023-02-27 17:13:21 +00:00
..
javascript lua/js: remove user-data helpers 2023-01-29 01:52:31 +02:00
lua ytdl_hook: don't overwrite force-media-title 2023-02-27 17:07:38 +00:00
audio.c audio: remove a duplicate clearing of a struct variable 2023-02-27 17:02:19 +00:00
client.c client API: reintroduce CONF_TYPE_FLAG for type conversion 2023-02-27 11:21:49 +01:00
client.h scripting: remove race condition when toggling internal scripts 2020-03-26 23:59:44 +01:00
command.c command: add platform property 2023-02-27 17:13:21 +00:00
command.h player: make deprecated track/chapter/metadata events internal 2021-12-15 12:29:10 +01:00
configfiles.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00
core.h player/video: add VOCTRL_CONTENT_TYPE 2022-11-15 23:18:55 +00:00
external_files.c external_files: recognize webp files as cover art 2022-12-29 15:48:57 +01:00
external_files.h player: add automatic loading of external cover art files 2020-09-28 00:12:52 +02:00
javascript.c various: fix warning -Wimplicit-const-int-float-conversion 2023-02-26 16:45:07 +01:00
loadfile.c options: transition options from OPT_FLAG to OPT_BOOL 2023-02-21 17:15:17 +00:00
lua.c lua: add mp.del_property() 2023-01-28 14:20:20 -06:00
main.c msg: log-file set at mpv.conf: don't ignore early messages 2023-01-23 11:05:08 +02:00
misc.c vo_wayland: fix warning -Wvoid-pointer-to-enum-cast 2023-02-26 16:45:07 +01:00
osd.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00
playloop.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00
screenshot.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c player/scripting: fix use-after-free when loading script folders 2021-04-08 23:47:35 +03:00
sub.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00
video.c various: drop unused #include "config.h" 2023-02-20 14:21:18 +00:00