diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-08-13 13:40:01 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-08-18 10:19:05 +0200 |
commit | 42d621d131a45fb63571ca6029c2fc4f02811c10 (patch) | |
tree | 8a8c32a05e78393c923405b089f2b68968a2f57d /libavfilter/vf_blackdetect.c | |
parent | 831a999ddaf89ad3bb31bfcf4201463098444539 (diff) |
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.
Diffstat (limited to 'libavfilter/vf_blackdetect.c')
-rw-r--r-- | libavfilter/vf_blackdetect.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c index 29f6c079d5..cf1b9244b3 100644 --- a/libavfilter/vf_blackdetect.c +++ b/libavfilter/vf_blackdetect.c @@ -48,13 +48,15 @@ typedef struct { } BlackDetectContext; #define OFFSET(x) offsetof(BlackDetectContext, x) +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM + static const AVOption blackdetect_options[] = { - { "d", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX}, - { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX}, - { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1}, - { "pic_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1}, - { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1}, - { "pix_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1}, + { "d", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS }, + { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS }, + { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS }, + { "pic_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS }, + { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS }, + { "pix_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS }, { NULL }, }; @@ -219,4 +221,5 @@ AVFilter avfilter_vf_blackdetect = { .request_frame = request_frame, }, { .name = NULL } }, + .priv_class = &blackdetect_class, }; |