summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2017-12-17 01:25:23 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-13 20:16:01 -0800
commit8f9785d128eef0eae656d32d664ae1a8bff0bb12 (patch)
tree61250cdc4cd0505492e245757450e1a672713640 /DOCS
parentf17246fec15963e7cc098cf7ba7263ad02877b99 (diff)
downloadmpv-8f9785d128eef0eae656d32d664ae1a8bff0bb12.tar.bz2
mpv-8f9785d128eef0eae656d32d664ae1a8bff0bb12.tar.xz
lua+js: Implement utils.getpid()
Usable for uniquely identifying mpv instances from subprocesses, controlling mpv with AppleScript, ... Adds a new mp_getpid() wrapper for cross-platform reasons.
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/man/javascript.rst2
-rw-r--r--DOCS/man/lua.rst4
2 files changed, 6 insertions, 0 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index 2ebdb15896..cd553510eb 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -180,6 +180,8 @@ Otherwise, where the Lua APIs return ``nil`` on error, JS returns ``undefined``.
``mp.utils.subprocess_detached(t)``
+``mp.utils.getpid()`` (LE)
+
``mp.add_hook(type, priority, fn)``
Additional utilities
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst
index 2e354c282f..53e6d1db21 100644
--- a/DOCS/man/lua.rst
+++ b/DOCS/man/lua.rst
@@ -682,6 +682,10 @@ strictly part of the guaranteed API.
The function returns ``nil``.
+``utils.getpid()``
+ Returns the process ID of the running mpv process. This can be used to identify
+ the calling mpv when launching (detached) subprocesses.
+
``utils.parse_json(str [, trail])``
Parses the given string argument as JSON, and returns it as a Lua table. On
error, returns ``nil, error``. (Currently, ``error`` is just a string