]> git.sesse.net Git - ffmpeg/commitdiff
bsf: switch to child_class_iterate()
authorAnton Khirnov <anton@khirnov.net>
Wed, 27 May 2020 13:34:07 +0000 (15:34 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 10 Jun 2020 10:36:44 +0000 (12:36 +0200)
libavcodec/bitstream_filters.c
libavcodec/bsf.c
libavcodec/bsf_internal.h

index a7aa5dca654a16cd63e4c1395e112cb551b4447b..b26d6a910e7b0bef8175cf16f8fc871e3cb53c39 100644 (file)
@@ -96,6 +96,7 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
     return NULL;
 }
 
+#if FF_API_CHILD_CLASS_NEXT
 const AVClass *ff_bsf_child_class_next(const AVClass *prev)
 {
     const AVBitStreamFilter *f = NULL;
@@ -115,3 +116,16 @@ const AVClass *ff_bsf_child_class_next(const AVClass *prev)
     }
     return NULL;
 }
+#endif
+
+const AVClass *ff_bsf_child_class_iterate(void **opaque)
+{
+    const AVBitStreamFilter *f;
+
+    /* find next filter with priv options */
+    while ((f = av_bsf_iterate(opaque))) {
+        if (f->priv_class)
+            return f->priv_class;
+    }
+    return NULL;
+}
index 5e1c794a76f9304039c5b0d80a1dce4c4b84501d..d71bc32584bc9ddd7a24bd047fe51a413c3dbabe 100644 (file)
@@ -79,7 +79,10 @@ static const AVClass bsf_class = {
     .item_name        = bsf_to_name,
     .version          = LIBAVUTIL_VERSION_INT,
     .child_next       = bsf_child_next,
+#if FF_API_CHILD_CLASS_NEXT
     .child_class_next = ff_bsf_child_class_next,
+#endif
+    .child_class_iterate = ff_bsf_child_class_iterate,
     .category         = AV_CLASS_CATEGORY_BITSTREAM_FILTER,
 };
 
index fefd5b890579ee95d43e673327a9901a1e875558..b78c134bdda61345f6e4d13a11c0cb83cd613344 100644 (file)
@@ -42,6 +42,10 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt);
  */
 int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt);
 
+#if FF_API_CHILD_CLASS_NEXT
 const AVClass *ff_bsf_child_class_next(const AVClass *prev);
+#endif
+
+const AVClass *ff_bsf_child_class_iterate(void **opaque);
 
 #endif /* AVCODEC_BSF_INTERNAL_H */