]> git.sesse.net Git - ffmpeg/commitdiff
Convert all AVClass struct declarations to designated initializers.
authorDiego Biurrun <diego@biurrun.de>
Sat, 10 Jun 2017 14:45:06 +0000 (16:45 +0200)
committerDiego Biurrun <diego@biurrun.de>
Mon, 12 Jun 2017 09:01:10 +0000 (11:01 +0200)
19 files changed:
libavcodec/aacenc.c
libavcodec/ac3enc_fixed.c
libavcodec/ac3enc_float.c
libavcodec/dnxhdenc.c
libavcodec/eac3enc.c
libavcodec/flacenc.c
libavcodec/libfdk-aacdec.c
libavcodec/libfdk-aacenc.c
libavcodec/libilbc.c
libavcodec/libopencore-amr.c
libavcodec/libopenh264enc.c
libavcodec/libvo-amrwbenc.c
libavcodec/libvorbis.c
libavfilter/vf_drawtext.c
libavfilter/vsrc_movie.c
libavutil/eval.c
libavutil/file.c
libavutil/imgutils.c
libavutil/tests/opt.c

index 9b0e99b28d0bd33e5b2c2aef7ae6232e6a916cf7..b7f60fb87283c5dd0429f6dcfd374548d8ba66d1 100644 (file)
@@ -803,10 +803,10 @@ static const AVOption aacenc_options[] = {
 };
 
 static const AVClass aacenc_class = {
-    "AAC encoder",
-    av_default_item_name,
-    aacenc_options,
-    LIBAVUTIL_VERSION_INT,
+    .class_name = "AAC encoder",
+    .item_name  = av_default_item_name,
+    .option     = aacenc_options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 AVCodec ff_aac_encoder = {
index cb1c58d578080ff52e3c8de56fd11d2c48b13919..a4ab5dfde2c16db4d5936f93d9aaae3f7018a383 100644 (file)
 
 #define AC3ENC_TYPE AC3ENC_TYPE_AC3_FIXED
 #include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = { "Fixed-Point AC-3 Encoder", av_default_item_name,
-                                      ac3_options, LIBAVUTIL_VERSION_INT };
+
+static const AVClass ac3enc_class = {
+    .class_name = "Fixed-Point AC-3 Encoder",
+    .item_name  = av_default_item_name,
+    .option     = ac3_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 /*
  * Normalize the input samples to use the maximum available precision.
index 249f9edd11c62068c198e963fcfdddb53ce8a5ee..95acea77704ae752701398b0dcefba05a0a77a0e 100644 (file)
 
 #define AC3ENC_TYPE AC3ENC_TYPE_AC3
 #include "ac3enc_opts_template.c"
-static const AVClass ac3enc_class = { "AC-3 Encoder", av_default_item_name,
-                                      ac3_options, LIBAVUTIL_VERSION_INT };
+
+static const AVClass ac3enc_class = {
+    .class_name = "AC-3 Encoder",
+    .item_name  = av_default_item_name,
+    .option     = ac3_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 
 /*
index 9d4b05292a66380a152cb27da172fde23ca52b6f..639debfa06eacca3b7340311a7a32474c36d769b 100644 (file)
@@ -52,10 +52,10 @@ static const AVOption options[] = {
 };
 
 static const AVClass class = {
-    "dnxhd",
-    av_default_item_name,
-    options,
-    LIBAVUTIL_VERSION_INT
+    .class_name = "dnxhd",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *restrict block,
index 3aa2d54013fb1d0059183f60d03a8acee8d29d50..17757bebefb582cd32bd2fa62b42472e1c811762 100644 (file)
 
 #define AC3ENC_TYPE AC3ENC_TYPE_EAC3
 #include "ac3enc_opts_template.c"
-static const AVClass eac3enc_class = { "E-AC-3 Encoder", av_default_item_name,
-                                       ac3_options, LIBAVUTIL_VERSION_INT };
+
+static const AVClass eac3enc_class = {
+    .class_name = "E-AC-3 Encoder",
+    .item_name  = av_default_item_name,
+    .option     = ac3_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 
 /**
index 0c1e6b7673a9792ee11f0a3564006c2147e12f52..2745b17a1cb03b1a66d0dffc7f03e47cb4762b00 100644 (file)
@@ -1359,10 +1359,10 @@ static const AVOption options[] = {
 };
 
 static const AVClass flac_encoder_class = {
-    "FLAC encoder",
-    av_default_item_name,
-    options,
-    LIBAVUTIL_VERSION_INT,
+    .class_name = "FLAC encoder",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 AVCodec ff_flac_encoder = {
index cdf7a0571fd815567a40ab52b317f448470efd85..637d1352a0a839dd40287abea1018f5f06cf046c 100644 (file)
@@ -79,7 +79,10 @@ static const AVOption fdk_aac_dec_options[] = {
 };
 
 static const AVClass fdk_aac_dec_class = {
-    "libfdk-aac decoder", av_default_item_name, fdk_aac_dec_options, LIBAVUTIL_VERSION_INT
+    .class_name = "libfdk-aac decoder",
+    .item_name  = av_default_item_name,
+    .option     = fdk_aac_dec_options,
+    .version    = LIBAVUTIL_VERSION_INT
 };
 
 static int get_stream_info(AVCodecContext *avctx)
index 2cea58f152e11c7f16065ed7de31cc68d3c09481..03879bbf5adbc9515338ad1a9c8fd326b045f8ce 100644 (file)
@@ -54,7 +54,10 @@ static const AVOption aac_enc_options[] = {
 };
 
 static const AVClass aac_enc_class = {
-    "libfdk_aac", av_default_item_name, aac_enc_options, LIBAVUTIL_VERSION_INT
+    .class_name = "libfdk_aac",
+    .item_name  = av_default_item_name,
+    .option     = aac_enc_options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static const char *aac_get_error(AACENC_ERROR err)
index a5b2f3a18bdffd03d649172ab9b5e7a1d90cb308..80b69a562cbf5297ca3fb8bfb3aa773393c6b8f3 100644 (file)
@@ -51,7 +51,10 @@ static const AVOption ilbc_dec_options[] = {
 };
 
 static const AVClass ilbc_dec_class = {
-    "libilbc", av_default_item_name, ilbc_dec_options, LIBAVUTIL_VERSION_INT
+    .class_name = "libilbc",
+    .item_name  = av_default_item_name,
+    .option     = ilbc_dec_options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static av_cold int ilbc_decode_init(AVCodecContext *avctx)
@@ -126,7 +129,10 @@ static const AVOption ilbc_enc_options[] = {
 };
 
 static const AVClass ilbc_enc_class = {
-    "libilbc", av_default_item_name, ilbc_enc_options, LIBAVUTIL_VERSION_INT
+    .class_name = "libilbc",
+    .item_name  = av_default_item_name,
+    .option     = ilbc_enc_options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static av_cold int ilbc_encode_init(AVCodecContext *avctx)
index 27ab7d202fbe50355e4b9bab259a7f45b4698811..8200f6719c6478125c245ea2fc4358c90b91ec1d 100644 (file)
@@ -184,7 +184,10 @@ static const AVOption options[] = {
 };
 
 static const AVClass class = {
-    "libopencore_amrnb", av_default_item_name, options, LIBAVUTIL_VERSION_INT
+    .class_name = "libopencore_amrnb",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
index b7c011893ea1a57750a73a609324c0297c42f66a..3b32790bae5eec0afd53710c543d3c2568cae119 100644 (file)
@@ -75,7 +75,10 @@ static const AVOption options[] = {
 };
 
 static const AVClass class = {
-    "libopenh264enc", av_default_item_name, options, LIBAVUTIL_VERSION_INT
+    .class_name = "libopenh264enc",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static av_cold int svc_encode_close(AVCodecContext *avctx)
index 5fc904cd8f50413503cc7992939ab6ce40c76475..5439d661103d464e4193f87167b350639ce5b3b4 100644 (file)
@@ -46,7 +46,10 @@ static const AVOption options[] = {
 };
 
 static const AVClass class = {
-    "libvo_amrwbenc", av_default_item_name, options, LIBAVUTIL_VERSION_INT
+    .class_name = "libvo_amrwbenc",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 static int get_wb_bitrate_mode(int bitrate, void *log_ctx)
index 86c1ed6a75a5360703480ace0627f202af15469e..3dfd589476d1645f46b11c9023b220084d078c15 100644 (file)
@@ -72,7 +72,12 @@ static const AVCodecDefault defaults[] = {
     { NULL },
 };
 
-static const AVClass class = { "libvorbis", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
+static const AVClass class = {
+    .class_name = "libvorbis",
+    .item_name  = av_default_item_name,
+    .option     = options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
 
 
 static int vorbis_error_to_averror(int ov_err)
index 5668c8e8e0b23e867a0b99f5ca70ea830b38c4b7..a5e3f911b4aef8bd23757ceeba41800d7b5b084b 100644 (file)
@@ -209,9 +209,9 @@ static const char *drawtext_get_name(void *ctx)
 }
 
 static const AVClass drawtext_class = {
-    "DrawTextContext",
-    drawtext_get_name,
-    drawtext_options
+    .class_name = "DrawTextContext",
+    .item_name  = drawtext_get_name,
+    .option     = drawtext_options,
 };
 
 #undef __FTERRORS_H__
index 7fc99258488b53142cf17aea49d6b51debbfb3b7..aff6e620ff1af07987bf2e85c73269c4fb992cbc 100644 (file)
@@ -81,9 +81,9 @@ static const char *movie_get_name(void *ctx)
 }
 
 static const AVClass movie_class = {
-    "MovieContext",
-    movie_get_name,
-    movie_options
+    .class_name = "MovieContext",
+    .item_name  = movie_get_name,
+    .option     = movie_options,
 };
 
 static av_cold int movie_init(AVFilterContext *ctx)
index b5d71c6000e44234df108800784ebfc3718fe3d9..7d7c16e927a4dad304ff50cfb19fb2e61d0aa235 100644 (file)
@@ -52,7 +52,14 @@ typedef struct Parser {
     double var[VARS];
 } Parser;
 
-static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) };
+static const AVClass class = {
+    .class_name                = "Eval",
+    .item_name                 = av_default_item_name,
+    .option                    = NULL,
+    .version                   = LIBAVUTIL_VERSION_INT,
+    .log_level_offset_offset   = offsetof(Parser, log_offset),
+    .parent_log_context_offset = offsetof(Parser, log_ctx),
+};
 
 static const int8_t si_prefixes['z' - 'E' + 1] = {
     ['y'-'E']= -24,
index 18a110aeeb4ac0c03b1265f712bc2df979390ca5..05ed2479a248dce2772a49eafcd031d5be6ec6c4 100644 (file)
@@ -42,8 +42,12 @@ typedef struct FileLogContext {
 } FileLogContext;
 
 static const AVClass file_log_ctx_class = {
-    "FILE", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT,
-    offsetof(FileLogContext, log_offset), offsetof(FileLogContext, log_ctx)
+    .class_name                = "FILE",
+    .item_name                 = av_default_item_name,
+    .option                    = NULL,
+    .version                   = LIBAVUTIL_VERSION_INT,
+    .log_level_offset_offset   = offsetof(FileLogContext, log_offset),
+    .parent_log_context_offset = offsetof(FileLogContext, log_ctx),
 };
 
 int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
index 20d06ec1759e9b846d721f1cc5d6ea58b2e40a35..84abb11656e9957b03c0e8cd51625dde6b8129c6 100644 (file)
@@ -219,7 +219,14 @@ typedef struct ImgUtils {
     void *log_ctx;
 } ImgUtils;
 
-static const AVClass imgutils_class = { "IMGUTILS", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(ImgUtils, log_offset), offsetof(ImgUtils, log_ctx) };
+static const AVClass imgutils_class = {
+    .class_name                = "IMGUTILS",
+    .item_name                 = av_default_item_name,
+    .option                    = NULL,
+    .version                   = LIBAVUTIL_VERSION_INT,
+    .log_level_offset_offset   = offsetof(ImgUtils, log_offset),
+    .parent_log_context_offset = offsetof(ImgUtils, log_ctx),
+};
 
 int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
 {
index 350ce3d8202f42b739833916a240d514439a51a7..9ed9d2b6b1fd4650c96e0f626012835967536f67 100644 (file)
@@ -59,9 +59,9 @@ static const char *test_get_name(void *ctx)
 }
 
 static const AVClass test_class = {
-    "TestContext",
-    test_get_name,
-    test_options
+    .class_name = "TestContext",
+    .item_name  = test_get_name,
+    .option     = test_options,
 };
 
 int main(void)