avfilter/vf_neighbor: Deduplicate AVClasses
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
31adb960b7
commit
443706d937
@ -354,14 +354,12 @@ static const AVFilterPad neighbor_outputs[] = {
|
|||||||
#define OFFSET(x) offsetof(NContext, x)
|
#define OFFSET(x) offsetof(NContext, x)
|
||||||
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
|
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
|
||||||
|
|
||||||
#define DEFINE_NEIGHBOR_FILTER(name_, description_) \
|
#define DEFINE_NEIGHBOR_FILTER(name_, description_, priv_class_) \
|
||||||
AVFILTER_DEFINE_CLASS(name_); \
|
|
||||||
\
|
|
||||||
const AVFilter ff_vf_##name_ = { \
|
const AVFilter ff_vf_##name_ = { \
|
||||||
.name = #name_, \
|
.name = #name_, \
|
||||||
.description = NULL_IF_CONFIG_SMALL(description_), \
|
.description = NULL_IF_CONFIG_SMALL(description_), \
|
||||||
|
.priv_class = &priv_class_##_class, \
|
||||||
.priv_size = sizeof(NContext), \
|
.priv_size = sizeof(NContext), \
|
||||||
.priv_class = &name_##_class, \
|
|
||||||
.query_formats = query_formats, \
|
.query_formats = query_formats, \
|
||||||
FILTER_INPUTS(neighbor_inputs), \
|
FILTER_INPUTS(neighbor_inputs), \
|
||||||
FILTER_OUTPUTS(neighbor_outputs), \
|
FILTER_OUTPUTS(neighbor_outputs), \
|
||||||
@ -384,30 +382,31 @@ static const AVOption options[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
AVFILTER_DEFINE_CLASS_EXT(erosion_dilation, "erosion/dilation", options);
|
||||||
|
|
||||||
#if CONFIG_EROSION_FILTER
|
#if CONFIG_EROSION_FILTER
|
||||||
|
|
||||||
#define erosion_options options
|
DEFINE_NEIGHBOR_FILTER(erosion, "Apply erosion effect.", erosion_dilation);
|
||||||
DEFINE_NEIGHBOR_FILTER(erosion, "Apply erosion effect.");
|
|
||||||
|
|
||||||
#endif /* CONFIG_EROSION_FILTER */
|
#endif /* CONFIG_EROSION_FILTER */
|
||||||
|
|
||||||
#if CONFIG_DILATION_FILTER
|
#if CONFIG_DILATION_FILTER
|
||||||
|
|
||||||
#define dilation_options options
|
DEFINE_NEIGHBOR_FILTER(dilation, "Apply dilation effect.", erosion_dilation);
|
||||||
DEFINE_NEIGHBOR_FILTER(dilation, "Apply dilation effect.");
|
|
||||||
|
|
||||||
#endif /* CONFIG_DILATION_FILTER */
|
#endif /* CONFIG_DILATION_FILTER */
|
||||||
|
|
||||||
|
AVFILTER_DEFINE_CLASS_EXT(deflate_inflate, "deflate/inflate",
|
||||||
|
&options[DEINFLATE_OPTIONS_OFFSET]);
|
||||||
|
|
||||||
#if CONFIG_DEFLATE_FILTER
|
#if CONFIG_DEFLATE_FILTER
|
||||||
|
|
||||||
#define deflate_options &options[DEINFLATE_OPTIONS_OFFSET]
|
DEFINE_NEIGHBOR_FILTER(deflate, "Apply deflate effect.", deflate_inflate);
|
||||||
DEFINE_NEIGHBOR_FILTER(deflate, "Apply deflate effect.");
|
|
||||||
|
|
||||||
#endif /* CONFIG_DEFLATE_FILTER */
|
#endif /* CONFIG_DEFLATE_FILTER */
|
||||||
|
|
||||||
#if CONFIG_INFLATE_FILTER
|
#if CONFIG_INFLATE_FILTER
|
||||||
|
|
||||||
#define inflate_options &options[DEINFLATE_OPTIONS_OFFSET]
|
DEFINE_NEIGHBOR_FILTER(inflate, "Apply inflate effect.", deflate_inflate);
|
||||||
DEFINE_NEIGHBOR_FILTER(inflate, "Apply inflate effect.");
|
|
||||||
|
|
||||||
#endif /* CONFIG_INFLATE_FILTER */
|
#endif /* CONFIG_INFLATE_FILTER */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user