From 828bd2963cd10a851e0a977809687aed4d377dc3 Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Tue, 2 Jan 2018 20:46:58 +0000 Subject: command: add demuxer-lavf-list property Was only available with --demuxer-lavf-format=help and the demuxer needed to be used for it to actually print the list. This can be used in the future to check if 'dash' support was compiled with FFmpeg so ytdl_hook can use it instead. For now, dashdec is too rudimentary to be used right away. --- common/av_common.c | 17 +++++++++++++++++ common/av_common.h | 1 + 2 files changed, 18 insertions(+) (limited to 'common') diff --git a/common/av_common.c b/common/av_common.c index 65a212b994..0599d98465 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "config.h" @@ -33,6 +34,7 @@ #include "common/msg.h" #include "demux/packet.h" #include "demux/stheader.h" +#include "misc/bstr.h" #include "video/fmt-conversion.h" #include "av_common.h" #include "codecs.h" @@ -246,6 +248,21 @@ void mp_add_lavc_encoders(struct mp_decoder_list *list) } } +char **mp_get_lavf_demuxers(void) +{ + char **list = NULL; + AVInputFormat *cur = NULL; + int num = 0; + for (;;) { + cur = av_iformat_next(cur); + if (!cur) + break; + MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, cur->name)); + } + MP_TARRAY_APPEND(NULL, list, num, NULL); + return list; +} + int mp_codec_to_av_codec_id(const char *codec) { int id = AV_CODEC_ID_NONE; diff --git a/common/av_common.h b/common/av_common.h index 6d0c823b8d..0e7c838884 100644 --- a/common/av_common.h +++ b/common/av_common.h @@ -41,6 +41,7 @@ double mp_pts_from_av(int64_t av_pts, AVRational *tb); void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads); void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type); void mp_add_lavc_encoders(struct mp_decoder_list *list); +char **mp_get_lavf_demuxers(void); int mp_codec_to_av_codec_id(const char *codec); const char *mp_codec_from_av_codec_id(int codec_id); void mp_set_avdict(struct AVDictionary **dict, char **kv); -- cgit v1.2.3