summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-14 22:22:33 +0200
committerwm4 <wm4@nowhere>2020-05-14 22:22:33 +0200
commita58b2df3f84da9c19e4900e2524036a176c16c7a (patch)
tree78eff7220527e9682e72ca6394553ef74a3081ca /player/command.c
parentc6369933f1d9cd204b09be95ef7d4ed1351610e2 (diff)
downloadmpv-a58b2df3f84da9c19e4900e2524036a176c16c7a.tar.bz2
mpv-a58b2df3f84da9c19e4900e2524036a176c16c7a.tar.xz
command: add input-key-list property
Fixes: #7698
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 322ce973c9..04e84c998f 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3016,6 +3016,20 @@ static int mp_property_protocols(void *ctx, struct m_property *prop,
return M_PROPERTY_NOT_IMPLEMENTED;
}
+static int mp_property_keylist(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ switch (action) {
+ case M_PROPERTY_GET:
+ *(char ***)arg = mp_get_key_list();
+ return M_PROPERTY_OK;
+ case M_PROPERTY_GET_TYPE:
+ *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING_LIST};
+ return M_PROPERTY_OK;
+ }
+ return M_PROPERTY_NOT_IMPLEMENTED;
+}
+
static int get_decoder_entry(int item, int action, void *arg, void *ctx)
{
struct mp_decoder_list *codecs = ctx;
@@ -3533,6 +3547,7 @@ static const struct m_property mp_properties_base[] = {
{"decoder-list", mp_property_decoders},
{"encoder-list", mp_property_encoders},
{"demuxer-lavf-list", mp_property_lavf_demuxers},
+ {"input-key-list", mp_property_keylist},
{"mpv-version", mp_property_version},
{"mpv-configuration", mp_property_configuration},