From 433210535244e94d20d92eb272d27097daea9a11 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 3 Oct 2014 01:24:48 +0200 Subject: command: allow passing memory addresses to overlay_add For the sake of libmpv. Might make things much easier for the user, especially on Windows. On the other hand, it's a bit sketchy that a command exists that makes the player access arbitrary memory regions. (But do note that input commands are not meant to be "secure" and never were - for example, there's the "run" command, which obviously allows running random shell commands.) --- DOCS/man/input.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'DOCS/man/input.rst') diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index f83e72703c..bbfe2b7963 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -456,6 +456,16 @@ Input Commands that are Possibly Subject to Change random points. Instead, call ``overlay_add`` again (preferably with a different memory region to prevent tearing). + It is also possible to pass a raw memory address for use as bitmap memory + by passing a memory address as integer prefixed with a ``&`` character. + Passing the wrong thing here will crash the player. The ``offset`` parameter + is not used and must be 0. This mode might be useful for use with libmpv. + + On Windows, currently only raw memory addresses work. File mapping is not + implemented because a ``mmap`` compatibility layer is missing, and because + this kind of shared memory method would perhaps not be overly useful on + Windows. + ``offset`` is the offset of the first pixel in the source file. It is passed directly to ``mmap`` and is subject to certain restrictions (see ``man mmap`` for details). In particular, this value has to be a -- cgit v1.2.3