From 42d621d131a45fb63571ca6029c2fc4f02811c10 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 13 Aug 2012 13:40:01 +0200 Subject: lavfi: add priv class to filter definitions and flags to filter internal options This allows the iteration callbacks to discover the internal class and options, and show them when required. --- libavfilter/af_silencedetect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libavfilter/af_silencedetect.c') diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c index bfda3e574d..d6bcd6347d 100644 --- a/libavfilter/af_silencedetect.c +++ b/libavfilter/af_silencedetect.c @@ -42,11 +42,12 @@ typedef struct { } SilenceDetectContext; #define OFFSET(x) offsetof(SilenceDetectContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM static const AVOption silencedetect_options[] = { - { "n", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX }, - { "noise", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX }, - { "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX}, - { "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX}, + { "n", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX, FLAGS }, + { "noise", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX, FLAGS }, + { "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX, FLAGS }, + { "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX, FLAGS }, { NULL }, }; @@ -165,4 +166,5 @@ AVFilter avfilter_af_silencedetect = { .type = AVMEDIA_TYPE_AUDIO, }, { .name = NULL } }, + .priv_class = &silencedetect_class, }; -- cgit v1.2.3