[FFmpeg-devel] [PATCH 16/17] AVIOContext: switch to child_class_iterate()

Anton Khirnov anton at khirnov.net
Thu May 28 23:15:58 EEST 2020


---
 libavformat/aviobuf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index eb0387bdf7..5ba5de01c6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -48,10 +48,19 @@ static void *ff_avio_child_next(void *obj, void *prev)
     return prev ? NULL : s->opaque;
 }
 
+#if FF_API_CHILD_CLASS_NEXT
 static const AVClass *ff_avio_child_class_next(const AVClass *prev)
 {
     return prev ? NULL : &ffurl_context_class;
 }
+#endif
+
+static const AVClass *child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : &ffurl_context_class;
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
 
 #define OFFSET(x) offsetof(AVIOContext,x)
 #define E AV_OPT_FLAG_ENCODING_PARAM
@@ -67,7 +76,10 @@ const AVClass ff_avio_class = {
     .version    = LIBAVUTIL_VERSION_INT,
     .option     = ff_avio_options,
     .child_next = ff_avio_child_next,
+#if FF_API_CHILD_CLASS_NEXT
     .child_class_next = ff_avio_child_class_next,
+#endif
+    .child_class_iterate = child_class_iterate,
 };
 
 static void fill_buffer(AVIOContext *s);
-- 
2.26.2



More information about the ffmpeg-devel mailing list