summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-09 21:09:31 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commit059e7fdb3aaace0c6259728547da1896249818e4 (patch)
treefb0195bb585921b55458a764a981c1187ae46ec8 /player/command.c
parentfb62ffdb943c7b50c3667aeaf452301f84b3b67f (diff)
downloadmpv-059e7fdb3aaace0c6259728547da1896249818e4.tar.bz2
mpv-059e7fdb3aaace0c6259728547da1896249818e4.tar.xz
command: move screenshot command stubs to screenshot.c
Commands are not a monolithic giant switch() statement anymore, but individual functions. There's no reason to have the command handlers themselves in command.c, with a weird under-defined API in between. (In the future, I'd like to split up command.c further, and when I do that, scrrenshot.c will probably gets its own mp_cmd_def[] array, and define the commands locally instead of exporting the raw handlers.)
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/player/command.c b/player/command.c
index 12c232640a..7d2109be7f 100644
--- a/player/command.c
+++ b/player/command.c
@@ -5622,51 +5622,6 @@ static void cmd_rescan_external_files(void *p)
}
}
-static void cmd_screenshot(void *p)
-{
- struct mp_cmd_ctx *cmd = p;
- struct MPContext *mpctx = cmd->mpctx;
- bool async = cmd->cmd->flags & MP_ASYNC_CMD;
- int mode = cmd->args[0].v.i & 3;
- int freq = (cmd->args[0].v.i | cmd->args[1].v.i) >> 3;
- screenshot_request(mpctx, mode, freq, cmd->msg_osd, async);
-}
-
-static void cmd_screenshot_to_file(void *p)
-{
- struct mp_cmd_ctx *cmd = p;
- struct MPContext *mpctx = cmd->mpctx;
- bool async = cmd->cmd->flags & MP_ASYNC_CMD;
- screenshot_to_file(mpctx, cmd->args[0].v.s, cmd->args[1].v.i, cmd->msg_osd,
- async);
-}
-
-static void cmd_screenshot_raw(void *p)
-{
- struct mp_cmd_ctx *cmd = p;
- struct MPContext *mpctx = cmd->mpctx;
- struct mpv_node *res = &cmd->result;
-
- struct mp_image *img = screenshot_get_rgb(mpctx, cmd->args[0].v.i);
- if (!img) {
- cmd->success = false;
- return;
- }
-
- node_init(res, MPV_FORMAT_NODE_MAP, NULL);
- node_map_add_int64(res, "w", img->w);
- node_map_add_int64(res, "h", img->h);
- node_map_add_int64(res, "stride", img->stride[0]);
- node_map_add_string(res, "format", "bgr0");
- struct mpv_byte_array *ba =
- node_map_add(res, "data", MPV_FORMAT_BYTE_ARRAY)->u.ba;
- *ba = (struct mpv_byte_array){
- .data = img->planes[0],
- .size = img->stride[0] * img->h,
- };
- talloc_steal(ba, img);
-}
-
static void cmd_run(void *p)
{
struct mp_cmd_ctx *cmd = p;