summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-01-22 23:06:26 -0600
committerDudemanguy <random342@airmail.cc>2023-02-27 17:13:21 +0000
commit80feac62f175173d7a4a002450482e4be6a02a83 (patch)
tree6f939919f6f536a4c3da97ef48ecd608b2ad7be8 /DOCS
parent8ea7aa54719f790d64f3d96c63a7c8eaf756ca27 (diff)
downloadmpv-80feac62f175173d7a4a002450482e4be6a02a83.tar.bz2
mpv-80feac62f175173d7a4a002450482e4be6a02a83.tar.xz
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
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/input.rst6
2 files changed, 7 insertions, 0 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index bff74cd16c..785a39b1e7 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -57,6 +57,7 @@ Interface changes
- add `--tone-mapping-visualize`
- change type of `--brightness`, `--saturation`, `--contrast`, `--hue` and
`--gamma` to float.
+ - add `platform` property
--- mpv 0.35.0 ---
- add the `--vo=gpu-next` video output driver, as well as the options
`--allow-delayed-peak-detect`, `--builtin-scalers`,
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index ea305af615..4f9e68d567 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -3341,6 +3341,12 @@ Property list
somewhat weird form (apparently "hex BCD"), indicating the release version
of the libass library linked to mpv.
+``platform``
+ Returns a string describing what target platform mpv was built for. The value
+ of this is dependent on what the underlying build system detects. Some of the
+ most common values are: ``windows``, ``darwin`` (macos or ios), ``linux``,
+ ``android``, and ``freebsd``. Note that this is not a complete listing.
+
``options/<name>`` (RW)
The value of option ``--<name>``. Most options can be changed at runtime by
writing to this property. Note that many options require reloading the file