From 33774e18ed4c49857c042870099e3e3dd6fe614d Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 1 Mar 2016 21:46:49 +0100 Subject: command: add encoder-list property Also change decoder-list (for the sake of sharing the underlying code for both properties). --- common/av_common.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'common/av_common.c') diff --git a/common/av_common.c b/common/av_common.c index 8b979cabba..5cb434f969 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -158,6 +158,21 @@ void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type) } } +// (Abuses the decoder list data structures.) +void mp_add_lavc_encoders(struct mp_decoder_list *list) +{ + AVCodec *cur = NULL; + for (;;) { + cur = av_codec_next(cur); + if (!cur) + break; + if (av_codec_is_encoder(cur)) { + mp_add_decoder(list, "lavc", mp_codec_from_av_codec_id(cur->id), + cur->name, cur->long_name); + } + } +} + int mp_codec_to_av_codec_id(const char *codec) { int id = AV_CODEC_ID_NONE; -- cgit v1.2.3