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 /player/command.h | |
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
Diffstat (limited to 'player/command.h')
-rw-r--r-- | player/command.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/player/command.h b/player/command.h index b6ccffe80f..ae3af82886 100644 --- a/player/command.h +++ b/player/command.h @@ -20,6 +20,8 @@ #include <stdbool.h> +#include "libmpv/client.h" + struct MPContext; struct mp_cmd; struct mp_log; @@ -43,12 +45,31 @@ struct mp_cmd_ctx { bool bar_osd; // OSD bar requested bool seek_msg_osd; // same as above, but for seek commands bool seek_bar_osd; - // Return values + // If mp_cmd_def.can_abort is set, this will be set. + struct mp_abort_entry *abort; + // Return values (to be set by command implementation, read by the + // completion callback). bool success; // true by default - struct mpv_node *result; + struct mpv_node result; + // Command handlers can set this to false if returning from the command + // handler does not complete the command. It stops the common command code + // from signaling the completion automatically, and you can call + // mp_cmd_ctx_complete() to invoke on_completion() properly (including all + // the bookkeeping). + /// (Note that in no case you can call mp_cmd_ctx_complete() from within + // the command handler, because it frees the mp_cmd_ctx.) + bool completed; // true by default + // This is managed by the common command code. For rules about how and where + // this is called see run_command() comments. + void (*on_completion)(struct mp_cmd_ctx *cmd); + void *on_completion_priv; // for free use by on_completion callback }; -int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *res); +void run_command(struct MPContext *mpctx, struct mp_cmd *cmd, + struct mp_abort_entry *abort, + void (*on_completion)(struct mp_cmd_ctx *cmd), + void *on_completion_priv); +void mp_cmd_ctx_complete(struct mp_cmd_ctx *cmd); char *mp_property_expand_string(struct MPContext *mpctx, const char *str); char *mp_property_expand_escaped_string(struct MPContext *mpctx, const char *str); void property_print_help(struct MPContext *mpctx); |