diff mbox series

[FFmpeg-devel,v2,09/17] avcodec/codec_internal: nuke init_static_data()

Message ID 20240408125950.53472-10-ffmpeg@haasn.xyz
State New
Headers show
Series Add avcodec_get_supported_config() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Niklas Haas April 8, 2024, 12:57 p.m. UTC
From: Niklas Haas <git@haasn.dev>

All hail get_supported_config()
---
 libavcodec/allcodecs.c      | 7 +------
 libavcodec/codec_internal.h | 8 --------
 2 files changed, 1 insertion(+), 14 deletions(-)

Comments

Niklas Haas April 9, 2024, 1 p.m. UTC | #1
On Mon, 08 Apr 2024 14:57:13 +0200 Niklas Haas <ffmpeg@haasn.xyz> wrote:
> From: Niklas Haas <git@haasn.dev>
> 
> All hail get_supported_config()
> ---
>  libavcodec/allcodecs.c      | 7 +------
>  libavcodec/codec_internal.h | 8 --------
>  2 files changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index a9f1797930a..1f22e06e710 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -916,13 +916,8 @@ static AVOnce av_codec_static_init = AV_ONCE_INIT;
>  static void av_codec_init_static(void)
>  {
>      for (int i = 0; codec_list[i]; i++) {
> -        const FFCodec *codec = codec_list[i];
> -        if (codec->init_static_data) {
> -            codec->init_static_data((FFCodec*) codec);
> -            continue;
> -        }
> -
>          /* Backward compatibility with deprecated public fields */
> +        const FFCodec *codec = codec_list[i];
>          if (!codec->get_supported_config)
>              continue;
>  
> diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h
> index bac3e30ba2c..d3033db3375 100644
> --- a/libavcodec/codec_internal.h
> +++ b/libavcodec/codec_internal.h
> @@ -174,14 +174,6 @@ typedef struct FFCodec {
>       */
>      const FFCodecDefault *defaults;
>  
> -    /**
> -     * Initialize codec static data, called from av_codec_iterate().
> -     *
> -     * This is not intended for time consuming operations as it is
> -     * run for every codec regardless of that codec being used.
> -     */
> -    void (*init_static_data)(struct FFCodec *codec);
> -
>      int (*init)(struct AVCodecContext *);
>  
>      union {
> -- 
> 2.44.0
> 

Note: This depends on my other series for dropping init_static_data from
libx264.
diff mbox series

Patch

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index a9f1797930a..1f22e06e710 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -916,13 +916,8 @@  static AVOnce av_codec_static_init = AV_ONCE_INIT;
 static void av_codec_init_static(void)
 {
     for (int i = 0; codec_list[i]; i++) {
-        const FFCodec *codec = codec_list[i];
-        if (codec->init_static_data) {
-            codec->init_static_data((FFCodec*) codec);
-            continue;
-        }
-
         /* Backward compatibility with deprecated public fields */
+        const FFCodec *codec = codec_list[i];
         if (!codec->get_supported_config)
             continue;
 
diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h
index bac3e30ba2c..d3033db3375 100644
--- a/libavcodec/codec_internal.h
+++ b/libavcodec/codec_internal.h
@@ -174,14 +174,6 @@  typedef struct FFCodec {
      */
     const FFCodecDefault *defaults;
 
-    /**
-     * Initialize codec static data, called from av_codec_iterate().
-     *
-     * This is not intended for time consuming operations as it is
-     * run for every codec regardless of that codec being used.
-     */
-    void (*init_static_data)(struct FFCodec *codec);
-
     int (*init)(struct AVCodecContext *);
 
     union {