[FFmpeg-cvslog] all: use designated initializers for AVOption.unit

Anton Khirnov git at videolan.org
Wed Feb 14 15:54:25 EET 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Feb 11 15:41:05 2024 +0100| [1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86] | committer: Anton Khirnov

all: use designated initializers for AVOption.unit

Makes it robust against adding fields before it, which will be useful in
following commits.

Majority of the patch generated by the following Coccinelle script:

@@
typedef AVOption;
identifier arr_name;
initializer list il;
initializer list[8] il1;
expression tail;
@@
AVOption arr_name[] = { il, { il1,
- tail
+ .unit = tail
}, ...  };

with some manual changes, as the script:
* has trouble with options defined inside macros
* sometimes does not handle options under an #else branch
* sometimes swallows whitespace

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86
---

 fftools/ffmpeg_mux_init.c              |   2 +-
 libavcodec/aacdec_template.c           |  16 +-
 libavcodec/aacenc.c                    |   8 +-
 libavcodec/ac3dec_float.c              |   2 +-
 libavcodec/ac3enc.c                    |  58 ++--
 libavcodec/amfenc_av1.c                | 162 +++++-----
 libavcodec/amfenc_h264.c               | 150 +++++-----
 libavcodec/amfenc_hevc.c               | 146 ++++-----
 libavcodec/apedec.c                    |   4 +-
 libavcodec/audiotoolboxenc.c           |  12 +-
 libavcodec/avdct.c                     |  46 +--
 libavcodec/bsf/av1_metadata.c          |   4 +-
 libavcodec/bsf/dump_extradata.c        |   2 +-
 libavcodec/bsf/dv_error_marker.c       |  38 +--
 libavcodec/bsf/filter_units.c          |  20 +-
 libavcodec/bsf/h264_metadata.c         |   4 +-
 libavcodec/bsf/h265_metadata.c         |   2 +-
 libavcodec/bsf/hapqa_extract.c         |   6 +-
 libavcodec/bsf/prores_metadata.c       |  46 +--
 libavcodec/bsf/remove_extradata.c      |   2 +-
 libavcodec/bsf/vp9_metadata.c          |   4 +-
 libavcodec/cbs_bsf.h                   |   4 +-
 libavcodec/ccaption_dec.c              |   8 +-
 libavcodec/cfhdenc.c                   |  28 +-
 libavcodec/cuviddec.c                  |   8 +-
 libavcodec/dcadec.c                    |   6 +-
 libavcodec/dnxhdenc.c                  |  14 +-
 libavcodec/dolby_e.c                   |   6 +-
 libavcodec/dxvenc.c                    |   4 +-
 libavcodec/exr.c                       |  34 +--
 libavcodec/exrenc.c                    |  16 +-
 libavcodec/ffv1enc.c                   |  10 +-
 libavcodec/flacenc.c                   |  36 +--
 libavcodec/gif.c                       |   6 +-
 libavcodec/hapenc.c                    |  14 +-
 libavcodec/huffyuvenc.c                |   8 +-
 libavcodec/j2kenc.c                    |  24 +-
 libavcodec/jpeglsenc.c                 |   8 +-
 libavcodec/libaomenc.c                 |  28 +-
 libavcodec/libaribb24.c                |   6 +-
 libavcodec/libaribcaption.c            |   4 +-
 libavcodec/libfdk-aacdec.c             |  20 +-
 libavcodec/libfdk-aacenc.c             |  10 +-
 libavcodec/libopenh264enc.c            |  30 +-
 libavcodec/libopenjpegenc.c            |  36 +--
 libavcodec/libopusenc.c                |  18 +-
 libavcodec/libsvtav1.c                 |  14 +-
 libavcodec/libtwolame.c                |  12 +-
 libavcodec/libvpxenc.c                 |  60 ++--
 libavcodec/libwebpenc_common.c         |  16 +-
 libavcodec/libx264.c                   |  70 ++---
 libavcodec/libxavs.c                   |  22 +-
 libavcodec/libxeve.c                   |  34 +--
 libavcodec/libxvid.c                   |   8 +-
 libavcodec/libzvbi-teletextdec.c       |   8 +-
 libavcodec/ljpegenc.c                  |   8 +-
 libavcodec/magicyuvenc.c               |   8 +-
 libavcodec/mediacodecenc.c             | 226 +++++++-------
 libavcodec/mfenc.c                     |  36 +--
 libavcodec/mjpegenc.c                  |   6 +-
 libavcodec/mlpenc.c                    |  12 +-
 libavcodec/mpeg12enc.c                 |  24 +-
 libavcodec/mpegvideoenc.h              |  54 ++--
 libavcodec/nvenc_av1.c                 | 142 ++++-----
 libavcodec/nvenc_h264.c                | 208 ++++++-------
 libavcodec/nvenc_hevc.c                | 182 ++++++------
 libavcodec/omx.c                       |   8 +-
 libavcodec/options.c                   |   2 +-
 libavcodec/options_table.h             | 526 ++++++++++++++++-----------------
 libavcodec/opusenc.c                   |   4 +-
 libavcodec/pngenc.c                    |  14 +-
 libavcodec/profiles.h                  |   2 +-
 libavcodec/proresenc_kostya.c          |  30 +-
 libavcodec/qsvdec.c                    |  24 +-
 libavcodec/qsvenc.h                    |  54 ++--
 libavcodec/qsvenc_av1.c                |   6 +-
 libavcodec/qsvenc_h264.c               |  40 +--
 libavcodec/qsvenc_hevc.c               |  42 +--
 libavcodec/qsvenc_mpeg2.c              |  10 +-
 libavcodec/qsvenc_vp9.c                |  12 +-
 libavcodec/s302m.c                     |  10 +-
 libavcodec/snowenc.c                   |  16 +-
 libavcodec/svq1enc.c                   |   8 +-
 libavcodec/tiffenc.c                   |  10 +-
 libavcodec/utvideoenc.c                |  10 +-
 libavcodec/vaapi_encode.h              |   6 +-
 libavcodec/vaapi_encode_av1.c          |  14 +-
 libavcodec/vaapi_encode_h264.c         |  28 +-
 libavcodec/vaapi_encode_h265.c         |  20 +-
 libavcodec/vaapi_encode_mpeg2.c        |   8 +-
 libavcodec/vbnenc.c                    |   8 +-
 libavcodec/vc2enc.c                    |  26 +-
 libavcodec/videotoolboxenc.c           |  72 ++---
 libavdevice/bktr.c                     |  14 +-
 libavdevice/caca.c                     |  10 +-
 libavdevice/decklink_dec_c.c           | 104 +++----
 libavdevice/decklink_enc_c.c           |  48 +--
 libavdevice/iec61883.c                 |   8 +-
 libavdevice/libcdio.c                  |  12 +-
 libavdevice/openal-dec.c               |   6 +-
 libavdevice/v4l2.c                     |  26 +-
 libavdevice/xcbgrab.c                  |   4 +-
 libavfilter/af_aap.c                   |  20 +-
 libavfilter/af_acrossover.c            |  30 +-
 libavfilter/af_acrusher.c              |   6 +-
 libavfilter/af_adeclick.c              |  24 +-
 libavfilter/af_adenorm.c               |  10 +-
 libavfilter/af_adynamicequalizer.c     |  48 +--
 libavfilter/af_aemphasis.c             |  26 +-
 libavfilter/af_afade.c                 | 116 ++++----
 libavfilter/af_afftdn.c                |  62 ++--
 libavfilter/af_afir.c                  |  34 +--
 libavfilter/af_afwtdn.c                |  16 +-
 libavfilter/af_agate.c                 |  18 +-
 libavfilter/af_aiir.c                  |  40 +--
 libavfilter/af_amix.c                  |   8 +-
 libavfilter/af_anequalizer.c           |   6 +-
 libavfilter/af_anlmdn.c                |  10 +-
 libavfilter/af_anlms.c                 |  20 +-
 libavfilter/af_aphaser.c               |  10 +-
 libavfilter/af_apulsator.c             |  20 +-
 libavfilter/af_arls.c                  |  20 +-
 libavfilter/af_asoftclip.c             |  20 +-
 libavfilter/af_aspectralstats.c        |  32 +-
 libavfilter/af_astats.c                |  60 ++--
 libavfilter/af_axcorrelate.c           |   8 +-
 libavfilter/af_biquads.c               |  46 +--
 libavfilter/af_bs2b.c                  |   8 +-
 libavfilter/af_deesser.c               |   8 +-
 libavfilter/af_firequalizer.c          |  34 +--
 libavfilter/af_flanger.c               |  16 +-
 libavfilter/af_haas.c                  |  10 +-
 libavfilter/af_hdcd.c                  |  20 +-
 libavfilter/af_headphone.c             |  12 +-
 libavfilter/af_loudnorm.c              |   8 +-
 libavfilter/af_rubberband.c            |  56 ++--
 libavfilter/af_sidechaincompress.c     |  18 +-
 libavfilter/af_silenceremove.c         |  28 +-
 libavfilter/af_sofalizer.c             |   6 +-
 libavfilter/af_stereotools.c           |  34 +--
 libavfilter/af_surround.c              |   6 +-
 libavfilter/af_volume.c                |  20 +-
 libavfilter/asrc_afirsrc.c             |  58 ++--
 libavfilter/asrc_anoisesrc.c           |  18 +-
 libavfilter/avf_abitscope.c            |   8 +-
 libavfilter/avf_ahistogram.c           |  36 +--
 libavfilter/avf_avectorscope.c         |  38 +--
 libavfilter/avf_showcqt.c              |  16 +-
 libavfilter/avf_showcwt.c              |  62 ++--
 libavfilter/avf_showfreqs.c            |  40 +--
 libavfilter/avf_showspectrum.c         | 148 +++++-----
 libavfilter/avf_showvolume.c           |  18 +-
 libavfilter/avf_showwaves.c            |   2 +-
 libavfilter/avfilter.c                 |   2 +-
 libavfilter/avfiltergraph.c            |   4 +-
 libavfilter/buffersrc.c                |  48 +--
 libavfilter/dnn/dnn_backend_openvino.c |   8 +-
 libavfilter/f_bench.c                  |   6 +-
 libavfilter/f_drawgraph.c              |  20 +-
 libavfilter/f_ebur128.c                |  36 +--
 libavfilter/f_graphmonitor.c           |  56 ++--
 libavfilter/f_interleave.c             |   8 +-
 libavfilter/f_metadata.c               |  28 +-
 libavfilter/f_perms.c                  |  12 +-
 libavfilter/f_sidedata.c               |  50 ++--
 libavfilter/framesync.c                |  14 +-
 libavfilter/qrencode.c                 |  18 +-
 libavfilter/vaf_spectrumsynth.c        |  22 +-
 libavfilter/vf_atadenoise.c            |   6 +-
 libavfilter/vf_blend.c                 |  94 +++---
 libavfilter/vf_blend_vulkan.c          |  14 +-
 libavfilter/vf_bm3d.c                  |   6 +-
 libavfilter/vf_bwdif.c                 |   8 +-
 libavfilter/vf_chromanr.c              |   6 +-
 libavfilter/vf_chromashift.c           |  12 +-
 libavfilter/vf_ciescope.c              |  68 ++---
 libavfilter/vf_codecview.c             |  12 +-
 libavfilter/vf_colorchannelmixer.c     |  16 +-
 libavfilter/vf_colorcorrect.c          |  10 +-
 libavfilter/vf_colorlevels.c           |  16 +-
 libavfilter/vf_colormap.c              |  12 +-
 libavfilter/vf_colorspace.c            |  28 +-
 libavfilter/vf_colorspace_cuda.c       |  10 +-
 libavfilter/vf_convolution.c           |  14 +-
 libavfilter/vf_convolve.c              |  18 +-
 libavfilter/vf_cover_rect.c            |   6 +-
 libavfilter/vf_cropdetect.c            |   6 +-
 libavfilter/vf_curves.c                |  30 +-
 libavfilter/vf_datascope.c             |  14 +-
 libavfilter/vf_deblock.c               |   6 +-
 libavfilter/vf_dedot.c                 |   6 +-
 libavfilter/vf_deflicker.c             |  18 +-
 libavfilter/vf_deinterlace_vaapi.c     |  18 +-
 libavfilter/vf_derain.c                |  10 +-
 libavfilter/vf_deshake.c               |  16 +-
 libavfilter/vf_despill.c               |   6 +-
 libavfilter/vf_detelecine.c            |  10 +-
 libavfilter/vf_displace.c              |  10 +-
 libavfilter/vf_dnn_classify.c          |   4 +-
 libavfilter/vf_dnn_detect.c            |  16 +-
 libavfilter/vf_dnn_processing.c        |   6 +-
 libavfilter/vf_drawtext.c              |  20 +-
 libavfilter/vf_edgedetect.c            |  22 +-
 libavfilter/vf_entropy.c               |   6 +-
 libavfilter/vf_eq.c                    |   2 +-
 libavfilter/vf_estdif.c                |  10 +-
 libavfilter/vf_extractplanes.c         |  16 +-
 libavfilter/vf_fade.c                  |   4 +-
 libavfilter/vf_fftdnoiz.c              |   6 +-
 libavfilter/vf_fftfilt.c               |   2 +-
 libavfilter/vf_field.c                 |   6 +-
 libavfilter/vf_fieldhint.c             |   8 +-
 libavfilter/vf_fieldmatch.c            |  46 +--
 libavfilter/vf_fieldorder.c            |   2 +-
 libavfilter/vf_fillborders.c           |  16 +-
 libavfilter/vf_fps.c                   |  18 +-
 libavfilter/vf_framerate.c             |   6 +-
 libavfilter/vf_geq.c                   |  12 +-
 libavfilter/vf_guided.c                |  12 +-
 libavfilter/vf_histeq.c                |   4 +-
 libavfilter/vf_histogram.c             |  54 ++--
 libavfilter/vf_huesaturation.c         |  16 +-
 libavfilter/vf_hwmap.c                 |  10 +-
 libavfilter/vf_iccgen.c                |  58 ++--
 libavfilter/vf_il.c                    |  42 +--
 libavfilter/vf_lenscorrection.c        |   6 +-
 libavfilter/vf_lensfun.c               |  42 +--
 libavfilter/vf_libplacebo.c            | 208 ++++++-------
 libavfilter/vf_lut3d.c                 |  30 +-
 libavfilter/vf_maskedthreshold.c       |   6 +-
 libavfilter/vf_mcdeint.c               |   4 +-
 libavfilter/vf_mestimate.c             |   4 +-
 libavfilter/vf_minterpolate.c          |  12 +-
 libavfilter/vf_mix.c                   |   8 +-
 libavfilter/vf_morpho.c                |  22 +-
 libavfilter/vf_negate.c                |  16 +-
 libavfilter/vf_nnedi.c                 |  76 ++---
 libavfilter/vf_noise.c                 |  12 +-
 libavfilter/vf_overlay.c               |  14 +-
 libavfilter/vf_overlay_cuda.c          |  10 +-
 libavfilter/vf_overlay_qsv.c           |   8 +-
 libavfilter/vf_overlay_vaapi.c         |   8 +-
 libavfilter/vf_pad.c                   |   2 +-
 libavfilter/vf_palettegen.c            |   8 +-
 libavfilter/vf_paletteuse.c            |  22 +-
 libavfilter/vf_perspective.c           |  14 +-
 libavfilter/vf_phase.c                 |   4 +-
 libavfilter/vf_pixelize.c              |  10 +-
 libavfilter/vf_pp7.c                   |   8 +-
 libavfilter/vf_pseudocolor.c           |  48 +--
 libavfilter/vf_pullup.c                |   8 +-
 libavfilter/vf_remap.c                 |   2 +-
 libavfilter/vf_remap_opencl.c          |   6 +-
 libavfilter/vf_scale.c                 |  50 ++--
 libavfilter/vf_scale_cuda.c            |  18 +-
 libavfilter/vf_scale_npp.c             |  32 +-
 libavfilter/vf_scale_vaapi.c           |  32 +-
 libavfilter/vf_scale_vulkan.c          |  20 +-
 libavfilter/vf_selectivecolor.c        |   6 +-
 libavfilter/vf_setparams.c             | 168 +++++------
 libavfilter/vf_sharpen_npp.c           |   4 +-
 libavfilter/vf_shear.c                 |   6 +-
 libavfilter/vf_shufflepixels.c         |  18 +-
 libavfilter/vf_signalstats.c           |  16 +-
 libavfilter/vf_signature.c             |  14 +-
 libavfilter/vf_spp.c                   |   6 +-
 libavfilter/vf_sr.c                    |   4 +-
 libavfilter/vf_ssim360.c               |  26 +-
 libavfilter/vf_stereo3d.c              | 114 +++----
 libavfilter/vf_subtitles.c             |   8 +-
 libavfilter/vf_telecine.c              |  10 +-
 libavfilter/vf_thumbnail.c             |   8 +-
 libavfilter/vf_tinterlace.c            |  44 +--
 libavfilter/vf_tonemap.c               |  16 +-
 libavfilter/vf_tonemap_opencl.c        |  54 ++--
 libavfilter/vf_tonemap_vaapi.c         |  14 +-
 libavfilter/vf_tpad.c                  |   8 +-
 libavfilter/vf_transpose.c             |  10 +-
 libavfilter/vf_transpose_npp.c         |  18 +-
 libavfilter/vf_transpose_opencl.c      |  10 +-
 libavfilter/vf_transpose_vaapi.c       |  10 +-
 libavfilter/vf_transpose_vt.c          |  10 +-
 libavfilter/vf_transpose_vulkan.c      |  10 +-
 libavfilter/vf_v360.c                  | 224 +++++++-------
 libavfilter/vf_vaguedenoiser.c         |  14 +-
 libavfilter/vf_vectorscope.c           |  62 ++--
 libavfilter/vf_vidstabdetect.c         |   6 +-
 libavfilter/vf_vidstabtransform.c      |  24 +-
 libavfilter/vf_vignette.c              |  12 +-
 libavfilter/vf_vpp_qsv.c               |  64 ++--
 libavfilter/vf_w3fdif.c                |  10 +-
 libavfilter/vf_waveform.c              |  94 +++---
 libavfilter/vf_weave.c                 |  10 +-
 libavfilter/vf_xfade.c                 | 120 ++++----
 libavfilter/vf_xfade_opencl.c          |  22 +-
 libavfilter/vf_xfade_vulkan.c          |  36 +--
 libavfilter/vf_yadif_videotoolbox.m    |   6 +-
 libavfilter/vf_zscale.c                | 220 +++++++-------
 libavfilter/vsrc_ddagrab.c             |  16 +-
 libavfilter/vsrc_gradients.c           |  14 +-
 libavfilter/vsrc_mandelbrot.c          |  22 +-
 libavfilter/vsrc_mptestsrc.c           |  26 +-
 libavfilter/vsrc_sierpinski.c          |   6 +-
 libavfilter/vsrc_testsrc.c             |  14 +-
 libavfilter/vsrc_testsrc_vulkan.c      |  14 +-
 libavfilter/window_func.h              |  46 +--
 libavfilter/yadif_common.c             |   8 +-
 libavformat/avisynth.c                 |  16 +-
 libavformat/chromaprint.c              |   8 +-
 libavformat/dashenc.c                  |  24 +-
 libavformat/flvenc.c                   |  12 +-
 libavformat/hlsenc.c                   |  54 ++--
 libavformat/http.c                     |   6 +-
 libavformat/img2dec.c                  |  18 +-
 libavformat/libamqp.c                  |   6 +-
 libavformat/libopenmpt.c               |   6 +-
 libavformat/librist.c                  |   8 +-
 libavformat/librtmp.c                  |   8 +-
 libavformat/libsrt.c                   |  22 +-
 libavformat/matroskaenc.c              |   8 +-
 libavformat/mov.c                      |   8 +-
 libavformat/movenc.c                   |  58 ++--
 libavformat/mpegtsenc.c                |  34 +--
 libavformat/mxfenc.c                   |  16 +-
 libavformat/nutenc.c                   |   8 +-
 libavformat/options_table.h            |  80 ++---
 libavformat/rtmpproto.c                |  14 +-
 libavformat/rtpenc.h                   |  12 +-
 libavformat/rtsp.c                     |  36 +--
 libavformat/segment.c                  |  20 +-
 libavformat/spdifenc.c                 |   4 +-
 libavformat/unix.c                     |   8 +-
 libavformat/wavenc.c                   |  16 +-
 libavformat/webvttdec.c                |  10 +-
 libavutil/iamf.c                       |  26 +-
 libavutil/tests/opt.c                  |   8 +-
 libswresample/options.c                |  70 ++---
 libswscale/options.c                   |  60 ++--
 338 files changed, 4684 insertions(+), 4684 deletions(-)

Diff:   http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commitdiff;h=1e7d2007c3aca1cc1cd3b1ca409f4ded6c885f86


More information about the ffmpeg-cvslog mailing list