summaryrefslogtreecommitdiffstats
path: root/filters/user_filters.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-31 06:50:21 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-03 05:00:52 -0800
commitafb167cfd2521198539fbd23d772a252554221f0 (patch)
treedbd95c0f370734d94da5db9888b7e74ddd600431 /filters/user_filters.c
parent174261450589d8a6ff21426c1cfc3f2508620583 (diff)
downloadmpv-afb167cfd2521198539fbd23d772a252554221f0.tar.bz2
mpv-afb167cfd2521198539fbd23d772a252554221f0.tar.xz
options: slightly improve filter help output for lavfi bridge
--vf=help will now list libavfilter filters, and e.g. --vf=yadif=help will list libavfilter filter options. The latter is rather bare, because the AVOption API is really awful (holy shit how is it so bad), and would require us to handle _every_ option type manually. Alternatively we could call av_opt_show2(), which ffmpeg uses for help output in its CLI tools and which is much more detailed. But it's rather foreign and forces output through av_log(), so I don't really want to use it.
Diffstat (limited to 'filters/user_filters.c')
-rw-r--r--filters/user_filters.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/filters/user_filters.c b/filters/user_filters.c
index 30358a4a94..89d7743d53 100644
--- a/filters/user_filters.c
+++ b/filters/user_filters.c
@@ -1,3 +1,5 @@
+#include <libavutil/avutil.h>
+
#include "config.h"
#include "common/common.h"
@@ -36,11 +38,23 @@ static bool get_af_desc(struct m_obj_desc *dst, int index)
return get_desc_from(af_list, MP_ARRAY_SIZE(af_list), dst, index);
}
+static void print_af_help_list(struct mp_log *log)
+{
+ print_lavfi_help_list(log, AVMEDIA_TYPE_AUDIO);
+}
+
+static void print_af_lavfi_help(struct mp_log *log, const char *name)
+{
+ print_lavfi_help(log, name, AVMEDIA_TYPE_AUDIO);
+}
+
const struct m_obj_list af_obj_list = {
.get_desc = get_af_desc,
.description = "audio filters",
.allow_disable_entries = true,
.allow_unknown_entries = true,
+ .print_help_list = print_af_help_list,
+ .print_unknown_entry_help = print_af_lavfi_help,
};
// --vf option
@@ -72,11 +86,23 @@ static bool get_vf_desc(struct m_obj_desc *dst, int index)
return get_desc_from(vf_list, MP_ARRAY_SIZE(vf_list), dst, index);
}
+static void print_vf_help_list(struct mp_log *log)
+{
+ print_lavfi_help_list(log, AVMEDIA_TYPE_VIDEO);
+}
+
+static void print_vf_lavfi_help(struct mp_log *log, const char *name)
+{
+ print_lavfi_help(log, name, AVMEDIA_TYPE_VIDEO);
+}
+
const struct m_obj_list vf_obj_list = {
.get_desc = get_vf_desc,
.description = "video filters",
.allow_disable_entries = true,
.allow_unknown_entries = true,
+ .print_help_list = print_vf_help_list,
+ .print_unknown_entry_help = print_vf_lavfi_help,
};
// Create a bidir, single-media filter from command line arguments.