diff mbox series

[FFmpeg-devel,19/38] avfilter/vf_format: Deduplicate AVClasses

Message ID AM7PR03MB6660D05661CD3C943F6C10C48FD79@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 57f6c23f299a138d74a84371f3523fb6d25ae92c
Headers show
Series [FFmpeg-devel,01/39] avfilter/vf_maskedminmax: Simplify init | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 11, 2021, 11:42 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_format.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c
index b34675b8e0..0a5c739db6 100644
--- a/libavfilter/vf_format.c
+++ b/libavfilter/vf_format.c
@@ -140,10 +140,9 @@  static const AVOption options[] = {
     { NULL }
 };
 
-#if CONFIG_FORMAT_FILTER
+AVFILTER_DEFINE_CLASS_EXT(format, "(no)format", options);
 
-#define format_options options
-AVFILTER_DEFINE_CLASS(format);
+#if CONFIG_FORMAT_FILTER
 
 static const AVFilterPad avfilter_vf_format_inputs[] = {
     {
@@ -179,9 +178,6 @@  const AVFilter ff_vf_format = {
 
 #if CONFIG_NOFORMAT_FILTER
 
-#define noformat_options options
-AVFILTER_DEFINE_CLASS(noformat);
-
 static const AVFilterPad avfilter_vf_noformat_inputs[] = {
     {
         .name             = "default",
@@ -200,6 +196,7 @@  static const AVFilterPad avfilter_vf_noformat_outputs[] = {
 const AVFilter ff_vf_noformat = {
     .name          = "noformat",
     .description   = NULL_IF_CONFIG_SMALL("Force libavfilter not to use any of the specified pixel formats for the input to the next filter."),
+    .priv_class    = &format_class,
 
     .init          = init,
     .uninit        = uninit,
@@ -207,7 +204,6 @@  const AVFilter ff_vf_noformat = {
     .query_formats = query_formats,
 
     .priv_size     = sizeof(FormatContext),
-    .priv_class    = &noformat_class,
 
     FILTER_INPUTS(avfilter_vf_noformat_inputs),
     FILTER_OUTPUTS(avfilter_vf_noformat_outputs),