diff mbox series

[FFmpeg-devel,12/17] framesync: switch to child_class_iterate()

Message ID 20200528201559.22618-12-anton@khirnov.net
State Accepted
Headers show
Series [FFmpeg-devel,01/17] Remove unnecessary use of avcodec_close(). | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Anton Khirnov May 28, 2020, 8:15 p.m. UTC
---
 libavfilter/framesync.c | 7 +++++++
 libavfilter/framesync.h | 3 +++
 2 files changed, 10 insertions(+)

Comments

Nicolas George May 29, 2020, 11:26 a.m. UTC | #1
Anton Khirnov (12020-05-28):
> ---
>  libavfilter/framesync.c | 7 +++++++
>  libavfilter/framesync.h | 3 +++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
> index b32a5cba6c..04119d686c 100644
> --- a/libavfilter/framesync.c
> +++ b/libavfilter/framesync.c
> @@ -53,6 +53,13 @@ static const AVClass framesync_class = {
>      .parent_log_context_offset = OFFSET(parent),
>  };
>  
> +const AVClass *ff_framesync_child_class_iterate(void **iter)
> +{
> +    const AVClass *c = *iter ? NULL : &framesync_class;

> +    *iter = (void*)(uintptr_t)c;

"void *" please.

> +    return c;
> +}
> +
>  enum {
>      STATE_BOF,
>      STATE_RUN,
> diff --git a/libavfilter/framesync.h b/libavfilter/framesync.h
> index 37743cccb7..51bab16285 100644
> --- a/libavfilter/framesync.h
> +++ b/libavfilter/framesync.h
> @@ -297,6 +297,8 @@ int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1);
>   */
>  int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1);
>  
> +const AVClass *ff_framesync_child_class_iterate(void **iter);
> +
>  #define FRAMESYNC_DEFINE_CLASS(name, context, field) \
>  static int name##_framesync_preinit(AVFilterContext *ctx) { \
>      context *s = ctx->priv; \
> @@ -318,6 +320,7 @@ static const AVClass name##_class = { \
>      .version          = LIBAVUTIL_VERSION_INT, \
>      .category         = AV_CLASS_CATEGORY_FILTER, \
>      .child_class_next = name##_child_class_next, \
> +    .child_class_iterate = ff_framesync_child_class_iterate, \
>      .child_next       = name##_child_next, \
>  }
>  

LGTM.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/framesync.c b/libavfilter/framesync.c
index b32a5cba6c..04119d686c 100644
--- a/libavfilter/framesync.c
+++ b/libavfilter/framesync.c
@@ -53,6 +53,13 @@  static const AVClass framesync_class = {
     .parent_log_context_offset = OFFSET(parent),
 };
 
+const AVClass *ff_framesync_child_class_iterate(void **iter)
+{
+    const AVClass *c = *iter ? NULL : &framesync_class;
+    *iter = (void*)(uintptr_t)c;
+    return c;
+}
+
 enum {
     STATE_BOF,
     STATE_RUN,
diff --git a/libavfilter/framesync.h b/libavfilter/framesync.h
index 37743cccb7..51bab16285 100644
--- a/libavfilter/framesync.h
+++ b/libavfilter/framesync.h
@@ -297,6 +297,8 @@  int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1);
  */
 int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1);
 
+const AVClass *ff_framesync_child_class_iterate(void **iter);
+
 #define FRAMESYNC_DEFINE_CLASS(name, context, field) \
 static int name##_framesync_preinit(AVFilterContext *ctx) { \
     context *s = ctx->priv; \
@@ -318,6 +320,7 @@  static const AVClass name##_class = { \
     .version          = LIBAVUTIL_VERSION_INT, \
     .category         = AV_CLASS_CATEGORY_FILTER, \
     .child_class_next = name##_child_class_next, \
+    .child_class_iterate = ff_framesync_child_class_iterate, \
     .child_next       = name##_child_next, \
 }