This macro will allow to share options between AVClasses without
having to redefine the option name (as is currently done) and will
also allow to share the AVClasses itself (which is possible now
that AVClass.child_class_next is gone).

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavfilter/internal.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 6ddf024d93..e7c154aff0 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -278,14 +278,16 @@ int ff_append_outpad_free_name(AVFilterContext *f, 
AVFilterPad *p);
  */
 int ff_request_frame(AVFilterLink *link);
 
-#define AVFILTER_DEFINE_CLASS(fname)            \
-    static const AVClass fname##_class = {      \
-        .class_name = #fname,                   \
+#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options) \
+    static const AVClass name##_class = {       \
+        .class_name = desc,                     \
         .item_name  = av_default_item_name,     \
-        .option     = fname##_options,          \
+        .option     = options,                  \
         .version    = LIBAVUTIL_VERSION_INT,    \
         .category   = AV_CLASS_CATEGORY_FILTER, \
     }
+#define AVFILTER_DEFINE_CLASS(fname) \
+    AVFILTER_DEFINE_CLASS_EXT(fname, #fname, fname##_options)
 
 /**
  * Find the index of a link.
-- 
2.30.2

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to