mirror of
https://github.com/mpv-player/mpv
synced 2025-02-06 15:11:58 +00:00
player: add internal vo-resize
command
Intended to be used with the properties from previous commit.
This commit is contained in:
parent
451fc931b0
commit
0030e049cd
@ -732,7 +732,7 @@ Input Commands that are Possibly Subject to Change
|
||||
Load a script, similar to the ``--script`` option.
|
||||
|
||||
Undocumented commands: ``tv-last-channel`` (TV/DVB only),
|
||||
``ao-reload`` (experimental/internal).
|
||||
``ao-reload``, ``vo-resize`` (experimental/internal).
|
||||
|
||||
Hooks
|
||||
~~~~~
|
||||
|
@ -4744,7 +4744,8 @@ The following video options are currently all specific to ``--vo=gpu`` and
|
||||
``--android-surface-width=<number>``
|
||||
``--android-surface-height=<number>``
|
||||
Set dimensions of the rendering surface used by the Android gpu context.
|
||||
Needs to be set by the embedding application.
|
||||
Needs to be set by the embedding application. Setting these does not re-
|
||||
configure the vo, thus ``vo-resize`` should be called afterwards.
|
||||
|
||||
Android with ``--gpu-context=android`` only.
|
||||
|
||||
|
@ -191,6 +191,7 @@ const struct mp_cmd_def mp_cmds[] = {
|
||||
|
||||
{ MP_CMD_VF, "vf", { ARG_STRING, ARG_STRING } },
|
||||
{ MP_CMD_VF_COMMAND, "vf-command", { ARG_STRING, ARG_STRING, ARG_STRING } },
|
||||
{ MP_CMD_VO_RESIZE, "vo-resize", },
|
||||
|
||||
{ MP_CMD_SCRIPT_BINDING, "script-binding", { ARG_STRING },
|
||||
.allow_auto_repeat = true, .on_updown = true},
|
||||
|
@ -99,6 +99,7 @@ enum mp_command_type {
|
||||
/// Video filter commands
|
||||
MP_CMD_VF,
|
||||
MP_CMD_VF_COMMAND,
|
||||
MP_CMD_VO_RESIZE,
|
||||
|
||||
/// Internal for Lua scripts
|
||||
MP_CMD_SCRIPT_BINDING,
|
||||
|
@ -5419,6 +5419,13 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
reload_audio_output(mpctx);
|
||||
break;
|
||||
|
||||
case MP_CMD_VO_RESIZE: {
|
||||
if (!mpctx->video_out)
|
||||
return -1;
|
||||
vo_control(mpctx->video_out, VOCTRL_EXTERNAL_RESIZE, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
case MP_CMD_AF:
|
||||
return edit_filters_osd(mpctx, STREAM_AUDIO, cmd->args[0].v.s,
|
||||
cmd->args[1].v.s, msg_osd);
|
||||
|
@ -111,6 +111,9 @@ enum mp_voctrl {
|
||||
VOCTRL_GET_DISPLAY_FPS, // double*
|
||||
|
||||
VOCTRL_GET_PREF_DEINT, // int*
|
||||
|
||||
/* private to vo_gpu */
|
||||
VOCTRL_EXTERNAL_RESIZE,
|
||||
};
|
||||
|
||||
// VOCTRL_SET_EQUALIZER
|
||||
|
@ -207,6 +207,10 @@ static int control(struct vo *vo, uint32_t request, void *data)
|
||||
case VOCTRL_PERFORMANCE_DATA:
|
||||
gl_video_perfdata(p->renderer, (struct voctrl_performance_data *)data);
|
||||
return true;
|
||||
case VOCTRL_EXTERNAL_RESIZE:
|
||||
p->ctx->fns->reconfig(p->ctx);
|
||||
resize(vo);
|
||||
return true;
|
||||
}
|
||||
|
||||
int events = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user