diff options
author | wm4 <wm4@nowhere> | 2016-03-01 21:46:49 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-01 21:46:57 +0100 |
commit | 33774e18ed4c49857c042870099e3e3dd6fe614d (patch) | |
tree | d19275a23ca9ea6551a52bca99d62b0d9493edd5 /player | |
parent | af66fa8fa5d8e46b26a08a2b241f03d46abb3c2b (diff) |
command: add encoder-list property
Also change decoder-list (for the sake of sharing the underlying code
for both properties).
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c index 9dc46900f2..275effb5a4 100644 --- a/player/command.c +++ b/player/command.c @@ -32,6 +32,7 @@ #include "config.h" #include "mpv_talloc.h" #include "client.h" +#include "common/av_common.h" #include "common/codecs.h" #include "common/msg.h" #include "common/msg_control.h" @@ -3299,7 +3300,7 @@ static int get_decoder_entry(int item, int action, void *arg, void *ctx) struct m_sub_property props[] = { {"family", SUB_PROP_STR(c->family)}, {"codec", SUB_PROP_STR(c->codec)}, - {"decoder", SUB_PROP_STR(c->decoder)}, + {"driver" , SUB_PROP_STR(c->decoder)}, {"description", SUB_PROP_STR(c->desc)}, {0} }; @@ -3321,6 +3322,17 @@ static int mp_property_decoders(void *ctx, struct m_property *prop, return r; } +static int mp_property_encoders(void *ctx, struct m_property *prop, + int action, void *arg) +{ + struct mp_decoder_list *codecs = talloc_zero(NULL, struct mp_decoder_list); + mp_add_lavc_encoders(codecs); + int r = m_property_read_list(action, arg, codecs->num_entries, + get_decoder_entry, codecs); + talloc_free(codecs); + return r; +} + static int mp_property_version(void *ctx, struct m_property *prop, int action, void *arg) { @@ -3749,6 +3761,7 @@ static const struct m_property mp_properties[] = { {"protocol-list", mp_property_protocols}, {"decoder-list", mp_property_decoders}, + {"encoder-list", mp_property_encoders}, {"mpv-version", mp_property_version}, {"mpv-configuration", mp_property_configuration}, |