diff options
author | Anton Kindestam <antonki@kth.se> | 2018-12-05 19:02:03 +0100 |
---|---|---|
committer | Anton Kindestam <antonki@kth.se> | 2018-12-05 19:19:24 +0100 |
commit | 8b83c8996686072bc743b112ae5cb3bf93aa33ed (patch) | |
tree | b09ce6a7ff470b05006622f19914b3d39d2f7d9f | |
parent | 5bcac8580df6fc62323136f756a3a6d1e754fe9c (diff) | |
parent | 559a400ac36e75a8d73ba263fd7fa6736df1c2da (diff) | |
download | mpv-8b83c8996686072bc743b112ae5cb3bf93aa33ed.tar.bz2 mpv-8b83c8996686072bc743b112ae5cb3bf93aa33ed.tar.xz |
Merge commit '559a400ac36e75a8d73ba263fd7fa6736df1c2da' into wm4-commits--merge-edition
This bumps libmpv version to 1.103
98 files changed, 3936 insertions, 3147 deletions
diff --git a/DOCS/client-api-changes.rst b/DOCS/client-api-changes.rst index 6197e48a39..b9b264d220 100644 --- a/DOCS/client-api-changes.rst +++ b/DOCS/client-api-changes.rst @@ -32,6 +32,10 @@ API changes :: --- mpv 0.30.0 --- + 1.103 - redo handling of async commands + - add mpv_event_command and make it possible to return values from + commands issued with mpv_command_async() or mpv_command_node_async() + - add mpv_abort_async_command() 1.102 - rename struct mpv_opengl_drm_osd_size to mpv_opengl_drm_draw_surface_size - rename MPV_RENDER_PARAM_DRM_OSD_SIZE to MPV_RENDER_PARAM_DRM_DRAW_SURFACE_SIZE diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index cbc9af18f8..82a5d1a875 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -47,6 +47,25 @@ Interface changes - support for `--spirv-compiler=nvidia` has been removed, leaving `shaderc` as the only option. The `--spirv-compiler` option itself has been marked as deprecated, and may be removed in the future. + - ipc: require that "request_id" fields are integers. Other types are still + accepted for compatibility, but this will stop in the future. Also, if no + request_id is provided, 0 will be assumed. + - mpv_command_node() and mp.command_native() now support named arguments + (see manpage). If you want to use them, use a new version of the manpage + as reference, which lists the definitive names. + - edition and disc title switching will now fully reload playback (may have + consequences for scripts, client API, or when using file-local options) + - remove async playback abort hack. This breaks aborting playback in the + following cases, iff the current stream is a network stream that + completely stopped responding: + - setting "program" property + - setting "cache-size" property + In earlier versions of mpv, the player core froze as well in these cases, + but could still be aborted with the quit, stop, playlist-prev, + playlist-next commands. If these properties are not accessed, frozen + network streams should not freeze the player core (only playback in + uncached regions), and differing behavior should be reported as a bug. + If --demuxer-thread=no is used, there are no guarantees. --- mpv 0.29.0 --- - drop --opensles-sample-rate, as --audio-samplerate should be used if desired - drop deprecated --videotoolbox-format, --ff-aid, --ff-vid, --ff-sid, @@ -131,8 +150,6 @@ Interface changes of 3D content doesn't justify such an option anyway. - change cycle-values command to use the current value, instead of an internal counter that remembered the current position. - - edition and disc title switching will now fully reload playback (may have - consequences for scripts, client API, or when using file-local options) - remove deprecated ao/vo auto profiles. Consider using scripts like auto-profiles.lua instead. --- mpv 0.28.0 --- diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 2fcf6857e7..7c95965773 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -41,10 +41,10 @@ commands they're bound to on the OSD, instead of executing the commands:: (Only closing the window will make **mpv** exit, pressing normal keys will merely display the binding, even if mapped to quit.) -General Input Command Syntax ----------------------------- +input.conf syntax +----------------- -``[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] [<prefixes>] <command> (<argument>)* [; <command>]`` +``[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] <command> ( ; <command> )*`` Note that by default, the right Alt key can be used to create special characters, and thus does not register as a modifier. The option @@ -59,9 +59,9 @@ character), or a symbolic name (as printed by ``--input-keylist``). ``<section>`` (braced with ``{`` and ``}``) is the input section for this command. -Arguments are separated by whitespace. This applies even to string arguments. -For this reason, string arguments should be quoted with ``"``. Inside quotes, -C-style escaping can be used. +``<command>`` is the command itself. It consists of the command name and +multiple (or none) commands, all separated by whitespace. String arguments +need to be quoted with ``"``. Details see ``Flat command syntax``. You can bind multiple commands to one key. For example: @@ -78,15 +78,89 @@ that matches, and the multi-key command will never be called. Intermediate keys can be remapped to ``ignore`` in order to avoid this issue. The maximum number of (non-modifier) keys for combinations is currently 4. +Flat command syntax +------------------- + +This is the syntax used in input.conf, and referred to "input.conf syntax" in +a number of other places. + +``<command> ::= [<prefixes>] <command_name> (<argument>)*`` +``<argument> ::= (<string> | " <quoted_string> " )`` + +``command_name`` is an unquoted string with the command name itself. See +`List of Input Commands`_ for a list. + +Arguments are separated by whitespace. This applies even to string arguments. +For this reason, string arguments should be quoted with ``"``. If a string +argument contains spaces or certain special characters, quoting and possibly +escaping is mandatory, or the command cannot be parsed correctly. + +Inside quotes, C-style escaping can be used. JSON escapes according to RFC 8259, +minus surrogate pair escapes, should be a safe subset that can be used. + +Commands specified as arrays +---------------------------- + +This applies to certain APIs, such as ``mp.commandv()`` or +``mp.command_native()`` (with array parameters) in Lua scripting, or +``mpv_command()`` or ``mpv_command_node()`` (with MPV_FORMAT_NODE_ARRAY) in the +C libmpv client API. + +The command as well as all arguments are passed as a single array. Similar to +the `Flat command syntax`_, you can first pass prefixes as strings (each as +separate array item), then the command name as string, and then each argument +as string or a native value. + +Since these APIs pass arguments as separate strings or native values, they do +not expect quotes, and do support escaping. Technically, there is the input.conf +parser, which first splits the command string into arguments, and then invokes +argument parsers for each argument. The input.conf parser normally handles +quotes and escaping. The array command APIs mentioned above pass strings +directly to the argument parsers, or can sidestep them by the ability to pass +non-string values. + +Sometimes commands have string arguments, that in turn are actually parsed by +other components (e.g. filter strings with ``vf add``) - in these cases, you +you would have to double-escape in input.conf, but not with the array APIs. + +For complex commands, consider using `Named arguments`_ instead, which should +give slightly more compatibility. Some commands do not support named arguments +and inherently take an array, though. + +Named arguments +--------------- + +This applies to certain APIs, such as ``mp.command_native()`` (with tables that +have string keys) in Lua scripting, or ``mpv_command_node()`` (with +MPV_FORMAT_NODE_MAP) in the C libmpv client API. + +Like with array commands, quoting and escaping is inherently not needed in the +normal case. + +The name of each command is defined in each command description in the +`List of Input Commands`_. ``--input-cmdlist`` also lists them. + +Some commands do not support named arguments (e.g. ``run`` command). You need +to use APIs that pass arguments as arrays. + +Named arguments are not supported in the "flat" input.conf syntax, which means +you cannot use them for key bindings in input.conf at all. + List of Input Commands ---------------------- +Commands with parameters have the parameter name enclosed in ``<`` / ``>``. +Don't add those to the actual command. Optional arguments are enclosed in +``[`` / ``]``. If you don't pass them, they will be set to a default value. + +Remember to quote string arguments in input.conf (see `Flat command syntax`_). + ``ignore`` Use this to "block" keys that should be unbound, and do nothing. Useful for disabling default bindings, without disabling all bindings with ``--no-input-default-bindings``. -``seek <seconds> [relative|absolute|absolute-percent|relative-percent|exact|keyframes]`` +``seek <target> [<flags>]`` Change the playback position. By default, seeks by a relative amount of seconds. @@ -114,7 +188,7 @@ List of Input Commands 3rd parameter (essentially using a space instead of ``+``). The 3rd parameter is still parsed, but is considered deprecated. -``revert-seek [mode]`` +``revert-seek [<flags>]`` Undoes the ``seek`` command, and some other commands that seek (but not necessarily all of them). Calling this command once will jump to the playback position before the seek. Calling it a second time undoes the @@ -144,22 +218,24 @@ List of Input Commands This does not work with audio-only playback. -``set <property> "<value>"`` - Set the given property to the given value. +``set <name> <value>`` + Set the given property or option to the given value. -``add <property> [<value>]`` - Add the given value to the property. On overflow or underflow, clamp the - property to the maximum. If ``<value>`` is omitted, assume ``1``. +``add <name> [<value>]`` + Add the given value to the property or option. On overflow or underflow, + clamp the property to the maximum. If ``<value>`` is omitted, assume ``1``. -``cycle <property> [up|down]`` - Cycle the given property. ``up`` and ``down`` set the cycle direction. On - overflow, set the property back to the minimum, on underflow set it to the - maximum. If ``up`` or ``down`` is omitted, assume ``up``. +``cycle <name> [<value>]`` + Cycle the given property or option. The second argument can be ``up`` or + ``down`` to set the cycle direction. On overflow, set the property back to + the minimum, on underflow set it to the maximum. If ``up`` or ``down`` is + omitted, assume ``up``. -``multiply <property> <factor>`` - Multiplies the value of a property with the numeric factor. +``multiply <name> <value>`` + Similar to ``add``, but multiplies the property or option with the numeric + value. -``screenshot [subtitles|video|window|single|each-frame]`` +``screenshot <flags>`` Take a screenshot. Multiple flags are available (some can be combined with ``+``): @@ -186,45 +262,46 @@ List of Input Commands second argument (and did not have flags). This syntax is still understood, but deprecated and might be removed in the future. - Setting the ``async`` flag will make encoding and writing the actual image - file asynchronous in most cases. (``each-frame`` mode ignores this flag - currently.) Requesting async screenshots too early or too often could lead - to the same filenames being chosen, and overwriting each others in undefined - order. + If you combine this command with another one using ``;``, you can use t |