From 20f972701806be20a77f808db332d9489343bb78 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 16 Mar 2022 21:09:54 +0100 Subject: [PATCH] avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- configure | 6 +- libavcodec/012v.c | 12 +- libavcodec/4xm.c | 12 +- libavcodec/8bps.c | 12 +- libavcodec/8svx.c | 28 +- libavcodec/a64multienc.c | 28 +- libavcodec/aacdec.c | 42 +- libavcodec/aacdec_fixed.c | 20 +- libavcodec/aacenc.c | 18 +- libavcodec/aasc.c | 12 +- libavcodec/ac3dec_fixed.c | 16 +- libavcodec/ac3dec_float.c | 32 +- libavcodec/ac3enc_fixed.c | 22 +- libavcodec/ac3enc_float.c | 22 +- libavcodec/adpcm.c | 14 +- libavcodec/adpcmenc.c | 18 +- libavcodec/adxdec.c | 14 +- libavcodec/adxenc.c | 14 +- libavcodec/agm.c | 12 +- libavcodec/aic.c | 12 +- libavcodec/alac.c | 14 +- libavcodec/alacenc.c | 20 +- libavcodec/aliaspixdec.c | 13 +- libavcodec/aliaspixenc.c | 13 +- libavcodec/allcodecs.c | 1595 ++++++++++++++------------- libavcodec/alsdec.c | 12 +- libavcodec/amfenc_h264.c | 18 +- libavcodec/amfenc_hevc.c | 18 +- libavcodec/amrnbdec.c | 14 +- libavcodec/amrwbdec.c | 14 +- libavcodec/anm.c | 12 +- libavcodec/ansi.c | 12 +- libavcodec/apedec.c | 16 +- libavcodec/aptxdec.c | 36 +- libavcodec/aptxenc.c | 40 +- libavcodec/arbc.c | 12 +- libavcodec/argo.c | 12 +- libavcodec/assdec.c | 20 +- libavcodec/assenc.c | 20 +- libavcodec/asvdec.c | 24 +- libavcodec/asvenc.c | 24 +- libavcodec/atrac1.c | 14 +- libavcodec/atrac3.c | 28 +- libavcodec/atrac3plusdec.c | 24 +- libavcodec/atrac9dec.c | 12 +- libavcodec/audiotoolboxdec.c | 16 +- libavcodec/audiotoolboxenc.c | 24 +- libavcodec/aura.c | 12 +- libavcodec/av1dec.c | 16 +- libavcodec/avcodec.c | 36 +- libavcodec/avrndec.c | 12 +- libavcodec/avs.c | 12 +- libavcodec/avuidec.c | 12 +- libavcodec/avuienc.c | 14 +- libavcodec/bethsoftvideo.c | 12 +- libavcodec/bfi.c | 12 +- libavcodec/bink.c | 12 +- libavcodec/binkaudio.c | 24 +- libavcodec/bintext.c | 36 +- libavcodec/bitpacked_dec.c | 12 +- libavcodec/bitpacked_enc.c | 14 +- libavcodec/bmp.c | 13 +- libavcodec/bmpenc.c | 14 +- libavcodec/bmvaudio.c | 12 +- libavcodec/bmvvideo.c | 12 +- libavcodec/brenderpix.c | 13 +- libavcodec/c93.c | 12 +- libavcodec/cavsdec.c | 12 +- libavcodec/ccaption_dec.c | 14 +- libavcodec/cdgraphics.c | 12 +- libavcodec/cdtoons.c | 12 +- libavcodec/cdxl.c | 12 +- libavcodec/cfhd.c | 12 +- libavcodec/cfhdenc.c | 16 +- libavcodec/cinepak.c | 12 +- libavcodec/cinepakenc.c | 14 +- libavcodec/clearvideo.c | 12 +- libavcodec/cljrdec.c | 12 +- libavcodec/cljrenc.c | 17 +- libavcodec/cllc.c | 12 +- libavcodec/cngdec.c | 14 +- libavcodec/cngenc.c | 16 +- libavcodec/codec.h | 121 -- libavcodec/codec_internal.h | 134 ++- libavcodec/cook.c | 14 +- libavcodec/cpia.c | 12 +- libavcodec/cri.c | 12 +- libavcodec/crystalhd.c | 18 +- libavcodec/cscd.c | 12 +- libavcodec/cuviddec.c | 20 +- libavcodec/cyuv.c | 24 +- libavcodec/dcadec.c | 18 +- libavcodec/dcaenc.c | 22 +- libavcodec/dds.c | 12 +- libavcodec/decode.c | 37 +- libavcodec/decode.h | 2 +- libavcodec/dfa.c | 12 +- libavcodec/dfpwmdec.c | 12 +- libavcodec/dfpwmenc.c | 14 +- libavcodec/diracdec.c | 12 +- libavcodec/dnxhddec.c | 14 +- libavcodec/dnxhdenc.c | 18 +- libavcodec/dolby_e.c | 16 +- libavcodec/dpcm.c | 12 +- libavcodec/dpx.c | 13 +- libavcodec/dpxenc.c | 14 +- libavcodec/dsddec.c | 14 +- libavcodec/dsicinaudio.c | 12 +- libavcodec/dsicinvideo.c | 12 +- libavcodec/dss_sp.c | 12 +- libavcodec/dstdec.c | 14 +- libavcodec/dvaudiodec.c | 12 +- libavcodec/dvbsubdec.c | 12 +- libavcodec/dvbsubenc.c | 11 +- libavcodec/dvdec.c | 14 +- libavcodec/dvdsubdec.c | 12 +- libavcodec/dvdsubenc.c | 12 +- libavcodec/dvenc.c | 16 +- libavcodec/dxa.c | 12 +- libavcodec/dxtory.c | 13 +- libavcodec/dxv.c | 12 +- libavcodec/eac3enc.c | 22 +- libavcodec/eacmv.c | 12 +- libavcodec/eamad.c | 12 +- libavcodec/eatgq.c | 12 +- libavcodec/eatgv.c | 12 +- libavcodec/eatqi.c | 12 +- libavcodec/encode.c | 12 +- libavcodec/encode.h | 4 +- libavcodec/escape124.c | 12 +- libavcodec/escape130.c | 12 +- libavcodec/evrcdec.c | 14 +- libavcodec/exr.c | 14 +- libavcodec/exrenc.c | 16 +- libavcodec/fastaudio.c | 14 +- libavcodec/ffv1dec.c | 12 +- libavcodec/ffv1enc.c | 16 +- libavcodec/ffwavesynth.c | 12 +- libavcodec/fic.c | 14 +- libavcodec/fitsdec.c | 15 +- libavcodec/fitsenc.c | 15 +- libavcodec/flacdec.c | 16 +- libavcodec/flacenc.c | 16 +- libavcodec/flashsv.c | 28 +- libavcodec/flashsv2enc.c | 12 +- libavcodec/flashsvenc.c | 12 +- libavcodec/flicvideo.c | 12 +- libavcodec/flvdec.c | 16 +- libavcodec/flvenc.c | 14 +- libavcodec/fmvc.c | 12 +- libavcodec/frame_thread_encoder.c | 3 +- libavcodec/fraps.c | 12 +- libavcodec/frwu.c | 14 +- libavcodec/g2meet.c | 12 +- libavcodec/g722dec.c | 14 +- libavcodec/g722enc.c | 18 +- libavcodec/g723_1dec.c | 14 +- libavcodec/g723_1enc.c | 16 +- libavcodec/g726.c | 56 +- libavcodec/g729dec.c | 24 +- libavcodec/gdv.c | 12 +- libavcodec/gemdec.c | 13 +- libavcodec/gif.c | 14 +- libavcodec/gifdec.c | 14 +- libavcodec/gsmdec.c | 24 +- libavcodec/h261dec.c | 14 +- libavcodec/h261enc.c | 14 +- libavcodec/h263dec.c | 32 +- libavcodec/h264dec.c | 16 +- libavcodec/hapdec.c | 12 +- libavcodec/hapenc.c | 14 +- libavcodec/hcadec.c | 14 +- libavcodec/hcom.c | 12 +- libavcodec/hevcdec.c | 16 +- libavcodec/hnm4video.c | 12 +- libavcodec/hq_hqa.c | 12 +- libavcodec/hqx.c | 12 +- libavcodec/huffyuvdec.c | 36 +- libavcodec/huffyuvenc.c | 32 +- libavcodec/idcinvideo.c | 12 +- libavcodec/iff.c | 12 +- libavcodec/ilbcdec.c | 12 +- libavcodec/imc.c | 28 +- libavcodec/imm4.c | 12 +- libavcodec/imm5.c | 10 +- libavcodec/imx.c | 12 +- libavcodec/indeo2.c | 12 +- libavcodec/indeo3.c | 12 +- libavcodec/indeo4.c | 12 +- libavcodec/indeo5.c | 12 +- libavcodec/intelh263dec.c | 14 +- libavcodec/internal.h | 2 +- libavcodec/interplayacm.c | 12 +- libavcodec/interplayvideo.c | 12 +- libavcodec/ituh263enc.c | 30 +- libavcodec/j2kenc.c | 14 +- libavcodec/jacosubdec.c | 10 +- libavcodec/jpeg2000dec.c | 18 +- libavcodec/jpeglsdec.c | 12 +- libavcodec/jpeglsenc.c | 16 +- libavcodec/jvdec.c | 12 +- libavcodec/kgv1dec.c | 12 +- libavcodec/kmvc.c | 12 +- libavcodec/lagarith.c | 12 +- libavcodec/lcldec.c | 24 +- libavcodec/lclenc.c | 14 +- libavcodec/libaomdec.c | 16 +- libavcodec/libaomenc.c | 30 +- libavcodec/libaribb24.c | 15 +- libavcodec/libcelt_dec.c | 15 +- libavcodec/libcodec2.c | 43 +- libavcodec/libdav1d.c | 16 +- libavcodec/libdavs2.c | 16 +- libavcodec/libfdk-aacdec.c | 16 +- libavcodec/libfdk-aacenc.c | 26 +- libavcodec/libgsmdec.c | 29 +- libavcodec/libgsmenc.c | 40 +- libavcodec/libilbc.c | 30 +- libavcodec/libkvazaar.c | 18 +- libavcodec/libmp3lame.c | 24 +- libavcodec/libopencore-amr.c | 43 +- libavcodec/libopenh264dec.c | 14 +- libavcodec/libopenh264enc.c | 18 +- libavcodec/libopenjpegdec.c | 19 +- libavcodec/libopenjpegenc.c | 20 +- libavcodec/libopusdec.c | 18 +- libavcodec/libopusenc.c | 20 +- libavcodec/librav1e.c | 18 +- libavcodec/librsvgdec.c | 17 +- libavcodec/libshine.c | 24 +- libavcodec/libspeexdec.c | 15 +- libavcodec/libspeexenc.c | 24 +- libavcodec/libsvtav1.c | 18 +- libavcodec/libtheoraenc.c | 18 +- libavcodec/libtwolame.c | 24 +- libavcodec/libuavs3d.c | 16 +- libavcodec/libvo-amrwbenc.c | 17 +- libavcodec/libvorbisdec.c | 13 +- libavcodec/libvorbisenc.c | 18 +- libavcodec/libvpx.c | 8 +- libavcodec/libvpx.h | 4 +- libavcodec/libvpxdec.c | 30 +- libavcodec/libvpxenc.c | 36 +- libavcodec/libwebpenc.c | 19 +- libavcodec/libwebpenc_animencoder.c | 19 +- libavcodec/libwebpenc_common.h | 1 - libavcodec/libx264.c | 62 +- libavcodec/libx265.c | 24 +- libavcodec/libxavs.c | 18 +- libavcodec/libxavs2.c | 18 +- libavcodec/libxvid.c | 16 +- libavcodec/libzvbi-teletextdec.c | 17 +- libavcodec/ljpegenc.c | 16 +- libavcodec/loco.c | 12 +- libavcodec/lscrdec.c | 12 +- libavcodec/m101.c | 12 +- libavcodec/mace.c | 28 +- libavcodec/magicyuv.c | 12 +- libavcodec/magicyuvenc.c | 16 +- libavcodec/mdec.c | 12 +- libavcodec/mediacodecdec.c | 16 +- libavcodec/metasound.c | 14 +- libavcodec/mfenc.c | 18 +- libavcodec/microdvddec.c | 10 +- libavcodec/midivid.c | 12 +- libavcodec/mimic.c | 12 +- libavcodec/mjpegbdec.c | 14 +- libavcodec/mjpegdec.c | 44 +- libavcodec/mjpegenc.c | 32 +- libavcodec/mlpdec.c | 28 +- libavcodec/mlpenc.c | 40 +- libavcodec/mmaldec.c | 18 +- libavcodec/mmvideo.c | 12 +- libavcodec/mobiclip.c | 12 +- libavcodec/motionpixels.c | 12 +- libavcodec/movtextdec.c | 12 +- libavcodec/movtextenc.c | 12 +- libavcodec/mpc7.c | 14 +- libavcodec/mpc8.c | 14 +- libavcodec/mpeg12dec.c | 56 +- libavcodec/mpeg12enc.c | 36 +- libavcodec/mpeg4videodec.c | 20 +- libavcodec/mpeg4videoenc.c | 16 +- libavcodec/mpegaudiodec_fixed.c | 70 +- libavcodec/mpegaudiodec_float.c | 70 +- libavcodec/mpegaudioenc_fixed.c | 18 +- libavcodec/mpegaudioenc_float.c | 18 +- libavcodec/mpl2dec.c | 10 +- libavcodec/mscc.c | 24 +- libavcodec/msmpeg4dec.c | 64 +- libavcodec/msmpeg4enc.c | 42 +- libavcodec/msp2dec.c | 13 +- libavcodec/msrle.c | 12 +- libavcodec/mss1.c | 12 +- libavcodec/mss2.c | 12 +- libavcodec/mss3.c | 12 +- libavcodec/mss4.c | 12 +- libavcodec/msvideo1.c | 12 +- libavcodec/msvideo1enc.c | 12 +- libavcodec/mv30.c | 12 +- libavcodec/mvcdec.c | 24 +- libavcodec/mvha.c | 12 +- libavcodec/mwsc.c | 12 +- libavcodec/mxpegdec.c | 14 +- libavcodec/nellymoserdec.c | 14 +- libavcodec/nellymoserenc.c | 16 +- libavcodec/notchlc.c | 12 +- libavcodec/nuv.c | 12 +- libavcodec/nvenc_h264.c | 18 +- libavcodec/nvenc_hevc.c | 18 +- libavcodec/omx.c | 32 +- libavcodec/on2avc.c | 14 +- libavcodec/options.c | 15 +- libavcodec/opusdec.c | 14 +- libavcodec/opusenc.c | 22 +- libavcodec/pafaudio.c | 12 +- libavcodec/pafvideo.c | 12 +- libavcodec/pamenc.c | 14 +- libavcodec/pcm-bluray.c | 15 +- libavcodec/pcm-blurayenc.c | 20 +- libavcodec/pcm-dvd.c | 14 +- libavcodec/pcm-dvdenc.c | 20 +- libavcodec/pcm.c | 28 +- libavcodec/pcx.c | 13 +- libavcodec/pcxenc.c | 12 +- libavcodec/pgssubdec.c | 12 +- libavcodec/pgxdec.c | 13 +- libavcodec/photocd.c | 14 +- libavcodec/pictordec.c | 13 +- libavcodec/pixlet.c | 12 +- libavcodec/pngdec.c | 24 +- libavcodec/pngenc.c | 32 +- libavcodec/pnmdec.c | 73 +- libavcodec/pnmenc.c | 70 +- libavcodec/proresdec2.c | 14 +- libavcodec/proresenc_anatoliy.c | 36 +- libavcodec/proresenc_kostya.c | 18 +- libavcodec/prosumer.c | 12 +- libavcodec/psd.c | 13 +- libavcodec/pthread.c | 2 +- libavcodec/pthread_frame.c | 41 +- libavcodec/pthread_slice.c | 2 +- libavcodec/ptx.c | 13 +- libavcodec/qcelpdec.c | 12 +- libavcodec/qdm2.c | 12 +- libavcodec/qdmc.c | 12 +- libavcodec/qdrw.c | 13 +- libavcodec/qpeg.c | 12 +- libavcodec/qsvdec.c | 19 +- libavcodec/qsvenc_h264.c | 18 +- libavcodec/qsvenc_hevc.c | 18 +- libavcodec/qsvenc_jpeg.c | 18 +- libavcodec/qsvenc_mpeg2.c | 18 +- libavcodec/qsvenc_vp9.c | 18 +- libavcodec/qtrle.c | 12 +- libavcodec/qtrleenc.c | 12 +- libavcodec/r210dec.c | 36 +- libavcodec/r210enc.c | 42 +- libavcodec/ra144dec.c | 12 +- libavcodec/ra144enc.c | 20 +- libavcodec/ra288.c | 12 +- libavcodec/ralf.c | 14 +- libavcodec/rasc.c | 14 +- libavcodec/rawdec.c | 14 +- libavcodec/rawenc.c | 12 +- libavcodec/realtextdec.c | 10 +- libavcodec/rkmppdec.c | 20 +- libavcodec/rl2.c | 12 +- libavcodec/roqaudioenc.c | 14 +- libavcodec/roqvideodec.c | 12 +- libavcodec/roqvideoenc.c | 14 +- libavcodec/rpza.c | 12 +- libavcodec/rpzaenc.c | 14 +- libavcodec/rscc.c | 12 +- libavcodec/rv10.c | 32 +- libavcodec/rv10enc.c | 14 +- libavcodec/rv20enc.c | 14 +- libavcodec/rv30.c | 14 +- libavcodec/rv40.c | 14 +- libavcodec/s302m.c | 15 +- libavcodec/s302menc.c | 18 +- libavcodec/samidec.c | 10 +- libavcodec/sanm.c | 12 +- libavcodec/sbcdec.c | 20 +- libavcodec/sbcenc.c | 24 +- libavcodec/scpr.c | 12 +- libavcodec/screenpresso.c | 12 +- libavcodec/sga.c | 12 +- libavcodec/sgidec.c | 12 +- libavcodec/sgienc.c | 14 +- libavcodec/sgirledec.c | 12 +- libavcodec/sheervideo.c | 13 +- libavcodec/shorten.c | 14 +- libavcodec/sipr.c | 12 +- libavcodec/siren.c | 24 +- libavcodec/smacker.c | 24 +- libavcodec/smc.c | 12 +- libavcodec/smcenc.c | 12 +- libavcodec/snowdec.c | 12 +- libavcodec/snowenc.c | 14 +- libavcodec/sonic.c | 40 +- libavcodec/sp5xdec.c | 28 +- libavcodec/speedhq.c | 12 +- libavcodec/speedhqenc.c | 14 +- libavcodec/speexdec.c | 12 +- libavcodec/srtdec.c | 20 +- libavcodec/srtenc.c | 30 +- libavcodec/subviewerdec.c | 10 +- libavcodec/sunrast.c | 13 +- libavcodec/sunrastenc.c | 14 +- libavcodec/svq1dec.c | 14 +- libavcodec/svq1enc.c | 14 +- libavcodec/svq3.c | 14 +- libavcodec/takdec.c | 14 +- libavcodec/targa.c | 13 +- libavcodec/targa_y216dec.c | 12 +- libavcodec/targaenc.c | 14 +- libavcodec/tdsc.c | 12 +- libavcodec/tests/avcodec.c | 35 +- libavcodec/textdec.c | 60 +- libavcodec/thread.h | 4 +- libavcodec/tiertexseqv.c | 12 +- libavcodec/tiff.c | 14 +- libavcodec/tiffenc.c | 16 +- libavcodec/tmv.c | 12 +- libavcodec/truemotion1.c | 12 +- libavcodec/truemotion2.c | 12 +- libavcodec/truemotion2rt.c | 12 +- libavcodec/truespeech.c | 12 +- libavcodec/tscc.c | 12 +- libavcodec/tscc2.c | 12 +- libavcodec/tta.c | 14 +- libavcodec/ttaenc.c | 14 +- libavcodec/ttmlenc.c | 10 +- libavcodec/twinvqdec.c | 14 +- libavcodec/txd.c | 13 +- libavcodec/ulti.c | 12 +- libavcodec/utils.c | 11 +- libavcodec/utvideodec.c | 12 +- libavcodec/utvideoenc.c | 16 +- libavcodec/v210dec.c | 14 +- libavcodec/v210enc.c | 14 +- libavcodec/v210x.c | 12 +- libavcodec/v308dec.c | 12 +- libavcodec/v308enc.c | 14 +- libavcodec/v408dec.c | 24 +- libavcodec/v408enc.c | 28 +- libavcodec/v410dec.c | 12 +- libavcodec/v410enc.c | 14 +- libavcodec/v4l2_m2m_dec.c | 16 +- libavcodec/v4l2_m2m_enc.c | 16 +- libavcodec/vaapi_encode_h264.c | 18 +- libavcodec/vaapi_encode_h265.c | 18 +- libavcodec/vaapi_encode_mjpeg.c | 18 +- libavcodec/vaapi_encode_mpeg2.c | 18 +- libavcodec/vaapi_encode_vp8.c | 18 +- libavcodec/vaapi_encode_vp9.c | 18 +- libavcodec/vb.c | 12 +- libavcodec/vble.c | 12 +- libavcodec/vc1dec.c | 60 +- libavcodec/vc2enc.c | 16 +- libavcodec/vcr1.c | 12 +- libavcodec/videotoolboxenc.c | 52 +- libavcodec/vima.c | 12 +- libavcodec/vmdaudio.c | 12 +- libavcodec/vmdvideo.c | 12 +- libavcodec/vmnc.c | 12 +- libavcodec/vorbisdec.c | 18 +- libavcodec/vorbisenc.c | 14 +- libavcodec/vp3.c | 36 +- libavcodec/vp5.c | 12 +- libavcodec/vp6.c | 36 +- libavcodec/vp8.c | 26 +- libavcodec/vp9.c | 14 +- libavcodec/vqavideo.c | 12 +- libavcodec/wavpack.c | 12 +- libavcodec/wavpackenc.c | 16 +- libavcodec/wcmv.c | 12 +- libavcodec/webp.c | 12 +- libavcodec/webvttdec.c | 10 +- libavcodec/webvttenc.c | 10 +- libavcodec/wmadec.c | 28 +- libavcodec/wmaenc.c | 24 +- libavcodec/wmalosslessdec.c | 14 +- libavcodec/wmaprodec.c | 42 +- libavcodec/wmavoice.c | 12 +- libavcodec/wmv2dec.c | 14 +- libavcodec/wmv2enc.c | 14 +- libavcodec/wnv1.c | 12 +- libavcodec/wrapped_avframe.c | 20 +- libavcodec/ws-snd1.c | 12 +- libavcodec/xan.c | 12 +- libavcodec/xbmdec.c | 13 +- libavcodec/xbmenc.c | 13 +- libavcodec/xfacedec.c | 12 +- libavcodec/xfaceenc.c | 15 +- libavcodec/xl.c | 12 +- libavcodec/xpmdec.c | 13 +- libavcodec/xsubdec.c | 10 +- libavcodec/xsubenc.c | 10 +- libavcodec/xwddec.c | 13 +- libavcodec/xwdenc.c | 15 +- libavcodec/xxan.c | 12 +- libavcodec/y41pdec.c | 12 +- libavcodec/y41penc.c | 14 +- libavcodec/ylc.c | 12 +- libavcodec/yop.c | 10 +- libavcodec/yuv4dec.c | 12 +- libavcodec/yuv4enc.c | 15 +- libavcodec/zerocodec.c | 12 +- libavcodec/zmbv.c | 12 +- libavcodec/zmbvenc.c | 14 +- tools/target_dec_fuzzer.c | 27 +- 513 files changed, 5330 insertions(+), 5260 deletions(-) diff --git a/configure b/configure index c43d1bb2e7..a7953ffc16 100755 --- a/configure +++ b/configure @@ -3985,8 +3985,8 @@ OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c o INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev) MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c) DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c) -ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c) -DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c) +ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c) +DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c) CODEC_LIST=" $ENCODER_LIST $DECODER_LIST @@ -7867,7 +7867,7 @@ print_enabled_components(){ } print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST -print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST +print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST diff --git a/libavcodec/012v.c b/libavcodec/012v.c index 999d39fd33..9c7fb56d59 100644 --- a/libavcodec/012v.c +++ b/libavcodec/012v.c @@ -145,13 +145,13 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_zero12v_decoder = { - .name = "012v", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_012V, +const FFCodec ff_zero12v_decoder = { + .p.name = "012v", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_012V, .init = zero12v_decode_init, .decode = zero12v_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 7996c7a89e..1c4446fe13 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -1027,15 +1027,15 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_fourxm_decoder = { - .name = "4xm", - .long_name = NULL_IF_CONFIG_SMALL("4X Movie"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_4XM, +const FFCodec ff_fourxm_decoder = { + .p.name = "4xm", + .p.long_name = NULL_IF_CONFIG_SMALL("4X Movie"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_4XM, .priv_data_size = sizeof(FourXContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 61bb6797f0..3e8cd2591f 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -174,14 +174,14 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_eightbps_decoder = { - .name = "8bps", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_8BPS, +const FFCodec ff_eightbps_decoder = { + .p.name = "8bps", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime 8BPS video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_8BPS, .priv_data_size = sizeof(EightBpsContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 414b3a5793..7317ea3117 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -188,33 +188,33 @@ static av_cold int eightsvx_decode_close(AVCodecContext *avctx) } #if CONFIG_EIGHTSVX_FIB_DECODER -const AVCodec ff_eightsvx_fib_decoder = { - .name = "8svx_fib", - .long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_8SVX_FIB, +const FFCodec ff_eightsvx_fib_decoder = { + .p.name = "8svx_fib", + .p.long_name = NULL_IF_CONFIG_SMALL("8SVX fibonacci"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_8SVX_FIB, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, .decode = eightsvx_decode_frame, .close = eightsvx_decode_close, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_EIGHTSVX_EXP_DECODER -const AVCodec ff_eightsvx_exp_decoder = { - .name = "8svx_exp", - .long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_8SVX_EXP, +const FFCodec ff_eightsvx_exp_decoder = { + .p.name = "8svx_exp", + .p.long_name = NULL_IF_CONFIG_SMALL("8SVX exponential"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_8SVX_EXP, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, .decode = eightsvx_decode_frame, .close = eightsvx_decode_close, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c index e1bc677a9d..b642a575f1 100644 --- a/libavcodec/a64multienc.c +++ b/libavcodec/a64multienc.c @@ -393,32 +393,32 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } #if CONFIG_A64MULTI_ENCODER -const AVCodec ff_a64multi_encoder = { - .name = "a64multi", - .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_A64_MULTI, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_a64multi_encoder = { + .p.name = "a64multi", + .p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_A64_MULTI, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(A64Context), .init = a64multi_encode_init, .encode2 = a64multi_encode_frame, .close = a64multi_close_encoder, - .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, + .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_A64MULTI5_ENCODER -const AVCodec ff_a64multi5_encoder = { - .name = "a64multi5", - .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_A64_MULTI5, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_a64multi5_encoder = { + .p.name = "a64multi5", + .p.long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_A64_MULTI5, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(A64Context), .init = a64multi_encode_init, .encode2 = a64multi_encode_frame, .close = a64multi_close_encoder, - .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, + .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index dcbdd4880d..6f560909f3 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -552,27 +552,27 @@ static av_cold int latm_decode_init(AVCodecContext *avctx) return ret; } -const AVCodec ff_aac_decoder = { - .name = "aac", - .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC, +const FFCodec ff_aac_decoder = { + .p.name = "aac", + .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), .init = aac_decode_init, .close = aac_decode_close, .decode = aac_decode_frame, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = aac_channel_layout, + .p.channel_layouts = aac_channel_layout, #endif - .ch_layouts = aac_ch_layout, + .p.ch_layouts = aac_ch_layout, .flush = flush, - .priv_class = &aac_decoder_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), + .p.priv_class = &aac_decoder_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), }; /* @@ -580,24 +580,24 @@ const AVCodec ff_aac_decoder = { in MPEG transport streams which only contain one program. To do a more complex LATM demuxing a separate LATM demuxer should be used. */ -const AVCodec ff_aac_latm_decoder = { - .name = "aac_latm", - .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC_LATM, +const FFCodec ff_aac_latm_decoder = { + .p.name = "aac_latm", + .p.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC_LATM, .priv_data_size = sizeof(struct LATMContext), .init = latm_decode_init, .close = aac_decode_close, .decode = latm_decode_frame, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = aac_channel_layout, + .p.channel_layouts = aac_channel_layout, #endif - .ch_layouts = aac_ch_layout, + .p.ch_layouts = aac_ch_layout, .flush = flush, - .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), + .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), }; diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index fd067d0ad5..bdce588b26 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -450,24 +450,24 @@ static void apply_independent_coupling_fixed(AACContext *ac, #include "aacdec_template.c" -const AVCodec ff_aac_fixed_decoder = { - .name = "aac_fixed", - .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC, +const FFCodec ff_aac_fixed_decoder = { + .p.name = "aac_fixed", + .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), .init = aac_decode_init, .close = aac_decode_close, .decode = aac_decode_frame, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = aac_channel_layout, + .p.channel_layouts = aac_channel_layout, #endif - .ch_layouts = aac_ch_layout, - .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), + .p.ch_layouts = aac_ch_layout, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), .flush = flush, }; diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index b7d538ca2c..381ffef203 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -1137,20 +1137,20 @@ static const AVCodecDefault aac_encode_defaults[] = { { NULL } }; -const AVCodec ff_aac_encoder = { - .name = "aac", - .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC, +const FFCodec ff_aac_encoder = { + .p.name = "aac", + .p.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACEncContext), .init = aac_encode_init, .encode2 = aac_encode_frame, .close = aac_encode_end, .defaults = aac_encode_defaults, - .supported_samplerates = ff_mpeg4audio_sample_rates, + .p.supported_samplerates = ff_mpeg4audio_sample_rates, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &aacenc_class, + .p.priv_class = &aacenc_class, }; diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 60cd839613..9b1b64106e 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -150,15 +150,15 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_aasc_decoder = { - .name = "aasc", - .long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AASC, +const FFCodec ff_aasc_decoder = { + .p.name = "aasc", + .p.long_name = NULL_IF_CONFIG_SMALL("Autodesk RLE"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AASC, .priv_data_size = sizeof(AascContext), .init = aasc_decode_init, .close = aasc_decode_end, .decode = aasc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c index 08109296b5..de44bf80cf 100644 --- a/libavcodec/ac3dec_fixed.c +++ b/libavcodec/ac3dec_fixed.c @@ -169,19 +169,19 @@ static const AVClass ac3_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ac3_fixed_decoder = { - .name = "ac3_fixed", - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AC3, +const FFCodec ff_ac3_fixed_decoder = { + .p.name = "ac3_fixed", + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AC3, + .p.priv_class = &ac3_decoder_class, .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .priv_class = &ac3_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ac3dec_float.c b/libavcodec/ac3dec_float.c index 8b2efbc225..5aeb378bc6 100644 --- a/libavcodec/ac3dec_float.c +++ b/libavcodec/ac3dec_float.c @@ -59,38 +59,38 @@ static const AVClass ac3_eac3_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ac3_decoder = { - .name = "ac3", - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AC3, +const FFCodec ff_ac3_decoder = { + .p.name = "ac3", + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AC3, .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &ac3_eac3_decoder_class, + .p.priv_class = &ac3_eac3_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #if CONFIG_EAC3_DECODER -const AVCodec ff_eac3_decoder = { - .name = "eac3", - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_EAC3, +const FFCodec ff_eac3_decoder = { + .p.name = "eac3", + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_EAC3, .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, .close = ac3_decode_end, .decode = ac3_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &ac3_eac3_decoder_class, + .p.priv_class = &ac3_eac3_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index d29e1cc47c..af6b2a20f9 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -120,25 +120,25 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx) FF_DISABLE_DEPRECATION_WARNINGS -const AVCodec ff_ac3_fixed_encoder = { - .name = "ac3_fixed", - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AC3, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_ac3_fixed_encoder = { + .p.name = "ac3_fixed", + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AC3, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ac3_fixed_encode_init, .encode2 = ff_ac3_fixed_encode_frame, .close = ff_ac3_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .priv_class = &ff_ac3enc_class, + .p.priv_class = &ff_ac3enc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .supported_samplerates = ff_ac3_sample_rate_tab, + .p.supported_samplerates = ff_ac3_sample_rate_tab, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = ff_ac3_channel_layouts, + .p.channel_layouts = ff_ac3_channel_layouts, #endif - .ch_layouts = ff_ac3_ch_layouts, + .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, }; FF_ENABLE_DEPRECATION_WARNINGS diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 1c13920175..1323df74a9 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -124,24 +124,24 @@ av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx) } FF_DISABLE_DEPRECATION_WARNINGS -const AVCodec ff_ac3_encoder = { - .name = "ac3", - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AC3, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_ac3_encoder = { + .p.name = "ac3", + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AC3, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, .encode2 = ff_ac3_float_encode_frame, .close = ff_ac3_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &ff_ac3enc_class, - .supported_samplerates = ff_ac3_sample_rate_tab, + .p.priv_class = &ff_ac3enc_class, + .p.supported_samplerates = ff_ac3_sample_rate_tab, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = ff_ac3_channel_layouts, + .p.channel_layouts = ff_ac3_channel_layouts, #endif - .ch_layouts = ff_ac3_ch_layouts, + .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 85ba88ebbf..f5ad14d331 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -2286,17 +2286,17 @@ static const enum AVSampleFormat sample_fmts_both[] = { AV_SAMPLE_FMT_S16, #define ADPCM_DECODER_0(id_, sample_fmts_, name_, long_name_) #define ADPCM_DECODER_1(id_, sample_fmts_, name_, long_name_) \ -const AVCodec ff_ ## name_ ## _decoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = id_, \ +const FFCodec ff_ ## name_ ## _decoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = id_, \ + .p.capabilities = AV_CODEC_CAP_DR1, \ + .p.sample_fmts = sample_fmts_, \ .priv_data_size = sizeof(ADPCMDecodeContext), \ .init = adpcm_decode_init, \ .decode = adpcm_decode_frame, \ .flush = adpcm_flush, \ - .capabilities = AV_CODEC_CAP_DR1, \ - .sample_fmts = sample_fmts_, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; #define ADPCM_DECODER_2(enabled, codec_id, name, sample_fmts, long_name) \ diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index b15d97fda2..0a2e6bb3be 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -996,20 +996,20 @@ static const AVClass adpcm_encoder_class = { #define ADPCM_ENCODER_0(id_, name_, sample_fmts_, capabilities_, long_name_) #define ADPCM_ENCODER_1(id_, name_, sample_fmts_, capabilities_, long_name_) \ -const AVCodec ff_ ## name_ ## _encoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = id_, \ +const FFCodec ff_ ## name_ ## _encoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = id_, \ + .p.sample_fmts = sample_fmts_, \ + .p.ch_layouts = ch_layouts, \ + .p.capabilities = capabilities_ | AV_CODEC_CAP_DR1, \ + .p.priv_class = &adpcm_encoder_class, \ .priv_data_size = sizeof(ADPCMEncodeContext), \ .init = adpcm_encode_init, \ .encode2 = adpcm_encode_frame, \ .close = adpcm_encode_close, \ - .sample_fmts = sample_fmts_, \ - .ch_layouts = ch_layouts, \ - .capabilities = capabilities_ | AV_CODEC_CAP_DR1, \ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, \ - .priv_class = &adpcm_encoder_class, \ }; #define ADPCM_ENCODER_2(enabled, codec_id, name, sample_fmts, capabilities, long_name) \ ADPCM_ENCODER_ ## enabled(codec_id, name, sample_fmts, capabilities, long_name) diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 20c670b8f0..fd540f7d54 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -191,18 +191,18 @@ static void adx_decode_flush(AVCodecContext *avctx) c->eof = 0; } -const AVCodec ff_adpcm_adx_decoder = { - .name = "adpcm_adx", - .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_ADX, +const FFCodec ff_adpcm_adx_decoder = { + .p.name = "adpcm_adx", + .p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_ADX, .priv_data_size = sizeof(ADXContext), .init = adx_decode_init, .decode = adx_decode_frame, .flush = adx_decode_flush, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index acf12790fe..af8d2861e7 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -189,16 +189,16 @@ static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_adpcm_adx_encoder = { - .name = "adpcm_adx", - .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_ADX, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_adpcm_adx_encoder = { + .p.name = "adpcm_adx", + .p.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_ADX, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(ADXContext), .init = adx_encode_init, .encode2 = adx_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/agm.c b/libavcodec/agm.c index b37a160d38..28b66cd30d 100644 --- a/libavcodec/agm.c +++ b/libavcodec/agm.c @@ -1286,17 +1286,17 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_agm_decoder = { - .name = "agm", - .long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AGM, +const FFCodec ff_agm_decoder = { + .p.name = "agm", + .p.long_name = NULL_IF_CONFIG_SMALL("Amuse Graphics Movie"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AGM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AGMContext), .init = decode_init, .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EXPORTS_CROPPING, diff --git a/libavcodec/aic.c b/libavcodec/aic.c index ea4be0d45f..fa99205533 100644 --- a/libavcodec/aic.c +++ b/libavcodec/aic.c @@ -495,15 +495,15 @@ static av_cold int aic_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_aic_decoder = { - .name = "aic", - .long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AIC, +const FFCodec ff_aic_decoder = { + .p.name = "aic", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple Intermediate Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AIC, .priv_data_size = sizeof(AICContext), .init = aic_decode_init, .close = aic_decode_close, .decode = aic_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/alac.c b/libavcodec/alac.c index a66346ab34..90bd246fa6 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -611,16 +611,16 @@ static const AVClass alac_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_alac_decoder = { - .name = "alac", - .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ALAC, +const FFCodec ff_alac_decoder = { + .p.name = "alac", + .p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ALAC, .priv_data_size = sizeof(ALACContext), .init = alac_decode_init, .close = alac_decode_close, .decode = alac_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &alac_class + .p.priv_class = &alac_class }; diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 541b0fbd9a..62ac32e345 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -649,22 +649,22 @@ static const AVClass alacenc_class = { }; FF_DISABLE_DEPRECATION_WARNINGS -const AVCodec ff_alac_encoder = { - .name = "alac", - .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ALAC, +const FFCodec ff_alac_encoder = { + .p.name = "alac", + .p.long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ALAC, .priv_data_size = sizeof(AlacEncodeContext), - .priv_class = &alacenc_class, + .p.priv_class = &alacenc_class, .init = alac_encode_init, .encode2 = alac_encode_frame, .close = alac_encode_close, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = alac_channel_layouts, + .p.channel_layouts = alac_channel_layouts, #endif - .ch_layouts = ff_alac_ch_layouts, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, + .p.ch_layouts = ff_alac_ch_layouts, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/aliaspixdec.c b/libavcodec/aliaspixdec.c index e08891ec1b..1c156c3825 100644 --- a/libavcodec/aliaspixdec.c +++ b/libavcodec/aliaspixdec.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" #define ALIAS_HEADER_SIZE 10 @@ -121,11 +122,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_alias_pix_decoder = { - .name = "alias_pix", - .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ALIAS_PIX, +const FFCodec ff_alias_pix_decoder = { + .p.name = "alias_pix", + .p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ALIAS_PIX, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/aliaspixenc.c b/libavcodec/aliaspixenc.c index 27b7d1d8de..74b5450132 100644 --- a/libavcodec/aliaspixenc.c +++ b/libavcodec/aliaspixenc.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "encode.h" #define ALIAS_HEADER_SIZE 10 @@ -100,13 +101,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_alias_pix_encoder = { - .name = "alias_pix", - .long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ALIAS_PIX, +const FFCodec ff_alias_pix_encoder = { + .p.name = "alias_pix", + .p.long_name = NULL_IF_CONFIG_SMALL("Alias/Wavefront PIX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ALIAS_PIX, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 74049afa8f..b1aa7e266b 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -32,750 +32,751 @@ #include "libavutil/thread.h" #include "codec.h" #include "codec_id.h" +#include "codec_internal.h" -extern const AVCodec ff_a64multi_encoder; -extern const AVCodec ff_a64multi5_encoder; -extern const AVCodec ff_aasc_decoder; -extern const AVCodec ff_aic_decoder; -extern const AVCodec ff_alias_pix_encoder; -extern const AVCodec ff_alias_pix_decoder; -extern const AVCodec ff_agm_decoder; -extern const AVCodec ff_amv_encoder; -extern const AVCodec ff_amv_decoder; -extern const AVCodec ff_anm_decoder; -extern const AVCodec ff_ansi_decoder; -extern const AVCodec ff_apng_encoder; -extern const AVCodec ff_apng_decoder; -extern const AVCodec ff_arbc_decoder; -extern const AVCodec ff_argo_decoder; -extern const AVCodec ff_asv1_encoder; -extern const AVCodec ff_asv1_decoder; -extern const AVCodec ff_asv2_encoder; -extern const AVCodec ff_asv2_decoder; -extern const AVCodec ff_aura_decoder; -extern const AVCodec ff_aura2_decoder; -extern const AVCodec ff_avrp_encoder; -extern const AVCodec ff_avrp_decoder; -extern const AVCodec ff_avrn_decoder; -extern const AVCodec ff_avs_decoder; -extern const AVCodec ff_avui_encoder; -extern const AVCodec ff_avui_decoder; -extern const AVCodec ff_ayuv_encoder; -extern const AVCodec ff_ayuv_decoder; -extern const AVCodec ff_bethsoftvid_decoder; -extern const AVCodec ff_bfi_decoder; -extern const AVCodec ff_bink_decoder; -extern const AVCodec ff_bitpacked_decoder; -extern const AVCodec ff_bitpacked_encoder; -extern const AVCodec ff_bmp_encoder; -extern const AVCodec ff_bmp_decoder; -extern const AVCodec ff_bmv_video_decoder; -extern const AVCodec ff_brender_pix_decoder; -extern const AVCodec ff_c93_decoder; -extern const AVCodec ff_cavs_decoder; -extern const AVCodec ff_cdgraphics_decoder; -extern const AVCodec ff_cdtoons_decoder; -extern const AVCodec ff_cdxl_decoder; -extern const AVCodec ff_cfhd_encoder; -extern const AVCodec ff_cfhd_decoder; -extern const AVCodec ff_cinepak_encoder; -extern const AVCodec ff_cinepak_decoder; -extern const AVCodec ff_clearvideo_decoder; -extern const AVCodec ff_cljr_encoder; -extern const AVCodec ff_cljr_decoder; -extern const AVCodec ff_cllc_decoder; -extern const AVCodec ff_comfortnoise_encoder; -extern const AVCodec ff_comfortnoise_decoder; -extern const AVCodec ff_cpia_decoder; -extern const AVCodec ff_cri_decoder; -extern const AVCodec ff_cscd_decoder; -extern const AVCodec ff_cyuv_decoder; -extern const AVCodec ff_dds_decoder; -extern const AVCodec ff_dfa_decoder; -extern const AVCodec ff_dirac_decoder; -extern const AVCodec ff_dnxhd_encoder; -extern const AVCodec ff_dnxhd_decoder; -extern const AVCodec ff_dpx_encoder; -extern const AVCodec ff_dpx_decoder; -extern const AVCodec ff_dsicinvideo_decoder; -extern const AVCodec ff_dvaudio_decoder; -extern const AVCodec ff_dvvideo_encoder; -extern const AVCodec ff_dvvideo_decoder; -extern const AVCodec ff_dxa_decoder; -extern const AVCodec ff_dxtory_decoder; -extern const AVCodec ff_dxv_decoder; -extern const AVCodec ff_eacmv_decoder; -extern const AVCodec ff_eamad_decoder; -extern const AVCodec ff_eatgq_decoder; -extern const AVCodec ff_eatgv_decoder; -extern const AVCodec ff_eatqi_decoder; -extern const AVCodec ff_eightbps_decoder; -extern const AVCodec ff_eightsvx_exp_decoder; -extern const AVCodec ff_eightsvx_fib_decoder; -extern const AVCodec ff_escape124_decoder; -extern const AVCodec ff_escape130_decoder; -extern const AVCodec ff_exr_encoder; -extern const AVCodec ff_exr_decoder; -extern const AVCodec ff_ffv1_encoder; -extern const AVCodec ff_ffv1_decoder; -extern const AVCodec ff_ffvhuff_encoder; -extern const AVCodec ff_ffvhuff_decoder; -extern const AVCodec ff_fic_decoder; -extern const AVCodec ff_fits_encoder; -extern const AVCodec ff_fits_decoder; -extern const AVCodec ff_flashsv_encoder; -extern const AVCodec ff_flashsv_decoder; -extern const AVCodec ff_flashsv2_encoder; -extern const AVCodec ff_flashsv2_decoder; -extern const AVCodec ff_flic_decoder; -extern const AVCodec ff_flv_encoder; -extern const AVCodec ff_flv_decoder; -extern const AVCodec ff_fmvc_decoder; -extern const AVCodec ff_fourxm_decoder; -extern const AVCodec ff_fraps_decoder; -extern const AVCodec ff_frwu_decoder; -extern const AVCodec ff_g2m_decoder; -extern const AVCodec ff_gdv_decoder; -extern const AVCodec ff_gem_decoder; -extern const AVCodec ff_gif_encoder; -extern const AVCodec ff_gif_decoder; -extern const AVCodec ff_h261_encoder; -extern const AVCodec ff_h261_decoder; -extern const AVCodec ff_h263_encoder; -extern const AVCodec ff_h263_decoder; -extern const AVCodec ff_h263i_decoder; -extern const AVCodec ff_h263p_encoder; -extern const AVCodec ff_h263p_decoder; -extern const AVCodec ff_h263_v4l2m2m_decoder; -extern const AVCodec ff_h264_decoder; -extern const AVCodec ff_h264_crystalhd_decoder; -extern const AVCodec ff_h264_v4l2m2m_decoder; -extern const AVCodec ff_h264_mediacodec_decoder; -extern const AVCodec ff_h264_mmal_decoder; -extern const AVCodec ff_h264_qsv_decoder; -extern const AVCodec ff_h264_rkmpp_decoder; -extern const AVCodec ff_hap_encoder; -extern const AVCodec ff_hap_decoder; -extern const AVCodec ff_hevc_decoder; -extern const AVCodec ff_hevc_qsv_decoder; -extern const AVCodec ff_hevc_rkmpp_decoder; -extern const AVCodec ff_hevc_v4l2m2m_decoder; -extern const AVCodec ff_hnm4_video_decoder; -extern const AVCodec ff_hq_hqa_decoder; -extern const AVCodec ff_hqx_decoder; -extern const AVCodec ff_huffyuv_encoder; -extern const AVCodec ff_huffyuv_decoder; -extern const AVCodec ff_hymt_decoder; -extern const AVCodec ff_idcin_decoder; -extern const AVCodec ff_iff_ilbm_decoder; -extern const AVCodec ff_imm4_decoder; -extern const AVCodec ff_imm5_decoder; -extern const AVCodec ff_indeo2_decoder; -extern const AVCodec ff_indeo3_decoder; -extern const AVCodec ff_indeo4_decoder; -extern const AVCodec ff_indeo5_decoder; -extern const AVCodec ff_interplay_video_decoder; -extern const AVCodec ff_ipu_decoder; -extern const AVCodec ff_jpeg2000_encoder; -extern const AVCodec ff_jpeg2000_decoder; -extern const AVCodec ff_jpegls_encoder; -extern const AVCodec ff_jpegls_decoder; -extern const AVCodec ff_jv_decoder; -extern const AVCodec ff_kgv1_decoder; -extern const AVCodec ff_kmvc_decoder; -extern const AVCodec ff_lagarith_decoder; -extern const AVCodec ff_ljpeg_encoder; -extern const AVCodec ff_loco_decoder; -extern const AVCodec ff_lscr_decoder; -extern const AVCodec ff_m101_decoder; -extern const AVCodec ff_magicyuv_encoder; -extern const AVCodec ff_magicyuv_decoder; -extern const AVCodec ff_mdec_decoder; -extern const AVCodec ff_mimic_decoder; -extern const AVCodec ff_mjpeg_encoder; -extern const AVCodec ff_mjpeg_decoder; -extern const AVCodec ff_mjpegb_decoder; -extern const AVCodec ff_mmvideo_decoder; -extern const AVCodec ff_mobiclip_decoder; -extern const AVCodec ff_motionpixels_decoder; -extern const AVCodec ff_mpeg1video_encoder; -extern const AVCodec ff_mpeg1video_decoder; -extern const AVCodec ff_mpeg2video_encoder; -extern const AVCodec ff_mpeg2video_decoder; -extern const AVCodec ff_mpeg4_encoder; -extern const AVCodec ff_mpeg4_decoder; -extern const AVCodec ff_mpeg4_crystalhd_decoder; -extern const AVCodec ff_mpeg4_v4l2m2m_decoder; -extern const AVCodec ff_mpeg4_mmal_decoder; -extern const AVCodec ff_mpegvideo_decoder; -extern const AVCodec ff_mpeg1_v4l2m2m_decoder; -extern const AVCodec ff_mpeg2_mmal_decoder; -extern const AVCodec ff_mpeg2_crystalhd_decoder; -extern const AVCodec ff_mpeg2_v4l2m2m_decoder; -extern const AVCodec ff_mpeg2_qsv_decoder; -extern const AVCodec ff_mpeg2_mediacodec_decoder; -extern const AVCodec ff_msa1_decoder; -extern const AVCodec ff_mscc_decoder; -extern const AVCodec ff_msmpeg4v1_decoder; -extern const AVCodec ff_msmpeg4v2_encoder; -extern const AVCodec ff_msmpeg4v2_decoder; -extern const AVCodec ff_msmpeg4v3_encoder; -extern const AVCodec ff_msmpeg4v3_decoder; -extern const AVCodec ff_msmpeg4_crystalhd_decoder; -extern const AVCodec ff_msp2_decoder; -extern const AVCodec ff_msrle_decoder; -extern const AVCodec ff_mss1_decoder; -extern const AVCodec ff_mss2_decoder; -extern const AVCodec ff_msvideo1_encoder; -extern const AVCodec ff_msvideo1_decoder; -extern const AVCodec ff_mszh_decoder; -extern const AVCodec ff_mts2_decoder; -extern const AVCodec ff_mv30_decoder; -extern const AVCodec ff_mvc1_decoder; -extern const AVCodec ff_mvc2_decoder; -extern const AVCodec ff_mvdv_decoder; -extern const AVCodec ff_mvha_decoder; -extern const AVCodec ff_mwsc_decoder; -extern const AVCodec ff_mxpeg_decoder; -extern const AVCodec ff_notchlc_decoder; -extern const AVCodec ff_nuv_decoder; -extern const AVCodec ff_paf_video_decoder; -extern const AVCodec ff_pam_encoder; -extern const AVCodec ff_pam_decoder; -extern const AVCodec ff_pbm_encoder; -extern const AVCodec ff_pbm_decoder; -extern const AVCodec ff_pcx_encoder; -extern const AVCodec ff_pcx_decoder; -extern const AVCodec ff_pfm_encoder; -extern const AVCodec ff_pfm_decoder; -extern const AVCodec ff_pgm_encoder; -extern const AVCodec ff_pgm_decoder; -extern const AVCodec ff_pgmyuv_encoder; -extern const AVCodec ff_pgmyuv_decoder; -extern const AVCodec ff_pgx_decoder; -extern const AVCodec ff_photocd_decoder; -extern const AVCodec ff_pictor_decoder; -extern const AVCodec ff_pixlet_decoder; -extern const AVCodec ff_png_encoder; -extern const AVCodec ff_png_decoder; -extern const AVCodec ff_ppm_encoder; -extern const AVCodec ff_ppm_decoder; -extern const AVCodec ff_prores_encoder; -extern const AVCodec ff_prores_decoder; -extern const AVCodec ff_prores_aw_encoder; -extern const AVCodec ff_prores_ks_encoder; -extern const AVCodec ff_prosumer_decoder; -extern const AVCodec ff_psd_decoder; -extern const AVCodec ff_ptx_decoder; -extern const AVCodec ff_qdraw_decoder; -extern const AVCodec ff_qpeg_decoder; -extern const AVCodec ff_qtrle_encoder; -extern const AVCodec ff_qtrle_decoder; -extern const AVCodec ff_r10k_encoder; -extern const AVCodec ff_r10k_decoder; -extern const AVCodec ff_r210_encoder; -extern const AVCodec ff_r210_decoder; -extern const AVCodec ff_rasc_decoder; -extern const AVCodec ff_rawvideo_encoder; -extern const AVCodec ff_rawvideo_decoder; -extern const AVCodec ff_rl2_decoder; -extern const AVCodec ff_roq_encoder; -extern const AVCodec ff_roq_decoder; -extern const AVCodec ff_rpza_encoder; -extern const AVCodec ff_rpza_decoder; -extern const AVCodec ff_rscc_decoder; -extern const AVCodec ff_rv10_encoder; -extern const AVCodec ff_rv10_decoder; -extern const AVCodec ff_rv20_encoder; -extern const AVCodec ff_rv20_decoder; -extern const AVCodec ff_rv30_decoder; -extern const AVCodec ff_rv40_decoder; -extern const AVCodec ff_s302m_encoder; -extern const AVCodec ff_s302m_decoder; -extern const AVCodec ff_sanm_decoder; -extern const AVCodec ff_scpr_decoder; -extern const AVCodec ff_screenpresso_decoder; -extern const AVCodec ff_sga_decoder; -extern const AVCodec ff_sgi_encoder; -extern const AVCodec ff_sgi_decoder; -extern const AVCodec ff_sgirle_decoder; -extern const AVCodec ff_sheervideo_decoder; -extern const AVCodec ff_simbiosis_imx_decoder; -extern const AVCodec ff_smacker_decoder; -extern const AVCodec ff_smc_encoder; -extern const AVCodec ff_smc_decoder; -extern const AVCodec ff_smvjpeg_decoder; -extern const AVCodec ff_snow_encoder; -extern const AVCodec ff_snow_decoder; -extern const AVCodec ff_sp5x_decoder; -extern const AVCodec ff_speedhq_decoder; -extern const AVCodec ff_speedhq_encoder; -extern const AVCodec ff_speex_decoder; -extern const AVCodec ff_srgc_decoder; -extern const AVCodec ff_sunrast_encoder; -extern const AVCodec ff_sunrast_decoder; -extern const AVCodec ff_svq1_encoder; -extern const AVCodec ff_svq1_decoder; -extern const AVCodec ff_svq3_decoder; -extern const AVCodec ff_targa_encoder; -extern const AVCodec ff_targa_decoder; -extern const AVCodec ff_targa_y216_decoder; -extern const AVCodec ff_tdsc_decoder; -extern const AVCodec ff_theora_decoder; -extern const AVCodec ff_thp_decoder; -extern const AVCodec ff_tiertexseqvideo_decoder; -extern const AVCodec ff_tiff_encoder; -extern const AVCodec ff_tiff_decoder; -extern const AVCodec ff_tmv_decoder; -extern const AVCodec ff_truemotion1_decoder; -extern const AVCodec ff_truemotion2_decoder; -extern const AVCodec ff_truemotion2rt_decoder; -extern const AVCodec ff_tscc_decoder; -extern const AVCodec ff_tscc2_decoder; -extern const AVCodec ff_txd_decoder; -extern const AVCodec ff_ulti_decoder; -extern const AVCodec ff_utvideo_encoder; -extern const AVCodec ff_utvideo_decoder; -extern const AVCodec ff_v210_encoder; -extern const AVCodec ff_v210_decoder; -extern const AVCodec ff_v210x_decoder; -extern const AVCodec ff_v308_encoder; -extern const AVCodec ff_v308_decoder; -extern const AVCodec ff_v408_encoder; -extern const AVCodec ff_v408_decoder; -extern const AVCodec ff_v410_encoder; -extern const AVCodec ff_v410_decoder; -extern const AVCodec ff_vb_decoder; -extern const AVCodec ff_vble_decoder; -extern const AVCodec ff_vc1_decoder; -extern const AVCodec ff_vc1_crystalhd_decoder; -extern const AVCodec ff_vc1image_decoder; -extern const AVCodec ff_vc1_mmal_decoder; -extern const AVCodec ff_vc1_qsv_decoder; -extern const AVCodec ff_vc1_v4l2m2m_decoder; -extern const AVCodec ff_vc2_encoder; -extern const AVCodec ff_vcr1_decoder; -extern const AVCodec ff_vmdvideo_decoder; -extern const AVCodec ff_vmnc_decoder; -extern const AVCodec ff_vp3_decoder; -extern const AVCodec ff_vp4_decoder; -extern const AVCodec ff_vp5_decoder; -extern const AVCodec ff_vp6_decoder; -extern const AVCodec ff_vp6a_decoder; -extern const AVCodec ff_vp6f_decoder; -extern const AVCodec ff_vp7_decoder; -extern const AVCodec ff_vp8_decoder; -extern const AVCodec ff_vp8_rkmpp_decoder; -extern const AVCodec ff_vp8_v4l2m2m_decoder; -extern const AVCodec ff_vp9_decoder; -extern const AVCodec ff_vp9_rkmpp_decoder; -extern const AVCodec ff_vp9_v4l2m2m_decoder; -extern const AVCodec ff_vqa_decoder; -extern const AVCodec ff_webp_decoder; -extern const AVCodec ff_wcmv_decoder; -extern const AVCodec ff_wrapped_avframe_encoder; -extern const AVCodec ff_wrapped_avframe_decoder; -extern const AVCodec ff_wmv1_encoder; -extern const AVCodec ff_wmv1_decoder; -extern const AVCodec ff_wmv2_encoder; -extern const AVCodec ff_wmv2_decoder; -extern const AVCodec ff_wmv3_decoder; -extern const AVCodec ff_wmv3_crystalhd_decoder; -extern const AVCodec ff_wmv3image_decoder; -extern const AVCodec ff_wnv1_decoder; -extern const AVCodec ff_xan_wc3_decoder; -extern const AVCodec ff_xan_wc4_decoder; -extern const AVCodec ff_xbm_encoder; -extern const AVCodec ff_xbm_decoder; -extern const AVCodec ff_xface_encoder; -extern const AVCodec ff_xface_decoder; -extern const AVCodec ff_xl_decoder; -extern const AVCodec ff_xpm_decoder; -extern const AVCodec ff_xwd_encoder; -extern const AVCodec ff_xwd_decoder; -extern const AVCodec ff_y41p_encoder; -extern const AVCodec ff_y41p_decoder; -extern const AVCodec ff_ylc_decoder; -extern const AVCodec ff_yop_decoder; -extern const AVCodec ff_yuv4_encoder; -extern const AVCodec ff_yuv4_decoder; -extern const AVCodec ff_zero12v_decoder; -extern const AVCodec ff_zerocodec_decoder; -extern const AVCodec ff_zlib_encoder; -extern const AVCodec ff_zlib_decoder; -extern const AVCodec ff_zmbv_encoder; -extern const AVCodec ff_zmbv_decoder; +extern const FFCodec ff_a64multi_encoder; +extern const FFCodec ff_a64multi5_encoder; +extern const FFCodec ff_aasc_decoder; +extern const FFCodec ff_aic_decoder; +extern const FFCodec ff_alias_pix_encoder; +extern const FFCodec ff_alias_pix_decoder; +extern const FFCodec ff_agm_decoder; +extern const FFCodec ff_amv_encoder; +extern const FFCodec ff_amv_decoder; +extern const FFCodec ff_anm_decoder; +extern const FFCodec ff_ansi_decoder; +extern const FFCodec ff_apng_encoder; +extern const FFCodec ff_apng_decoder; +extern const FFCodec ff_arbc_decoder; +extern const FFCodec ff_argo_decoder; +extern const FFCodec ff_asv1_encoder; +extern const FFCodec ff_asv1_decoder; +extern const FFCodec ff_asv2_encoder; +extern const FFCodec ff_asv2_decoder; +extern const FFCodec ff_aura_decoder; +extern const FFCodec ff_aura2_decoder; +extern const FFCodec ff_avrp_encoder; +extern const FFCodec ff_avrp_decoder; +extern const FFCodec ff_avrn_decoder; +extern const FFCodec ff_avs_decoder; +extern const FFCodec ff_avui_encoder; +extern const FFCodec ff_avui_decoder; +extern const FFCodec ff_ayuv_encoder; +extern const FFCodec ff_ayuv_decoder; +extern const FFCodec ff_bethsoftvid_decoder; +extern const FFCodec ff_bfi_decoder; +extern const FFCodec ff_bink_decoder; +extern const FFCodec ff_bitpacked_decoder; +extern const FFCodec ff_bitpacked_encoder; +extern const FFCodec ff_bmp_encoder; +extern const FFCodec ff_bmp_decoder; +extern const FFCodec ff_bmv_video_decoder; +extern const FFCodec ff_brender_pix_decoder; +extern const FFCodec ff_c93_decoder; +extern const FFCodec ff_cavs_decoder; +extern const FFCodec ff_cdgraphics_decoder; +extern const FFCodec ff_cdtoons_decoder; +extern const FFCodec ff_cdxl_decoder; +extern const FFCodec ff_cfhd_encoder; +extern const FFCodec ff_cfhd_decoder; +extern const FFCodec ff_cinepak_encoder; +extern const FFCodec ff_cinepak_decoder; +extern const FFCodec ff_clearvideo_decoder; +extern const FFCodec ff_cljr_encoder; +extern const FFCodec ff_cljr_decoder; +extern const FFCodec ff_cllc_decoder; +extern const FFCodec ff_comfortnoise_encoder; +extern const FFCodec ff_comfortnoise_decoder; +extern const FFCodec ff_cpia_decoder; +extern const FFCodec ff_cri_decoder; +extern const FFCodec ff_cscd_decoder; +extern const FFCodec ff_cyuv_decoder; +extern const FFCodec ff_dds_decoder; +extern const FFCodec ff_dfa_decoder; +extern const FFCodec ff_dirac_decoder; +extern const FFCodec ff_dnxhd_encoder; +extern const FFCodec ff_dnxhd_decoder; +extern const FFCodec ff_dpx_encoder; +extern const FFCodec ff_dpx_decoder; +extern const FFCodec ff_dsicinvideo_decoder; +extern const FFCodec ff_dvaudio_decoder; +extern const FFCodec ff_dvvideo_encoder; +extern const FFCodec ff_dvvideo_decoder; +extern const FFCodec ff_dxa_decoder; +extern const FFCodec ff_dxtory_decoder; +extern const FFCodec ff_dxv_decoder; +extern const FFCodec ff_eacmv_decoder; +extern const FFCodec ff_eamad_decoder; +extern const FFCodec ff_eatgq_decoder; +extern const FFCodec ff_eatgv_decoder; +extern const FFCodec ff_eatqi_decoder; +extern const FFCodec ff_eightbps_decoder; +extern const FFCodec ff_eightsvx_exp_decoder; +extern const FFCodec ff_eightsvx_fib_decoder; +extern const FFCodec ff_escape124_decoder; +extern const FFCodec ff_escape130_decoder; +extern const FFCodec ff_exr_encoder; +extern const FFCodec ff_exr_decoder; +extern const FFCodec ff_ffv1_encoder; +extern const FFCodec ff_ffv1_decoder; +extern const FFCodec ff_ffvhuff_encoder; +extern const FFCodec ff_ffvhuff_decoder; +extern const FFCodec ff_fic_decoder; +extern const FFCodec ff_fits_encoder; +extern const FFCodec ff_fits_decoder; +extern const FFCodec ff_flashsv_encoder; +extern const FFCodec ff_flashsv_decoder; +extern const FFCodec ff_flashsv2_encoder; +extern const FFCodec ff_flashsv2_decoder; +extern const FFCodec ff_flic_decoder; +extern const FFCodec ff_flv_encoder; +extern const FFCodec ff_flv_decoder; +extern const FFCodec ff_fmvc_decoder; +extern const FFCodec ff_fourxm_decoder; +extern const FFCodec ff_fraps_decoder; +extern const FFCodec ff_frwu_decoder; +extern const FFCodec ff_g2m_decoder; +extern const FFCodec ff_gdv_decoder; +extern const FFCodec ff_gem_decoder; +extern const FFCodec ff_gif_encoder; +extern const FFCodec ff_gif_decoder; +extern const FFCodec ff_h261_encoder; +extern const FFCodec ff_h261_decoder; +extern const FFCodec ff_h263_encoder; +extern const FFCodec ff_h263_decoder; +extern const FFCodec ff_h263i_decoder; +extern const FFCodec ff_h263p_encoder; +extern const FFCodec ff_h263p_decoder; +extern const FFCodec ff_h263_v4l2m2m_decoder; +extern const FFCodec ff_h264_decoder; +extern const FFCodec ff_h264_crystalhd_decoder; +extern const FFCodec ff_h264_v4l2m2m_decoder; +extern const FFCodec ff_h264_mediacodec_decoder; +extern const FFCodec ff_h264_mmal_decoder; +extern const FFCodec ff_h264_qsv_decoder; +extern const FFCodec ff_h264_rkmpp_decoder; +extern const FFCodec ff_hap_encoder; +extern const FFCodec ff_hap_decoder; +extern const FFCodec ff_hevc_decoder; +extern const FFCodec ff_hevc_qsv_decoder; +extern const FFCodec ff_hevc_rkmpp_decoder; +extern const FFCodec ff_hevc_v4l2m2m_decoder; +extern const FFCodec ff_hnm4_video_decoder; +extern const FFCodec ff_hq_hqa_decoder; +extern const FFCodec ff_hqx_decoder; +extern const FFCodec ff_huffyuv_encoder; +extern const FFCodec ff_huffyuv_decoder; +extern const FFCodec ff_hymt_decoder; +extern const FFCodec ff_idcin_decoder; +extern const FFCodec ff_iff_ilbm_decoder; +extern const FFCodec ff_imm4_decoder; +extern const FFCodec ff_imm5_decoder; +extern const FFCodec ff_indeo2_decoder; +extern const FFCodec ff_indeo3_decoder; +extern const FFCodec ff_indeo4_decoder; +extern const FFCodec ff_indeo5_decoder; +extern const FFCodec ff_interplay_video_decoder; +extern const FFCodec ff_ipu_decoder; +extern const FFCodec ff_jpeg2000_encoder; +extern const FFCodec ff_jpeg2000_decoder; +extern const FFCodec ff_jpegls_encoder; +extern const FFCodec ff_jpegls_decoder; +extern const FFCodec ff_jv_decoder; +extern const FFCodec ff_kgv1_decoder; +extern const FFCodec ff_kmvc_decoder; +extern const FFCodec ff_lagarith_decoder; +extern const FFCodec ff_ljpeg_encoder; +extern const FFCodec ff_loco_decoder; +extern const FFCodec ff_lscr_decoder; +extern const FFCodec ff_m101_decoder; +extern const FFCodec ff_magicyuv_encoder; +extern const FFCodec ff_magicyuv_decoder; +extern const FFCodec ff_mdec_decoder; +extern const FFCodec ff_mimic_decoder; +extern const FFCodec ff_mjpeg_encoder; +extern const FFCodec ff_mjpeg_decoder; +extern const FFCodec ff_mjpegb_decoder; +extern const FFCodec ff_mmvideo_decoder; +extern const FFCodec ff_mobiclip_decoder; +extern const FFCodec ff_motionpixels_decoder; +extern const FFCodec ff_mpeg1video_encoder; +extern const FFCodec ff_mpeg1video_decoder; +extern const FFCodec ff_mpeg2video_encoder; +extern const FFCodec ff_mpeg2video_decoder; +extern const FFCodec ff_mpeg4_encoder; +extern const FFCodec ff_mpeg4_decoder; +extern const FFCodec ff_mpeg4_crystalhd_decoder; +extern const FFCodec ff_mpeg4_v4l2m2m_decoder; +extern const FFCodec ff_mpeg4_mmal_decoder; +extern const FFCodec ff_mpegvideo_decoder; +extern const FFCodec ff_mpeg1_v4l2m2m_decoder; +extern const FFCodec ff_mpeg2_mmal_decoder; +extern const FFCodec ff_mpeg2_crystalhd_decoder; +extern const FFCodec ff_mpeg2_v4l2m2m_decoder; +extern const FFCodec ff_mpeg2_qsv_decoder; +extern const FFCodec ff_mpeg2_mediacodec_decoder; +extern const FFCodec ff_msa1_decoder; +extern const FFCodec ff_mscc_decoder; +extern const FFCodec ff_msmpeg4v1_decoder; +extern const FFCodec ff_msmpeg4v2_encoder; +extern const FFCodec ff_msmpeg4v2_decoder; +extern const FFCodec ff_msmpeg4v3_encoder; +extern const FFCodec ff_msmpeg4v3_decoder; +extern const FFCodec ff_msmpeg4_crystalhd_decoder; +extern const FFCodec ff_msp2_decoder; +extern const FFCodec ff_msrle_decoder; +extern const FFCodec ff_mss1_decoder; +extern const FFCodec ff_mss2_decoder; +extern const FFCodec ff_msvideo1_encoder; +extern const FFCodec ff_msvideo1_decoder; +extern const FFCodec ff_mszh_decoder; +extern const FFCodec ff_mts2_decoder; +extern const FFCodec ff_mv30_decoder; +extern const FFCodec ff_mvc1_decoder; +extern const FFCodec ff_mvc2_decoder; +extern const FFCodec ff_mvdv_decoder; +extern const FFCodec ff_mvha_decoder; +extern const FFCodec ff_mwsc_decoder; +extern const FFCodec ff_mxpeg_decoder; +extern const FFCodec ff_notchlc_decoder; +extern const FFCodec ff_nuv_decoder; +extern const FFCodec ff_paf_video_decoder; +extern const FFCodec ff_pam_encoder; +extern const FFCodec ff_pam_decoder; +extern const FFCodec ff_pbm_encoder; +extern const FFCodec ff_pbm_decoder; +extern const FFCodec ff_pcx_encoder; +extern const FFCodec ff_pcx_decoder; +extern const FFCodec ff_pfm_encoder; +extern const FFCodec ff_pfm_decoder; +extern const FFCodec ff_pgm_encoder; +extern const FFCodec ff_pgm_decoder; +extern const FFCodec ff_pgmyuv_encoder; +extern const FFCodec ff_pgmyuv_decoder; +extern const FFCodec ff_pgx_decoder; +extern const FFCodec ff_photocd_decoder; +extern const FFCodec ff_pictor_decoder; +extern const FFCodec ff_pixlet_decoder; +extern const FFCodec ff_png_encoder; +extern const FFCodec ff_png_decoder; +extern const FFCodec ff_ppm_encoder; +extern const FFCodec ff_ppm_decoder; +extern const FFCodec ff_prores_encoder; +extern const FFCodec ff_prores_decoder; +extern const FFCodec ff_prores_aw_encoder; +extern const FFCodec ff_prores_ks_encoder; +extern const FFCodec ff_prosumer_decoder; +extern const FFCodec ff_psd_decoder; +extern const FFCodec ff_ptx_decoder; +extern const FFCodec ff_qdraw_decoder; +extern const FFCodec ff_qpeg_decoder; +extern const FFCodec ff_qtrle_encoder; +extern const FFCodec ff_qtrle_decoder; +extern const FFCodec ff_r10k_encoder; +extern const FFCodec ff_r10k_decoder; +extern const FFCodec ff_r210_encoder; +extern const FFCodec ff_r210_decoder; +extern const FFCodec ff_rasc_decoder; +extern const FFCodec ff_rawvideo_encoder; +extern const FFCodec ff_rawvideo_decoder; +extern const FFCodec ff_rl2_decoder; +extern const FFCodec ff_roq_encoder; +extern const FFCodec ff_roq_decoder; +extern const FFCodec ff_rpza_encoder; +extern const FFCodec ff_rpza_decoder; +extern const FFCodec ff_rscc_decoder; +extern const FFCodec ff_rv10_encoder; +extern const FFCodec ff_rv10_decoder; +extern const FFCodec ff_rv20_encoder; +extern const FFCodec ff_rv20_decoder; +extern const FFCodec ff_rv30_decoder; +extern const FFCodec ff_rv40_decoder; +extern const FFCodec ff_s302m_encoder; +extern const FFCodec ff_s302m_decoder; +extern const FFCodec ff_sanm_decoder; +extern const FFCodec ff_scpr_decoder; +extern const FFCodec ff_screenpresso_decoder; +extern const FFCodec ff_sga_decoder; +extern const FFCodec ff_sgi_encoder; +extern const FFCodec ff_sgi_decoder; +extern const FFCodec ff_sgirle_decoder; +extern const FFCodec ff_sheervideo_decoder; +extern const FFCodec ff_simbiosis_imx_decoder; +extern const FFCodec ff_smacker_decoder; +extern const FFCodec ff_smc_encoder; +extern const FFCodec ff_smc_decoder; +extern const FFCodec ff_smvjpeg_decoder; +extern const FFCodec ff_snow_encoder; +extern const FFCodec ff_snow_decoder; +extern const FFCodec ff_sp5x_decoder; +extern const FFCodec ff_speedhq_decoder; +extern const FFCodec ff_speedhq_encoder; +extern const FFCodec ff_speex_decoder; +extern const FFCodec ff_srgc_decoder; +extern const FFCodec ff_sunrast_encoder; +extern const FFCodec ff_sunrast_decoder; +extern const FFCodec ff_svq1_encoder; +extern const FFCodec ff_svq1_decoder; +extern const FFCodec ff_svq3_decoder; +extern const FFCodec ff_targa_encoder; +extern const FFCodec ff_targa_decoder; +extern const FFCodec ff_targa_y216_decoder; +extern const FFCodec ff_tdsc_decoder; +extern const FFCodec ff_theora_decoder; +extern const FFCodec ff_thp_decoder; +extern const FFCodec ff_tiertexseqvideo_decoder; +extern const FFCodec ff_tiff_encoder; +extern const FFCodec ff_tiff_decoder; +extern const FFCodec ff_tmv_decoder; +extern const FFCodec ff_truemotion1_decoder; +extern const FFCodec ff_truemotion2_decoder; +extern const FFCodec ff_truemotion2rt_decoder; +extern const FFCodec ff_tscc_decoder; +extern const FFCodec ff_tscc2_decoder; +extern const FFCodec ff_txd_decoder; +extern const FFCodec ff_ulti_decoder; +extern const FFCodec ff_utvideo_encoder; +extern const FFCodec ff_utvideo_decoder; +extern const FFCodec ff_v210_encoder; +extern const FFCodec ff_v210_decoder; +extern const FFCodec ff_v210x_decoder; +extern const FFCodec ff_v308_encoder; +extern const FFCodec ff_v308_decoder; +extern const FFCodec ff_v408_encoder; +extern const FFCodec ff_v408_decoder; +extern const FFCodec ff_v410_encoder; +extern const FFCodec ff_v410_decoder; +extern const FFCodec ff_vb_decoder; +extern const FFCodec ff_vble_decoder; +extern const FFCodec ff_vc1_decoder; +extern const FFCodec ff_vc1_crystalhd_decoder; +extern const FFCodec ff_vc1image_decoder; +extern const FFCodec ff_vc1_mmal_decoder; +extern const FFCodec ff_vc1_qsv_decoder; +extern const FFCodec ff_vc1_v4l2m2m_decoder; +extern const FFCodec ff_vc2_encoder; +extern const FFCodec ff_vcr1_decoder; +extern const FFCodec ff_vmdvideo_decoder; +extern const FFCodec ff_vmnc_decoder; +extern const FFCodec ff_vp3_decoder; +extern const FFCodec ff_vp4_decoder; +extern const FFCodec ff_vp5_decoder; +extern const FFCodec ff_vp6_decoder; +extern const FFCodec ff_vp6a_decoder; +extern const FFCodec ff_vp6f_decoder; +extern const FFCodec ff_vp7_decoder; +extern const FFCodec ff_vp8_decoder; +extern const FFCodec ff_vp8_rkmpp_decoder; +extern const FFCodec ff_vp8_v4l2m2m_decoder; +extern const FFCodec ff_vp9_decoder; +extern const FFCodec ff_vp9_rkmpp_decoder; +extern const FFCodec ff_vp9_v4l2m2m_decoder; +extern const FFCodec ff_vqa_decoder; +extern const FFCodec ff_webp_decoder; +extern const FFCodec ff_wcmv_decoder; +extern const FFCodec ff_wrapped_avframe_encoder; +extern const FFCodec ff_wrapped_avframe_decoder; +extern const FFCodec ff_wmv1_encoder; +extern const FFCodec ff_wmv1_decoder; +extern const FFCodec ff_wmv2_encoder; +extern const FFCodec ff_wmv2_decoder; +extern const FFCodec ff_wmv3_decoder; +extern const FFCodec ff_wmv3_crystalhd_decoder; +extern const FFCodec ff_wmv3image_decoder; +extern const FFCodec ff_wnv1_decoder; +extern const FFCodec ff_xan_wc3_decoder; +extern const FFCodec ff_xan_wc4_decoder; +extern const FFCodec ff_xbm_encoder; +extern const FFCodec ff_xbm_decoder; +extern const FFCodec ff_xface_encoder; +extern const FFCodec ff_xface_decoder; +extern const FFCodec ff_xl_decoder; +extern const FFCodec ff_xpm_decoder; +extern const FFCodec ff_xwd_encoder; +extern const FFCodec ff_xwd_decoder; +extern const FFCodec ff_y41p_encoder; +extern const FFCodec ff_y41p_decoder; +extern const FFCodec ff_ylc_decoder; +extern const FFCodec ff_yop_decoder; +extern const FFCodec ff_yuv4_encoder; +extern const FFCodec ff_yuv4_decoder; +extern const FFCodec ff_zero12v_decoder; +extern const FFCodec ff_zerocodec_decoder; +extern const FFCodec ff_zlib_encoder; +extern const FFCodec ff_zlib_decoder; +extern const FFCodec ff_zmbv_encoder; +extern const FFCodec ff_zmbv_decoder; /* audio codecs */ -extern const AVCodec ff_aac_encoder; -extern const AVCodec ff_aac_decoder; -extern const AVCodec ff_aac_fixed_decoder; -extern const AVCodec ff_aac_latm_decoder; -extern const AVCodec ff_ac3_encoder; -extern const AVCodec ff_ac3_decoder; -extern const AVCodec ff_ac3_fixed_encoder; -extern const AVCodec ff_ac3_fixed_decoder; -extern const AVCodec ff_acelp_kelvin_decoder; -extern const AVCodec ff_alac_encoder; -extern const AVCodec ff_alac_decoder; -extern const AVCodec ff_als_decoder; -extern const AVCodec ff_amrnb_decoder; -extern const AVCodec ff_amrwb_decoder; -extern const AVCodec ff_ape_decoder; -extern const AVCodec ff_aptx_encoder; -extern const AVCodec ff_aptx_decoder; -extern const AVCodec ff_aptx_hd_encoder; -extern const AVCodec ff_aptx_hd_decoder; -extern const AVCodec ff_atrac1_decoder; -extern const AVCodec ff_atrac3_decoder; -extern const AVCodec ff_atrac3al_decoder; -extern const AVCodec ff_atrac3p_decoder; -extern const AVCodec ff_atrac3pal_decoder; -extern const AVCodec ff_atrac9_decoder; -extern const AVCodec ff_binkaudio_dct_decoder; -extern const AVCodec ff_binkaudio_rdft_decoder; -extern const AVCodec ff_bmv_audio_decoder; -extern const AVCodec ff_cook_decoder; -extern const AVCodec ff_dca_encoder; -extern const AVCodec ff_dca_decoder; -extern const AVCodec ff_dfpwm_encoder; -extern const AVCodec ff_dfpwm_decoder; -extern const AVCodec ff_dolby_e_decoder; -extern const AVCodec ff_dsd_lsbf_decoder; -extern const AVCodec ff_dsd_msbf_decoder; -extern const AVCodec ff_dsd_lsbf_planar_decoder; -extern const AVCodec ff_dsd_msbf_planar_decoder; -extern const AVCodec ff_dsicinaudio_decoder; -extern const AVCodec ff_dss_sp_decoder; -extern const AVCodec ff_dst_decoder; -extern const AVCodec ff_eac3_encoder; -extern const AVCodec ff_eac3_decoder; -extern const AVCodec ff_evrc_decoder; -extern const AVCodec ff_fastaudio_decoder; -extern const AVCodec ff_ffwavesynth_decoder; -extern const AVCodec ff_flac_encoder; -extern const AVCodec ff_flac_decoder; -extern const AVCodec ff_g723_1_encoder; -extern const AVCodec ff_g723_1_decoder; -extern const AVCodec ff_g729_decoder; -extern const AVCodec ff_gsm_decoder; -extern const AVCodec ff_gsm_ms_decoder; -extern const AVCodec ff_hca_decoder; -extern const AVCodec ff_hcom_decoder; -extern const AVCodec ff_iac_decoder; -extern const AVCodec ff_ilbc_decoder; -extern const AVCodec ff_imc_decoder; -extern const AVCodec ff_interplay_acm_decoder; -extern const AVCodec ff_mace3_decoder; -extern const AVCodec ff_mace6_decoder; -extern const AVCodec ff_metasound_decoder; -extern const AVCodec ff_mlp_encoder; -extern const AVCodec ff_mlp_decoder; -extern const AVCodec ff_mp1_decoder; -extern const AVCodec ff_mp1float_decoder; -extern const AVCodec ff_mp2_encoder; -extern const AVCodec ff_mp2_decoder; -extern const AVCodec ff_mp2float_decoder; -extern const AVCodec ff_mp2fixed_encoder; -extern const AVCodec ff_mp3float_decoder; -extern const AVCodec ff_mp3_decoder; -extern const AVCodec ff_mp3adufloat_decoder; -extern const AVCodec ff_mp3adu_decoder; -extern const AVCodec ff_mp3on4float_decoder; -extern const AVCodec ff_mp3on4_decoder; -extern const AVCodec ff_mpc7_decoder; -extern const AVCodec ff_mpc8_decoder; -extern const AVCodec ff_msnsiren_decoder; -extern const AVCodec ff_nellymoser_encoder; -extern const AVCodec ff_nellymoser_decoder; -extern const AVCodec ff_on2avc_decoder; -extern const AVCodec ff_opus_encoder; -extern const AVCodec ff_opus_decoder; -extern const AVCodec ff_paf_audio_decoder; -extern const AVCodec ff_qcelp_decoder; -extern const AVCodec ff_qdm2_decoder; -extern const AVCodec ff_qdmc_decoder; -extern const AVCodec ff_ra_144_encoder; -extern const AVCodec ff_ra_144_decoder; -extern const AVCodec ff_ra_288_decoder; -extern const AVCodec ff_ralf_decoder; -extern const AVCodec ff_sbc_encoder; -extern const AVCodec ff_sbc_decoder; -extern const AVCodec ff_shorten_decoder; -extern const AVCodec ff_sipr_decoder; -extern const AVCodec ff_siren_decoder; -extern const AVCodec ff_smackaud_decoder; -extern const AVCodec ff_sonic_encoder; -extern const AVCodec ff_sonic_decoder; -extern const AVCodec ff_sonic_ls_encoder; -extern const AVCodec ff_tak_decoder; -extern const AVCodec ff_truehd_encoder; -extern const AVCodec ff_truehd_decoder; -extern const AVCodec ff_truespeech_decoder; -extern const AVCodec ff_tta_encoder; -extern const AVCodec ff_tta_decoder; -extern const AVCodec ff_twinvq_decoder; -extern const AVCodec ff_vmdaudio_decoder; -extern const AVCodec ff_vorbis_encoder; -extern const AVCodec ff_vorbis_decoder; -extern const AVCodec ff_wavpack_encoder; -extern const AVCodec ff_wavpack_decoder; -extern const AVCodec ff_wmalossless_decoder; -extern const AVCodec ff_wmapro_decoder; -extern const AVCodec ff_wmav1_encoder; -extern const AVCodec ff_wmav1_decoder; -extern const AVCodec ff_wmav2_encoder; -extern const AVCodec ff_wmav2_decoder; -extern const AVCodec ff_wmavoice_decoder; -extern const AVCodec ff_ws_snd1_decoder; -extern const AVCodec ff_xma1_decoder; -extern const AVCodec ff_xma2_decoder; +extern const FFCodec ff_aac_encoder; +extern const FFCodec ff_aac_decoder; +extern const FFCodec ff_aac_fixed_decoder; +extern const FFCodec ff_aac_latm_decoder; +extern const FFCodec ff_ac3_encoder; +extern const FFCodec ff_ac3_decoder; +extern const FFCodec ff_ac3_fixed_encoder; +extern const FFCodec ff_ac3_fixed_decoder; +extern const FFCodec ff_acelp_kelvin_decoder; +extern const FFCodec ff_alac_encoder; +extern const FFCodec ff_alac_decoder; +extern const FFCodec ff_als_decoder; +extern const FFCodec ff_amrnb_decoder; +extern const FFCodec ff_amrwb_decoder; +extern const FFCodec ff_ape_decoder; +extern const FFCodec ff_aptx_encoder; +extern const FFCodec ff_aptx_decoder; +extern const FFCodec ff_aptx_hd_encoder; +extern const FFCodec ff_aptx_hd_decoder; +extern const FFCodec ff_atrac1_decoder; +extern const FFCodec ff_atrac3_decoder; +extern const FFCodec ff_atrac3al_decoder; +extern const FFCodec ff_atrac3p_decoder; +extern const FFCodec ff_atrac3pal_decoder; +extern const FFCodec ff_atrac9_decoder; +extern const FFCodec ff_binkaudio_dct_decoder; +extern const FFCodec ff_binkaudio_rdft_decoder; +extern const FFCodec ff_bmv_audio_decoder; +extern const FFCodec ff_cook_decoder; +extern const FFCodec ff_dca_encoder; +extern const FFCodec ff_dca_decoder; +extern const FFCodec ff_dfpwm_encoder; +extern const FFCodec ff_dfpwm_decoder; +extern const FFCodec ff_dolby_e_decoder; +extern const FFCodec ff_dsd_lsbf_decoder; +extern const FFCodec ff_dsd_msbf_decoder; +extern const FFCodec ff_dsd_lsbf_planar_decoder; +extern const FFCodec ff_dsd_msbf_planar_decoder; +extern const FFCodec ff_dsicinaudio_decoder; +extern const FFCodec ff_dss_sp_decoder; +extern const FFCodec ff_dst_decoder; +extern const FFCodec ff_eac3_encoder; +extern const FFCodec ff_eac3_decoder; +extern const FFCodec ff_evrc_decoder; +extern const FFCodec ff_fastaudio_decoder; +extern const FFCodec ff_ffwavesynth_decoder; +extern const FFCodec ff_flac_encoder; +extern const FFCodec ff_flac_decoder; +extern const FFCodec ff_g723_1_encoder; +extern const FFCodec ff_g723_1_decoder; +extern const FFCodec ff_g729_decoder; +extern const FFCodec ff_gsm_decoder; +extern const FFCodec ff_gsm_ms_decoder; +extern const FFCodec ff_hca_decoder; +extern const FFCodec ff_hcom_decoder; +extern const FFCodec ff_iac_decoder; +extern const FFCodec ff_ilbc_decoder; +extern const FFCodec ff_imc_decoder; +extern const FFCodec ff_interplay_acm_decoder; +extern const FFCodec ff_mace3_decoder; +extern const FFCodec ff_mace6_decoder; +extern const FFCodec ff_metasound_decoder; +extern const FFCodec ff_mlp_encoder; +extern const FFCodec ff_mlp_decoder; +extern const FFCodec ff_mp1_decoder; +extern const FFCodec ff_mp1float_decoder; +extern const FFCodec ff_mp2_encoder; +extern const FFCodec ff_mp2_decoder; +extern const FFCodec ff_mp2float_decoder; +extern const FFCodec ff_mp2fixed_encoder; +extern const FFCodec ff_mp3float_decoder; +extern const FFCodec ff_mp3_decoder; +extern const FFCodec ff_mp3adufloat_decoder; +extern const FFCodec ff_mp3adu_decoder; +extern const FFCodec ff_mp3on4float_decoder; +extern const FFCodec ff_mp3on4_decoder; +extern const FFCodec ff_mpc7_decoder; +extern const FFCodec ff_mpc8_decoder; +extern const FFCodec ff_msnsiren_decoder; +extern const FFCodec ff_nellymoser_encoder; +extern const FFCodec ff_nellymoser_decoder; +extern const FFCodec ff_on2avc_decoder; +extern const FFCodec ff_opus_encoder; +extern const FFCodec ff_opus_decoder; +extern const FFCodec ff_paf_audio_decoder; +extern const FFCodec ff_qcelp_decoder; +extern const FFCodec ff_qdm2_decoder; +extern const FFCodec ff_qdmc_decoder; +extern const FFCodec ff_ra_144_encoder; +extern const FFCodec ff_ra_144_decoder; +extern const FFCodec ff_ra_288_decoder; +extern const FFCodec ff_ralf_decoder; +extern const FFCodec ff_sbc_encoder; +extern const FFCodec ff_sbc_decoder; +extern const FFCodec ff_shorten_decoder; +extern const FFCodec ff_sipr_decoder; +extern const FFCodec ff_siren_decoder; +extern const FFCodec ff_smackaud_decoder; +extern const FFCodec ff_sonic_encoder; +extern const FFCodec ff_sonic_decoder; +extern const FFCodec ff_sonic_ls_encoder; +extern const FFCodec ff_tak_decoder; +extern const FFCodec ff_truehd_encoder; +extern const FFCodec ff_truehd_decoder; +extern const FFCodec ff_truespeech_decoder; +extern const FFCodec ff_tta_encoder; +extern const FFCodec ff_tta_decoder; +extern const FFCodec ff_twinvq_decoder; +extern const FFCodec ff_vmdaudio_decoder; +extern const FFCodec ff_vorbis_encoder; +extern const FFCodec ff_vorbis_decoder; +extern const FFCodec ff_wavpack_encoder; +extern const FFCodec ff_wavpack_decoder; +extern const FFCodec ff_wmalossless_decoder; +extern const FFCodec ff_wmapro_decoder; +extern const FFCodec ff_wmav1_encoder; +extern const FFCodec ff_wmav1_decoder; +extern const FFCodec ff_wmav2_encoder; +extern const FFCodec ff_wmav2_decoder; +extern const FFCodec ff_wmavoice_decoder; +extern const FFCodec ff_ws_snd1_decoder; +extern const FFCodec ff_xma1_decoder; +extern const FFCodec ff_xma2_decoder; /* PCM codecs */ -extern const AVCodec ff_pcm_alaw_encoder; -extern const AVCodec ff_pcm_alaw_decoder; -extern const AVCodec ff_pcm_bluray_encoder; -extern const AVCodec ff_pcm_bluray_decoder; -extern const AVCodec ff_pcm_dvd_encoder; -extern const AVCodec ff_pcm_dvd_decoder; -extern const AVCodec ff_pcm_f16le_decoder; -extern const AVCodec ff_pcm_f24le_decoder; -extern const AVCodec ff_pcm_f32be_encoder; -extern const AVCodec ff_pcm_f32be_decoder; -extern const AVCodec ff_pcm_f32le_encoder; -extern const AVCodec ff_pcm_f32le_decoder; -extern const AVCodec ff_pcm_f64be_encoder; -extern const AVCodec ff_pcm_f64be_decoder; -extern const AVCodec ff_pcm_f64le_encoder; -extern const AVCodec ff_pcm_f64le_decoder; -extern const AVCodec ff_pcm_lxf_decoder; -extern const AVCodec ff_pcm_mulaw_encoder; -extern const AVCodec ff_pcm_mulaw_decoder; -extern const AVCodec ff_pcm_s8_encoder; -extern const AVCodec ff_pcm_s8_decoder; -extern const AVCodec ff_pcm_s8_planar_encoder; -extern const AVCodec ff_pcm_s8_planar_decoder; -extern const AVCodec ff_pcm_s16be_encoder; -extern const AVCodec ff_pcm_s16be_decoder; -extern const AVCodec ff_pcm_s16be_planar_encoder; -extern const AVCodec ff_pcm_s16be_planar_decoder; -extern const AVCodec ff_pcm_s16le_encoder; -extern const AVCodec ff_pcm_s16le_decoder; -extern const AVCodec ff_pcm_s16le_planar_encoder; -extern const AVCodec ff_pcm_s16le_planar_decoder; -extern const AVCodec ff_pcm_s24be_encoder; -extern const AVCodec ff_pcm_s24be_decoder; -extern const AVCodec ff_pcm_s24daud_encoder; -extern const AVCodec ff_pcm_s24daud_decoder; -extern const AVCodec ff_pcm_s24le_encoder; -extern const AVCodec ff_pcm_s24le_decoder; -extern const AVCodec ff_pcm_s24le_planar_encoder; -extern const AVCodec ff_pcm_s24le_planar_decoder; -extern const AVCodec ff_pcm_s32be_encoder; -extern const AVCodec ff_pcm_s32be_decoder; -extern const AVCodec ff_pcm_s32le_encoder; -extern const AVCodec ff_pcm_s32le_decoder; -extern const AVCodec ff_pcm_s32le_planar_encoder; -extern const AVCodec ff_pcm_s32le_planar_decoder; -extern const AVCodec ff_pcm_s64be_encoder; -extern const AVCodec ff_pcm_s64be_decoder; -extern const AVCodec ff_pcm_s64le_encoder; -extern const AVCodec ff_pcm_s64le_decoder; -extern const AVCodec ff_pcm_sga_decoder; -extern const AVCodec ff_pcm_u8_encoder; -extern const AVCodec ff_pcm_u8_decoder; -extern const AVCodec ff_pcm_u16be_encoder; -extern const AVCodec ff_pcm_u16be_decoder; -extern const AVCodec ff_pcm_u16le_encoder; -extern const AVCodec ff_pcm_u16le_decoder; -extern const AVCodec ff_pcm_u24be_encoder; -extern const AVCodec ff_pcm_u24be_decoder; -extern const AVCodec ff_pcm_u24le_encoder; -extern const AVCodec ff_pcm_u24le_decoder; -extern const AVCodec ff_pcm_u32be_encoder; -extern const AVCodec ff_pcm_u32be_decoder; -extern const AVCodec ff_pcm_u32le_encoder; -extern const AVCodec ff_pcm_u32le_decoder; -extern const AVCodec ff_pcm_vidc_encoder; -extern const AVCodec ff_pcm_vidc_decoder; +extern const FFCodec ff_pcm_alaw_encoder; +extern const FFCodec ff_pcm_alaw_decoder; +extern const FFCodec ff_pcm_bluray_encoder; +extern const FFCodec ff_pcm_bluray_decoder; +extern const FFCodec ff_pcm_dvd_encoder; +extern const FFCodec ff_pcm_dvd_decoder; +extern const FFCodec ff_pcm_f16le_decoder; +extern const FFCodec ff_pcm_f24le_decoder; +extern const FFCodec ff_pcm_f32be_encoder; +extern const FFCodec ff_pcm_f32be_decoder; +extern const FFCodec ff_pcm_f32le_encoder; +extern const FFCodec ff_pcm_f32le_decoder; +extern const FFCodec ff_pcm_f64be_encoder; +extern const FFCodec ff_pcm_f64be_decoder; +extern const FFCodec ff_pcm_f64le_encoder; +extern const FFCodec ff_pcm_f64le_decoder; +extern const FFCodec ff_pcm_lxf_decoder; +extern const FFCodec ff_pcm_mulaw_encoder; +extern const FFCodec ff_pcm_mulaw_decoder; +extern const FFCodec ff_pcm_s8_encoder; +extern const FFCodec ff_pcm_s8_decoder; +extern const FFCodec ff_pcm_s8_planar_encoder; +extern const FFCodec ff_pcm_s8_planar_decoder; +extern const FFCodec ff_pcm_s16be_encoder; +extern const FFCodec ff_pcm_s16be_decoder; +extern const FFCodec ff_pcm_s16be_planar_encoder; +extern const FFCodec ff_pcm_s16be_planar_decoder; +extern const FFCodec ff_pcm_s16le_encoder; +extern const FFCodec ff_pcm_s16le_decoder; +extern const FFCodec ff_pcm_s16le_planar_encoder; +extern const FFCodec ff_pcm_s16le_planar_decoder; +extern const FFCodec ff_pcm_s24be_encoder; +extern const FFCodec ff_pcm_s24be_decoder; +extern const FFCodec ff_pcm_s24daud_encoder; +extern const FFCodec ff_pcm_s24daud_decoder; +extern const FFCodec ff_pcm_s24le_encoder; +extern const FFCodec ff_pcm_s24le_decoder; +extern const FFCodec ff_pcm_s24le_planar_encoder; +extern const FFCodec ff_pcm_s24le_planar_decoder; +extern const FFCodec ff_pcm_s32be_encoder; +extern const FFCodec ff_pcm_s32be_decoder; +extern const FFCodec ff_pcm_s32le_encoder; +extern const FFCodec ff_pcm_s32le_decoder; +extern const FFCodec ff_pcm_s32le_planar_encoder; +extern const FFCodec ff_pcm_s32le_planar_decoder; +extern const FFCodec ff_pcm_s64be_encoder; +extern const FFCodec ff_pcm_s64be_decoder; +extern const FFCodec ff_pcm_s64le_encoder; +extern const FFCodec ff_pcm_s64le_decoder; +extern const FFCodec ff_pcm_sga_decoder; +extern const FFCodec ff_pcm_u8_encoder; +extern const FFCodec ff_pcm_u8_decoder; +extern const FFCodec ff_pcm_u16be_encoder; +extern const FFCodec ff_pcm_u16be_decoder; +extern const FFCodec ff_pcm_u16le_encoder; +extern const FFCodec ff_pcm_u16le_decoder; +extern const FFCodec ff_pcm_u24be_encoder; +extern const FFCodec ff_pcm_u24be_decoder; +extern const FFCodec ff_pcm_u24le_encoder; +extern const FFCodec ff_pcm_u24le_decoder; +extern const FFCodec ff_pcm_u32be_encoder; +extern const FFCodec ff_pcm_u32be_decoder; +extern const FFCodec ff_pcm_u32le_encoder; +extern const FFCodec ff_pcm_u32le_decoder; +extern const FFCodec ff_pcm_vidc_encoder; +extern const FFCodec ff_pcm_vidc_decoder; /* DPCM codecs */ -extern const AVCodec ff_derf_dpcm_decoder; -extern const AVCodec ff_gremlin_dpcm_decoder; -extern const AVCodec ff_interplay_dpcm_decoder; -extern const AVCodec ff_roq_dpcm_encoder; -extern const AVCodec ff_roq_dpcm_decoder; -extern const AVCodec ff_sdx2_dpcm_decoder; -extern const AVCodec ff_sol_dpcm_decoder; -extern const AVCodec ff_xan_dpcm_decoder; +extern const FFCodec ff_derf_dpcm_decoder; +extern const FFCodec ff_gremlin_dpcm_decoder; +extern const FFCodec ff_interplay_dpcm_decoder; +extern const FFCodec ff_roq_dpcm_encoder; +extern const FFCodec ff_roq_dpcm_decoder; +extern const FFCodec ff_sdx2_dpcm_decoder; +extern const FFCodec ff_sol_dpcm_decoder; +extern const FFCodec ff_xan_dpcm_decoder; /* ADPCM codecs */ -extern const AVCodec ff_adpcm_4xm_decoder; -extern const AVCodec ff_adpcm_adx_encoder; -extern const AVCodec ff_adpcm_adx_decoder; -extern const AVCodec ff_adpcm_afc_decoder; -extern const AVCodec ff_adpcm_agm_decoder; -extern const AVCodec ff_adpcm_aica_decoder; -extern const AVCodec ff_adpcm_argo_decoder; -extern const AVCodec ff_adpcm_argo_encoder; -extern const AVCodec ff_adpcm_ct_decoder; -extern const AVCodec ff_adpcm_dtk_decoder; -extern const AVCodec ff_adpcm_ea_decoder; -extern const AVCodec ff_adpcm_ea_maxis_xa_decoder; -extern const AVCodec ff_adpcm_ea_r1_decoder; -extern const AVCodec ff_adpcm_ea_r2_decoder; -extern const AVCodec ff_adpcm_ea_r3_decoder; -extern const AVCodec ff_adpcm_ea_xas_decoder; -extern const AVCodec ff_adpcm_g722_encoder; -extern const AVCodec ff_adpcm_g722_decoder; -extern const AVCodec ff_adpcm_g726_encoder; -extern const AVCodec ff_adpcm_g726_decoder; -extern const AVCodec ff_adpcm_g726le_encoder; -extern const AVCodec ff_adpcm_g726le_decoder; -extern const AVCodec ff_adpcm_ima_acorn_decoder; -extern const AVCodec ff_adpcm_ima_amv_decoder; -extern const AVCodec ff_adpcm_ima_amv_encoder; -extern const AVCodec ff_adpcm_ima_alp_decoder; -extern const AVCodec ff_adpcm_ima_alp_encoder; -extern const AVCodec ff_adpcm_ima_apc_decoder; -extern const AVCodec ff_adpcm_ima_apm_decoder; -extern const AVCodec ff_adpcm_ima_apm_encoder; -extern const AVCodec ff_adpcm_ima_cunning_decoder; -extern const AVCodec ff_adpcm_ima_dat4_decoder; -extern const AVCodec ff_adpcm_ima_dk3_decoder; -extern const AVCodec ff_adpcm_ima_dk4_decoder; -extern const AVCodec ff_adpcm_ima_ea_eacs_decoder; -extern const AVCodec ff_adpcm_ima_ea_sead_decoder; -extern const AVCodec ff_adpcm_ima_iss_decoder; -extern const AVCodec ff_adpcm_ima_moflex_decoder; -extern const AVCodec ff_adpcm_ima_mtf_decoder; -extern const AVCodec ff_adpcm_ima_oki_decoder; -extern const AVCodec ff_adpcm_ima_qt_encoder; -extern const AVCodec ff_adpcm_ima_qt_decoder; -extern const AVCodec ff_adpcm_ima_rad_decoder; -extern const AVCodec ff_adpcm_ima_ssi_decoder; -extern const AVCodec ff_adpcm_ima_ssi_encoder; -extern const AVCodec ff_adpcm_ima_smjpeg_decoder; -extern const AVCodec ff_adpcm_ima_wav_encoder; -extern const AVCodec ff_adpcm_ima_wav_decoder; -extern const AVCodec ff_adpcm_ima_ws_encoder; -extern const AVCodec ff_adpcm_ima_ws_decoder; -extern const AVCodec ff_adpcm_ms_encoder; -extern const AVCodec ff_adpcm_ms_decoder; -extern const AVCodec ff_adpcm_mtaf_decoder; -extern const AVCodec ff_adpcm_psx_decoder; -extern const AVCodec ff_adpcm_sbpro_2_decoder; -extern const AVCodec ff_adpcm_sbpro_3_decoder; -extern const AVCodec ff_adpcm_sbpro_4_decoder; -extern const AVCodec ff_adpcm_swf_encoder; -extern const AVCodec ff_adpcm_swf_decoder; -extern const AVCodec ff_adpcm_thp_decoder; -extern const AVCodec ff_adpcm_thp_le_decoder; -extern const AVCodec ff_adpcm_vima_decoder; -extern const AVCodec ff_adpcm_xa_decoder; -extern const AVCodec ff_adpcm_yamaha_encoder; -extern const AVCodec ff_adpcm_yamaha_decoder; -extern const AVCodec ff_adpcm_zork_decoder; +extern const FFCodec ff_adpcm_4xm_decoder; +extern const FFCodec ff_adpcm_adx_encoder; +extern const FFCodec ff_adpcm_adx_decoder; +extern const FFCodec ff_adpcm_afc_decoder; +extern const FFCodec ff_adpcm_agm_decoder; +extern const FFCodec ff_adpcm_aica_decoder; +extern const FFCodec ff_adpcm_argo_decoder; +extern const FFCodec ff_adpcm_argo_encoder; +extern const FFCodec ff_adpcm_ct_decoder; +extern const FFCodec ff_adpcm_dtk_decoder; +extern const FFCodec ff_adpcm_ea_decoder; +extern const FFCodec ff_adpcm_ea_maxis_xa_decoder; +extern const FFCodec ff_adpcm_ea_r1_decoder; +extern const FFCodec ff_adpcm_ea_r2_decoder; +extern const FFCodec ff_adpcm_ea_r3_decoder; +extern const FFCodec ff_adpcm_ea_xas_decoder; +extern const FFCodec ff_adpcm_g722_encoder; +extern const FFCodec ff_adpcm_g722_decoder; +extern const FFCodec ff_adpcm_g726_encoder; +extern const FFCodec ff_adpcm_g726_decoder; +extern const FFCodec ff_adpcm_g726le_encoder; +extern const FFCodec ff_adpcm_g726le_decoder; +extern const FFCodec ff_adpcm_ima_acorn_decoder; +extern const FFCodec ff_adpcm_ima_amv_decoder; +extern const FFCodec ff_adpcm_ima_amv_encoder; +extern const FFCodec ff_adpcm_ima_alp_decoder; +extern const FFCodec ff_adpcm_ima_alp_encoder; +extern const FFCodec ff_adpcm_ima_apc_decoder; +extern const FFCodec ff_adpcm_ima_apm_decoder; +extern const FFCodec ff_adpcm_ima_apm_encoder; +extern const FFCodec ff_adpcm_ima_cunning_decoder; +extern const FFCodec ff_adpcm_ima_dat4_decoder; +extern const FFCodec ff_adpcm_ima_dk3_decoder; +extern const FFCodec ff_adpcm_ima_dk4_decoder; +extern const FFCodec ff_adpcm_ima_ea_eacs_decoder; +extern const FFCodec ff_adpcm_ima_ea_sead_decoder; +extern const FFCodec ff_adpcm_ima_iss_decoder; +extern const FFCodec ff_adpcm_ima_moflex_decoder; +extern const FFCodec ff_adpcm_ima_mtf_decoder; +extern const FFCodec ff_adpcm_ima_oki_decoder; +extern const FFCodec ff_adpcm_ima_qt_encoder; +extern const FFCodec ff_adpcm_ima_qt_decoder; +extern const FFCodec ff_adpcm_ima_rad_decoder; +extern const FFCodec ff_adpcm_ima_ssi_decoder; +extern const FFCodec ff_adpcm_ima_ssi_encoder; +extern const FFCodec ff_adpcm_ima_smjpeg_decoder; +extern const FFCodec ff_adpcm_ima_wav_encoder; +extern const FFCodec ff_adpcm_ima_wav_decoder; +extern const FFCodec ff_adpcm_ima_ws_encoder; +extern const FFCodec ff_adpcm_ima_ws_decoder; +extern const FFCodec ff_adpcm_ms_encoder; +extern const FFCodec ff_adpcm_ms_decoder; +extern const FFCodec ff_adpcm_mtaf_decoder; +extern const FFCodec ff_adpcm_psx_decoder; +extern const FFCodec ff_adpcm_sbpro_2_decoder; +extern const FFCodec ff_adpcm_sbpro_3_decoder; +extern const FFCodec ff_adpcm_sbpro_4_decoder; +extern const FFCodec ff_adpcm_swf_encoder; +extern const FFCodec ff_adpcm_swf_decoder; +extern const FFCodec ff_adpcm_thp_decoder; +extern const FFCodec ff_adpcm_thp_le_decoder; +extern const FFCodec ff_adpcm_vima_decoder; +extern const FFCodec ff_adpcm_xa_decoder; +extern const FFCodec ff_adpcm_yamaha_encoder; +extern const FFCodec ff_adpcm_yamaha_decoder; +extern const FFCodec ff_adpcm_zork_decoder; /* subtitles */ -extern const AVCodec ff_ssa_encoder; -extern const AVCodec ff_ssa_decoder; -extern const AVCodec ff_ass_encoder; -extern const AVCodec ff_ass_decoder; -extern const AVCodec ff_ccaption_decoder; -extern const AVCodec ff_dvbsub_encoder; -extern const AVCodec ff_dvbsub_decoder; -extern const AVCodec ff_dvdsub_encoder; -extern const AVCodec ff_dvdsub_decoder; -extern const AVCodec ff_jacosub_decoder; -extern const AVCodec ff_microdvd_decoder; -extern const AVCodec ff_movtext_encoder; -extern const AVCodec ff_movtext_decoder; -extern const AVCodec ff_mpl2_decoder; -extern const AVCodec ff_pgssub_decoder; -extern const AVCodec ff_pjs_decoder; -extern const AVCodec ff_realtext_decoder; -extern const AVCodec ff_sami_decoder; -extern const AVCodec ff_srt_encoder; -extern const AVCodec ff_srt_decoder; -extern const AVCodec ff_stl_decoder; -extern const AVCodec ff_subrip_encoder; -extern const AVCodec ff_subrip_decoder; -extern const AVCodec ff_subviewer_decoder; -extern const AVCodec ff_subviewer1_decoder; -extern const AVCodec ff_text_encoder; -extern const AVCodec ff_text_decoder; -extern const AVCodec ff_ttml_encoder; -extern const AVCodec ff_vplayer_decoder; -extern const AVCodec ff_webvtt_encoder; -extern const AVCodec ff_webvtt_decoder; -extern const AVCodec ff_xsub_encoder; -extern const AVCodec ff_xsub_decoder; +extern const FFCodec ff_ssa_encoder; +extern const FFCodec ff_ssa_decoder; +extern const FFCodec ff_ass_encoder; +extern const FFCodec ff_ass_decoder; +extern const FFCodec ff_ccaption_decoder; +extern const FFCodec ff_dvbsub_encoder; +extern const FFCodec ff_dvbsub_decoder; +extern const FFCodec ff_dvdsub_encoder; +extern const FFCodec ff_dvdsub_decoder; +extern const FFCodec ff_jacosub_decoder; +extern const FFCodec ff_microdvd_decoder; +extern const FFCodec ff_movtext_encoder; +extern const FFCodec ff_movtext_decoder; +extern const FFCodec ff_mpl2_decoder; +extern const FFCodec ff_pgssub_decoder; +extern const FFCodec ff_pjs_decoder; +extern const FFCodec ff_realtext_decoder; +extern const FFCodec ff_sami_decoder; +extern const FFCodec ff_srt_encoder; +extern const FFCodec ff_srt_decoder; +extern const FFCodec ff_stl_decoder; +extern const FFCodec ff_subrip_encoder; +extern const FFCodec ff_subrip_decoder; +extern const FFCodec ff_subviewer_decoder; +extern const FFCodec ff_subviewer1_decoder; +extern const FFCodec ff_text_encoder; +extern const FFCodec ff_text_decoder; +extern const FFCodec ff_ttml_encoder; +extern const FFCodec ff_vplayer_decoder; +extern const FFCodec ff_webvtt_encoder; +extern const FFCodec ff_webvtt_decoder; +extern const FFCodec ff_xsub_encoder; +extern const FFCodec ff_xsub_decoder; /* external libraries */ -extern const AVCodec ff_aac_at_encoder; -extern const AVCodec ff_aac_at_decoder; -extern const AVCodec ff_ac3_at_decoder; -extern const AVCodec ff_adpcm_ima_qt_at_decoder; -extern const AVCodec ff_alac_at_encoder; -extern const AVCodec ff_alac_at_decoder; -extern const AVCodec ff_amr_nb_at_decoder; -extern const AVCodec ff_eac3_at_decoder; -extern const AVCodec ff_gsm_ms_at_decoder; -extern const AVCodec ff_ilbc_at_encoder; -extern const AVCodec ff_ilbc_at_decoder; -extern const AVCodec ff_mp1_at_decoder; -extern const AVCodec ff_mp2_at_decoder; -extern const AVCodec ff_mp3_at_decoder; -extern const AVCodec ff_pcm_alaw_at_encoder; -extern const AVCodec ff_pcm_alaw_at_decoder; -extern const AVCodec ff_pcm_mulaw_at_encoder; -extern const AVCodec ff_pcm_mulaw_at_decoder; -extern const AVCodec ff_qdmc_at_decoder; -extern const AVCodec ff_qdm2_at_decoder; -extern AVCodec ff_libaom_av1_encoder; -extern const AVCodec ff_libaribb24_decoder; -extern const AVCodec ff_libcelt_decoder; -extern const AVCodec ff_libcodec2_encoder; -extern const AVCodec ff_libcodec2_decoder; -extern const AVCodec ff_libdav1d_decoder; -extern const AVCodec ff_libdavs2_decoder; -extern const AVCodec ff_libfdk_aac_encoder; -extern const AVCodec ff_libfdk_aac_decoder; -extern const AVCodec ff_libgsm_encoder; -extern const AVCodec ff_libgsm_decoder; -extern const AVCodec ff_libgsm_ms_encoder; -extern const AVCodec ff_libgsm_ms_decoder; -extern const AVCodec ff_libilbc_encoder; -extern const AVCodec ff_libilbc_decoder; -extern const AVCodec ff_libmp3lame_encoder; -extern const AVCodec ff_libopencore_amrnb_encoder; -extern const AVCodec ff_libopencore_amrnb_decoder; -extern const AVCodec ff_libopencore_amrwb_decoder; -extern const AVCodec ff_libopenjpeg_encoder; -extern const AVCodec ff_libopenjpeg_decoder; -extern const AVCodec ff_libopus_encoder; -extern const AVCodec ff_libopus_decoder; -extern const AVCodec ff_librav1e_encoder; -extern const AVCodec ff_librsvg_decoder; -extern const AVCodec ff_libshine_encoder; -extern const AVCodec ff_libspeex_encoder; -extern const AVCodec ff_libspeex_decoder; -extern const AVCodec ff_libsvtav1_encoder; -extern const AVCodec ff_libtheora_encoder; -extern const AVCodec ff_libtwolame_encoder; -extern const AVCodec ff_libuavs3d_decoder; -extern const AVCodec ff_libvo_amrwbenc_encoder; -extern const AVCodec ff_libvorbis_encoder; -extern const AVCodec ff_libvorbis_decoder; -extern const AVCodec ff_libvpx_vp8_encoder; -extern const AVCodec ff_libvpx_vp8_decoder; -extern AVCodec ff_libvpx_vp9_encoder; -extern AVCodec ff_libvpx_vp9_decoder; +extern const FFCodec ff_aac_at_encoder; +extern const FFCodec ff_aac_at_decoder; +extern const FFCodec ff_ac3_at_decoder; +extern const FFCodec ff_adpcm_ima_qt_at_decoder; +extern const FFCodec ff_alac_at_encoder; +extern const FFCodec ff_alac_at_decoder; +extern const FFCodec ff_amr_nb_at_decoder; +extern const FFCodec ff_eac3_at_decoder; +extern const FFCodec ff_gsm_ms_at_decoder; +extern const FFCodec ff_ilbc_at_encoder; +extern const FFCodec ff_ilbc_at_decoder; +extern const FFCodec ff_mp1_at_decoder; +extern const FFCodec ff_mp2_at_decoder; +extern const FFCodec ff_mp3_at_decoder; +extern const FFCodec ff_pcm_alaw_at_encoder; +extern const FFCodec ff_pcm_alaw_at_decoder; +extern const FFCodec ff_pcm_mulaw_at_encoder; +extern const FFCodec ff_pcm_mulaw_at_decoder; +extern const FFCodec ff_qdmc_at_decoder; +extern const FFCodec ff_qdm2_at_decoder; +extern FFCodec ff_libaom_av1_encoder; +extern const FFCodec ff_libaribb24_decoder; +extern const FFCodec ff_libcelt_decoder; +extern const FFCodec ff_libcodec2_encoder; +extern const FFCodec ff_libcodec2_decoder; +extern const FFCodec ff_libdav1d_decoder; +extern const FFCodec ff_libdavs2_decoder; +extern const FFCodec ff_libfdk_aac_encoder; +extern const FFCodec ff_libfdk_aac_decoder; +extern const FFCodec ff_libgsm_encoder; +extern const FFCodec ff_libgsm_decoder; +extern const FFCodec ff_libgsm_ms_encoder; +extern const FFCodec ff_libgsm_ms_decoder; +extern const FFCodec ff_libilbc_encoder; +extern const FFCodec ff_libilbc_decoder; +extern const FFCodec ff_libmp3lame_encoder; +extern const FFCodec ff_libopencore_amrnb_encoder; +extern const FFCodec ff_libopencore_amrnb_decoder; +extern const FFCodec ff_libopencore_amrwb_decoder; +extern const FFCodec ff_libopenjpeg_encoder; +extern const FFCodec ff_libopenjpeg_decoder; +extern const FFCodec ff_libopus_encoder; +extern const FFCodec ff_libopus_decoder; +extern const FFCodec ff_librav1e_encoder; +extern const FFCodec ff_librsvg_decoder; +extern const FFCodec ff_libshine_encoder; +extern const FFCodec ff_libspeex_encoder; +extern const FFCodec ff_libspeex_decoder; +extern const FFCodec ff_libsvtav1_encoder; +extern const FFCodec ff_libtheora_encoder; +extern const FFCodec ff_libtwolame_encoder; +extern const FFCodec ff_libuavs3d_decoder; +extern const FFCodec ff_libvo_amrwbenc_encoder; +extern const FFCodec ff_libvorbis_encoder; +extern const FFCodec ff_libvorbis_decoder; +extern const FFCodec ff_libvpx_vp8_encoder; +extern const FFCodec ff_libvpx_vp8_decoder; +extern FFCodec ff_libvpx_vp9_encoder; +extern FFCodec ff_libvpx_vp9_decoder; /* preferred over libwebp */ -extern const AVCodec ff_libwebp_anim_encoder; -extern const AVCodec ff_libwebp_encoder; -extern const AVCodec ff_libx262_encoder; +extern const FFCodec ff_libwebp_anim_encoder; +extern const FFCodec ff_libwebp_encoder; +extern const FFCodec ff_libx262_encoder; #if CONFIG_LIBX264_ENCODER #include #if X264_BUILD < 153 @@ -783,80 +784,80 @@ extern const AVCodec ff_libx262_encoder; #else #define LIBX264_CONST const #endif -extern LIBX264_CONST AVCodec ff_libx264_encoder; +extern LIBX264_CONST FFCodec ff_libx264_encoder; #endif -extern const AVCodec ff_libx264rgb_encoder; -extern AVCodec ff_libx265_encoder; -extern const AVCodec ff_libxavs_encoder; -extern const AVCodec ff_libxavs2_encoder; -extern const AVCodec ff_libxvid_encoder; -extern const AVCodec ff_libzvbi_teletext_decoder; +extern const FFCodec ff_libx264rgb_encoder; +extern FFCodec ff_libx265_encoder; +extern const FFCodec ff_libxavs_encoder; +extern const FFCodec ff_libxavs2_encoder; +extern const FFCodec ff_libxvid_encoder; +extern const FFCodec ff_libzvbi_teletext_decoder; /* text */ -extern const AVCodec ff_bintext_decoder; -extern const AVCodec ff_xbin_decoder; -extern const AVCodec ff_idf_decoder; +extern const FFCodec ff_bintext_decoder; +extern const FFCodec ff_xbin_decoder; +extern const FFCodec ff_idf_decoder; /* external libraries, that shouldn't be used by default if one of the * above is available */ -extern const AVCodec ff_aac_mf_encoder; -extern const AVCodec ff_ac3_mf_encoder; -extern const AVCodec ff_h263_v4l2m2m_encoder; -extern const AVCodec ff_libaom_av1_decoder; +extern const FFCodec ff_aac_mf_encoder; +extern const FFCodec ff_ac3_mf_encoder; +extern const FFCodec ff_h263_v4l2m2m_encoder; +extern const FFCodec ff_libaom_av1_decoder; /* hwaccel hooks only, so prefer external decoders */ -extern const AVCodec ff_av1_decoder; -extern const AVCodec ff_av1_cuvid_decoder; -extern const AVCodec ff_av1_qsv_decoder; -extern const AVCodec ff_libopenh264_encoder; -extern const AVCodec ff_libopenh264_decoder; -extern const AVCodec ff_h264_amf_encoder; -extern const AVCodec ff_h264_cuvid_decoder; -extern const AVCodec ff_h264_mf_encoder; -extern const AVCodec ff_h264_nvenc_encoder; -extern const AVCodec ff_h264_omx_encoder; -extern const AVCodec ff_h264_qsv_encoder; -extern const AVCodec ff_h264_v4l2m2m_encoder; -extern const AVCodec ff_h264_vaapi_encoder; -extern const AVCodec ff_h264_videotoolbox_encoder; -extern const AVCodec ff_hevc_amf_encoder; -extern const AVCodec ff_hevc_cuvid_decoder; -extern const AVCodec ff_hevc_mediacodec_decoder; -extern const AVCodec ff_hevc_mf_encoder; -extern const AVCodec ff_hevc_nvenc_encoder; -extern const AVCodec ff_hevc_qsv_encoder; -extern const AVCodec ff_hevc_v4l2m2m_encoder; -extern const AVCodec ff_hevc_vaapi_encoder; -extern const AVCodec ff_hevc_videotoolbox_encoder; -extern const AVCodec ff_libkvazaar_encoder; -extern const AVCodec ff_mjpeg_cuvid_decoder; -extern const AVCodec ff_mjpeg_qsv_encoder; -extern const AVCodec ff_mjpeg_qsv_decoder; -extern const AVCodec ff_mjpeg_vaapi_encoder; -extern const AVCodec ff_mp3_mf_encoder; -extern const AVCodec ff_mpeg1_cuvid_decoder; -extern const AVCodec ff_mpeg2_cuvid_decoder; -extern const AVCodec ff_mpeg2_qsv_encoder; -extern const AVCodec ff_mpeg2_vaapi_encoder; -extern const AVCodec ff_mpeg4_cuvid_decoder; -extern const AVCodec ff_mpeg4_mediacodec_decoder; -extern const AVCodec ff_mpeg4_omx_encoder; -extern const AVCodec ff_mpeg4_v4l2m2m_encoder; -extern const AVCodec ff_prores_videotoolbox_encoder; -extern const AVCodec ff_vc1_cuvid_decoder; -extern const AVCodec ff_vp8_cuvid_decoder; -extern const AVCodec ff_vp8_mediacodec_decoder; -extern const AVCodec ff_vp8_qsv_decoder; -extern const AVCodec ff_vp8_v4l2m2m_encoder; -extern const AVCodec ff_vp8_vaapi_encoder; -extern const AVCodec ff_vp9_cuvid_decoder; -extern const AVCodec ff_vp9_mediacodec_decoder; -extern const AVCodec ff_vp9_qsv_decoder; -extern const AVCodec ff_vp9_vaapi_encoder; -extern const AVCodec ff_vp9_qsv_encoder; +extern const FFCodec ff_av1_decoder; +extern const FFCodec ff_av1_cuvid_decoder; +extern const FFCodec ff_av1_qsv_decoder; +extern const FFCodec ff_libopenh264_encoder; +extern const FFCodec ff_libopenh264_decoder; +extern const FFCodec ff_h264_amf_encoder; +extern const FFCodec ff_h264_cuvid_decoder; +extern const FFCodec ff_h264_mf_encoder; +extern const FFCodec ff_h264_nvenc_encoder; +extern const FFCodec ff_h264_omx_encoder; +extern const FFCodec ff_h264_qsv_encoder; +extern const FFCodec ff_h264_v4l2m2m_encoder; +extern const FFCodec ff_h264_vaapi_encoder; +extern const FFCodec ff_h264_videotoolbox_encoder; +extern const FFCodec ff_hevc_amf_encoder; +extern const FFCodec ff_hevc_cuvid_decoder; +extern const FFCodec ff_hevc_mediacodec_decoder; +extern const FFCodec ff_hevc_mf_encoder; +extern const FFCodec ff_hevc_nvenc_encoder; +extern const FFCodec ff_hevc_qsv_encoder; +extern const FFCodec ff_hevc_v4l2m2m_encoder; +extern const FFCodec ff_hevc_vaapi_encoder; +extern const FFCodec ff_hevc_videotoolbox_encoder; +extern const FFCodec ff_libkvazaar_encoder; +extern const FFCodec ff_mjpeg_cuvid_decoder; +extern const FFCodec ff_mjpeg_qsv_encoder; +extern const FFCodec ff_mjpeg_qsv_decoder; +extern const FFCodec ff_mjpeg_vaapi_encoder; +extern const FFCodec ff_mp3_mf_encoder; +extern const FFCodec ff_mpeg1_cuvid_decoder; +extern const FFCodec ff_mpeg2_cuvid_decoder; +extern const FFCodec ff_mpeg2_qsv_encoder; +extern const FFCodec ff_mpeg2_vaapi_encoder; +extern const FFCodec ff_mpeg4_cuvid_decoder; +extern const FFCodec ff_mpeg4_mediacodec_decoder; +extern const FFCodec ff_mpeg4_omx_encoder; +extern const FFCodec ff_mpeg4_v4l2m2m_encoder; +extern const FFCodec ff_prores_videotoolbox_encoder; +extern const FFCodec ff_vc1_cuvid_decoder; +extern const FFCodec ff_vp8_cuvid_decoder; +extern const FFCodec ff_vp8_mediacodec_decoder; +extern const FFCodec ff_vp8_qsv_decoder; +extern const FFCodec ff_vp8_v4l2m2m_encoder; +extern const FFCodec ff_vp8_vaapi_encoder; +extern const FFCodec ff_vp9_cuvid_decoder; +extern const FFCodec ff_vp9_mediacodec_decoder; +extern const FFCodec ff_vp9_qsv_decoder; +extern const FFCodec ff_vp9_vaapi_encoder; +extern const FFCodec ff_vp9_qsv_encoder; // The iterate API is not usable with ossfuzz due to the excessive size of binaries created #if CONFIG_OSSFUZZ -const AVCodec * codec_list[] = { +const FFCodec * codec_list[] = { NULL, NULL, NULL @@ -870,21 +871,21 @@ static void av_codec_init_static(void) { for (int i = 0; codec_list[i]; i++) { if (codec_list[i]->init_static_data) - codec_list[i]->init_static_data((AVCodec*)codec_list[i]); + codec_list[i]->init_static_data((FFCodec*)codec_list[i]); } } const AVCodec *av_codec_iterate(void **opaque) { uintptr_t i = (uintptr_t)*opaque; - const AVCodec *c = codec_list[i]; + const FFCodec *c = codec_list[i]; ff_thread_once(&av_codec_static_init, av_codec_init_static); if (c) *opaque = (void*)(i + 1); - return c; + return &c->p; } static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id) diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index c28e2037b7..8f0b061602 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -2176,16 +2176,16 @@ static av_cold void flush(AVCodecContext *avctx) } -const AVCodec ff_als_decoder = { - .name = "als", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP4ALS, +const FFCodec ff_als_decoder = { + .p.name = "als", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Audio Lossless Coding (ALS)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP4ALS, .priv_data_size = sizeof(ALSDecContext), .init = decode_init, .close = decode_end, .decode = decode_frame, .flush = flush, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c index ce31d1333a..3e3a9d4cc7 100644 --- a/libavcodec/amfenc_h264.c +++ b/libavcodec/amfenc_h264.c @@ -378,21 +378,21 @@ static const AVClass h264_amf_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_amf_encoder = { - .name = "h264_amf", - .long_name = NULL_IF_CONFIG_SMALL("AMD AMF H.264 Encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_h264_amf_encoder = { + .p.name = "h264_amf", + .p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF H.264 Encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .init = amf_encode_init_h264, .receive_packet = ff_amf_receive_packet, .close = ff_amf_encode_close, .priv_data_size = sizeof(AmfContext), - .priv_class = &h264_amf_class, + .p.priv_class = &h264_amf_class, .defaults = defaults, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = ff_amf_pix_fmts, - .wrapper_name = "amf", + .p.pix_fmts = ff_amf_pix_fmts, + .p.wrapper_name = "amf", .hw_configs = ff_amfenc_hw_configs, }; diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c index cfdff34716..24f95fb1ea 100644 --- a/libavcodec/amfenc_hevc.c +++ b/libavcodec/amfenc_hevc.c @@ -310,21 +310,21 @@ static const AVClass hevc_amf_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hevc_amf_encoder = { - .name = "hevc_amf", - .long_name = NULL_IF_CONFIG_SMALL("AMD AMF HEVC encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, +const FFCodec ff_hevc_amf_encoder = { + .p.name = "hevc_amf", + .p.long_name = NULL_IF_CONFIG_SMALL("AMD AMF HEVC encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, .init = amf_encode_init_hevc, .receive_packet = ff_amf_receive_packet, .close = ff_amf_encode_close, .priv_data_size = sizeof(AmfContext), - .priv_class = &hevc_amf_class, + .p.priv_class = &hevc_amf_class, .defaults = defaults, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = ff_amf_pix_fmts, - .wrapper_name = "amf", + .p.pix_fmts = ff_amf_pix_fmts, + .p.wrapper_name = "amf", .hw_configs = ff_amfenc_hw_configs, }; diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index e0143ce2b1..86fbd17700 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -1097,16 +1097,16 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, } -const AVCodec ff_amrnb_decoder = { - .name = "amrnb", - .long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_NB, +const FFCodec ff_amrnb_decoder = { + .p.name = "amrnb", + .p.long_name = NULL_IF_CONFIG_SMALL("AMR-NB (Adaptive Multi-Rate NarrowBand)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRChannelsContext), .init = amrnb_decode_init, .decode = amrnb_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c index fe2412bc83..6f019e3a6f 100644 --- a/libavcodec/amrwbdec.c +++ b/libavcodec/amrwbdec.c @@ -1293,16 +1293,16 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_amrwb_decoder = { - .name = "amrwb", - .long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_WB, +const FFCodec ff_amrwb_decoder = { + .p.name = "amrwb", + .p.long_name = NULL_IF_CONFIG_SMALL("AMR-WB (Adaptive Multi-Rate WideBand)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_WB, .priv_data_size = sizeof(AMRWBChannelsContext), .init = amrwb_decode_init, .decode = amrwb_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/anm.c b/libavcodec/anm.c index f01943f6f3..8b05a20eb8 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -190,15 +190,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_anm_decoder = { - .name = "anm", - .long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ANM, +const FFCodec ff_anm_decoder = { + .p.name = "anm", + .p.long_name = NULL_IF_CONFIG_SMALL("Deluxe Paint Animation"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ANM, .priv_data_size = sizeof(AnmContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 312f1c532a..fd66b12fae 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -481,16 +481,16 @@ static const AVCodecDefault ansi_defaults[] = { { NULL }, }; -const AVCodec ff_ansi_decoder = { - .name = "ansi", - .long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ANSI, +const FFCodec ff_ansi_decoder = { + .p.name = "ansi", + .p.long_name = NULL_IF_CONFIG_SMALL("ASCII/ANSI art"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ANSI, .priv_data_size = sizeof(AnsiContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .defaults = ansi_defaults, }; diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index 416b01063f..f7f8a88994 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -1659,22 +1659,22 @@ static const AVClass ape_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ape_decoder = { - .name = "ape", - .long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_APE, +const FFCodec ff_ape_decoder = { + .p.name = "ape", + .p.long_name = NULL_IF_CONFIG_SMALL("Monkey's Audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APE, .priv_data_size = sizeof(APEContext), .init = ape_decode_init, .close = ape_decode_close, .decode = ape_decode_frame, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .flush = ape_flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .priv_class = &ape_decoder_class, + .p.priv_class = &ape_decoder_class, }; diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index 3e4c6d55c6..3e30336964 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -175,41 +175,41 @@ static int aptx_decode_frame(AVCodecContext *avctx, void *data, } #if CONFIG_APTX_DECODER -const AVCodec ff_aptx_decoder = { - .name = "aptx", - .long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_APTX, +const FFCodec ff_aptx_decoder = { + .p.name = "aptx", + .p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APTX, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, .decode = aptx_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, }; #endif #if CONFIG_APTX_HD_DECODER -const AVCodec ff_aptx_hd_decoder = { - .name = "aptx_hd", - .long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_APTX_HD, +const FFCodec ff_aptx_hd_decoder = { + .p.name = "aptx_hd", + .p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APTX_HD, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, .decode = aptx_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, }; #endif diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 35ce896220..206eb439e1 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -245,45 +245,45 @@ static av_cold int aptx_close(AVCodecContext *avctx) } #if CONFIG_APTX_ENCODER -const AVCodec ff_aptx_encoder = { - .name = "aptx", - .long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_APTX, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_aptx_encoder = { + .p.name = "aptx", + .p.long_name = NULL_IF_CONFIG_SMALL("aptX (Audio Processing Technology for Bluetooth)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APTX, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, .encode2 = aptx_encode_frame, .close = aptx_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, + .p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, }; #endif #if CONFIG_APTX_HD_ENCODER -const AVCodec ff_aptx_hd_encoder = { - .name = "aptx_hd", - .long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_APTX_HD, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_aptx_hd_encoder = { + .p.name = "aptx_hd", + .p.long_name = NULL_IF_CONFIG_SMALL("aptX HD (Audio Processing Technology for Bluetooth)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_APTX_HD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(AptXContext), .init = ff_aptx_init, .encode2 = aptx_encode_frame, .close = aptx_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, + .p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, }; #endif diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c index 0dfc9d5526..04d10c33bb 100644 --- a/libavcodec/arbc.c +++ b/libavcodec/arbc.c @@ -212,16 +212,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_arbc_decoder = { - .name = "arbc", - .long_name = NULL_IF_CONFIG_SMALL("Gryphon's Anim Compressor"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ARBC, +const FFCodec ff_arbc_decoder = { + .p.name = "arbc", + .p.long_name = NULL_IF_CONFIG_SMALL("Gryphon's Anim Compressor"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ARBC, .priv_data_size = sizeof(ARBCContext), .init = decode_init, .decode = decode_frame, .flush = decode_flush, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/argo.c b/libavcodec/argo.c index b83aee2884..44ab7a22b7 100644 --- a/libavcodec/argo.c +++ b/libavcodec/argo.c @@ -733,16 +733,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_argo_decoder = { - .name = "argo", - .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ARGO, +const FFCodec ff_argo_decoder = { + .p.name = "argo", + .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ARGO, .priv_data_size = sizeof(ArgoContext), .init = decode_init, .decode = decode_frame, .flush = decode_flush, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index 538d8bf490..86d3e3e5a8 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -64,11 +64,11 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, } #if CONFIG_SSA_DECODER -const AVCodec ff_ssa_decoder = { - .name = "ssa", - .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_ASS, +const FFCodec ff_ssa_decoder = { + .p.name = "ssa", + .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, .decode = ass_decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -76,11 +76,11 @@ const AVCodec ff_ssa_decoder = { #endif #if CONFIG_ASS_DECODER -const AVCodec ff_ass_decoder = { - .name = "ass", - .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_ASS, +const FFCodec ff_ass_decoder = { + .p.name = "ass", + .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_ASS, .init = ass_decode_init, .decode = ass_decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c index 6e5b4bb4a8..948ccdf083 100644 --- a/libavcodec/assenc.c +++ b/libavcodec/assenc.c @@ -69,11 +69,11 @@ static int ass_encode_frame(AVCodecContext *avctx, } #if CONFIG_SSA_ENCODER -const AVCodec ff_ssa_encoder = { - .name = "ssa", - .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_ASS, +const FFCodec ff_ssa_encoder = { + .p.name = "ssa", + .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, .encode_sub = ass_encode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -81,11 +81,11 @@ const AVCodec ff_ssa_encoder = { #endif #if CONFIG_ASS_ENCODER -const AVCodec ff_ass_encoder = { - .name = "ass", - .long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_ASS, +const FFCodec ff_ass_encoder = { + .p.name = "ass", + .p.long_name = NULL_IF_CONFIG_SMALL("ASS (Advanced SubStation Alpha) subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_ASS, .init = ass_encode_init, .encode_sub = ass_encode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index aa8ad9f703..3bed903516 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -329,30 +329,30 @@ static av_cold int decode_end(AVCodecContext *avctx) } #if CONFIG_ASV1_DECODER -const AVCodec ff_asv1_decoder = { - .name = "asv1", - .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ASV1, +const FFCodec ff_asv1_decoder = { + .p.name = "asv1", + .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ASV1, .priv_data_size = sizeof(ASV1Context), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASV2_DECODER -const AVCodec ff_asv2_decoder = { - .name = "asv2", - .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ASV2, +const FFCodec ff_asv2_decoder = { + .p.name = "asv2", + .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ASV2, .priv_data_size = sizeof(ASV1Context), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index cdbfbf62fd..8dd15f29bd 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -343,30 +343,30 @@ static av_cold int encode_init(AVCodecContext *avctx) } #if CONFIG_ASV1_ENCODER -const AVCodec ff_asv1_encoder = { - .name = "asv1", - .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ASV1, +const FFCodec ff_asv1_encoder = { + .p.name = "asv1", + .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ASV1, .priv_data_size = sizeof(ASV1Context), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ASV2_ENCODER -const AVCodec ff_asv2_encoder = { - .name = "asv2", - .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ASV2, +const FFCodec ff_asv2_encoder = { + .p.name = "asv2", + .p.long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ASV2, .priv_data_size = sizeof(ASV1Context), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index f57c5cc1fb..aaf58da7d6 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -385,17 +385,17 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx) } -const AVCodec ff_atrac1_decoder = { - .name = "atrac1", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC1, +const FFCodec ff_atrac1_decoder = { + .p.name = "atrac1", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC1 (Adaptive TRansform Acoustic Coding)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC1, .priv_data_size = sizeof(AT1Ctx), .init = atrac1_decode_init, .close = atrac1_decode_end, .decode = atrac1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 9010c8d4f6..be53fe44f9 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -1017,32 +1017,32 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_atrac3_decoder = { - .name = "atrac3", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC3, +const FFCodec ff_atrac3_decoder = { + .p.name = "atrac3", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 (Adaptive TRansform Acoustic Coding 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC3, .priv_data_size = sizeof(ATRAC3Context), .init = atrac3_decode_init, .close = atrac3_decode_close, .decode = atrac3_decode_frame, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_atrac3al_decoder = { - .name = "atrac3al", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC3AL, +const FFCodec ff_atrac3al_decoder = { + .p.name = "atrac3al", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3 AL (Adaptive TRansform Acoustic Coding 3 Advanced Lossless)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC3AL, .priv_data_size = sizeof(ATRAC3Context), .init = atrac3_decode_init, .close = atrac3_decode_close, .decode = atrac3al_decode_frame, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/atrac3plusdec.c b/libavcodec/atrac3plusdec.c index f0b0a1fa73..435fe75152 100644 --- a/libavcodec/atrac3plusdec.c +++ b/libavcodec/atrac3plusdec.c @@ -391,12 +391,12 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data, return avctx->codec_id == AV_CODEC_ID_ATRAC3P ? FFMIN(avctx->block_align, avpkt->size) : avpkt->size; } -const AVCodec ff_atrac3p_decoder = { - .name = "atrac3plus", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC3P, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_atrac3p_decoder = { + .p.name = "atrac3plus", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ (Adaptive TRansform Acoustic Coding 3+)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC3P, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, @@ -404,12 +404,12 @@ const AVCodec ff_atrac3p_decoder = { .decode = atrac3p_decode_frame, }; -const AVCodec ff_atrac3pal_decoder = { - .name = "atrac3plusal", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC3PAL, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_atrac3pal_decoder = { + .p.name = "atrac3plusal", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC3+ AL (Adaptive TRansform Acoustic Coding 3+ Advanced Lossless)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC3PAL, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(ATRAC3PContext), .init = atrac3p_decode_init, diff --git a/libavcodec/atrac9dec.c b/libavcodec/atrac9dec.c index 932710e001..4af5f7e0ba 100644 --- a/libavcodec/atrac9dec.c +++ b/libavcodec/atrac9dec.c @@ -988,16 +988,16 @@ static av_cold int atrac9_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_atrac9_decoder = { - .name = "atrac9", - .long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ATRAC9, +const FFCodec ff_atrac9_decoder = { + .p.name = "atrac9", + .p.long_name = NULL_IF_CONFIG_SMALL("ATRAC9 (Adaptive TRansform Acoustic Coding 9)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ATRAC9, .priv_data_size = sizeof(ATRAC9Context), .init = atrac9_decode_init, .close = atrac9_decode_close, .decode = atrac9_decode_frame, .flush = atrac9_decode_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, }; diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 9c2a969e57..3b5fc942bb 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -585,21 +585,21 @@ static av_cold int ffat_close_decoder(AVCodecContext *avctx) #define FFAT_DEC(NAME, ID, bsf_name) \ FFAT_DEC_CLASS(NAME) \ - const AVCodec ff_##NAME##_at_decoder = { \ - .name = #NAME "_at", \ - .long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = ID, \ + const FFCodec ff_##NAME##_at_decoder = { \ + .p.name = #NAME "_at", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = ID, \ .priv_data_size = sizeof(ATDecodeContext), \ .init = ffat_init_decoder, \ .close = ffat_close_decoder, \ .decode = ffat_decode, \ .flush = ffat_decode_flush, \ - .priv_class = &ffat_##NAME##_dec_class, \ + .p.priv_class = &ffat_##NAME##_dec_class, \ .bsfs = bsf_name, \ - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, \ - .wrapper_name = "at", \ + .p.wrapper_name = "at", \ }; FFAT_DEC(aac, AV_CODEC_ID_AAC, "aac_adtstoasc") diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 5deedcab73..4e7073064f 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -613,28 +613,28 @@ static const AVOption options[] = { #define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS) \ FFAT_ENC_CLASS(NAME) \ - const AVCodec ff_##NAME##_at_encoder = { \ - .name = #NAME "_at", \ - .long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = ID, \ + const FFCodec ff_##NAME##_at_encoder = { \ + .p.name = #NAME "_at", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = ID, \ .priv_data_size = sizeof(ATDecodeContext), \ .init = ffat_init_encoder, \ .close = ffat_close_encoder, \ .encode2 = ffat_encode, \ .flush = ffat_encode_flush, \ - .priv_class = &ffat_##NAME##_enc_class, \ - .capabilities = AV_CODEC_CAP_DELAY | \ + .p.priv_class = &ffat_##NAME##_enc_class, \ + .p.capabilities = AV_CODEC_CAP_DELAY | \ AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ - .channel_layouts= CHANNEL_LAYOUTS, \ - .ch_layouts = CH_LAYOUTS, \ - .sample_fmts = (const enum AVSampleFormat[]) { \ + .p.channel_layouts = CHANNEL_LAYOUTS, \ + .p.ch_layouts = CH_LAYOUTS, \ + .p.sample_fmts = (const enum AVSampleFormat[]) { \ AV_SAMPLE_FMT_S16, \ AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \ }, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ - .profiles = PROFILES, \ - .wrapper_name = "at", \ + .p.profiles = PROFILES, \ + .p.wrapper_name = "at", \ }; static const AVChannelLayout aac_at_ch_layouts[] = { diff --git a/libavcodec/aura.c b/libavcodec/aura.c index f32d820cf2..290fd83de4 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -98,13 +98,13 @@ static int aura_decode_frame(AVCodecContext *avctx, return pkt->size; } -const AVCodec ff_aura2_decoder = { - .name = "aura2", - .long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AURA2, +const FFCodec ff_aura2_decoder = { + .p.name = "aura2", + .p.long_name = NULL_IF_CONFIG_SMALL("Auravision Aura 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AURA2, .init = aura_decode_init, .decode = aura_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 1995deada9..a274d8867e 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1238,22 +1238,22 @@ static const AVClass av1_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_av1_decoder = { - .name = "av1", - .long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, +const FFCodec ff_av1_decoder = { + .p.name = "av1", + .p.long_name = NULL_IF_CONFIG_SMALL("Alliance for Open Media AV1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(AV1DecContext), .init = av1_decode_init, .close = av1_decode_free, .decode = av1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, .flush = av1_decode_flush, - .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), - .priv_class = &av1_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), + .p.priv_class = &av1_class, .bsfs = "av1_frame_split", .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_AV1_DXVA2_HWACCEL diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 3374142394..fbe4a5e413 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -94,13 +94,13 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, static AVMutex codec_mutex = AV_MUTEX_INITIALIZER; -static void lock_avcodec(const AVCodec *codec) +static void lock_avcodec(const FFCodec *codec) { if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) ff_mutex_lock(&codec_mutex); } -static void unlock_avcodec(const AVCodec *codec) +static void unlock_avcodec(const FFCodec *codec) { if (!(codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE) && codec->init) ff_mutex_unlock(&codec_mutex); @@ -140,6 +140,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code { int ret = 0; AVCodecInternal *avci; + const FFCodec *codec2; if (avcodec_is_open(avctx)) return 0; @@ -155,6 +156,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } if (!codec) codec = avctx->codec; + codec2 = ffcodec(codec); if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) && avctx->codec_id == AV_CODEC_ID_NONE) { @@ -194,9 +196,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code avci->skip_samples_multiplier = 1; - if (codec->priv_data_size > 0) { + if (codec2->priv_data_size > 0) { if (!avctx->priv_data) { - avctx->priv_data = av_mallocz(codec->priv_data_size); + avctx->priv_data = av_mallocz(codec2->priv_data_size); if (!avctx->priv_data) { ret = AVERROR(ENOMEM); goto free_and_end; @@ -327,25 +329,25 @@ FF_ENABLE_DEPRECATION_WARNINGS if (HAVE_THREADS && !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) { - /* Frame-threaded decoders call AVCodec.init for their child contexts. */ - lock_avcodec(codec); + /* Frame-threaded decoders call FFCodec.init for their child contexts. */ + lock_avcodec(codec2); ret = ff_thread_init(avctx); - unlock_avcodec(codec); + unlock_avcodec(codec2); if (ret < 0) { goto free_and_end; } } - if (!HAVE_THREADS && !(codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) + if (!HAVE_THREADS && !(codec2->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) avctx->thread_count = 1; if (!(avctx->active_thread_type & FF_THREAD_FRAME) || avci->frame_thread_encoder) { - if (avctx->codec->init) { - lock_avcodec(codec); - ret = avctx->codec->init(avctx); - unlock_avcodec(codec); + if (codec2->init) { + lock_avcodec(codec2); + ret = codec2->init(avctx); + unlock_avcodec(codec2); if (ret < 0) { - avci->needs_close = avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP; + avci->needs_close = codec2->caps_internal & FF_CODEC_CAP_INIT_CLEANUP; goto free_and_end; } } @@ -439,8 +441,8 @@ void avcodec_flush_buffers(AVCodecContext *avctx) if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) ff_thread_flush(avctx); - else if (avctx->codec->flush) - avctx->codec->flush(avctx); + else if (ffcodec(avctx->codec)->flush) + ffcodec(avctx->codec)->flush(avctx); avctx->pts_correction_last_pts = avctx->pts_correction_last_dts = INT64_MIN; @@ -484,8 +486,8 @@ av_cold int avcodec_close(AVCodecContext *avctx) } if (HAVE_THREADS && avci->thread_ctx) ff_thread_free(avctx); - if (avci->needs_close && avctx->codec->close) - avctx->codec->close(avctx); + if (avci->needs_close && ffcodec(avctx->codec)->close) + ffcodec(avctx->codec)->close(avctx); avci->byte_buffer_size = 0; av_freep(&avci->byte_buffer); av_frame_free(&avci->buffer_frame); diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index 7e19db3705..dd00a6fd39 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -90,14 +90,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_avrn_decoder = { - .name = "avrn", - .long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVRN, +const FFCodec ff_avrn_decoder = { + .p.name = "avrn", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid AVI Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVRN, .priv_data_size = sizeof(AVRnContext), .init = init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index d697b567fa..1367491ea2 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -177,15 +177,15 @@ static av_cold int avs_decode_end(AVCodecContext *avctx) } -const AVCodec ff_avs_decoder = { - .name = "avs", - .long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVS, +const FFCodec ff_avs_decoder = { + .p.name = "avs", + .p.long_name = NULL_IF_CONFIG_SMALL("AVS (Audio Video Standard) video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVS, .priv_data_size = sizeof(AvsContext), .init = avs_decode_init, .decode = avs_decode_frame, .close = avs_decode_end, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index 5ebe4f306e..b9ead39d6f 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -120,13 +120,13 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_avui_decoder = { - .name = "avui", - .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVUI, +const FFCodec ff_avui_decoder = { + .p.name = "avui", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVUI, + .p.capabilities = AV_CODEC_CAP_DR1, .init = avui_decode_init, .decode = avui_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c index e941afba63..dccfd65c90 100644 --- a/libavcodec/avuienc.c +++ b/libavcodec/avuienc.c @@ -91,14 +91,14 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_avui_encoder = { - .name = "avui", - .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVUI, +const FFCodec ff_avui_encoder = { + .p.name = "avui", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVUI, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, .init = avui_encode_init, .encode2 = avui_encode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 2c6328c1ea..74dce58f73 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -159,15 +159,15 @@ static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_bethsoftvid_decoder = { - .name = "bethsoftvid", - .long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BETHSOFTVID, +const FFCodec ff_bethsoftvid_decoder = { + .p.name = "bethsoftvid", + .p.long_name = NULL_IF_CONFIG_SMALL("Bethesda VID video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BETHSOFTVID, .priv_data_size = sizeof(BethsoftvidContext), .init = bethsoftvid_decode_init, .close = bethsoftvid_decode_end, .decode = bethsoftvid_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 3dce7d6eb8..6e838df02b 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -176,15 +176,15 @@ static av_cold int bfi_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_bfi_decoder = { - .name = "bfi", - .long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BFI, +const FFCodec ff_bfi_decoder = { + .p.name = "bfi", + .p.long_name = NULL_IF_CONFIG_SMALL("Brute Force & Ignorance"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BFI, .priv_data_size = sizeof(BFIContext), .init = bfi_decode_init, .close = bfi_decode_close, .decode = bfi_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 6a2e5e79e1..9b83d73348 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1419,16 +1419,16 @@ static void flush(AVCodecContext *avctx) c->frame_num = 0; } -const AVCodec ff_bink_decoder = { - .name = "binkvideo", - .long_name = NULL_IF_CONFIG_SMALL("Bink video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BINKVIDEO, +const FFCodec ff_bink_decoder = { + .p.name = "binkvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Bink video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BINKVIDEO, .priv_data_size = sizeof(BinkContext), .init = decode_init, .close = decode_end, .decode = decode_frame, .flush = flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 7398cb3c3e..bdf50756b4 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -346,30 +346,30 @@ static void decode_flush(AVCodecContext *avctx) s->first = 1; } -const AVCodec ff_binkaudio_rdft_decoder = { - .name = "binkaudio_rdft", - .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_BINKAUDIO_RDFT, +const FFCodec ff_binkaudio_rdft_decoder = { + .p.name = "binkaudio_rdft", + .p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (RDFT)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_BINKAUDIO_RDFT, .priv_data_size = sizeof(BinkAudioContext), .init = decode_init, .flush = decode_flush, .close = decode_end, .receive_frame = binkaudio_receive_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_binkaudio_dct_decoder = { - .name = "binkaudio_dct", - .long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_BINKAUDIO_DCT, +const FFCodec ff_binkaudio_dct_decoder = { + .p.name = "binkaudio_dct", + .p.long_name = NULL_IF_CONFIG_SMALL("Bink Audio (DCT)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_BINKAUDIO_DCT, .priv_data_size = sizeof(BinkAudioContext), .init = decode_init, .flush = decode_flush, .close = decode_end, .receive_frame = binkaudio_receive_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index 59f99f7ebd..0fad8305f8 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -218,41 +218,41 @@ static int decode_frame(AVCodecContext *avctx, } #if CONFIG_BINTEXT_DECODER -const AVCodec ff_bintext_decoder = { - .name = "bintext", - .long_name = NULL_IF_CONFIG_SMALL("Binary text"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BINTEXT, +const FFCodec ff_bintext_decoder = { + .p.name = "bintext", + .p.long_name = NULL_IF_CONFIG_SMALL("Binary text"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BINTEXT, .priv_data_size = sizeof(XbinContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_XBIN_DECODER -const AVCodec ff_xbin_decoder = { - .name = "xbin", - .long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XBIN, +const FFCodec ff_xbin_decoder = { + .p.name = "xbin", + .p.long_name = NULL_IF_CONFIG_SMALL("eXtended BINary text"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XBIN, .priv_data_size = sizeof(XbinContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_IDF_DECODER -const AVCodec ff_idf_decoder = { - .name = "idf", - .long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IDF, +const FFCodec ff_idf_decoder = { + .p.name = "idf", + .p.long_name = NULL_IF_CONFIG_SMALL("iCEDraw text"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IDF, .priv_data_size = sizeof(XbinContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/bitpacked_dec.c b/libavcodec/bitpacked_dec.c index 751f55493d..3301a72752 100644 --- a/libavcodec/bitpacked_dec.c +++ b/libavcodec/bitpacked_dec.c @@ -142,15 +142,15 @@ static int bitpacked_decode(AVCodecContext *avctx, void *data, int *got_frame, } -const AVCodec ff_bitpacked_decoder = { - .name = "bitpacked", - .long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BITPACKED, +const FFCodec ff_bitpacked_decoder = { + .p.name = "bitpacked", + .p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BITPACKED, + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(struct BitpackedContext), .init = bitpacked_init_decoder, .decode = bitpacked_decode, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, .codec_tags = (const uint32_t []){ MKTAG('U', 'Y', 'V', 'Y'), FF_CODEC_TAGS_END, diff --git a/libavcodec/bitpacked_enc.c b/libavcodec/bitpacked_enc.c index ddada1f03f..c9c0501f39 100644 --- a/libavcodec/bitpacked_enc.c +++ b/libavcodec/bitpacked_enc.c @@ -104,16 +104,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_bitpacked_encoder = { - .name = "bitpacked", - .long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BITPACKED, +const FFCodec ff_bitpacked_encoder = { + .p.name = "bitpacked", + .p.long_name = NULL_IF_CONFIG_SMALL("Bitpacked"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BITPACKED, .priv_data_size = sizeof(struct BitpackedContext), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index c4f6044cb4..d8ff7b8342 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -24,6 +24,7 @@ #include "avcodec.h" #include "bytestream.h" #include "bmp.h" +#include "codec_internal.h" #include "internal.h" #include "msrledec.h" @@ -365,11 +366,11 @@ static int bmp_decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_bmp_decoder = { - .name = "bmp", - .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BMP, +const FFCodec ff_bmp_decoder = { + .p.name = "bmp", + .p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BMP, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = bmp_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index a11f2fb2b4..1f2303c1e0 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -155,15 +155,15 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_bmp_encoder = { - .name = "bmp", - .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BMP, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_bmp_encoder = { + .p.name = "bmp", + .p.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BMP, + .p.capabilities = AV_CODEC_CAP_DR1, .init = bmp_encode_init, .encode2 = bmp_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c index c3a7d954e2..be04f7be94 100644 --- a/libavcodec/bmvaudio.c +++ b/libavcodec/bmvaudio.c @@ -79,13 +79,13 @@ static int bmv_aud_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_bmv_audio_decoder = { - .name = "bmv_audio", - .long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_BMV_AUDIO, +const FFCodec ff_bmv_audio_decoder = { + .p.name = "bmv_audio", + .p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_BMV_AUDIO, .init = bmv_aud_decode_init, .decode = bmv_aud_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/bmvvideo.c b/libavcodec/bmvvideo.c index befcbbd6b4..94e9734e38 100644 --- a/libavcodec/bmvvideo.c +++ b/libavcodec/bmvvideo.c @@ -286,14 +286,14 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_bmv_video_decoder = { - .name = "bmv_video", - .long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BMV_VIDEO, +const FFCodec ff_bmv_video_decoder = { + .p.name = "bmv_video", + .p.long_name = NULL_IF_CONFIG_SMALL("Discworld II BMV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BMV_VIDEO, .priv_data_size = sizeof(BMVDecContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/brenderpix.c b/libavcodec/brenderpix.c index 4726fd3d77..8cb0c16d4d 100644 --- a/libavcodec/brenderpix.c +++ b/libavcodec/brenderpix.c @@ -25,6 +25,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" #define HEADER1_CHUNK 0x03 @@ -285,11 +286,11 @@ static int pix_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_brender_pix_decoder = { - .name = "brender_pix", - .long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_BRENDER_PIX, +const FFCodec ff_brender_pix_decoder = { + .p.name = "brender_pix", + .p.long_name = NULL_IF_CONFIG_SMALL("BRender PIX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_BRENDER_PIX, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = pix_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 23c02ef5bb..bc66ad6b0c 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -258,15 +258,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_c93_decoder = { - .name = "c93", - .long_name = NULL_IF_CONFIG_SMALL("Interplay C93"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_C93, +const FFCodec ff_c93_decoder = { + .p.name = "c93", + .p.long_name = NULL_IF_CONFIG_SMALL("Interplay C93"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_C93, .priv_data_size = sizeof(C93DecoderContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 8fd485f5e1..ba7ead6f41 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -1309,16 +1309,16 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } } -const AVCodec ff_cavs_decoder = { - .name = "cavs", - .long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CAVS, +const FFCodec ff_cavs_decoder = { + .p.name = "cavs", + .p.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CAVS, .priv_data_size = sizeof(AVSContext), .init = ff_cavs_init, .close = ff_cavs_end, .decode = cavs_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .flush = cavs_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index e7c52d6823..371c8d18b7 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -944,17 +944,17 @@ static const AVClass ccaption_dec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ccaption_decoder = { - .name = "cc_dec", - .long_name = NULL_IF_CONFIG_SMALL("Closed Caption (EIA-608 / CEA-708)"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_EIA_608, +const FFCodec ff_ccaption_decoder = { + .p.name = "cc_dec", + .p.long_name = NULL_IF_CONFIG_SMALL("Closed Caption (EIA-608 / CEA-708)"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_EIA_608, + .p.priv_class = &ccaption_dec_class, + .p.capabilities = AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(CCaptionSubContext), .init = init_decoder, .close = close_decoder, .flush = flush_decoder, .decode = decode, - .priv_class = &ccaption_dec_class, - .capabilities = AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index ebbc83711c..5797134d10 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -388,16 +388,16 @@ static av_cold int cdg_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cdgraphics_decoder = { - .name = "cdgraphics", - .long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CDGRAPHICS, +const FFCodec ff_cdgraphics_decoder = { + .p.name = "cdgraphics", + .p.long_name = NULL_IF_CONFIG_SMALL("CD Graphics video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CDGRAPHICS, .priv_data_size = sizeof(CDGraphicsContext), .init = cdg_decode_init, .close = cdg_decode_end, .decode = cdg_decode_frame, .flush = cdg_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cdtoons.c b/libavcodec/cdtoons.c index b9d4e6429c..e99d703e53 100644 --- a/libavcodec/cdtoons.c +++ b/libavcodec/cdtoons.c @@ -443,16 +443,16 @@ static av_cold int cdtoons_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cdtoons_decoder = { - .name = "cdtoons", - .long_name = NULL_IF_CONFIG_SMALL("CDToons video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CDTOONS, +const FFCodec ff_cdtoons_decoder = { + .p.name = "cdtoons", + .p.long_name = NULL_IF_CONFIG_SMALL("CDToons video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CDTOONS, .priv_data_size = sizeof(CDToonsContext), .init = cdtoons_decode_init, .close = cdtoons_decode_end, .decode = cdtoons_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .flush = cdtoons_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index 533b10d660..d11106a4e4 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -337,15 +337,15 @@ static av_cold int cdxl_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cdxl_decoder = { - .name = "cdxl", - .long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CDXL, +const FFCodec ff_cdxl_decoder = { + .p.name = "cdxl", + .p.long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CDXL, .priv_data_size = sizeof(CDXLVideoContext), .init = cdxl_decode_init, .close = cdxl_decode_end, .decode = cdxl_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 5ebecd49d2..97cfdebba2 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -1456,16 +1456,16 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) } #endif -const AVCodec ff_cfhd_decoder = { - .name = "cfhd", - .long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CFHD, +const FFCodec ff_cfhd_decoder = { + .p.name = "cfhd", + .p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CFHD, .priv_data_size = sizeof(CFHDContext), .init = cfhd_init, .close = cfhd_close, .decode = cfhd_decode, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c index 9cc08bfea3..f9b8ed2625 100644 --- a/libavcodec/cfhdenc.c +++ b/libavcodec/cfhdenc.c @@ -845,18 +845,18 @@ static const AVClass cfhd_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_cfhd_encoder = { - .name = "cfhd", - .long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CFHD, +const FFCodec ff_cfhd_encoder = { + .p.name = "cfhd", + .p.long_name = NULL_IF_CONFIG_SMALL("GoPro CineForm HD"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CFHD, .priv_data_size = sizeof(CFHDEncContext), - .priv_class = &cfhd_class, + .p.priv_class = &cfhd_class, .init = cfhd_encode_init, .close = cfhd_encode_close, .encode2 = cfhd_encode_frame, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 1ba50c5243..d215e0c11c 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -507,15 +507,15 @@ static av_cold int cinepak_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cinepak_decoder = { - .name = "cinepak", - .long_name = NULL_IF_CONFIG_SMALL("Cinepak"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CINEPAK, +const FFCodec ff_cinepak_decoder = { + .p.name = "cinepak", + .p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CINEPAK, .priv_data_size = sizeof(CinepakContext), .init = cinepak_decode_init, .close = cinepak_decode_end, .decode = cinepak_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c index 00e96f989a..66baae3a1a 100644 --- a/libavcodec/cinepakenc.c +++ b/libavcodec/cinepakenc.c @@ -1194,16 +1194,16 @@ static av_cold int cinepak_encode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cinepak_encoder = { - .name = "cinepak", - .long_name = NULL_IF_CONFIG_SMALL("Cinepak"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CINEPAK, +const FFCodec ff_cinepak_encoder = { + .p.name = "cinepak", + .p.long_name = NULL_IF_CONFIG_SMALL("Cinepak"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CINEPAK, .priv_data_size = sizeof(CinepakEncContext), .init = cinepak_encode_init, .encode2 = cinepak_encode_frame, .close = cinepak_encode_end, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, - .priv_class = &cinepak_class, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, + .p.priv_class = &cinepak_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index a3cc3815b5..8400fafd78 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -767,15 +767,15 @@ static av_cold int clv_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_clearvideo_decoder = { - .name = "clearvideo", - .long_name = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CLEARVIDEO, +const FFCodec ff_clearvideo_decoder = { + .p.name = "clearvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CLEARVIDEO, .priv_data_size = sizeof(CLVContext), .init = clv_decode_init, .close = clv_decode_end, .decode = clv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cljrdec.c b/libavcodec/cljrdec.c index b5c4690160..47b75186c0 100644 --- a/libavcodec/cljrdec.c +++ b/libavcodec/cljrdec.c @@ -83,14 +83,14 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_cljr_decoder = { - .name = "cljr", - .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CLJR, +const FFCodec ff_cljr_decoder = { + .p.name = "cljr", + .p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CLJR, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cljrenc.c b/libavcodec/cljrenc.c index 21e033753b..6bd8537316 100644 --- a/libavcodec/cljrenc.c +++ b/libavcodec/cljrenc.c @@ -27,6 +27,7 @@ #include "libavutil/opt.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" #include "put_bits.h" @@ -107,15 +108,15 @@ static const AVClass cljr_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_cljr_encoder = { - .name = "cljr", - .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CLJR, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_cljr_encoder = { + .p.name = "cljr", + .p.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CLJR, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(CLJRContext), .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, - .priv_class = &cljr_class, + .p.priv_class = &cljr_class, }; diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index 64d3709958..dd7c6fcad6 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -492,15 +492,15 @@ static av_cold int cllc_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_cllc_decoder = { - .name = "cllc", - .long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CLLC, +const FFCodec ff_cllc_decoder = { + .p.name = "cllc", + .p.long_name = NULL_IF_CONFIG_SMALL("Canopus Lossless Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CLLC, .priv_data_size = sizeof(CLLCContext), .init = cllc_decode_init, .decode = cllc_decode_frame, .close = cllc_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cngdec.c b/libavcodec/cngdec.c index 5271b3e61a..e59aa2e60e 100644 --- a/libavcodec/cngdec.c +++ b/libavcodec/cngdec.c @@ -163,19 +163,19 @@ static int cng_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_comfortnoise_decoder = { - .name = "comfortnoise", - .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_COMFORT_NOISE, +const FFCodec ff_comfortnoise_decoder = { + .p.name = "comfortnoise", + .p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_COMFORT_NOISE, .priv_data_size = sizeof(CNGContext), .init = cng_decode_init, .decode = cng_decode_frame, .flush = cng_decode_flush, .close = cng_decode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c index 6452d2e6a8..650bfa1938 100644 --- a/libavcodec/cngenc.c +++ b/libavcodec/cngenc.c @@ -96,18 +96,18 @@ static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_comfortnoise_encoder = { - .name = "comfortnoise", - .long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_COMFORT_NOISE, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_comfortnoise_encoder = { + .p.name = "comfortnoise", + .p.long_name = NULL_IF_CONFIG_SMALL("RFC 3389 comfort noise generator"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_COMFORT_NOISE, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(CNGContext), .init = cng_encode_init, .encode2 = cng_encode_frame, .close = cng_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 8c2884d087..03e8be90a2 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -190,12 +190,6 @@ typedef struct AVProfile { const char *name; ///< short name for the profile } AVProfile; -typedef struct AVCodecDefault AVCodecDefault; - -struct AVCodecContext; -struct AVSubtitle; -struct AVPacket; - /** * AVCodec. */ @@ -250,121 +244,6 @@ typedef struct AVCodec { * Array of supported channel layouts, terminated with a zeroed layout. */ const AVChannelLayout *ch_layouts; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - /** - * Internal codec capabilities. - * See FF_CODEC_CAP_* in internal.h - */ - int caps_internal; - - int priv_data_size; - /** - * @name Frame-level threading support functions - * @{ - */ - /** - * Copy necessary context variables from a previous thread context to the current one. - * If not defined, the next thread will start automatically; otherwise, the codec - * must call ff_thread_finish_setup(). - * - * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. - */ - int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src); - - /** - * Copy variables back to the user-facing context - */ - int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src); - /** @} */ - - /** - * Private codec-specific defaults. - */ - const AVCodecDefault *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 AVCodec *codec); - - int (*init)(struct AVCodecContext *); - int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size, - const struct AVSubtitle *sub); - /** - * Encode data to an AVPacket. - * - * @param avctx codec context - * @param avpkt output AVPacket - * @param[in] frame AVFrame containing the raw data to be encoded - * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a - * non-empty packet was returned in avpkt. - * @return 0 on success, negative error code on failure - */ - int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, - const struct AVFrame *frame, int *got_packet_ptr); - /** - * Decode picture or subtitle data. - * - * @param avctx codec context - * @param outdata codec type dependent output struct - * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a - * non-empty frame or subtitle was returned in - * outdata. - * @param[in] avpkt AVPacket containing the data to be decoded - * @return amount of bytes read from the packet on success, negative error - * code on failure - */ - int (*decode)(struct AVCodecContext *avctx, void *outdata, - int *got_frame_ptr, struct AVPacket *avpkt); - int (*close)(struct AVCodecContext *); - /** - * Encode API with decoupled frame/packet dataflow. This function is called - * to get one output packet. It should call ff_encode_get_frame() to obtain - * input data. - */ - int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt); - - /** - * Decode API with decoupled packet/frame dataflow. This function is called - * to get one output frame. It should call ff_decode_get_packet() to obtain - * input data. - */ - int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame); - /** - * Flush buffers. - * Will be called when seeking - */ - void (*flush)(struct AVCodecContext *); - - /** - * Decoding only, a comma-separated list of bitstream filters to apply to - * packets before decoding. - */ - const char *bsfs; - - /** - * Array of pointers to hardware configurations supported by the codec, - * or NULL if no hardware supported. The array is terminated by a NULL - * pointer. - * - * The user can only access this field via avcodec_get_hw_config(). - */ - const struct AVCodecHWConfigInternal *const *hw_configs; - - /** - * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. - */ - const uint32_t *codec_tags; } AVCodec; /** diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 07c8e943e2..7e317a6396 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -19,6 +19,11 @@ #ifndef AVCODEC_CODEC_INTERNAL_H #define AVCODEC_CODEC_INTERNAL_H +#include + +#include "libavutil/attributes.h" +#include "codec.h" + /** * The codec does not modify any global variables in the init function, * allowing to call the init function without locking any global mutexes. @@ -70,13 +75,136 @@ #define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8) /** - * AVCodec.codec_tags termination value + * FFCodec.codec_tags termination value */ #define FF_CODEC_TAGS_END -1 -struct AVCodecDefault { +typedef struct AVCodecDefault { const char *key; const char *value; -}; +} AVCodecDefault; + +struct AVCodecContext; +struct AVSubtitle; +struct AVPacket; + +typedef struct FFCodec { + /** + * The public AVCodec. See codec.h for it. + */ + AVCodec p; + + /** + * Internal codec capabilities FF_CODEC_CAP_*. + */ + int caps_internal; + + int priv_data_size; + /** + * @name Frame-level threading support functions + * @{ + */ + /** + * Copy necessary context variables from a previous thread context to the current one. + * If not defined, the next thread will start automatically; otherwise, the codec + * must call ff_thread_finish_setup(). + * + * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. + */ + int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src); + + /** + * Copy variables back to the user-facing context + */ + int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src); + /** @} */ + + /** + * Private codec-specific defaults. + */ + const AVCodecDefault *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 *); + int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size, + const struct AVSubtitle *sub); + /** + * Encode data to an AVPacket. + * + * @param avctx codec context + * @param avpkt output AVPacket + * @param[in] frame AVFrame containing the raw data to be encoded + * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a + * non-empty packet was returned in avpkt. + * @return 0 on success, negative error code on failure + */ + int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, + const struct AVFrame *frame, int *got_packet_ptr); + /** + * Decode picture or subtitle data. + * + * @param avctx codec context + * @param outdata codec type dependent output struct + * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a + * non-empty frame or subtitle was returned in + * outdata. + * @param[in] avpkt AVPacket containing the data to be decoded + * @return amount of bytes read from the packet on success, negative error + * code on failure + */ + int (*decode)(struct AVCodecContext *avctx, void *outdata, + int *got_frame_ptr, struct AVPacket *avpkt); + int (*close)(struct AVCodecContext *); + /** + * Encode API with decoupled frame/packet dataflow. This function is called + * to get one output packet. It should call ff_encode_get_frame() to obtain + * input data. + */ + int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt); + + /** + * Decode API with decoupled packet/frame dataflow. This function is called + * to get one output frame. It should call ff_decode_get_packet() to obtain + * input data. + */ + int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame); + /** + * Flush buffers. + * Will be called when seeking + */ + void (*flush)(struct AVCodecContext *); + + /** + * Decoding only, a comma-separated list of bitstream filters to apply to + * packets before decoding. + */ + const char *bsfs; + + /** + * Array of pointers to hardware configurations supported by the codec, + * or NULL if no hardware supported. The array is terminated by a NULL + * pointer. + * + * The user can only access this field via avcodec_get_hw_config(). + */ + const struct AVCodecHWConfigInternal *const *hw_configs; + + /** + * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. + */ + const uint32_t *codec_tags; +} FFCodec; + +static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) +{ + return (const FFCodec*)codec; +} #endif /* AVCODEC_CODEC_INTERNAL_H */ diff --git a/libavcodec/cook.c b/libavcodec/cook.c index ebdc7be906..c305f5e56d 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1297,17 +1297,17 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_cook_decoder = { - .name = "cook", - .long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_COOK, +const FFCodec ff_cook_decoder = { + .p.name = "cook", + .p.long_name = NULL_IF_CONFIG_SMALL("Cook / Cooker / Gecko (RealAudio G2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_COOK, .priv_data_size = sizeof(COOKContext), .init = cook_decode_init, .close = cook_decode_close, .decode = cook_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index cd72d63c2b..e19160a506 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -222,15 +222,15 @@ static av_cold int cpia_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cpia_decoder = { - .name = "cpia", - .long_name = NULL_IF_CONFIG_SMALL("CPiA video format"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CPIA, +const FFCodec ff_cpia_decoder = { + .p.name = "cpia", + .p.long_name = NULL_IF_CONFIG_SMALL("CPiA video format"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CPIA, .priv_data_size = sizeof(CpiaContext), .init = cpia_decode_init, .close = cpia_decode_end, .decode = cpia_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/cri.c b/libavcodec/cri.c index f0a2238a30..4757a1da03 100644 --- a/libavcodec/cri.c +++ b/libavcodec/cri.c @@ -424,15 +424,15 @@ static av_cold int cri_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_cri_decoder = { - .name = "cri", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CRI, +const FFCodec ff_cri_decoder = { + .p.name = "cri", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CRI, .priv_data_size = sizeof(CRIContext), .init = cri_decode_init, .decode = cri_decode_frame, .close = cri_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .long_name = NULL_IF_CONFIG_SMALL("Cintel RAW"), + .p.long_name = NULL_IF_CONFIG_SMALL("Cintel RAW"), }; diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 61ddf68ccc..d4cf385cbd 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -774,22 +774,22 @@ static int crystalhd_receive_frame(AVCodecContext *avctx, AVFrame *frame) .option = options, \ .version = LIBAVUTIL_VERSION_INT, \ }; \ - const AVCodec ff_##x##_crystalhd_decoder = { \ - .name = #x "_crystalhd", \ - .long_name = NULL_IF_CONFIG_SMALL("CrystalHD " #X " decoder"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = AV_CODEC_ID_##X, \ + const FFCodec ff_##x##_crystalhd_decoder = { \ + .p.name = #x "_crystalhd", \ + .p.long_name = NULL_IF_CONFIG_SMALL("CrystalHD " #X " decoder"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = AV_CODEC_ID_##X, \ .priv_data_size = sizeof(CHDContext), \ - .priv_class = &x##_crystalhd_class, \ + .p.priv_class = &x##_crystalhd_class, \ .init = init, \ .close = uninit, \ .receive_frame = crystalhd_receive_frame, \ .flush = flush, \ .bsfs = bsf_name, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ .caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \ - .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \ - .wrapper_name = "crystalhd", \ + .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, \ + .p.wrapper_name = "crystalhd", \ }; #if CONFIG_H264_CRYSTALHD_DECODER diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index b852624d83..fd513d8402 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -167,15 +167,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_cscd_decoder = { - .name = "camstudio", - .long_name = NULL_IF_CONFIG_SMALL("CamStudio"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CSCD, +const FFCodec ff_cscd_decoder = { + .p.name = "camstudio", + .p.long_name = NULL_IF_CONFIG_SMALL("CamStudio"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CSCD, .priv_data_size = sizeof(CamStudioContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c index 8db4daa022..0060e51c91 100644 --- a/libavcodec/cuviddec.c +++ b/libavcodec/cuviddec.c @@ -943,7 +943,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) return AVERROR_BUG; } - if (avctx->codec->bsfs) { + if (ffcodec(avctx->codec)->bsfs) { const AVCodecParameters *par = avctx->internal->bsf->par_out; extradata = par->extradata; extradata_size = par->extradata_size; @@ -1103,27 +1103,27 @@ static const AVCodecHWConfigInternal *const cuvid_hw_configs[] = { .option = options, \ .version = LIBAVUTIL_VERSION_INT, \ }; \ - const AVCodec ff_##x##_cuvid_decoder = { \ - .name = #x "_cuvid", \ - .long_name = NULL_IF_CONFIG_SMALL("Nvidia CUVID " #X " decoder"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = AV_CODEC_ID_##X, \ + const FFCodec ff_##x##_cuvid_decoder = { \ + .p.name = #x "_cuvid", \ + .p.long_name = NULL_IF_CONFIG_SMALL("Nvidia CUVID " #X " decoder"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = AV_CODEC_ID_##X, \ .priv_data_size = sizeof(CuvidContext), \ - .priv_class = &x##_cuvid_class, \ + .p.priv_class = &x##_cuvid_class, \ .init = cuvid_decode_init, \ .close = cuvid_decode_end, \ .receive_frame = cuvid_output_frame, \ .flush = cuvid_flush, \ .bsfs = bsf_name, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ .caps_internal = FF_CODEC_CAP_SETS_FRAME_PROPS, \ - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, \ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ AV_PIX_FMT_P016, \ AV_PIX_FMT_NONE }, \ .hw_configs = cuvid_hw_configs, \ - .wrapper_name = "cuvid", \ + .p.wrapper_name = "cuvid", \ }; #if CONFIG_AV1_CUVID_DECODER && defined(CUVID_HAS_AV1_SUPPORT) diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index c851c0392e..a59dd358bf 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -179,29 +179,29 @@ static int cyuv_decode_frame(AVCodecContext *avctx, } #if CONFIG_AURA_DECODER -const AVCodec ff_aura_decoder = { - .name = "aura", - .long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AURA, +const FFCodec ff_aura_decoder = { + .p.name = "aura", + .p.long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AURA, .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, .decode = cyuv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_CYUV_DECODER -const AVCodec ff_cyuv_decoder = { - .name = "cyuv", - .long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CYUV, +const FFCodec ff_cyuv_decoder = { + .p.name = "cyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CYUV, .priv_data_size = sizeof(CyuvDecodeContext), .init = cyuv_decode_init, .decode = cyuv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index fb91711bf9..3fc1bc705f 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -411,20 +411,20 @@ static const AVClass dcadec_class = { .category = AV_CLASS_CATEGORY_DECODER, }; -const AVCodec ff_dca_decoder = { - .name = "dca", - .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DTS, +const FFCodec ff_dca_decoder = { + .p.name = "dca", + .p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), .init = dcadec_init, .decode = dcadec_decode_frame, .close = dcadec_close, .flush = dcadec_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &dcadec_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), + .p.priv_class = &dcadec_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index 02a071e9d5..bbe3067ce3 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -1240,29 +1240,29 @@ static const AVCodecDefault defaults[] = { { NULL }, }; -const AVCodec ff_dca_encoder = { - .name = "dca", - .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DTS, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, +const FFCodec ff_dca_encoder = { + .p.name = "dca", + .p.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DTS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, .priv_data_size = sizeof(DCAEncContext), .init = encode_init, .close = encode_close, .encode2 = encode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = sample_rates, + .p.supported_samplerates = sample_rates, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]){ + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_2_2, @@ -1271,5 +1271,5 @@ const AVCodec ff_dca_encoder = { { 0 }, }, .defaults = defaults, - .priv_class = &dcaenc_class, + .p.priv_class = &dcaenc_class, }; diff --git a/libavcodec/dds.c b/libavcodec/dds.c index 5a2516edff..32690e1fd7 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -749,13 +749,13 @@ static int dds_decode(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_dds_decoder = { - .name = "dds", - .long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DDS, +const FFCodec ff_dds_decoder = { + .p.name = "dds", + .p.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DDS, .decode = dds_decode, .priv_data_size = sizeof(DDSContext), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE }; diff --git a/libavcodec/decode.c b/libavcodec/decode.c index c13de8081b..f9fdb935f6 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -188,14 +188,15 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt) static int decode_bsfs_init(AVCodecContext *avctx) { AVCodecInternal *avci = avctx->internal; + const FFCodec *const codec = ffcodec(avctx->codec); int ret; if (avci->bsf) return 0; - ret = av_bsf_list_parse_str(avctx->codec->bsfs, &avci->bsf); + ret = av_bsf_list_parse_str(codec->bsfs, &avci->bsf); if (ret < 0) { - av_log(avctx, AV_LOG_ERROR, "Error parsing decoder bitstream filters '%s': %s\n", avctx->codec->bsfs, av_err2str(ret)); + av_log(avctx, AV_LOG_ERROR, "Error parsing decoder bitstream filters '%s': %s\n", codec->bsfs, av_err2str(ret)); if (ret != AVERROR(ENOMEM)) ret = AVERROR_BUG; goto fail; @@ -233,7 +234,7 @@ int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt) if (ret < 0) return ret; - if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { ret = extract_packet_props(avctx->internal, pkt); if (ret < 0) goto finish; @@ -295,6 +296,7 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, { AVCodecInternal *avci = avctx->internal; AVPacket *const pkt = avci->in_pkt; + const FFCodec *const codec = ffcodec(avctx->codec); int got_frame, actual_got_frame; int ret; @@ -320,9 +322,9 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME) { ret = ff_thread_decode_frame(avctx, frame, &got_frame, pkt); } else { - ret = avctx->codec->decode(avctx, frame, &got_frame, pkt); + ret = codec->decode(avctx, frame, &got_frame, pkt); - if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS)) + if (!(codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS)) frame->pkt_dts = pkt->dts; if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) { if(!avctx->has_b_frames) @@ -507,7 +509,7 @@ FF_ENABLE_DEPRECATION_WARNINGS pkt->size -= consumed; pkt->pts = AV_NOPTS_VALUE; pkt->dts = AV_NOPTS_VALUE; - if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { avci->last_pkt_props->size -= consumed; // See extract_packet_props() comment. avci->last_pkt_props->pts = AV_NOPTS_VALUE; avci->last_pkt_props->dts = AV_NOPTS_VALUE; @@ -539,12 +541,13 @@ static int decode_simple_receive_frame(AVCodecContext *avctx, AVFrame *frame) static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) { AVCodecInternal *avci = avctx->internal; + const FFCodec *const codec = ffcodec(avctx->codec); int ret; av_assert0(!frame->buf[0]); - if (avctx->codec->receive_frame) { - ret = avctx->codec->receive_frame(avctx, frame); + if (codec->receive_frame) { + ret = codec->receive_frame(avctx, frame); if (ret != AVERROR(EAGAIN)) av_packet_unref(avci->last_pkt_props); } else @@ -553,7 +556,7 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) if (ret == AVERROR_EOF) avci->draining_done = 1; - if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS) && + if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS) && IS_EMPTY(avci->last_pkt_props)) { // May fail if the FIFO is empty. av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1); @@ -859,7 +862,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) sub->pts = av_rescale_q(avpkt->pts, avctx->pkt_timebase, AV_TIME_BASE_Q); - ret = avctx->codec->decode(avctx, sub, got_sub_ptr, pkt); + ret = ffcodec(avctx->codec)->decode(avctx, sub, got_sub_ptr, pkt); if (pkt == avci->buffer_pkt) // did we recode? av_packet_unref(avci->buffer_pkt); if (ret < 0) { @@ -909,11 +912,11 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *avctx, // If a device was supplied when the codec was opened, assume that the // user wants to use it. - if (avctx->hw_device_ctx && avctx->codec->hw_configs) { + if (avctx->hw_device_ctx && ffcodec(avctx->codec)->hw_configs) { AVHWDeviceContext *device_ctx = (AVHWDeviceContext*)avctx->hw_device_ctx->data; for (i = 0;; i++) { - config = &avctx->codec->hw_configs[i]->public; + config = &ffcodec(avctx->codec)->hw_configs[i]->public; if (!config) break; if (!(config->methods & @@ -1025,7 +1028,7 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, int i, ret; for (i = 0;; i++) { - hw_config = avctx->codec->hw_configs[i]; + hw_config = ffcodec(avctx->codec)->hw_configs[i]; if (!hw_config) return AVERROR(ENOENT); if (hw_config->public.pix_fmt == hw_pix_fmt) @@ -1169,9 +1172,9 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt) break; } - if (avctx->codec->hw_configs) { + if (ffcodec(avctx->codec)->hw_configs) { for (i = 0;; i++) { - hw_config = avctx->codec->hw_configs[i]; + hw_config = ffcodec(avctx->codec)->hw_configs[i]; if (!hw_config) break; if (hw_config->public.pix_fmt == user_choice) @@ -1538,7 +1541,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) { AV_PKT_DATA_DYNAMIC_HDR10_PLUS, AV_FRAME_DATA_DYNAMIC_HDR_PLUS }, }; - if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { + if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { frame->pts = pkt->pts; frame->pkt_pos = pkt->pos; frame->pkt_duration = pkt->duration; @@ -1739,7 +1742,7 @@ FF_ENABLE_DEPRECATION_WARNINGS end: if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && !override_dimensions && - !(avctx->codec->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING)) { + !(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING)) { frame->width = avctx->width; frame->height = avctx->height; } diff --git a/libavcodec/decode.h b/libavcodec/decode.h index dee2543b1c..1b40f714e1 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -90,7 +90,7 @@ int ff_copy_palette(void *dst, const AVPacket *src, void *logctx); /** * Perform decoder initialization and validation. - * Called when opening the decoder, before the AVCodec.init() call. + * Called when opening the decoder, before the FFCodec.init() call. */ int ff_decode_preinit(AVCodecContext *avctx); diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 4071a98f38..97a9bd5a1f 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -423,15 +423,15 @@ static av_cold int dfa_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_dfa_decoder = { - .name = "dfa", - .long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DFA, +const FFCodec ff_dfa_decoder = { + .p.name = "dfa", + .p.long_name = NULL_IF_CONFIG_SMALL("Chronomaster DFA"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DFA, .priv_data_size = sizeof(DfaContext), .init = dfa_decode_init, .close = dfa_decode_end, .decode = dfa_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmdec.c index 4e37e773bc..dca7678795 100644 --- a/libavcodec/dfpwmdec.c +++ b/libavcodec/dfpwmdec.c @@ -125,14 +125,14 @@ static int dfpwm_dec_frame(struct AVCodecContext *ctx, void *data, return packet->size; } -const AVCodec ff_dfpwm_decoder = { - .name = "dfpwm", - .long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DFPWM, +const FFCodec ff_dfpwm_decoder = { + .p.name = "dfpwm", + .p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_dec_init, .decode = dfpwm_dec_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dfpwmenc.c b/libavcodec/dfpwmenc.c index 5b94a02672..e3a001aea7 100644 --- a/libavcodec/dfpwmenc.c +++ b/libavcodec/dfpwmenc.c @@ -107,15 +107,15 @@ static int dfpwm_enc_frame(struct AVCodecContext *ctx, struct AVPacket *packet, return 0; } -const AVCodec ff_dfpwm_encoder = { - .name = "dfpwm", - .long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DFPWM, +const FFCodec ff_dfpwm_encoder = { + .p.name = "dfpwm", + .p.long_name = NULL_IF_CONFIG_SMALL("DFPWM1a audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DFPWM, .priv_data_size = sizeof(DFPWMState), .init = dfpwm_enc_init, .encode2 = dfpwm_enc_frame, - .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE}, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, + .p.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE}, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 0c8325e586..d5c095c689 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -2356,16 +2356,16 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return buf_idx; } -const AVCodec ff_dirac_decoder = { - .name = "dirac", - .long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DIRAC, +const FFCodec ff_dirac_decoder = { + .p.name = "dirac", + .p.long_name = NULL_IF_CONFIG_SMALL("BBC Dirac VC-2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DIRAC, .priv_data_size = sizeof(DiracContext), .init = dirac_decode_init, .close = dirac_decode_end, .decode = dirac_decode_frame, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = dirac_decode_flush, }; diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 7a5de737ed..141ca94359 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -725,17 +725,17 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_dnxhd_decoder = { - .name = "dnxhd", - .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DNXHD, +const FFCodec ff_dnxhd_decoder = { + .p.name = "dnxhd", + .p.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DNXHD, .priv_data_size = sizeof(DNXHDContext), .init = dnxhd_decode_init, .close = dnxhd_decode_close, .decode = dnxhd_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), + .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 93dd789914..ab38f4c22f 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -1352,26 +1352,26 @@ static const AVCodecDefault dnxhd_defaults[] = { { NULL }, }; -const AVCodec ff_dnxhd_encoder = { - .name = "dnxhd", - .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DNXHD, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | +const FFCodec ff_dnxhd_encoder = { + .p.name = "dnxhd", + .p.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DNXHD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .priv_data_size = sizeof(DNXHDEncContext), .init = dnxhd_encode_init, .encode2 = dnxhd_encode_picture, .close = dnxhd_encode_end, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE }, - .priv_class = &dnxhd_class, + .p.priv_class = &dnxhd_class, .defaults = dnxhd_defaults, - .profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), + .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c index 0652a8c031..20435f8f25 100644 --- a/libavcodec/dolby_e.c +++ b/libavcodec/dolby_e.c @@ -1297,18 +1297,18 @@ static const AVClass dolby_e_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_dolby_e_decoder = { - .name = "dolby_e", - .long_name = NULL_IF_CONFIG_SMALL("Dolby E"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DOLBY_E, +const FFCodec ff_dolby_e_decoder = { + .p.name = "dolby_e", + .p.long_name = NULL_IF_CONFIG_SMALL("Dolby E"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DOLBY_E, .priv_data_size = sizeof(DBEDecodeContext), - .priv_class = &dolby_e_decoder_class, + .p.priv_class = &dolby_e_decoder_class, .init = dolby_e_init, .decode = dolby_e_decode_frame, .close = dolby_e_close, .flush = dolby_e_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index 9cbc571a15..ddd6b47ff4 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -411,15 +411,15 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data, } #define DPCM_DECODER(id_, name_, long_name_) \ -const AVCodec ff_ ## name_ ## _decoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = id_, \ +const FFCodec ff_ ## name_ ## _decoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = id_, \ + .p.capabilities = AV_CODEC_CAP_DR1, \ .priv_data_size = sizeof(DPCMContext), \ .init = dpcm_decode_init, \ .decode = dpcm_decode_frame, \ - .capabilities = AV_CODEC_CAP_DR1, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 3563bdc538..fb7005e8a8 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -26,6 +26,7 @@ #include "libavutil/timecode.h" #include "bytestream.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" enum DPX_TRC { @@ -762,11 +763,11 @@ static int decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_dpx_decoder = { - .name = "dpx", - .long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DPX, +const FFCodec ff_dpx_decoder = { + .p.name = "dpx", + .p.long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DPX, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index e32e0ba269..15023d615e 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -274,16 +274,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_dpx_encoder = { - .name = "dpx", - .long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DPX, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_dpx_encoder = { + .p.name = "dpx", + .p.long_name = NULL_IF_CONFIG_SMALL("DPX (Digital Picture Exchange) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DPX, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(DPXContext), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GRAY8, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index b5450120d7..2838392e77 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -116,15 +116,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, } #define DSD_DECODER(id_, name_, long_name_) \ -const AVCodec ff_ ## name_ ## _decoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = AV_CODEC_ID_##id_, \ +const FFCodec ff_ ## name_ ## _decoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = AV_CODEC_ID_##id_, \ .init = decode_init, \ .decode = decode_frame, \ - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ AV_SAMPLE_FMT_NONE }, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ }; diff --git a/libavcodec/dsicinaudio.c b/libavcodec/dsicinaudio.c index efc5252a80..14a0c6fec3 100644 --- a/libavcodec/dsicinaudio.c +++ b/libavcodec/dsicinaudio.c @@ -122,14 +122,14 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_dsicinaudio_decoder = { - .name = "dsicinaudio", - .long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DSICINAUDIO, +const FFCodec ff_dsicinaudio_decoder = { + .p.name = "dsicinaudio", + .p.long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DSICINAUDIO, .priv_data_size = sizeof(CinAudioContext), .init = cinaudio_decode_init, .decode = cinaudio_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c index 6851078426..41e90344e9 100644 --- a/libavcodec/dsicinvideo.c +++ b/libavcodec/dsicinvideo.c @@ -322,15 +322,15 @@ static av_cold int cinvideo_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_dsicinvideo_decoder = { - .name = "dsicinvideo", - .long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DSICINVIDEO, +const FFCodec ff_dsicinvideo_decoder = { + .p.name = "dsicinvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Delphine Software International CIN video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DSICINVIDEO, .priv_data_size = sizeof(CinVideoContext), .init = cinvideo_decode_init, .close = cinvideo_decode_end, .decode = cinvideo_decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/dss_sp.c b/libavcodec/dss_sp.c index 067e0e2ce3..d305f993b4 100644 --- a/libavcodec/dss_sp.c +++ b/libavcodec/dss_sp.c @@ -773,14 +773,14 @@ static int dss_sp_decode_frame(AVCodecContext *avctx, void *data, return DSS_SP_FRAME_SIZE; } -const AVCodec ff_dss_sp_decoder = { - .name = "dss_sp", - .long_name = NULL_IF_CONFIG_SMALL("Digital Speech Standard - Standard Play mode (DSS SP)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DSS_SP, +const FFCodec ff_dss_sp_decoder = { + .p.name = "dss_sp", + .p.long_name = NULL_IF_CONFIG_SMALL("Digital Speech Standard - Standard Play mode (DSS SP)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DSS_SP, .priv_data_size = sizeof(DssSpContext), .init = dss_sp_decode_init, .decode = dss_sp_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c index d262e3e0fd..0458856580 100644 --- a/libavcodec/dstdec.c +++ b/libavcodec/dstdec.c @@ -379,16 +379,16 @@ dsd: return avpkt->size; } -const AVCodec ff_dst_decoder = { - .name = "dst", - .long_name = NULL_IF_CONFIG_SMALL("DST (Digital Stream Transfer)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DST, +const FFCodec ff_dst_decoder = { + .p.name = "dst", + .p.long_name = NULL_IF_CONFIG_SMALL("DST (Digital Stream Transfer)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DST, .priv_data_size = sizeof(DSTContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvaudiodec.c b/libavcodec/dvaudiodec.c index 92abfee8ba..96aa1c2005 100644 --- a/libavcodec/dvaudiodec.c +++ b/libavcodec/dvaudiodec.c @@ -119,14 +119,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, return s->block_size; } -const AVCodec ff_dvaudio_decoder = { - .name = "dvaudio", - .long_name = NULL_IF_CONFIG_SMALL("Ulead DV Audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_DVAUDIO, +const FFCodec ff_dvaudio_decoder = { + .p.name = "dvaudio", + .p.long_name = NULL_IF_CONFIG_SMALL("Ulead DV Audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DVAUDIO, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(DVAudioContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 4948f0b6f9..0731202aaf 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1740,15 +1740,15 @@ static const AVClass dvbsubdec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_dvbsub_decoder = { - .name = "dvbsub", - .long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_DVB_SUBTITLE, +const FFCodec ff_dvbsub_decoder = { + .p.name = "dvbsub", + .p.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_DVB_SUBTITLE, .priv_data_size = sizeof(DVBSubContext), .init = dvbsub_init_decoder, .close = dvbsub_close_decoder, .decode = dvbsub_decode, - .priv_class = &dvbsubdec_class, + .p.priv_class = &dvbsubdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvbsubenc.c b/libavcodec/dvbsubenc.c index 322fc27cb4..5444dbfa99 100644 --- a/libavcodec/dvbsubenc.c +++ b/libavcodec/dvbsubenc.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "libavutil/colorspace.h" typedef struct DVBSubtitleContext { @@ -505,11 +506,11 @@ static int dvbsub_encode(AVCodecContext *avctx, uint8_t *outbuf, int buf_size, return q - outbuf; } -const AVCodec ff_dvbsub_encoder = { - .name = "dvbsub", - .long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_DVB_SUBTITLE, +const FFCodec ff_dvbsub_encoder = { + .p.name = "dvbsub", + .p.long_name = NULL_IF_CONFIG_SMALL("DVB subtitles"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_DVB_SUBTITLE, .priv_data_size = sizeof(DVBSubtitleContext), .encode_sub = dvbsub_encode, }; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 052d5b5a38..2e64cb2f55 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -682,15 +682,15 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, return s->sys->frame_size; } -const AVCodec ff_dvvideo_decoder = { - .name = "dvvideo", - .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DVVIDEO, +const FFCodec ff_dvvideo_decoder = { + .p.name = "dvvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DVVIDEO, .priv_data_size = sizeof(DVVideoContext), .init = dvvideo_decode_init, .decode = dvvideo_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, - .max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, + .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index f8c2e4e431..734a387223 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -755,15 +755,15 @@ static const AVClass dvdsub_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_dvdsub_decoder = { - .name = "dvdsub", - .long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_DVD_SUBTITLE, +const FFCodec ff_dvdsub_decoder = { + .p.name = "dvdsub", + .p.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_DVD_SUBTITLE, .priv_data_size = sizeof(DVDSubContext), .init = dvdsub_init, .decode = dvdsub_decode, .flush = dvdsub_flush, - .priv_class = &dvdsub_class, + .p.priv_class = &dvdsub_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c index 8858b633f0..d6960e5f70 100644 --- a/libavcodec/dvdsubenc.c +++ b/libavcodec/dvdsubenc.c @@ -494,14 +494,14 @@ static const AVClass dvdsubenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_dvdsub_encoder = { - .name = "dvdsub", - .long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_DVD_SUBTITLE, +const FFCodec ff_dvdsub_encoder = { + .p.name = "dvdsub", + .p.long_name = NULL_IF_CONFIG_SMALL("DVD subtitles"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_DVD_SUBTITLE, .init = dvdsub_init, .encode_sub = dvdsub_encode, - .priv_class = &dvdsubenc_class, + .p.priv_class = &dvdsubenc_class, .priv_data_size = sizeof(DVDSubtitleContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index cafd2f3943..2a760465e5 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -1206,20 +1206,20 @@ static const AVClass dvvideo_encode_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_dvvideo_encoder = { - .name = "dvvideo", - .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DVVIDEO, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | +const FFCodec ff_dvvideo_encoder = { + .p.name = "dvvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DVVIDEO, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .priv_data_size = sizeof(DVVideoContext), .init = dvvideo_encode_init, .encode2 = dvvideo_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &dvvideo_encode_class, + .p.priv_class = &dvvideo_encode_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 29b6e8c1cd..a3a7cf217b 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -361,15 +361,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_dxa_decoder = { - .name = "dxa", - .long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DXA, +const FFCodec ff_dxa_decoder = { + .p.name = "dxa", + .p.long_name = NULL_IF_CONFIG_SMALL("Feeble Files/ScummVM DXA"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DXA, .priv_data_size = sizeof(DxaDecContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index 76e9d605b8..bd51e5c1b9 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -28,6 +28,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "get_bits.h" #include "unary.h" #include "thread.h" @@ -870,11 +871,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_dxtory_decoder = { - .name = "dxtory", - .long_name = NULL_IF_CONFIG_SMALL("Dxtory"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DXTORY, +const FFCodec ff_dxtory_decoder = { + .p.name = "dxtory", + .p.long_name = NULL_IF_CONFIG_SMALL("Dxtory"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DXTORY, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, }; diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index 0e98e74b1c..9aa7aa0d35 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -1261,16 +1261,16 @@ static int dxv_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_dxv_decoder = { - .name = "dxv", - .long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DXV, +const FFCodec ff_dxv_decoder = { + .p.name = "dxv", + .p.long_name = NULL_IF_CONFIG_SMALL("Resolume DXV"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DXV, .init = dxv_init, .decode = dxv_decode, .close = dxv_close, .priv_data_size = sizeof(DXVContext), - .capabilities = AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index 5964eeee5a..5c19d70266 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -250,24 +250,24 @@ void ff_eac3_output_frame_header(AC3EncodeContext *s) FF_DISABLE_DEPRECATION_WARNINGS -const AVCodec ff_eac3_encoder = { - .name = "eac3", - .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_EAC3, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_eac3_encoder = { + .p.name = "eac3", + .p.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 E-AC-3"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_EAC3, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(AC3EncodeContext), .init = ff_ac3_float_encode_init, .encode2 = ff_ac3_float_encode_frame, .close = ff_ac3_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &eac3enc_class, - .supported_samplerates = ff_ac3_sample_rate_tab, + .p.priv_class = &eac3enc_class, + .p.supported_samplerates = ff_ac3_sample_rate_tab, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = ff_ac3_channel_layouts, + .p.channel_layouts = ff_ac3_channel_layouts, #endif - .ch_layouts = ff_ac3_ch_layouts, + .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 790c513b02..f060b57459 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -231,15 +231,15 @@ static av_cold int cmv_decode_end(AVCodecContext *avctx){ return 0; } -const AVCodec ff_eacmv_decoder = { - .name = "eacmv", - .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CMV, +const FFCodec ff_eacmv_decoder = { + .p.name = "eacmv", + .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts CMV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CMV, .priv_data_size = sizeof(CmvContext), .init = cmv_decode_init, .close = cmv_decode_end, .decode = cmv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 7a27a57582..239ee1b38e 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -342,15 +342,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_eamad_decoder = { - .name = "eamad", - .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MAD, +const FFCodec ff_eamad_decoder = { + .p.name = "eamad", + .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts Madcow Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MAD, .priv_data_size = sizeof(MadContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index 29bde5a6e3..93024b7e9f 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -248,14 +248,14 @@ static int tgq_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_eatgq_decoder = { - .name = "eatgq", - .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TGQ, +const FFCodec ff_eatgq_decoder = { + .p.name = "eatgq", + .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGQ video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TGQ, .priv_data_size = sizeof(TgqContext), .init = tgq_decode_init, .decode = tgq_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index e32438442c..8475509ccb 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -360,15 +360,15 @@ static av_cold int tgv_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_eatgv_decoder = { - .name = "eatgv", - .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TGV, +const FFCodec ff_eatgv_decoder = { + .p.name = "eatgv", + .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TGV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TGV, .priv_data_size = sizeof(TgvContext), .init = tgv_decode_init, .close = tgv_decode_end, .decode = tgv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 625e99f0ae..59dec04137 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -183,15 +183,15 @@ static av_cold int tqi_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_eatqi_decoder = { - .name = "eatqi", - .long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TQI Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TQI, +const FFCodec ff_eatqi_decoder = { + .p.name = "eatqi", + .p.long_name = NULL_IF_CONFIG_SMALL("Electronic Arts TQI Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TQI, .priv_data_size = sizeof(TqiContext), .init = tqi_decode_init, .close = tqi_decode_end, .decode = tqi_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 47fa3ac4bf..70bd8da81f 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -27,6 +27,7 @@ #include "libavutil/samplefmt.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" #include "frame_thread_encoder.h" #include "internal.h" @@ -151,7 +152,7 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, return -1; } - ret = avctx->codec->encode_sub(avctx, buf, buf_size, sub); + ret = ffcodec(avctx->codec)->encode_sub(avctx, buf, buf_size, sub); avctx->frame_number++; return ret; } @@ -176,6 +177,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) AVCodecInternal *avci = avctx->internal; EncodeSimpleContext *es = &avci->es; AVFrame *frame = es->in_frame; + const FFCodec *const codec = ffcodec(avctx->codec); int got_packet; int ret; @@ -200,7 +202,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) got_packet = 0; - av_assert0(avctx->codec->encode2); + av_assert0(codec->encode2); if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder && (avctx->active_thread_type & FF_THREAD_FRAME)) @@ -210,7 +212,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) * no sense to use the properties of the current frame anyway). */ ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet); else { - ret = avctx->codec->encode2(avctx, avpkt, frame, &got_packet); + ret = codec->encode2(avctx, avpkt, frame, &got_packet); if (avctx->codec->type == AVMEDIA_TYPE_VIDEO && !ret && got_packet && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) avpkt->pts = avpkt->dts = frame->pts; @@ -290,8 +292,8 @@ static int encode_receive_packet_internal(AVCodecContext *avctx, AVPacket *avpkt return AVERROR(EINVAL); } - if (avctx->codec->receive_packet) { - ret = avctx->codec->receive_packet(avctx, avpkt); + if (ffcodec(avctx->codec)->receive_packet) { + ret = ffcodec(avctx->codec)->receive_packet(avctx, avpkt); if (ret < 0) av_packet_unref(avpkt); else diff --git a/libavcodec/encode.h b/libavcodec/encode.h index c9cec0cc80..97b3acf9df 100644 --- a/libavcodec/encode.h +++ b/libavcodec/encode.h @@ -47,7 +47,7 @@ int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, i /** * Check AVPacket size and allocate data. * - * Encoders supporting AVCodec.encode2() can use this as a convenience to + * Encoders supporting FFCodec.encode2() can use this as a convenience to * obtain a big enough buffer for the encoded bitstream. * * @param avctx the AVCodecContext of the encoder @@ -61,7 +61,7 @@ int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size); /* * Perform encoder initialization and validation. - * Called when opening the encoder, before the AVCodec.init() call. + * Called when opening the encoder, before the FFCodec.init() call. */ int ff_encode_preinit(AVCodecContext *avctx); diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 066875f5e3..94af68edae 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -377,15 +377,15 @@ static int escape124_decode_frame(AVCodecContext *avctx, } -const AVCodec ff_escape124_decoder = { - .name = "escape124", - .long_name = NULL_IF_CONFIG_SMALL("Escape 124"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ESCAPE124, +const FFCodec ff_escape124_decoder = { + .p.name = "escape124", + .p.long_name = NULL_IF_CONFIG_SMALL("Escape 124"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ESCAPE124, .priv_data_size = sizeof(Escape124Context), .init = escape124_decode_init, .close = escape124_decode_close, .decode = escape124_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 5fa8997219..1826d4ec68 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -346,15 +346,15 @@ static int escape130_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_escape130_decoder = { - .name = "escape130", - .long_name = NULL_IF_CONFIG_SMALL("Escape 130"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ESCAPE130, +const FFCodec ff_escape130_decoder = { + .p.name = "escape130", + .p.long_name = NULL_IF_CONFIG_SMALL("Escape 130"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ESCAPE130, .priv_data_size = sizeof(Escape130Context), .init = escape130_decode_init, .close = escape130_decode_close, .decode = escape130_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c index d2df28e3e9..904994f7c2 100644 --- a/libavcodec/evrcdec.c +++ b/libavcodec/evrcdec.c @@ -930,15 +930,15 @@ static const AVClass evrcdec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_evrc_decoder = { - .name = "evrc", - .long_name = NULL_IF_CONFIG_SMALL("EVRC (Enhanced Variable Rate Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_EVRC, +const FFCodec ff_evrc_decoder = { + .p.name = "evrc", + .p.long_name = NULL_IF_CONFIG_SMALL("EVRC (Enhanced Variable Rate Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_EVRC, .init = evrc_decode_init, .decode = evrc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(EVRCContext), - .priv_class = &evrcdec_class, + .p.priv_class = &evrcdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/exr.c b/libavcodec/exr.c index f5e1456a25..dd5924245f 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -2341,17 +2341,17 @@ static const AVClass exr_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_exr_decoder = { - .name = "exr", - .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_EXR, +const FFCodec ff_exr_decoder = { + .p.name = "exr", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_EXR, .priv_data_size = sizeof(EXRContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .priv_class = &exr_class, + .p.priv_class = &exr_class, }; diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c index fc7d2c3d6b..baf29f5912 100644 --- a/libavcodec/exrenc.c +++ b/libavcodec/exrenc.c @@ -534,18 +534,18 @@ static const AVClass exr_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_exr_encoder = { - .name = "exr", - .long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), +const FFCodec ff_exr_encoder = { + .p.name = "exr", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenEXR image"), .priv_data_size = sizeof(EXRContext), - .priv_class = &exr_class, - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_EXR, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.priv_class = &exr_class, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_EXR, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, AV_PIX_FMT_NONE }, diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c index 6c10a31ce2..151f03931a 100644 --- a/libavcodec/fastaudio.c +++ b/libavcodec/fastaudio.c @@ -188,17 +188,17 @@ static av_cold int fastaudio_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_fastaudio_decoder = { - .name = "fastaudio", - .long_name = NULL_IF_CONFIG_SMALL("MobiClip FastAudio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_FASTAUDIO, +const FFCodec ff_fastaudio_decoder = { + .p.name = "fastaudio", + .p.long_name = NULL_IF_CONFIG_SMALL("MobiClip FastAudio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_FASTAUDIO, .priv_data_size = sizeof(FastAudioContext), .init = fastaudio_init, .decode = fastaudio_decode, .close = fastaudio_close, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 87d1c7b009..a5aae79c94 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -1052,17 +1052,17 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) } #endif -const AVCodec ff_ffv1_decoder = { - .name = "ffv1", - .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FFV1, +const FFCodec ff_ffv1_decoder = { + .p.name = "ffv1", + .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FFV1, .priv_data_size = sizeof(FFV1Context), .init = decode_init, .close = ff_ffv1_close, .decode = decode_frame, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ | + .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/ | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index c209911fa8..edaa8b4b3d 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1278,17 +1278,17 @@ static const AVClass ffv1_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ffv1_encoder = { - .name = "ffv1", - .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FFV1, +const FFCodec ff_ffv1_encoder = { + .p.name = "ffv1", + .p.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FFV1, .priv_data_size = sizeof(FFV1Context), .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_0RGB32, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, @@ -1311,6 +1311,6 @@ const AVCodec ff_ffv1_encoder = { AV_PIX_FMT_NONE }, - .priv_class = &ffv1_class, + .p.priv_class = &ffv1_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c index b614634038..ea939b9009 100644 --- a/libavcodec/ffwavesynth.c +++ b/libavcodec/ffwavesynth.c @@ -460,15 +460,15 @@ static av_cold int wavesynth_close(AVCodecContext *avc) return 0; } -const AVCodec ff_ffwavesynth_decoder = { - .name = "wavesynth", - .long_name = NULL_IF_CONFIG_SMALL("Wave synthesis pseudo-codec"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_FFWAVESYNTH, +const FFCodec ff_ffwavesynth_decoder = { + .p.name = "wavesynth", + .p.long_name = NULL_IF_CONFIG_SMALL("Wave synthesis pseudo-codec"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_FFWAVESYNTH, .priv_data_size = sizeof(struct wavesynth_context), .init = wavesynth_init, .close = wavesynth_close, .decode = wavesynth_decode, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/fic.c b/libavcodec/fic.c index b75ded72f2..79e45ec0d8 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -484,16 +484,16 @@ static const AVClass fic_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_fic_decoder = { - .name = "fic", - .long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FIC, +const FFCodec ff_fic_decoder = { + .p.name = "fic", + .p.long_name = NULL_IF_CONFIG_SMALL("Mirillis FIC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FIC, .priv_data_size = sizeof(FICContext), .init = fic_decode_init, .decode = fic_decode_frame, .close = fic_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, - .priv_class = &fic_decoder_class, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, + .p.priv_class = &fic_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c index af60217a8a..b285787056 100644 --- a/libavcodec/fitsdec.c +++ b/libavcodec/fitsdec.c @@ -31,6 +31,7 @@ */ #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include #include "libavutil/intreadwrite.h" @@ -320,13 +321,13 @@ static const AVClass fits_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_fits_decoder = { - .name = "fits", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FITS, +const FFCodec ff_fits_decoder = { + .p.name = "fits", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FITS, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), + .p.priv_class = &fits_decoder_class, .priv_data_size = sizeof(FITSContext), .decode = fits_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), - .priv_class = &fits_decoder_class }; diff --git a/libavcodec/fitsenc.c b/libavcodec/fitsenc.c index 3ac1141b69..eebabfb621 100644 --- a/libavcodec/fitsenc.c +++ b/libavcodec/fitsenc.c @@ -32,6 +32,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "encode.h" static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt, @@ -109,14 +110,14 @@ static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_fits_encoder = { - .name = "fits", - .long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FITS, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_fits_encoder = { + .p.name = "fits", + .p.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FITS, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = fits_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRAP16BE, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRAP16BE, AV_PIX_FMT_GBRP16BE, AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index f012424ced..dd6026f9de 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -658,23 +658,23 @@ static const AVClass flac_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_flac_decoder = { - .name = "flac", - .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_FLAC, +const FFCodec ff_flac_decoder = { + .p.name = "flac", + .p.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_FLAC, .priv_data_size = sizeof(FLACContext), .init = flac_decode_init, .close = flac_decode_close, .decode = flac_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, - .priv_class = &flac_decoder_class, + .p.priv_class = &flac_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index e4e4d5ea15..6b46664dd9 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1458,20 +1458,20 @@ static const AVClass flac_encoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_flac_encoder = { - .name = "flac", - .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_FLAC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_flac_encoder = { + .p.name = "flac", + .p.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_FLAC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(FlacEncodeContext), .init = flac_encode_init, .encode2 = flac_encode_frame, .close = flac_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, - .priv_class = &flac_encoder_class, + .p.priv_class = &flac_encoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index c438bbce39..013f0c7989 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -494,18 +494,18 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data, } #if CONFIG_FLASHSV_DECODER -const AVCodec ff_flashsv_decoder = { - .name = "flashsv", - .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLASHSV, +const FFCodec ff_flashsv_decoder = { + .p.name = "flashsv", + .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLASHSV, .priv_data_size = sizeof(FlashSVContext), .init = flashsv_decode_init, .close = flashsv_decode_end, .decode = flashsv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, }; #endif /* CONFIG_FLASHSV_DECODER */ @@ -561,17 +561,17 @@ static av_cold int flashsv2_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_flashsv2_decoder = { - .name = "flashsv2", - .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLASHSV2, +const FFCodec ff_flashsv2_decoder = { + .p.name = "flashsv2", + .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLASHSV2, .priv_data_size = sizeof(FlashSVContext), .init = flashsv2_decode_init, .close = flashsv2_decode_end, .decode = flashsv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, }; #endif /* CONFIG_FLASHSV2_DECODER */ diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c index 314c286f1e..42ae77810c 100644 --- a/libavcodec/flashsv2enc.c +++ b/libavcodec/flashsv2enc.c @@ -910,15 +910,15 @@ static av_cold int flashsv2_encode_end(AVCodecContext * avctx) return 0; } -const AVCodec ff_flashsv2_encoder = { - .name = "flashsv2", - .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLASHSV2, +const FFCodec ff_flashsv2_encoder = { + .p.name = "flashsv2", + .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLASHSV2, .priv_data_size = sizeof(FlashSV2Context), .init = flashsv2_encode_init, .encode2 = flashsv2_encode_frame, .close = flashsv2_encode_end, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index f3178da7a1..0059ea5a46 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -257,15 +257,15 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_flashsv_encoder = { - .name = "flashsv", - .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLASHSV, +const FFCodec ff_flashsv_encoder = { + .p.name = "flashsv", + .p.long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLASHSV, .priv_data_size = sizeof(FlashSVContext), .init = flashsv_encode_init, .encode2 = flashsv_encode_frame, .close = flashsv_encode_end, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index eacb4b1b03..2169202f4f 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -1105,15 +1105,15 @@ static av_cold int flic_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_flic_decoder = { - .name = "flic", - .long_name = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLIC, +const FFCodec ff_flic_decoder = { + .p.name = "flic", + .p.long_name = NULL_IF_CONFIG_SMALL("Autodesk Animator Flic video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLIC, .priv_data_size = sizeof(FlicDecodeContext), .init = flic_decode_init, .close = flic_decode_end, .decode = flic_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index 8b30d0078c..096f82fa88 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -113,19 +113,19 @@ int ff_flv_decode_picture_header(MpegEncContext *s) return 0; } -const AVCodec ff_flv_decoder = { - .name = "flv", - .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLV1, +const FFCodec ff_flv_decoder = { + .p.name = "flv", + .p.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLV1, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index 8a1e5d6076..1796c8a698 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -92,17 +92,17 @@ void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, } } -const AVCodec ff_flv_encoder = { - .name = "flv", - .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FLV1, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_flv_encoder = { + .p.name = "flv", + .p.long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FLV1, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, }; diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c index f43aea1514..385c737e0e 100644 --- a/libavcodec/fmvc.c +++ b/libavcodec/fmvc.c @@ -627,16 +627,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_fmvc_decoder = { - .name = "fmvc", - .long_name = NULL_IF_CONFIG_SMALL("FM Screen Capture Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FMVC, +const FFCodec ff_fmvc_decoder = { + .p.name = "fmvc", + .p.long_name = NULL_IF_CONFIG_SMALL("FM Screen Capture Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FMVC, .priv_data_size = sizeof(FMVCContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index d4f86f7418..c6528dd804 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -28,6 +28,7 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "pthread_internal.h" #include "thread.h" @@ -103,7 +104,7 @@ static void * attribute_align_arg worker(void *v){ frame = task->indata; pkt = task->outdata; - ret = avctx->codec->encode2(avctx, pkt, frame, &got_packet); + ret = ffcodec(avctx->codec)->encode2(avctx, pkt, frame, &got_packet); if(got_packet) { int ret2 = av_packet_make_refcounted(pkt); if (ret >= 0 && ret2 < 0) diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index a9db56d1fe..7a8acc418f 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -341,15 +341,15 @@ static av_cold int decode_end(AVCodecContext *avctx) } -const AVCodec ff_fraps_decoder = { - .name = "fraps", - .long_name = NULL_IF_CONFIG_SMALL("Fraps"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FRAPS, +const FFCodec ff_fraps_decoder = { + .p.name = "fraps", + .p.long_name = NULL_IF_CONFIG_SMALL("Fraps"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FRAPS, .priv_data_size = sizeof(FrapsContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 12b56f976a..558fac8d54 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -116,15 +116,15 @@ static const AVClass frwu_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_frwu_decoder = { - .name = "frwu", - .long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FRWU, +const FFCodec ff_frwu_decoder = { + .p.name = "frwu", + .p.long_name = NULL_IF_CONFIG_SMALL("Forward Uncompressed"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FRWU, .priv_data_size = sizeof(FRWUContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .priv_class = &frwu_class, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.priv_class = &frwu_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 578b5d9b93..30432867e3 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -1623,15 +1623,15 @@ static av_cold int g2m_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_g2m_decoder = { - .name = "g2m", - .long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_G2M, +const FFCodec ff_g2m_decoder = { + .p.name = "g2m", + .p.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_G2M, .priv_data_size = sizeof(G2MContext), .init = g2m_decode_init, .close = g2m_decode_end, .decode = g2m_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c index c3927f8221..727d88b7ba 100644 --- a/libavcodec/g722dec.c +++ b/libavcodec/g722dec.c @@ -140,15 +140,15 @@ static int g722_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_adpcm_g722_decoder = { - .name = "g722", - .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G722, +const FFCodec ff_adpcm_g722_decoder = { + .p.name = "g722", + .p.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G722, .priv_data_size = sizeof(G722Context), .init = g722_decode_init, .decode = g722_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .priv_class = &g722_decoder_class, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.priv_class = &g722_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index 8cb41be37a..ca6bd46532 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -371,21 +371,21 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_adpcm_g722_encoder = { - .name = "g722", - .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G722, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_adpcm_g722_encoder = { + .p.name = "g722", + .p.long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G722, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G722Context), .init = g722_encode_init, .close = g722_encode_close, .encode2 = g722_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]){ + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c index a0d2df7a93..71f758b55b 100644 --- a/libavcodec/g723_1dec.c +++ b/libavcodec/g723_1dec.c @@ -1112,15 +1112,15 @@ static const AVClass g723_1dec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_g723_1_decoder = { - .name = "g723_1", - .long_name = NULL_IF_CONFIG_SMALL("G.723.1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_G723_1, +const FFCodec ff_g723_1_decoder = { + .p.name = "g723_1", + .p.long_name = NULL_IF_CONFIG_SMALL("G.723.1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_G723_1, .priv_data_size = sizeof(G723_1_Context), .init = g723_1_decode_init, .decode = g723_1_decode_frame, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, - .priv_class = &g723_1dec_class, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.priv_class = &g723_1dec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/g723_1enc.c b/libavcodec/g723_1enc.c index 9f91d282f5..a4cfb72519 100644 --- a/libavcodec/g723_1enc.c +++ b/libavcodec/g723_1enc.c @@ -1238,20 +1238,20 @@ static const AVCodecDefault defaults[] = { { NULL }, }; -const AVCodec ff_g723_1_encoder = { - .name = "g723_1", - .long_name = NULL_IF_CONFIG_SMALL("G.723.1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_G723_1, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_g723_1_encoder = { + .p.name = "g723_1", + .p.long_name = NULL_IF_CONFIG_SMALL("G.723.1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_G723_1, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(G723_1_Context), .init = g723_1_encode_init, .encode2 = g723_1_encode_frame, .defaults = defaults, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .ch_layouts = (const AVChannelLayout[]){ + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/g726.c b/libavcodec/g726.c index ef5a21a253..92e14c5e74 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -400,36 +400,36 @@ static const AVCodecDefault defaults[] = { #endif #if CONFIG_ADPCM_G726_ENCODER -const AVCodec ff_adpcm_g726_encoder = { - .name = "g726", - .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G726, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_adpcm_g726_encoder = { + .p.name = "g726", + .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G726, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, .encode2 = g726_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &g726_class, + .p.priv_class = &g726_class, .defaults = defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ADPCM_G726LE_ENCODER -const AVCodec ff_adpcm_g726le_encoder = { - .name = "g726le", - .long_name = NULL_IF_CONFIG_SMALL("G.726 little endian ADPCM (\"right-justified\")"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G726LE, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_adpcm_g726le_encoder = { + .p.name = "g726le", + .p.long_name = NULL_IF_CONFIG_SMALL("G.726 little endian ADPCM (\"right-justified\")"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G726LE, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(G726Context), .init = g726_encode_init, .encode2 = g726_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &g726_class, + .p.priv_class = &g726_class, .defaults = defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -503,31 +503,31 @@ static void g726_decode_flush(AVCodecContext *avctx) #endif #if CONFIG_ADPCM_G726_DECODER -const AVCodec ff_adpcm_g726_decoder = { - .name = "g726", - .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G726, +const FFCodec ff_adpcm_g726_decoder = { + .p.name = "g726", + .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G726, .priv_data_size = sizeof(G726Context), .init = g726_decode_init, .decode = g726_decode_frame, .flush = g726_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_ADPCM_G726LE_DECODER -const AVCodec ff_adpcm_g726le_decoder = { - .name = "g726le", - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_G726LE, +const FFCodec ff_adpcm_g726le_decoder = { + .p.name = "g726le", + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_G726LE, .priv_data_size = sizeof(G726Context), .init = g726_decode_init, .decode = g726_decode_frame, .flush = g726_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM little-endian"), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index f96ecbda5f..3ca141a2da 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -753,28 +753,28 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_g729_decoder = { - .name = "g729", - .long_name = NULL_IF_CONFIG_SMALL("G.729"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_G729, +const FFCodec ff_g729_decoder = { + .p.name = "g729", + .p.long_name = NULL_IF_CONFIG_SMALL("G.729"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_G729, .priv_data_size = sizeof(G729Context), .init = decoder_init, .decode = decode_frame, .close = decode_close, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -const AVCodec ff_acelp_kelvin_decoder = { - .name = "acelp.kelvin", - .long_name = NULL_IF_CONFIG_SMALL("Sipro ACELP.KELVIN"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ACELP_KELVIN, +const FFCodec ff_acelp_kelvin_decoder = { + .p.name = "acelp.kelvin", + .p.long_name = NULL_IF_CONFIG_SMALL("Sipro ACELP.KELVIN"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ACELP_KELVIN, .priv_data_size = sizeof(G729Context), .init = decoder_init, .decode = decode_frame, .close = decode_close, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c index 4c012ce309..e8af2f563f 100644 --- a/libavcodec/gdv.c +++ b/libavcodec/gdv.c @@ -561,15 +561,15 @@ static av_cold int gdv_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_gdv_decoder = { - .name = "gdv", - .long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_GDV, +const FFCodec ff_gdv_decoder = { + .p.name = "gdv", + .p.long_name = NULL_IF_CONFIG_SMALL("Gremlin Digital Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_GDV, .priv_data_size = sizeof(GDVContext), .init = gdv_decode_init, .close = gdv_decode_close, .decode = gdv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/gemdec.c b/libavcodec/gemdec.c index fd14b22390..83b71727d6 100644 --- a/libavcodec/gemdec.c +++ b/libavcodec/gemdec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" static const uint32_t gem_color_palette[16]={ @@ -351,12 +352,12 @@ static av_cold int gem_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_gem_decoder = { - .name = "gem", - .long_name = NULL_IF_CONFIG_SMALL("GEM Raster image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_GEM, +const FFCodec ff_gem_decoder = { + .p.name = "gem", + .p.long_name = NULL_IF_CONFIG_SMALL("GEM Raster image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_GEM, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = gem_decode_frame, .close = gem_close, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/gif.c b/libavcodec/gif.c index d6a39fe210..a22cae1f0b 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -552,19 +552,19 @@ static const AVClass gif_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_gif_encoder = { - .name = "gif", - .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_GIF, +const FFCodec ff_gif_encoder = { + .p.name = "gif", + .p.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_GIF, .priv_data_size = sizeof(GIFContext), .init = gif_encode_init, .encode2 = gif_encode_frame, .close = gif_encode_close, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, - .priv_class = &gif_class, + .p.priv_class = &gif_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index d652666225..aeeefe477d 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -555,17 +555,17 @@ static const AVClass decoder_class = { .category = AV_CLASS_CATEGORY_DECODER, }; -const AVCodec ff_gif_decoder = { - .name = "gif", - .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_GIF, +const FFCodec ff_gif_decoder = { + .p.name = "gif", + .p.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_GIF, .priv_data_size = sizeof(GifState), .init = gif_decode_init, .close = gif_decode_close, .decode = gif_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &decoder_class, + .p.priv_class = &decoder_class, }; diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c index cf91ff11e9..02d988ae40 100644 --- a/libavcodec/gsmdec.c +++ b/libavcodec/gsmdec.c @@ -114,30 +114,30 @@ static void gsm_flush(AVCodecContext *avctx) } #if CONFIG_GSM_DECODER -const AVCodec ff_gsm_decoder = { - .name = "gsm", - .long_name = NULL_IF_CONFIG_SMALL("GSM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM, +const FFCodec ff_gsm_decoder = { + .p.name = "gsm", + .p.long_name = NULL_IF_CONFIG_SMALL("GSM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM, .priv_data_size = sizeof(GSMContext), .init = gsm_init, .decode = gsm_decode_frame, .flush = gsm_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_GSM_MS_DECODER -const AVCodec ff_gsm_ms_decoder = { - .name = "gsm_ms", - .long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM_MS, +const FFCodec ff_gsm_ms_decoder = { + .p.name = "gsm_ms", + .p.long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM_MS, .priv_data_size = sizeof(GSMContext), .init = gsm_init, .decode = gsm_decode_frame, .flush = gsm_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 60e7430376..2830966eb6 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -681,16 +681,16 @@ static av_cold int h261_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_h261_decoder = { - .name = "h261", - .long_name = NULL_IF_CONFIG_SMALL("H.261"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H261, +const FFCodec ff_h261_decoder = { + .p.name = "h261", + .p.long_name = NULL_IF_CONFIG_SMALL("H.261"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H261, .priv_data_size = sizeof(H261DecContext), .init = h261_decode_init, .close = h261_decode_end, .decode = h261_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .max_lowres = 3, + .p.max_lowres = 3, }; diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 33bb689571..f18f58b107 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -400,17 +400,17 @@ av_cold void ff_h261_encode_init(MpegEncContext *s) ff_thread_once(&init_static_once, h261_encode_init_static); } -const AVCodec ff_h261_encoder = { - .name = "h261", - .long_name = NULL_IF_CONFIG_SMALL("H.261"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H261, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_h261_encoder = { + .p.name = "h261", + .p.long_name = NULL_IF_CONFIG_SMALL("H.261"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H261, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(H261EncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 9ffce5d865..886fbee8c8 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -755,16 +755,16 @@ static const AVCodecHWConfigInternal *const h263_hw_config_list[] = { NULL }; -const AVCodec ff_h263_decoder = { - .name = "h263", - .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, +const FFCodec ff_h263_decoder = { + .p.name = "h263", + .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -772,21 +772,21 @@ const AVCodec ff_h263_decoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, - .max_lowres = 3, - .pix_fmts = ff_h263_hwaccel_pixfmt_list_420, + .p.max_lowres = 3, + .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, .hw_configs = h263_hw_config_list, }; -const AVCodec ff_h263p_decoder = { - .name = "h263p", - .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263P, +const FFCodec ff_h263p_decoder = { + .p.name = "h263p", + .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263P, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -794,7 +794,7 @@ const AVCodec ff_h263p_decoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = ff_mpeg_flush, - .max_lowres = 3, - .pix_fmts = ff_h263_hwaccel_pixfmt_list_420, + .p.max_lowres = 3, + .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, .hw_configs = h263_hw_config_list, }; diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 9cad57d88b..2a510b0a01 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -1069,16 +1069,16 @@ static const AVClass h264_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_decoder = { - .name = "h264", - .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_h264_decoder = { + .p.name = "h264", + .p.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(H264Context), .init = h264_decode_init, .close = h264_decode_end, .decode = h264_decode_frame, - .capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 | + .p.capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .hw_configs = (const AVCodecHWConfigInternal *const []) { @@ -1110,6 +1110,6 @@ const AVCodec ff_h264_decoder = { .flush = h264_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context), .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context_for_user), - .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles), - .priv_class = &h264_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles), + .p.priv_class = &h264_class, }; diff --git a/libavcodec/hapdec.c b/libavcodec/hapdec.c index ed080549a6..4a7ac15a8e 100644 --- a/libavcodec/hapdec.c +++ b/libavcodec/hapdec.c @@ -473,16 +473,16 @@ static av_cold int hap_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_hap_decoder = { - .name = "hap", - .long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HAP, +const FFCodec ff_hap_decoder = { + .p.name = "hap", + .p.long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HAP, .init = hap_init, .decode = hap_decode, .close = hap_close, .priv_data_size = sizeof(HapContext), - .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/hapenc.c b/libavcodec/hapenc.c index 6f07ce081d..ee03fef449 100644 --- a/libavcodec/hapenc.c +++ b/libavcodec/hapenc.c @@ -349,17 +349,17 @@ static const AVClass hapenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hap_encoder = { - .name = "hap", - .long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HAP, +const FFCodec ff_hap_encoder = { + .p.name = "hap", + .p.long_name = NULL_IF_CONFIG_SMALL("Vidvox Hap"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HAP, .priv_data_size = sizeof(HapContext), - .priv_class = &hapenc_class, + .p.priv_class = &hapenc_class, .init = hap_init, .encode2 = hap_encode, .close = hap_close, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE, }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c index b51f19139c..b178456e1c 100644 --- a/libavcodec/hcadec.c +++ b/libavcodec/hcadec.c @@ -446,17 +446,17 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_hca_decoder = { - .name = "hca", - .long_name = NULL_IF_CONFIG_SMALL("CRI HCA"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_HCA, +const FFCodec ff_hca_decoder = { + .p.name = "hca", + .p.long_name = NULL_IF_CONFIG_SMALL("CRI HCA"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_HCA, .priv_data_size = sizeof(HCAContext), .init = decode_init, .decode = decode_frame, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/hcom.c b/libavcodec/hcom.c index bc004dc98c..17e99c91bf 100644 --- a/libavcodec/hcom.c +++ b/libavcodec/hcom.c @@ -135,15 +135,15 @@ static av_cold int hcom_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_hcom_decoder = { - .name = "hcom", - .long_name = NULL_IF_CONFIG_SMALL("HCOM Audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_HCOM, +const FFCodec ff_hcom_decoder = { + .p.name = "hcom", + .p.long_name = NULL_IF_CONFIG_SMALL("HCOM Audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_HCOM, .priv_data_size = sizeof(HCOMContext), .init = hcom_init, .close = hcom_close, .decode = hcom_decode, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index ed6548e403..09c07acdc2 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -3875,23 +3875,23 @@ static const AVClass hevc_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hevc_decoder = { - .name = "hevc", - .long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, +const FFCodec ff_hevc_decoder = { + .p.name = "hevc", + .p.long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, .priv_data_size = sizeof(HEVCContext), - .priv_class = &hevc_decoder_class, + .p.priv_class = &hevc_decoder_class, .init = hevc_decode_init, .close = hevc_decode_free, .decode = hevc_decode_frame, .flush = hevc_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(hevc_update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, - .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), + .p.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_HEVC_DXVA2_HWACCEL HWACCEL_DXVA2(hevc), diff --git a/libavcodec/hnm4video.c b/libavcodec/hnm4video.c index c03ea97913..25228420ec 100644 --- a/libavcodec/hnm4video.c +++ b/libavcodec/hnm4video.c @@ -498,15 +498,15 @@ static av_cold int hnm_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_hnm4_video_decoder = { - .name = "hnm4video", - .long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HNM4_VIDEO, +const FFCodec ff_hnm4_video_decoder = { + .p.name = "hnm4video", + .p.long_name = NULL_IF_CONFIG_SMALL("HNM 4 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HNM4_VIDEO, .priv_data_size = sizeof(Hnm4VideoContext), .init = hnm_decode_init, .close = hnm_decode_end, .decode = hnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c index 6e9d7bf4c4..fac22e95f6 100644 --- a/libavcodec/hq_hqa.c +++ b/libavcodec/hq_hqa.c @@ -382,16 +382,16 @@ static av_cold int hq_hqa_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_hq_hqa_decoder = { - .name = "hq_hqa", - .long_name = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HQ_HQA, +const FFCodec ff_hq_hqa_decoder = { + .p.name = "hq_hqa", + .p.long_name = NULL_IF_CONFIG_SMALL("Canopus HQ/HQA"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HQ_HQA, .priv_data_size = sizeof(HQContext), .init = hq_hqa_decode_init, .decode = hq_hqa_decode_frame, .close = hq_hqa_decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/hqx.c b/libavcodec/hqx.c index b89b6e58f6..a1b3b39a0a 100644 --- a/libavcodec/hqx.c +++ b/libavcodec/hqx.c @@ -535,16 +535,16 @@ static av_cold int hqx_decode_init(AVCodecContext *avctx) return ff_hqx_init_vlcs(ctx); } -const AVCodec ff_hqx_decoder = { - .name = "hqx", - .long_name = NULL_IF_CONFIG_SMALL("Canopus HQX"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HQX, +const FFCodec ff_hqx_decoder = { + .p.name = "hqx", + .p.long_name = NULL_IF_CONFIG_SMALL("Canopus HQX"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HQX, .priv_data_size = sizeof(HQXContext), .init = hqx_decode_init, .decode = hqx_decode_frame, .close = hqx_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index d43d333ede..5fdefa9bd5 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -1263,47 +1263,47 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return (get_bits_count(&s->gb) + 31) / 32 * 4 + table_size; } -const AVCodec ff_huffyuv_decoder = { - .name = "huffyuv", - .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HUFFYUV, +const FFCodec ff_huffyuv_decoder = { + .p.name = "huffyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HUFFYUV, .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #if CONFIG_FFVHUFF_DECODER -const AVCodec ff_ffvhuff_decoder = { - .name = "ffvhuff", - .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FFVHUFF, +const FFCodec ff_ffvhuff_decoder = { + .p.name = "ffvhuff", + .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FFVHUFF, .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_FFVHUFF_DECODER */ #if CONFIG_HYMT_DECODER -const AVCodec ff_hymt_decoder = { - .name = "hymt", - .long_name = NULL_IF_CONFIG_SMALL("HuffYUV MT"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HYMT, +const FFCodec ff_hymt_decoder = { + .p.name = "hymt", + .p.long_name = NULL_IF_CONFIG_SMALL("HuffYUV MT"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HYMT, .priv_data_size = sizeof(HYuvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 2e226d41ea..a19cf7efdc 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -1049,18 +1049,18 @@ static const AVClass ff_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_huffyuv_encoder = { - .name = "huffyuv", - .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HUFFYUV, +const FFCodec ff_huffyuv_encoder = { + .p.name = "huffyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HUFFYUV, .priv_data_size = sizeof(HYuvContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .priv_class = &normal_class, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.priv_class = &normal_class, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, @@ -1069,18 +1069,18 @@ const AVCodec ff_huffyuv_encoder = { }; #if CONFIG_FFVHUFF_ENCODER -const AVCodec ff_ffvhuff_encoder = { - .name = "ffvhuff", - .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_FFVHUFF, +const FFCodec ff_ffvhuff_encoder = { + .p.name = "ffvhuff", + .p.long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_FFVHUFF, .priv_data_size = sizeof(HYuvContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .priv_class = &ff_class, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.priv_class = &ff_class, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_GBRP, diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 35c4818fbe..4f121804b2 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -243,15 +243,15 @@ static const AVCodecDefault idcin_defaults[] = { { NULL }, }; -const AVCodec ff_idcin_decoder = { - .name = "idcinvideo", - .long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IDCIN, +const FFCodec ff_idcin_decoder = { + .p.name = "idcinvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IDCIN, .priv_data_size = sizeof(IdcinContext), .init = idcin_decode_init, .decode = idcin_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .defaults = idcin_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/iff.c b/libavcodec/iff.c index e95cf22150..95ce10b554 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -1911,16 +1911,16 @@ static int decode_frame(AVCodecContext *avctx, } #if CONFIG_IFF_ILBM_DECODER -const AVCodec ff_iff_ilbm_decoder = { - .name = "iff", - .long_name = NULL_IF_CONFIG_SMALL("IFF ACBM/ANIM/DEEP/ILBM/PBM/RGB8/RGBN"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IFF_ILBM, +const FFCodec ff_iff_ilbm_decoder = { + .p.name = "iff", + .p.long_name = NULL_IF_CONFIG_SMALL("IFF ACBM/ANIM/DEEP/ILBM/PBM/RGB8/RGBN"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IFF_ILBM, .priv_data_size = sizeof(IffContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/libavcodec/ilbcdec.c b/libavcodec/ilbcdec.c index 590e728257..19ecd14411 100644 --- a/libavcodec/ilbcdec.c +++ b/libavcodec/ilbcdec.c @@ -1479,14 +1479,14 @@ static av_cold int ilbc_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_ilbc_decoder = { - .name = "ilbc", - .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ILBC, +const FFCodec ff_ilbc_decoder = { + .p.name = "ilbc", + .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ILBC, .init = ilbc_decode_init, .decode = ilbc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(ILBCContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/imc.c b/libavcodec/imc.c index cf7b2206d1..f11d28d28c 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -1085,35 +1085,35 @@ static av_cold void flush(AVCodecContext *avctx) } #if CONFIG_IMC_DECODER -const AVCodec ff_imc_decoder = { - .name = "imc", - .long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_IMC, +const FFCodec ff_imc_decoder = { + .p.name = "imc", + .p.long_name = NULL_IF_CONFIG_SMALL("IMC (Intel Music Coder)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_IMC, .priv_data_size = sizeof(IMCContext), .init = imc_decode_init, .close = imc_decode_close, .decode = imc_decode_frame, .flush = flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_IAC_DECODER -const AVCodec ff_iac_decoder = { - .name = "iac", - .long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_IAC, +const FFCodec ff_iac_decoder = { + .p.name = "iac", + .p.long_name = NULL_IF_CONFIG_SMALL("IAC (Indeo Audio Coder)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_IAC, .priv_data_size = sizeof(IMCContext), .init = imc_decode_init, .close = imc_decode_close, .decode = imc_decode_frame, .flush = flush, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index 685966774a..40dc67f5d0 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -533,17 +533,17 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_imm4_decoder = { - .name = "imm4", - .long_name = NULL_IF_CONFIG_SMALL("Infinity IMM4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IMM4, +const FFCodec ff_imm4_decoder = { + .p.name = "imm4", + .p.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IMM4, .priv_data_size = sizeof(IMM4Context), .init = decode_init, .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/imm5.c b/libavcodec/imm5.c index 26ad2a4f21..eed3f89cc7 100644 --- a/libavcodec/imm5.c +++ b/libavcodec/imm5.c @@ -178,11 +178,11 @@ static av_cold int imm5_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_imm5_decoder = { - .name = "imm5", - .long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IMM5, +const FFCodec ff_imm5_decoder = { + .p.name = "imm5", + .p.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IMM5, .init = imm5_init, .decode = imm5_decode_frame, .close = imm5_close, diff --git a/libavcodec/imx.c b/libavcodec/imx.c index 5d8f40baf9..0f94c1ec57 100644 --- a/libavcodec/imx.c +++ b/libavcodec/imx.c @@ -180,17 +180,17 @@ static int imx_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_simbiosis_imx_decoder = { - .name = "simbiosis_imx", - .long_name = NULL_IF_CONFIG_SMALL("Simbiosis Interactive IMX Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SIMBIOSIS_IMX, +const FFCodec ff_simbiosis_imx_decoder = { + .p.name = "simbiosis_imx", + .p.long_name = NULL_IF_CONFIG_SMALL("Simbiosis Interactive IMX Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SIMBIOSIS_IMX, .priv_data_size = sizeof(SimbiosisIMXContext), .init = imx_decode_init, .decode = imx_decode_frame, .close = imx_decode_close, .flush = imx_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index e8b99a457c..aec118c84c 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -261,15 +261,15 @@ static av_cold int ir2_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_indeo2_decoder = { - .name = "indeo2", - .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_INDEO2, +const FFCodec ff_indeo2_decoder = { + .p.name = "indeo2", + .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_INDEO2, .priv_data_size = sizeof(Ir2Context), .init = ir2_decode_init, .close = ir2_decode_end, .decode = ir2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 1a84de2398..c697432cbe 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1134,15 +1134,15 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_indeo3_decoder = { - .name = "indeo3", - .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_INDEO3, +const FFCodec ff_indeo3_decoder = { + .p.name = "indeo3", + .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_INDEO3, .priv_data_size = sizeof(Indeo3DecodeContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 5b3d00631a..833be98514 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -703,15 +703,15 @@ static av_cold int decode_init(AVCodecContext *avctx) } -const AVCodec ff_indeo4_decoder = { - .name = "indeo4", - .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_INDEO4, +const FFCodec ff_indeo4_decoder = { + .p.name = "indeo4", + .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_INDEO4, .priv_data_size = sizeof(IVI45DecContext), .init = decode_init, .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index afa7cec8ed..9a77cb9fba 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -683,15 +683,15 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_indeo5_decoder = { - .name = "indeo5", - .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_INDEO5, +const FFCodec ff_indeo5_decoder = { + .p.name = "indeo5", + .p.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo Video Interactive 5"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_INDEO5, .priv_data_size = sizeof(IVI45DecContext), .init = decode_init, .close = ff_ivi_decode_close, .decode = ff_ivi_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index 6ec8ed38d6..ddac619b8f 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -129,19 +129,19 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) return 0; } -const AVCodec ff_h263i_decoder = { - .name = "h263i", - .long_name = NULL_IF_CONFIG_SMALL("Intel H.263"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263I, +const FFCodec ff_h263i_decoder = { + .p.name = "h263i", + .p.long_name = NULL_IF_CONFIG_SMALL("Intel H.263"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263I, .priv_data_size = sizeof(MpegEncContext), .init = ff_h263_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/internal.h b/libavcodec/internal.h index d16a87db2c..854c969395 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -113,7 +113,7 @@ typedef struct AVCodecInternal { EncodeSimpleContext es; /** - * If this is set, then AVCodec->close (if existing) needs to be called + * If this is set, then FFCodec->close (if existing) needs to be called * for the parent AVCodecContext. */ int needs_close; diff --git a/libavcodec/interplayacm.c b/libavcodec/interplayacm.c index 6ab77dcfd1..c6aab6c4c3 100644 --- a/libavcodec/interplayacm.c +++ b/libavcodec/interplayacm.c @@ -633,15 +633,15 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_interplay_acm_decoder = { - .name = "interplayacm", - .long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_INTERPLAY_ACM, +const FFCodec ff_interplay_acm_decoder = { + .p.name = "interplayacm", + .p.long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_INTERPLAY_ACM, .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(InterplayACMContext), }; diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index c4c22f7bc3..8b86d5513a 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1358,15 +1358,15 @@ static av_cold int ipvideo_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_interplay_video_decoder = { - .name = "interplayvideo", - .long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_INTERPLAY_VIDEO, +const FFCodec ff_interplay_video_decoder = { + .p.name = "interplayvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Interplay MVE video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_INTERPLAY_VIDEO, .priv_data_size = sizeof(IpvideoContext), .init = ipvideo_decode_init, .close = ipvideo_decode_end, .decode = ipvideo_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 2c06a5f66e..db7cdf1fcb 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -901,13 +901,13 @@ static const AVClass h263_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h263_encoder = { - .name = "h263", - .long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263, - .pix_fmts= (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, - .priv_class = &h263_class, +const FFCodec ff_h263_encoder = { + .p.name = "h263", + .p.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263, + .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, + .p.priv_class = &h263_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, @@ -936,14 +936,14 @@ static const AVClass h263p_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h263p_encoder = { - .name = "h263p", - .long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H263P, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &h263p_class, - .capabilities = AV_CODEC_CAP_SLICE_THREADS, +const FFCodec ff_h263p_encoder = { + .p.name = "h263p", + .p.long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H263P, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &h263p_class, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index b9f0a3c546..0658b056cb 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -1832,16 +1832,16 @@ static const AVClass j2k_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_jpeg2000_encoder = { - .name = "jpeg2000", - .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEG2000, +const FFCodec ff_jpeg2000_encoder = { + .p.name = "jpeg2000", + .p.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEG2000, .priv_data_size = sizeof(Jpeg2000EncoderContext), .init = j2kenc_init, .encode2 = encode_frame, .close = j2kenc_destroy, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, @@ -1849,6 +1849,6 @@ const AVCodec ff_jpeg2000_encoder = { AV_PIX_FMT_RGB48, AV_PIX_FMT_GRAY16, AV_PIX_FMT_NONE }, - .priv_class = &j2k_class, + .p.priv_class = &j2k_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c index dfb9866665..17a837ae70 100644 --- a/libavcodec/jacosubdec.c +++ b/libavcodec/jacosubdec.c @@ -194,11 +194,11 @@ end: return avpkt->size; } -const AVCodec ff_jacosub_decoder = { - .name = "jacosub", - .long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_JACOSUB, +const FFCodec ff_jacosub_decoder = { + .p.name = "jacosub", + .p.long_name = NULL_IF_CONFIG_SMALL("JACOsub subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_JACOSUB, .init = ff_ass_subtitle_header_default, .decode = jacosub_decode_frame, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index db994a710c..67638e589f 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -2571,17 +2571,17 @@ static const AVClass jpeg2000_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_jpeg2000_decoder = { - .name = "jpeg2000", - .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEG2000, - .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_DR1, +const FFCodec ff_jpeg2000_decoder = { + .p.name = "jpeg2000", + .p.long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEG2000, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_DR1, .priv_data_size = sizeof(Jpeg2000DecoderContext), .init = jpeg2000_decode_init, .decode = jpeg2000_decode_frame, - .priv_class = &jpeg2000_class, - .max_lowres = 5, - .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles), + .p.priv_class = &jpeg2000_class, + .p.max_lowres = 5, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 4213c32905..c3d0a1c9a7 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -552,16 +552,16 @@ end: return ret; } -const AVCodec ff_jpegls_decoder = { - .name = "jpegls", - .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEGLS, +const FFCodec ff_jpegls_decoder = { + .p.name = "jpegls", + .p.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEGLS, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, }; diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index 7c702da172..42c2d6b038 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -474,18 +474,18 @@ static const AVClass jpegls_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_jpegls_encoder = { - .name = "jpegls", - .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEGLS, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, +const FFCodec ff_jpegls_encoder = { + .p.name = "jpegls", + .p.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEGLS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(JPEGLSContext), - .priv_class = &jpegls_class, + .p.priv_class = &jpegls_class, .init = encode_jpegls_init, .encode2 = encode_picture_ls, .close = encode_jpegls_close, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_NONE diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index c0f810f4fd..5849f4d1fd 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -234,15 +234,15 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_jv_decoder = { - .name = "jv", - .long_name = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JV, +const FFCodec ff_jv_decoder = { + .p.name = "jv", + .p.long_name = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JV, .priv_data_size = sizeof(JvContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index 9efb9f6fed..8378dd20ff 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -177,16 +177,16 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_kgv1_decoder = { - .name = "kgv1", - .long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_KGV1, +const FFCodec ff_kgv1_decoder = { + .p.name = "kgv1", + .p.long_name = NULL_IF_CONFIG_SMALL("Kega Game Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_KGV1, .priv_data_size = sizeof(KgvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 0db316ccd6..c9b54c3514 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -405,14 +405,14 @@ static av_cold int decode_init(AVCodecContext * avctx) return 0; } -const AVCodec ff_kmvc_decoder = { - .name = "kmvc", - .long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_KMVC, +const FFCodec ff_kmvc_decoder = { + .p.name = "kmvc", + .p.long_name = NULL_IF_CONFIG_SMALL("Karl Morton's video codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_KMVC, .priv_data_size = sizeof(KmvcContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 1eab4cc8e3..39fbfab94f 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -726,14 +726,14 @@ static av_cold int lag_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_lagarith_decoder = { - .name = "lagarith", - .long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_LAGARITH, +const FFCodec ff_lagarith_decoder = { + .p.name = "lagarith", + .p.long_name = NULL_IF_CONFIG_SMALL("Lagarith lossless"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_LAGARITH, .priv_data_size = sizeof(LagarithContext), .init = lag_decode_init, .decode = lag_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index 1ecf6f1c98..254ed503ab 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -630,31 +630,31 @@ static av_cold int decode_end(AVCodecContext *avctx) } #if CONFIG_MSZH_DECODER -const AVCodec ff_mszh_decoder = { - .name = "mszh", - .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSZH, +const FFCodec ff_mszh_decoder = { + .p.name = "mszh", + .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) MSZH"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSZH, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(LclDecContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_ZLIB_DECODER -const AVCodec ff_zlib_decoder = { - .name = "zlib", - .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ZLIB, +const FFCodec ff_zlib_decoder = { + .p.name = "zlib", + .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ZLIB, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(LclDecContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index 39061c7d01..4389dcebf3 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -151,17 +151,17 @@ static av_cold int encode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_zlib_encoder = { - .name = "zlib", - .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ZLIB, +const FFCodec ff_zlib_encoder = { + .p.name = "zlib", + .p.long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ZLIB, .priv_data_size = sizeof(LclEncContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index 4bc64b8f7f..7bcade4628 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -249,17 +249,17 @@ static av_cold int av1_init(AVCodecContext *avctx) return aom_init(avctx, aom_codec_av1_dx()); } -const AVCodec ff_libaom_av1_decoder = { - .name = "libaom-av1", - .long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, +const FFCodec ff_libaom_av1_decoder = { + .p.name = "libaom-av1", + .p.long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(AV1DecodeContext), .init = av1_init, .close = aom_free, .decode = aom_decode, - .capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), - .wrapper_name = "libaom", + .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), + .p.wrapper_name = "libaom", }; diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index d62653135c..b880b3a1ae 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -1229,19 +1229,19 @@ static const enum AVPixelFormat av1_pix_fmts_highbd_with_gray[] = { AV_PIX_FMT_NONE }; -static av_cold void av1_init_static(AVCodec *codec) +static av_cold void av1_init_static(FFCodec *codec) { int supports_monochrome = aom_codec_version() >= 20001; aom_codec_caps_t codec_caps = aom_codec_get_caps(aom_codec_av1_cx()); if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) - codec->pix_fmts = supports_monochrome ? av1_pix_fmts_highbd_with_gray : - av1_pix_fmts_highbd; + codec->p.pix_fmts = supports_monochrome ? av1_pix_fmts_highbd_with_gray : + av1_pix_fmts_highbd; else - codec->pix_fmts = supports_monochrome ? av1_pix_fmts_with_gray : - av1_pix_fmts; + codec->p.pix_fmts = supports_monochrome ? av1_pix_fmts_with_gray : + av1_pix_fmts; if (aom_codec_version_major() < 2) - codec->capabilities |= AV_CODEC_CAP_EXPERIMENTAL; + codec->p.capabilities |= AV_CODEC_CAP_EXPERIMENTAL; } static av_cold int av1_init(AVCodecContext *avctx) @@ -1341,21 +1341,21 @@ static const AVClass class_aom = { .version = LIBAVUTIL_VERSION_INT, }; -AVCodec ff_libaom_av1_encoder = { - .name = "libaom-av1", - .long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +FFCodec ff_libaom_av1_encoder = { + .p.name = "libaom-av1", + .p.long_name = NULL_IF_CONFIG_SMALL("libaom AV1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), + .p.priv_class = &class_aom, + .p.wrapper_name = "libaom", .priv_data_size = sizeof(AOMContext), .init = av1_init, .encode2 = aom_encode, .close = aom_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles), - .priv_class = &class_aom, .defaults = defaults, .init_static_data = av1_init_static, - .wrapper_name = "libaom", }; diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index 0766c0079d..1b565b2fc9 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "libavcodec/ass.h" +#include "codec_internal.h" #include "libavutil/log.h" #include "libavutil/opt.h" @@ -380,16 +381,16 @@ static const AVClass aribb24_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libaribb24_decoder = { - .name = "libaribb24", - .long_name = NULL_IF_CONFIG_SMALL("libaribb24 ARIB STD-B24 caption decoder"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_ARIB_CAPTION, +const FFCodec ff_libaribb24_decoder = { + .p.name = "libaribb24", + .p.long_name = NULL_IF_CONFIG_SMALL("libaribb24 ARIB STD-B24 caption decoder"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_ARIB_CAPTION, + .p.priv_class = &aribb24_class, + .p.wrapper_name = "libaribb24", .priv_data_size = sizeof(Libaribb24Context), .init = libaribb24_init, .close = libaribb24_close, .decode = libaribb24_decode, .flush = libaribb24_flush, - .priv_class= &aribb24_class, - .wrapper_name = "libaribb24", }; diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c index 6ee6e29443..bae6e680d3 100644 --- a/libavcodec/libcelt_dec.c +++ b/libavcodec/libcelt_dec.c @@ -22,6 +22,7 @@ #include #include #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "libavutil/intreadwrite.h" @@ -127,15 +128,15 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data, return pkt->size; } -const AVCodec ff_libcelt_decoder = { - .name = "libcelt", - .long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_CELT, +const FFCodec ff_libcelt_decoder = { + .p.name = "libcelt", + .p.long_name = NULL_IF_CONFIG_SMALL("Xiph CELT decoder using libcelt"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_CELT, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.wrapper_name = "libcelt", .priv_data_size = sizeof(struct libcelt_context), .init = libcelt_dec_init, .close = libcelt_dec_close, .decode = libcelt_dec_decode, - .capabilities = AV_CODEC_CAP_DR1, - .wrapper_name = "libcelt", }; diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index a2efb813c6..f59cb31bf2 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -23,6 +23,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "libavutil/opt.h" +#include "codec_internal.h" #include "encode.h" #include "internal.h" #include "codec2utils.h" @@ -176,39 +177,39 @@ static int libcodec2_encode(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_libcodec2_decoder = { - .name = "libcodec2", - .long_name = NULL_IF_CONFIG_SMALL("codec2 decoder using libcodec2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_CODEC2, +const FFCodec ff_libcodec2_decoder = { + .p.name = "libcodec2", + .p.long_name = NULL_IF_CONFIG_SMALL("codec2 decoder using libcodec2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_CODEC2, + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF, + .p.supported_samplerates = (const int[]){ 8000, 0 }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_decoder, .close = libcodec2_close, .decode = libcodec2_decode, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF, - .supported_samplerates = (const int[]){ 8000, 0 }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, }; -const AVCodec ff_libcodec2_encoder = { - .name = "libcodec2", - .long_name = NULL_IF_CONFIG_SMALL("codec2 encoder using libcodec2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_CODEC2, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_libcodec2_encoder = { + .p.name = "libcodec2", + .p.long_name = NULL_IF_CONFIG_SMALL("codec2 encoder using libcodec2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_CODEC2, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.supported_samplerates = (const int[]){ 8000, 0 }, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.priv_class = &libcodec2_enc_class, .priv_data_size = sizeof(LibCodec2Context), .init = libcodec2_init_encoder, .close = libcodec2_close, .encode2 = libcodec2_encode, - .supported_samplerates = (const int[]){ 8000, 0 }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .priv_class = &libcodec2_enc_class, }; diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 960c129606..fb3ccf169e 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -573,19 +573,19 @@ static const AVClass libdav1d_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libdav1d_decoder = { - .name = "libdav1d", - .long_name = NULL_IF_CONFIG_SMALL("dav1d AV1 decoder by VideoLAN"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, +const FFCodec ff_libdav1d_decoder = { + .p.name = "libdav1d", + .p.long_name = NULL_IF_CONFIG_SMALL("dav1d AV1 decoder by VideoLAN"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, .priv_data_size = sizeof(Libdav1dContext), .init = libdav1d_init, .close = libdav1d_close, .flush = libdav1d_flush, .receive_frame = libdav1d_receive_frame, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_AUTO_THREADS, - .priv_class = &libdav1d_class, - .wrapper_name = "libdav1d", + .p.priv_class = &libdav1d_class, + .p.wrapper_name = "libdav1d", }; diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index a5424829a1..caf030b877 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -213,19 +213,19 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data, return ret == 0 ? buf_size : ret; } -const AVCodec ff_libdavs2_decoder = { - .name = "libdavs2", - .long_name = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVS2, +const FFCodec ff_libdavs2_decoder = { + .p.name = "libdavs2", + .p.long_name = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVS2, .priv_data_size = sizeof(DAVS2Context), .init = davs2_init, .close = davs2_end, .decode = davs2_decode_frame, .flush = davs2_flush, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .wrapper_name = "libdavs2", + .p.wrapper_name = "libdavs2", }; diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index 00d7bdead1..e9096a08e6 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -477,23 +477,23 @@ static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx) av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n"); } -const AVCodec ff_libfdk_aac_decoder = { - .name = "libfdk_aac", - .long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC, +const FFCodec ff_libfdk_aac_decoder = { + .p.name = "libfdk_aac", + .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(FDKAACDecContext), .init = fdk_aac_decode_init, .decode = fdk_aac_decode_frame, .close = fdk_aac_decode_close, .flush = fdk_aac_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF #if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 | AV_CODEC_CAP_DELAY #endif , - .priv_class = &fdk_aac_dec_class, + .p.priv_class = &fdk_aac_dec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "libfdk", + .p.wrapper_name = "libfdk", }; diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index 40161d5738..079bfc495c 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -475,25 +475,25 @@ static const int aac_sample_rates[] = { 24000, 22050, 16000, 12000, 11025, 8000, 0 }; -const AVCodec ff_libfdk_aac_encoder = { - .name = "libfdk_aac", - .long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AAC, +const FFCodec ff_libfdk_aac_encoder = { + .p.name = "libfdk_aac", + .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, .priv_data_size = sizeof(AACContext), .init = aac_encode_init, .encode2 = aac_encode_frame, .close = aac_encode_close, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &aac_enc_class, + .p.priv_class = &aac_enc_class, .defaults = aac_encode_defaults, - .profiles = profiles, - .supported_samplerates = aac_sample_rates, - .wrapper_name = "libfdk", + .p.profiles = profiles, + .p.supported_samplerates = aac_sample_rates, + .p.wrapper_name = "libfdk", #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = aac_channel_layout, + .p.channel_layouts = aac_channel_layout, #endif - .ch_layouts = aac_ch_layouts, + .p.ch_layouts = aac_ch_layouts, }; diff --git a/libavcodec/libgsmdec.c b/libavcodec/libgsmdec.c index fb9375075f..07fae624ff 100644 --- a/libavcodec/libgsmdec.c +++ b/libavcodec/libgsmdec.c @@ -39,6 +39,7 @@ #include "libavutil/common.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "gsm.h" @@ -125,32 +126,32 @@ static void libgsm_flush(AVCodecContext *avctx) { } #if CONFIG_LIBGSM_DECODER -const AVCodec ff_libgsm_decoder = { - .name = "libgsm", - .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM, +const FFCodec ff_libgsm_decoder = { + .p.name = "libgsm", + .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.wrapper_name = "libgsm", .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, .decode = libgsm_decode_frame, .flush = libgsm_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .wrapper_name = "libgsm", }; #endif #if CONFIG_LIBGSM_MS_DECODER -const AVCodec ff_libgsm_ms_decoder = { - .name = "libgsm_ms", - .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM_MS, +const FFCodec ff_libgsm_ms_decoder = { + .p.name = "libgsm_ms", + .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM_MS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.wrapper_name = "libgsm", .priv_data_size = sizeof(LibGSMDecodeContext), .init = libgsm_decode_init, .close = libgsm_decode_close, .decode = libgsm_decode_frame, .flush = libgsm_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .wrapper_name = "libgsm", }; #endif diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index 90aaecc2f8..d172bae11e 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -117,42 +117,42 @@ static const AVCodecDefault libgsm_defaults[] = { }; #if CONFIG_LIBGSM_ENCODER -const AVCodec ff_libgsm_encoder = { - .name = "libgsm", - .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_libgsm_encoder = { + .p.name = "libgsm", + .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM, + .p.capabilities = AV_CODEC_CAP_DR1, .init = libgsm_encode_init, .encode2 = libgsm_encode_frame, .close = libgsm_encode_close, .defaults = libgsm_defaults, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts= (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .wrapper_name = "libgsm", + .p.wrapper_name = "libgsm", }; #endif #if CONFIG_LIBGSM_MS_ENCODER -const AVCodec ff_libgsm_ms_encoder = { - .name = "libgsm_ms", - .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_GSM_MS, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_libgsm_ms_encoder = { + .p.name = "libgsm_ms", + .p.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_GSM_MS, + .p.capabilities = AV_CODEC_CAP_DR1, .init = libgsm_encode_init, .encode2 = libgsm_encode_frame, .close = libgsm_encode_close, .defaults = libgsm_defaults, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts= (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .wrapper_name = "libgsm", + .p.wrapper_name = "libgsm", }; #endif diff --git a/libavcodec/libilbc.c b/libavcodec/libilbc.c index 9c2edb9a3e..4ac40029a0 100644 --- a/libavcodec/libilbc.c +++ b/libavcodec/libilbc.c @@ -118,16 +118,16 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data, return s->decoder.no_of_bytes; } -const AVCodec ff_libilbc_decoder = { - .name = "libilbc", - .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ILBC, +const FFCodec ff_libilbc_decoder = { + .p.name = "libilbc", + .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ILBC, .priv_data_size = sizeof(ILBCDecContext), .init = ilbc_decode_init, .decode = ilbc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .priv_class = &ilbc_dec_class, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.priv_class = &ilbc_dec_class, }; typedef struct ILBCEncContext { @@ -200,17 +200,17 @@ static const AVCodecDefault ilbc_encode_defaults[] = { { NULL } }; -const AVCodec ff_libilbc_encoder = { - .name = "libilbc", - .long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ILBC, +const FFCodec ff_libilbc_encoder = { + .p.name = "libilbc", + .p.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ILBC, .priv_data_size = sizeof(ILBCEncContext), .init = ilbc_encode_init, .encode2 = ilbc_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .defaults = ilbc_encode_defaults, - .priv_class = &ilbc_enc_class, - .wrapper_name = "libbilbc", + .p.priv_class = &ilbc_enc_class, + .p.wrapper_name = "libbilbc", }; diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c index aa54d70841..147aae0407 100644 --- a/libavcodec/libkvazaar.c +++ b/libavcodec/libkvazaar.c @@ -318,16 +318,16 @@ static const AVCodecDefault defaults[] = { { NULL }, }; -const AVCodec ff_libkvazaar_encoder = { - .name = "libkvazaar", - .long_name = NULL_IF_CONFIG_SMALL("libkvazaar H.265 / HEVC"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libkvazaar_encoder = { + .p.name = "libkvazaar", + .p.long_name = NULL_IF_CONFIG_SMALL("libkvazaar H.265 / HEVC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, - .pix_fmts = pix_fmts, + .p.pix_fmts = pix_fmts, - .priv_class = &class, + .p.priv_class = &class, .priv_data_size = sizeof(LibkvazaarContext), .defaults = defaults, @@ -338,5 +338,5 @@ const AVCodec ff_libkvazaar_encoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, - .wrapper_name = "libkvazaar", + .p.wrapper_name = "libkvazaar", }; diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 4e3fb81a81..d69005a58a 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -328,32 +328,32 @@ static const int libmp3lame_sample_rates[] = { 44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000, 0 }; -const AVCodec ff_libmp3lame_encoder = { - .name = "libmp3lame", - .long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libmp3lame_encoder = { + .p.name = "libmp3lame", + .p.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(LAMEContext), .init = mp3lame_encode_init, .encode2 = mp3lame_encode_frame, .close = mp3lame_encode_close, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = libmp3lame_sample_rates, + .p.supported_samplerates = libmp3lame_sample_rates, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, }, - .priv_class = &libmp3lame_class, + .p.priv_class = &libmp3lame_class, .defaults = libmp3lame_defaults, - .wrapper_name = "libmp3lame", + .p.wrapper_name = "libmp3lame", }; diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 8b94b854d5..82e0bd708e 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -29,6 +29,7 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "audio_frame_queue.h" +#include "codec_internal.h" #include "encode.h" #include "internal.h" @@ -133,16 +134,16 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, return packet_size; } -const AVCodec ff_libopencore_amrnb_decoder = { - .name = "libopencore_amrnb", - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_NB, +const FFCodec ff_libopencore_amrnb_decoder = { + .p.name = "libopencore_amrnb", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRContext), .init = amr_nb_decode_init, .close = amr_nb_decode_close, .decode = amr_nb_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, }; #endif /* CONFIG_LIBOPENCORE_AMRNB_DECODER */ @@ -288,19 +289,19 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_libopencore_amrnb_encoder = { - .name = "libopencore_amrnb", - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_NB, +const FFCodec ff_libopencore_amrnb_encoder = { + .p.name = "libopencore_amrnb", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRContext), .init = amr_nb_encode_init, .encode2 = amr_nb_encode_frame, .close = amr_nb_encode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &amrnb_class, + .p.priv_class = &amrnb_class, }; #endif /* CONFIG_LIBOPENCORE_AMRNB_ENCODER */ @@ -373,17 +374,17 @@ static int amr_wb_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_libopencore_amrwb_decoder = { - .name = "libopencore_amrwb", - .long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_WB, +const FFCodec ff_libopencore_amrwb_decoder = { + .p.name = "libopencore_amrwb", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_WB, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.wrapper_name = "libopencore_amrwb", .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_decode_init, .close = amr_wb_decode_close, .decode = amr_wb_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .wrapper_name = "libopencore_amrwb", }; #endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */ diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c index 78528b9c0b..2cef2fbd47 100644 --- a/libavcodec/libopenh264dec.c +++ b/libavcodec/libopenh264dec.c @@ -157,18 +157,18 @@ static int svc_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_libopenh264_decoder = { - .name = "libopenh264", - .long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_libopenh264_decoder = { + .p.name = "libopenh264", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(SVCContext), .init = svc_decode_init, .decode = svc_decode_frame, .close = svc_decode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .bsfs = "h264_mp4toannexb", - .wrapper_name = "libopenh264", + .p.wrapper_name = "libopenh264", }; diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index ceb4c49cb7..95da01601b 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -451,21 +451,21 @@ static const AVCodecDefault svc_enc_defaults[] = { { NULL }, }; -const AVCodec ff_libopenh264_encoder = { - .name = "libopenh264", - .long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS, +const FFCodec ff_libopenh264_encoder = { + .p.name = "libopenh264", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(SVCContext), .init = svc_encode_init, .encode2 = svc_encode_frame, .close = svc_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .defaults = svc_enc_defaults, - .priv_class = &class, - .wrapper_name = "libopenh264", + .p.priv_class = &class, + .p.wrapper_name = "libopenh264", }; diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index c9496d886e..451dc7f65f 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -31,6 +31,7 @@ #include "libavutil/pixfmt.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "thread.h" @@ -501,16 +502,16 @@ static const AVClass openjpeg_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libopenjpeg_decoder = { - .name = "libopenjpeg", - .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEG2000, +const FFCodec ff_libopenjpeg_decoder = { + .p.name = "libopenjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEG2000, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.max_lowres = 31, + .p.priv_class = &openjpeg_class, + .p.wrapper_name = "libopenjpeg", .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_decode_init, .decode = libopenjpeg_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .max_lowres = 31, - .priv_class = &openjpeg_class, - .wrapper_name = "libopenjpeg", }; diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 08b7b6a152..a07fde9a09 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -29,8 +29,8 @@ #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" -#include "internal.h" #include typedef struct LibOpenJPEGContext { @@ -754,16 +754,16 @@ static const AVClass openjpeg_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libopenjpeg_encoder = { - .name = "libopenjpeg", - .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_JPEG2000, +const FFCodec ff_libopenjpeg_encoder = { + .p.name = "libopenjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_JPEG2000, .priv_data_size = sizeof(LibOpenJPEGContext), .init = libopenjpeg_encode_init, .encode2 = libopenjpeg_encode_frame, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBR24P, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, @@ -783,6 +783,6 @@ const AVCodec ff_libopenjpeg_encoder = { AV_PIX_FMT_XYZ12, AV_PIX_FMT_NONE }, - .priv_class = &openjpeg_class, - .wrapper_name = "libopenjpeg", + .p.priv_class = &openjpeg_class, + .p.wrapper_name = "libopenjpeg", }; diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index 2493776ea8..2271eed917 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -231,21 +231,21 @@ static const AVClass libopusdec_class = { }; -const AVCodec ff_libopus_decoder = { - .name = "libopus", - .long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_OPUS, +const FFCodec ff_libopus_decoder = { + .p.name = "libopus", + .p.long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(struct libopus_context), .init = libopus_decode_init, .close = libopus_decode_close, .decode = libopus_decode, .flush = libopus_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &libopusdec_class, - .wrapper_name = "libopus", + .p.priv_class = &libopusdec_class, + .p.wrapper_name = "libopus", }; diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 47fd658ac8..4a5ccbfaa5 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -583,21 +583,21 @@ static const int libopus_sample_rates[] = { 48000, 24000, 16000, 12000, 8000, 0, }; -const AVCodec ff_libopus_encoder = { - .name = "libopus", - .long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_OPUS, +const FFCodec ff_libopus_encoder = { + .p.name = "libopus", + .p.long_name = NULL_IF_CONFIG_SMALL("libopus Opus"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(LibopusEncContext), .init = libopus_encode_init, .encode2 = libopus_encode, .close = libopus_encode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = libopus_sample_rates, - .priv_class = &libopus_class, + .p.supported_samplerates = libopus_sample_rates, + .p.priv_class = &libopus_class, .defaults = libopus_defaults, - .wrapper_name = "libopus", + .p.wrapper_name = "libopus", }; diff --git a/libavcodec/librav1e.c b/libavcodec/librav1e.c index 3b0b12debf..ca11b4f8fc 100644 --- a/libavcodec/librav1e.c +++ b/libavcodec/librav1e.c @@ -614,20 +614,20 @@ static const AVClass class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_librav1e_encoder = { - .name = "librav1e", - .long_name = NULL_IF_CONFIG_SMALL("librav1e AV1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, +const FFCodec ff_librav1e_encoder = { + .p.name = "librav1e", + .p.long_name = NULL_IF_CONFIG_SMALL("librav1e AV1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, .init = librav1e_encode_init, .receive_packet = librav1e_receive_packet, .close = librav1e_encode_close, .priv_data_size = sizeof(librav1eContext), - .priv_class = &class, + .p.priv_class = &class, .defaults = librav1e_defaults, - .pix_fmts = librav1e_pix_fmts, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | + .p.pix_fmts = librav1e_pix_fmts, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, - .wrapper_name = "librav1e", + .p.wrapper_name = "librav1e", }; diff --git a/libavcodec/librsvgdec.c b/libavcodec/librsvgdec.c index 2895bbf28b..4a3b0c8ce7 100644 --- a/libavcodec/librsvgdec.c +++ b/libavcodec/librsvgdec.c @@ -20,6 +20,7 @@ */ #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "libavutil/opt.h" #include "librsvg-2.0/librsvg/rsvg.h" @@ -117,14 +118,14 @@ static const AVClass librsvg_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_librsvg_decoder = { - .name = "librsvg", - .long_name = NULL_IF_CONFIG_SMALL("Librsvg rasterizer"), - .priv_class = &librsvg_decoder_class, - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SVG, +const FFCodec ff_librsvg_decoder = { + .p.name = "librsvg", + .p.long_name = NULL_IF_CONFIG_SMALL("Librsvg rasterizer"), + .p.priv_class = &librsvg_decoder_class, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SVG, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.wrapper_name = "librsvg", .decode = librsvg_decode_frame, .priv_data_size = sizeof(LibRSVGContext), - .capabilities = AV_CODEC_CAP_DR1, - .wrapper_name = "librsvg", }; diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 1352a3a165..2274c1aa32 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -25,8 +25,8 @@ #include "libavutil/intreadwrite.h" #include "audio_frame_queue.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" -#include "internal.h" #include "mpegaudio.h" #include "mpegaudiodecheader.h" @@ -131,27 +131,27 @@ static const int libshine_sample_rates[] = { 44100, 48000, 32000, 0 }; -const AVCodec ff_libshine_encoder = { - .name = "libshine", - .long_name = NULL_IF_CONFIG_SMALL("libshine MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_libshine_encoder = { + .p.name = "libshine", + .p.long_name = NULL_IF_CONFIG_SMALL("libshine MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(SHINEContext), .init = libshine_encode_init, .encode2 = libshine_encode_frame, .close = libshine_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = libshine_sample_rates, + .p.supported_samplerates = libshine_sample_rates, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, }, - .wrapper_name = "libshine", + .p.wrapper_name = "libshine", }; diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 8029786b1f..bb7ccea647 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -26,6 +26,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" typedef struct LibSpeexContext { @@ -190,16 +191,16 @@ static av_cold void libspeex_decode_flush(AVCodecContext *avctx) speex_bits_reset(&s->bits); } -const AVCodec ff_libspeex_decoder = { - .name = "libspeex", - .long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SPEEX, +const FFCodec ff_libspeex_decoder = { + .p.name = "libspeex", + .p.long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SPEEX, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.wrapper_name = "libspeex", .priv_data_size = sizeof(LibSpeexContext), .init = libspeex_decode_init, .close = libspeex_decode_close, .decode = libspeex_decode_frame, .flush = libspeex_decode_flush, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .wrapper_name = "libspeex", }; diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index eef2485001..c811548a8b 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -348,29 +348,29 @@ static const AVCodecDefault defaults[] = { { NULL }, }; -const AVCodec ff_libspeex_encoder = { - .name = "libspeex", - .long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SPEEX, +const FFCodec ff_libspeex_encoder = { + .p.name = "libspeex", + .p.long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SPEEX, .priv_data_size = sizeof(LibSpeexEncContext), .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .capabilities = AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.capabilities = AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, }, - .supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 }, - .priv_class = &speex_class, + .p.supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 }, + .p.priv_class = &speex_class, .defaults = defaults, - .wrapper_name = "libspeex", + .p.wrapper_name = "libspeex", }; diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 16fdba149a..23c410d43e 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -597,21 +597,21 @@ static const AVCodecDefault eb_enc_defaults[] = { { NULL }, }; -const AVCodec ff_libsvtav1_encoder = { - .name = "libsvtav1", - .long_name = NULL_IF_CONFIG_SMALL("SVT-AV1(Scalable Video Technology for AV1) encoder"), +const FFCodec ff_libsvtav1_encoder = { + .p.name = "libsvtav1", + .p.long_name = NULL_IF_CONFIG_SMALL("SVT-AV1(Scalable Video Technology for AV1) encoder"), .priv_data_size = sizeof(SvtContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AV1, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AV1, .init = eb_enc_init, .receive_packet = eb_receive_packet, .close = eb_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = eb_enc_defaults, - .wrapper_name = "libsvtav1", + .p.wrapper_name = "libsvtav1", }; diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index a74fab9eff..af07575482 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -37,8 +37,8 @@ #include "libavutil/log.h" #include "libavutil/base64.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" -#include "internal.h" /* libtheora includes */ #include @@ -367,19 +367,19 @@ static av_cold int encode_close(AVCodecContext* avc_context) } /** AVCodec struct exposed to libavcodec */ -const AVCodec ff_libtheora_encoder = { - .name = "libtheora", - .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_THEORA, - .capabilities = AV_CODEC_CAP_DR1 | +const FFCodec ff_libtheora_encoder = { + .p.name = "libtheora", + .p.long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_THEORA, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY /* for statsfile summary */, .priv_data_size = sizeof(TheoraContext), .init = encode_init, .close = encode_close, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, - .wrapper_name = "libtheora", + .p.wrapper_name = "libtheora", }; diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c index cb803de1f3..4a914b3bea 100644 --- a/libavcodec/libtwolame.c +++ b/libavcodec/libtwolame.c @@ -209,19 +209,19 @@ static const int twolame_samplerates[] = { 16000, 22050, 24000, 32000, 44100, 48000, 0 }; -const AVCodec ff_libtwolame_encoder = { - .name = "libtwolame", - .long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP2, +const FFCodec ff_libtwolame_encoder = { + .p.name = "libtwolame", + .p.long_name = NULL_IF_CONFIG_SMALL("libtwolame MP2 (MPEG audio layer 2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(TWOLAMEContext), .init = twolame_encode_init, .encode2 = twolame_encode_frame, .close = twolame_encode_close, - .capabilities = AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DELAY, .defaults = twolame_defaults, - .priv_class = &twolame_class, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.priv_class = &twolame_class, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16, @@ -229,16 +229,16 @@ const AVCodec ff_libtwolame_encoder = { AV_SAMPLE_FMT_NONE }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, }, - .supported_samplerates = twolame_samplerates, - .wrapper_name = "libtwolame", + .p.supported_samplerates = twolame_samplerates, + .p.wrapper_name = "libtwolame", }; diff --git a/libavcodec/libuavs3d.c b/libavcodec/libuavs3d.c index ecfbd3cd17..a228082f59 100644 --- a/libavcodec/libuavs3d.c +++ b/libavcodec/libuavs3d.c @@ -247,20 +247,20 @@ static int libuavs3d_decode_frame(AVCodecContext *avctx, void *data, int *got_fr return buf_ptr - buf; } -const AVCodec ff_libuavs3d_decoder = { - .name = "libuavs3d", - .long_name = NULL_IF_CONFIG_SMALL("libuavs3d AVS3-P2/IEEE1857.10"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVS3, +const FFCodec ff_libuavs3d_decoder = { + .p.name = "libuavs3d", + .p.long_name = NULL_IF_CONFIG_SMALL("libuavs3d AVS3-P2/IEEE1857.10"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVS3, .priv_data_size = sizeof(uavs3d_context), .init = libuavs3d_init, .close = libuavs3d_end, .decode = libuavs3d_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .flush = libuavs3d_flush, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_NONE }, - .wrapper_name = "libuavs3d", + .p.wrapper_name = "libuavs3d", }; diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c index 4beede0863..a52edbfaac 100644 --- a/libavcodec/libvo-amrwbenc.c +++ b/libavcodec/libvo-amrwbenc.c @@ -27,6 +27,7 @@ #include "libavutil/internal.h" #include "libavutil/opt.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" #include "internal.h" @@ -139,18 +140,18 @@ static int amr_wb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_libvo_amrwbenc_encoder = { - .name = "libvo_amrwbenc", - .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB " +const FFCodec ff_libvo_amrwbenc_encoder = { + .p.name = "libvo_amrwbenc", + .p.long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB " "(Adaptive Multi-Rate Wide-Band)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_AMR_WB, + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AMR_WB, + .p.priv_class = &amrwb_class, + .p.wrapper_name = "libvo_amrwbenc", .priv_data_size = sizeof(AMRWBContext), .init = amr_wb_encode_init, .encode2 = amr_wb_encode_frame, .close = amr_wb_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .priv_class = &amrwb_class, - .wrapper_name = "libvo_amrwbenc", }; diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c index 7317b71ed6..7d2fdcf785 100644 --- a/libavcodec/libvorbisdec.c +++ b/libavcodec/libvorbisdec.c @@ -22,6 +22,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" typedef struct OggVorbisDecContext { @@ -210,14 +211,14 @@ static int oggvorbis_decode_close(AVCodecContext *avccontext) { } -const AVCodec ff_libvorbis_decoder = { - .name = "libvorbis", - .long_name = NULL_IF_CONFIG_SMALL("libvorbis"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_VORBIS, +const FFCodec ff_libvorbis_decoder = { + .p.name = "libvorbis", + .p.long_name = NULL_IF_CONFIG_SMALL("libvorbis"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_VORBIS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(OggVorbisDecContext), .init = oggvorbis_decode_init, .decode = oggvorbis_decode_frame, .close = oggvorbis_decode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, }; diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index 1162909550..16615be3fa 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -375,20 +375,20 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_libvorbis_encoder = { - .name = "libvorbis", - .long_name = NULL_IF_CONFIG_SMALL("libvorbis"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_VORBIS, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libvorbis_encoder = { + .p.name = "libvorbis", + .p.long_name = NULL_IF_CONFIG_SMALL("libvorbis"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_VORBIS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(LibvorbisEncContext), .init = libvorbis_encode_init, .encode2 = libvorbis_encode_frame, .close = libvorbis_encode_close, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, - .priv_class = &vorbis_class, + .p.priv_class = &vorbis_class, .defaults = defaults, - .wrapper_name = "libvorbis", + .p.wrapper_name = "libvorbis", }; diff --git a/libavcodec/libvpx.c b/libavcodec/libvpx.c index c2b00232d2..8601f82bd2 100644 --- a/libavcodec/libvpx.c +++ b/libavcodec/libvpx.c @@ -66,16 +66,16 @@ static const enum AVPixelFormat vp9_pix_fmts_highbd[] = { }; #endif -av_cold void ff_vp9_init_static(AVCodec *codec) +av_cold void ff_vp9_init_static(FFCodec *codec) { - codec->pix_fmts = vp9_pix_fmts_def; + codec->p.pix_fmts = vp9_pix_fmts_def; #if CONFIG_LIBVPX_VP9_ENCODER { vpx_codec_caps_t codec_caps = vpx_codec_get_caps(vpx_codec_vp9_cx()); if (codec_caps & VPX_CODEC_CAP_HIGHBITDEPTH) - codec->pix_fmts = vp9_pix_fmts_highbd; + codec->p.pix_fmts = vp9_pix_fmts_highbd; else - codec->pix_fmts = vp9_pix_fmts_highcol; + codec->p.pix_fmts = vp9_pix_fmts_highcol; } #endif } diff --git a/libavcodec/libvpx.h b/libavcodec/libvpx.h index 22b697fa01..0caed8cdcb 100644 --- a/libavcodec/libvpx.h +++ b/libavcodec/libvpx.h @@ -23,9 +23,9 @@ #include -#include "avcodec.h" +#include "codec_internal.h" -void ff_vp9_init_static(AVCodec *codec); +void ff_vp9_init_static(FFCodec *codec); #if 0 enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img); vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix); diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index f613d09737..592474b301 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -356,18 +356,18 @@ static av_cold int vp8_init(AVCodecContext *avctx) return vpx_init(avctx, &ctx->decoder, vpx_codec_vp8_dx()); } -const AVCodec ff_libvpx_vp8_decoder = { - .name = "libvpx", - .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, +const FFCodec ff_libvpx_vp8_decoder = { + .p.name = "libvpx", + .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, + .p.wrapper_name = "libvpx", .priv_data_size = sizeof(VPxContext), .init = vp8_init, .close = vpx_free, .decode = vpx_decode, - .capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .wrapper_name = "libvpx", }; #endif /* CONFIG_LIBVPX_VP8_DECODER */ @@ -378,19 +378,19 @@ static av_cold int vp9_init(AVCodecContext *avctx) return vpx_init(avctx, &ctx->decoder, vpx_codec_vp9_dx()); } -AVCodec ff_libvpx_vp9_decoder = { - .name = "libvpx-vp9", - .long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, +FFCodec ff_libvpx_vp9_decoder = { + .p.name = "libvpx-vp9", + .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.capabilities = AV_CODEC_CAP_OTHER_THREADS, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), + .p.wrapper_name = "libvpx", .priv_data_size = sizeof(VPxContext), .init = vp9_init, .close = vpx_free, .decode = vpx_decode, - .capabilities = AV_CODEC_CAP_OTHER_THREADS, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, .init_static_data = ff_vp9_init_static, - .profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), - .wrapper_name = "libvpx", }; #endif /* CONFIG_LIBVPX_VP9_DECODER */ diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 3bbb9013ee..b2e716e90c 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -1925,22 +1925,22 @@ static const AVClass class_vp8 = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libvpx_vp8_encoder = { - .name = "libvpx", - .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libvpx_vp8_encoder = { + .p.name = "libvpx", + .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(VPxContext), .init = vp8_init, .encode2 = vpx_encode, .close = vpx_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }, - .priv_class = &class_vp8, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }, + .p.priv_class = &class_vp8, .defaults = defaults, - .wrapper_name = "libvpx", + .p.wrapper_name = "libvpx", }; #endif /* CONFIG_LIBVPX_VP8_ENCODER */ @@ -1957,22 +1957,22 @@ static const AVClass class_vp9 = { .version = LIBAVUTIL_VERSION_INT, }; -AVCodec ff_libvpx_vp9_encoder = { - .name = "libvpx-vp9", - .long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +FFCodec ff_libvpx_vp9_encoder = { + .p.name = "libvpx-vp9", + .p.long_name = NULL_IF_CONFIG_SMALL("libvpx VP9"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), + .p.priv_class = &class_vp9, + .p.wrapper_name = "libvpx", .priv_data_size = sizeof(VPxContext), .init = vp9_init, .encode2 = vpx_encode, .close = vpx_free, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), - .priv_class = &class_vp9, .defaults = defaults, .init_static_data = ff_vp9_init_static, - .wrapper_name = "libvpx", }; #endif /* CONFIG_LIBVPX_VP9_ENCODER */ diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c index 180fff93f6..12f15bbf65 100644 --- a/libavcodec/libwebpenc.c +++ b/libavcodec/libwebpenc.c @@ -24,6 +24,7 @@ * WebP encoder using libwebp (WebPEncode API) */ +#include "codec_internal.h" #include "encode.h" #include "libwebpenc_common.h" @@ -86,18 +87,18 @@ static int libwebp_encode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_libwebp_encoder = { - .name = "libwebp", - .long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WEBP, - .capabilities = AV_CODEC_CAP_DR1, - .pix_fmts = ff_libwebpenc_pix_fmts, - .priv_class = &ff_libwebpenc_class, +const FFCodec ff_libwebp_encoder = { + .p.name = "libwebp", + .p.long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WEBP, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.pix_fmts = ff_libwebpenc_pix_fmts, + .p.priv_class = &ff_libwebpenc_class, + .p.wrapper_name = "libwebp", .priv_data_size = sizeof(LibWebPContext), .defaults = ff_libwebp_defaults, .init = libwebp_encode_init, .encode2 = libwebp_encode_frame, .close = libwebp_encode_close, - .wrapper_name = "libwebp", }; diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c index f75e5636b9..0f5b524335 100644 --- a/libavcodec/libwebpenc_animencoder.c +++ b/libavcodec/libwebpenc_animencoder.c @@ -25,6 +25,7 @@ */ #include "config.h" +#include "codec_internal.h" #include "encode.h" #include "libwebpenc_common.h" @@ -124,18 +125,18 @@ static int libwebp_anim_encode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_libwebp_anim_encoder = { - .name = "libwebp_anim", - .long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WEBP, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .pix_fmts = ff_libwebpenc_pix_fmts, - .priv_class = &ff_libwebpenc_class, +const FFCodec ff_libwebp_anim_encoder = { + .p.name = "libwebp_anim", + .p.long_name = NULL_IF_CONFIG_SMALL("libwebp WebP image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WEBP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.pix_fmts = ff_libwebpenc_pix_fmts, + .p.priv_class = &ff_libwebpenc_class, + .p.wrapper_name = "libwebp", .priv_data_size = sizeof(LibWebPAnimContext), .defaults = ff_libwebp_defaults, .init = libwebp_anim_encode_init, .encode2 = libwebp_anim_encode_frame, .close = libwebp_anim_encode_close, - .wrapper_name = "libwebp", }; diff --git a/libavcodec/libwebpenc_common.h b/libavcodec/libwebpenc_common.h index 5e96ef6acd..3c5a71e981 100644 --- a/libavcodec/libwebpenc_common.h +++ b/libavcodec/libwebpenc_common.h @@ -34,7 +34,6 @@ #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "avcodec.h" -#include "codec.h" #include "codec_internal.h" typedef struct LibWebPContextCommon { diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 019eb81ab7..40bdb986e0 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -1084,14 +1084,14 @@ static const enum AVPixelFormat pix_fmts_8bit_rgb[] = { #endif #if X264_BUILD < 153 -static av_cold void X264_init_static(AVCodec *codec) +static av_cold void X264_init_static(FFCodec *codec) { if (x264_bit_depth == 8) - codec->pix_fmts = pix_fmts_8bit; + codec->p.pix_fmts = pix_fmts_8bit; else if (x264_bit_depth == 9) - codec->pix_fmts = pix_fmts_9bit; + codec->p.pix_fmts = pix_fmts_9bit; else if (x264_bit_depth == 10) - codec->pix_fmts = pix_fmts_10bit; + codec->p.pix_fmts = pix_fmts_10bit; } #endif @@ -1216,31 +1216,31 @@ static const AVClass x264_class = { #if X264_BUILD >= 153 const #endif -AVCodec ff_libx264_encoder = { - .name = "libx264", - .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +FFCodec ff_libx264_encoder = { + .p.name = "libx264", + .p.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .p.priv_class = &x264_class, + .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, .encode2 = X264_frame, .close = X264_close, - .priv_class = &x264_class, .defaults = x264_defaults, #if X264_BUILD < 153 .init_static_data = X264_init_static, #else - .pix_fmts = pix_fmts_all, + .p.pix_fmts = pix_fmts_all, #endif .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS #if X264_BUILD >= 158 | FF_CODEC_CAP_INIT_THREADSAFE #endif , - .wrapper_name = "libx264", }; #endif @@ -1252,27 +1252,27 @@ static const AVClass rgbclass = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libx264rgb_encoder = { - .name = "libx264rgb", - .long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libx264rgb_encoder = { + .p.name = "libx264rgb", + .p.long_name = NULL_IF_CONFIG_SMALL("libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .p.pix_fmts = pix_fmts_8bit_rgb, + .p.priv_class = &rgbclass, + .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, .encode2 = X264_frame, .close = X264_close, - .priv_class = &rgbclass, .defaults = x264_defaults, - .pix_fmts = pix_fmts_8bit_rgb, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS #if X264_BUILD >= 158 | FF_CODEC_CAP_INIT_THREADSAFE #endif , - .wrapper_name = "libx264", }; #endif @@ -1284,22 +1284,22 @@ static const AVClass X262_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libx262_encoder = { - .name = "libx262", - .long_name = NULL_IF_CONFIG_SMALL("libx262 MPEG2VIDEO"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libx262_encoder = { + .p.name = "libx262", + .p.long_name = NULL_IF_CONFIG_SMALL("libx262 MPEG2VIDEO"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .p.pix_fmts = pix_fmts_8bit, + .p.priv_class = &X262_class, + .p.wrapper_name = "libx264", .priv_data_size = sizeof(X264Context), .init = X264_init, .encode2 = X264_frame, .close = X264_close, - .priv_class = &X262_class, .defaults = x264_defaults, - .pix_fmts = pix_fmts_8bit, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS, - .wrapper_name = "libx264", }; #endif diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 3217d45284..0ad2006cdc 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -693,14 +693,14 @@ static const enum AVPixelFormat x265_csp_twelve[] = { AV_PIX_FMT_NONE }; -static av_cold void libx265_encode_init_csp(AVCodec *codec) +static av_cold void libx265_encode_init_csp(FFCodec *codec) { if (x265_api_get(12)) - codec->pix_fmts = x265_csp_twelve; + codec->p.pix_fmts = x265_csp_twelve; else if (x265_api_get(10)) - codec->pix_fmts = x265_csp_ten; + codec->p.pix_fmts = x265_csp_ten; else if (x265_api_get(8)) - codec->pix_fmts = x265_csp_eight; + codec->p.pix_fmts = x265_csp_eight; } #define OFFSET(x) offsetof(libx265Context, x) @@ -740,21 +740,21 @@ static const AVCodecDefault x265_defaults[] = { { NULL }, }; -AVCodec ff_libx265_encoder = { - .name = "libx265", - .long_name = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +FFCodec ff_libx265_encoder = { + .p.name = "libx265", + .p.long_name = NULL_IF_CONFIG_SMALL("libx265 H.265 / HEVC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + .p.priv_class = &class, + .p.wrapper_name = "libx265", .init = libx265_encode_init, .init_static_data = libx265_encode_init_csp, .encode2 = libx265_encode_frame, .close = libx265_encode_close, .priv_data_size = sizeof(libx265Context), - .priv_class = &class, .defaults = x265_defaults, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .wrapper_name = "libx265", }; diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 14891f7c62..42507848d5 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -421,20 +421,20 @@ static const AVCodecDefault xavs_defaults[] = { { NULL }, }; -const AVCodec ff_libxavs_encoder = { - .name = "libxavs", - .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_CAVS, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libxavs_encoder = { + .p.name = "libxavs", + .p.long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CAVS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(XavsContext), .init = XAVS_init, .encode2 = XAVS_frame, .close = XAVS_close, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &xavs_class, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &xavs_class, .defaults = xavs_defaults, - .wrapper_name = "libxavs", + .p.wrapper_name = "libxavs", }; diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c index 0fc7a623e5..7f68c3c368 100644 --- a/libavcodec/libxavs2.c +++ b/libavcodec/libxavs2.c @@ -286,21 +286,21 @@ static const AVCodecDefault xavs2_defaults[] = { { NULL }, }; -const AVCodec ff_libxavs2_encoder = { - .name = "libxavs2", - .long_name = NULL_IF_CONFIG_SMALL("libxavs2 AVS2-P2/IEEE1857.4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVS2, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_libxavs2_encoder = { + .p.name = "libxavs2", + .p.long_name = NULL_IF_CONFIG_SMALL("libxavs2 AVS2-P2/IEEE1857.4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVS2, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, .priv_data_size = sizeof(XAVS2EContext), .init = xavs2_init, .encode2 = xavs2_encode_frame, .close = xavs2_close, .caps_internal = FF_CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &libxavs2, + .p.priv_class = &libxavs2, .defaults = xavs2_defaults, - .wrapper_name = "libxavs2", + .p.wrapper_name = "libxavs2", } ; diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 453f6f7d37..ece7aaaebd 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -897,18 +897,18 @@ static const AVClass xvid_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libxvid_encoder = { - .name = "libxvid", - .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, +const FFCodec ff_libxvid_encoder = { + .p.name = "libxvid", + .p.long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(struct xvid_context), .init = xvid_encode_init, .encode2 = xvid_encode_frame, .close = xvid_encode_close, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &xvid_class, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &xvid_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "libxvid", + .p.wrapper_name = "libxvid", }; diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 1073d6a0bd..5ebf47f796 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -20,6 +20,7 @@ #include "avcodec.h" #include "libavcodec/ass.h" +#include "codec_internal.h" #include "libavcodec/dvbtxt.h" #include "libavutil/opt.h" #include "libavutil/bprint.h" @@ -810,17 +811,17 @@ static const AVClass teletext_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_libzvbi_teletext_decoder = { - .name = "libzvbi_teletextdec", - .long_name = NULL_IF_CONFIG_SMALL("Libzvbi DVB teletext decoder"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_DVB_TELETEXT, +const FFCodec ff_libzvbi_teletext_decoder = { + .p.name = "libzvbi_teletextdec", + .p.long_name = NULL_IF_CONFIG_SMALL("Libzvbi DVB teletext decoder"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_DVB_TELETEXT, + .p.capabilities = AV_CODEC_CAP_DELAY, + .p.priv_class = &teletext_class, + .p.wrapper_name = "libzvbi", .priv_data_size = sizeof(TeletextContext), .init = teletext_init_decoder, .close = teletext_close_decoder, .decode = teletext_decode_frame, - .capabilities = AV_CODEC_CAP_DELAY, .flush = teletext_flush, - .priv_class= &teletext_class, - .wrapper_name = "libzvbi", }; diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index 2eef77c60f..fad19cbb76 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -321,18 +321,18 @@ static const AVClass ljpeg_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_ljpeg_encoder = { - .name = "ljpeg", - .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_LJPEG, +const FFCodec ff_ljpeg_encoder = { + .p.name = "ljpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_LJPEG, .priv_data_size = sizeof(LJpegEncContext), - .priv_class = &ljpeg_class, + .p.priv_class = &ljpeg_class, .init = ljpeg_encode_init, .encode2 = ljpeg_encode_frame, .close = ljpeg_encode_close, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUV444P , AV_PIX_FMT_YUV422P, diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 5088655a4f..0501a70ceb 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -338,14 +338,14 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_loco_decoder = { - .name = "loco", - .long_name = NULL_IF_CONFIG_SMALL("LOCO"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_LOCO, +const FFCodec ff_loco_decoder = { + .p.name = "loco", + .p.long_name = NULL_IF_CONFIG_SMALL("LOCO"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_LOCO, .priv_data_size = sizeof(LOCOContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/lscrdec.c b/libavcodec/lscrdec.c index 5210c843fa..ab5a391c94 100644 --- a/libavcodec/lscrdec.c +++ b/libavcodec/lscrdec.c @@ -245,16 +245,16 @@ static void lscr_decode_flush(AVCodecContext *avctx) av_frame_unref(s->last_picture); } -const AVCodec ff_lscr_decoder = { - .name = "lscr", - .long_name = NULL_IF_CONFIG_SMALL("LEAD Screen Capture"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_LSCR, +const FFCodec ff_lscr_decoder = { + .p.name = "lscr", + .p.long_name = NULL_IF_CONFIG_SMALL("LEAD Screen Capture"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_LSCR, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(LSCRContext), .init = lscr_decode_init, .close = lscr_decode_close, .decode = decode_frame_lscr, .flush = lscr_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/m101.c b/libavcodec/m101.c index 665afb0aa4..2c9e084ef1 100644 --- a/libavcodec/m101.c +++ b/libavcodec/m101.c @@ -106,13 +106,13 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_m101_decoder = { - .name = "m101", - .long_name = NULL_IF_CONFIG_SMALL("Matrox Uncompressed SD"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_M101, +const FFCodec ff_m101_decoder = { + .p.name = "m101", + .p.long_name = NULL_IF_CONFIG_SMALL("Matrox Uncompressed SD"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_M101, .init = m101_decode_init, .decode = m101_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mace.c b/libavcodec/mace.c index c32c9fc582..bb96acfba3 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -286,30 +286,30 @@ static int mace_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_mace3_decoder = { - .name = "mace3", - .long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MACE3, +const FFCodec ff_mace3_decoder = { + .p.name = "mace3", + .p.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 3:1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MACE3, .priv_data_size = sizeof(MACEContext), .init = mace_decode_init, .decode = mace_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -const AVCodec ff_mace6_decoder = { - .name = "mace6", - .long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MACE6, +const FFCodec ff_mace6_decoder = { + .p.name = "mace6", + .p.long_name = NULL_IF_CONFIG_SMALL("MACE (Macintosh Audio Compression/Expansion) 6:1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MACE6, .priv_data_size = sizeof(MACEContext), .init = mace_decode_init, .decode = mace_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index a2787c8b10..2d698251cb 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -694,16 +694,16 @@ static av_cold int magy_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_magicyuv_decoder = { - .name = "magicyuv", - .long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MAGICYUV, +const FFCodec ff_magicyuv_decoder = { + .p.name = "magicyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MAGICYUV, .priv_data_size = sizeof(MagicYUVContext), .init = magy_decode_init, .close = magy_decode_end, .decode = magy_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c index 5e642fc2cf..b365739443 100644 --- a/libavcodec/magicyuvenc.c +++ b/libavcodec/magicyuvenc.c @@ -563,18 +563,18 @@ static const AVClass magicyuv_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_magicyuv_encoder = { - .name = "magicyuv", - .long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MAGICYUV, +const FFCodec ff_magicyuv_encoder = { + .p.name = "magicyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MAGICYUV, .priv_data_size = sizeof(MagicYUVContext), - .priv_class = &magicyuv_class, + .p.priv_class = &magicyuv_class, .init = magy_encode_init, .close = magy_encode_close, .encode2 = magy_encode_frame, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 5d04268598..579fd59b00 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -251,15 +251,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_mdec_decoder = { - .name = "mdec", - .long_name = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MDEC, +const FFCodec ff_mdec_decoder = { + .p.name = "mdec", + .p.long_name = NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion DECoder)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MDEC, .priv_data_size = sizeof(MDECContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c index c7e41f5495..c8c9f1df08 100644 --- a/libavcodec/mediacodecdec.c +++ b/libavcodec/mediacodecdec.c @@ -532,22 +532,22 @@ static const AVClass ff_##short_name##_mediacodec_dec_class = { \ #define DECLARE_MEDIACODEC_VDEC(short_name, full_name, codec_id, bsf) \ DECLARE_MEDIACODEC_VCLASS(short_name) \ -const AVCodec ff_ ## short_name ## _mediacodec_decoder = { \ - .name = #short_name "_mediacodec", \ - .long_name = NULL_IF_CONFIG_SMALL(full_name " Android MediaCodec decoder"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = codec_id, \ - .priv_class = &ff_##short_name##_mediacodec_dec_class, \ +const FFCodec ff_ ## short_name ## _mediacodec_decoder = { \ + .p.name = #short_name "_mediacodec", \ + .p.long_name = NULL_IF_CONFIG_SMALL(full_name " Android MediaCodec decoder"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = codec_id, \ + .p.priv_class = &ff_##short_name##_mediacodec_dec_class, \ .priv_data_size = sizeof(MediaCodecH264DecContext), \ .init = mediacodec_decode_init, \ .receive_frame = mediacodec_receive_frame, \ .flush = mediacodec_decode_flush, \ .close = mediacodec_decode_close, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \ .bsfs = bsf, \ .hw_configs = mediacodec_hw_configs, \ - .wrapper_name = "mediacodec", \ + .p.wrapper_name = "mediacodec", \ }; \ #if CONFIG_H264_MEDIACODEC_DECODER diff --git a/libavcodec/metasound.c b/libavcodec/metasound.c index db771dd869..3897d42911 100644 --- a/libavcodec/metasound.c +++ b/libavcodec/metasound.c @@ -373,17 +373,17 @@ static av_cold int metasound_decode_init(AVCodecContext *avctx) return ff_twinvq_decode_init(avctx); } -const AVCodec ff_metasound_decoder = { - .name = "metasound", - .long_name = NULL_IF_CONFIG_SMALL("Voxware MetaSound"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_METASOUND, +const FFCodec ff_metasound_decoder = { + .p.name = "metasound", + .p.long_name = NULL_IF_CONFIG_SMALL("Voxware MetaSound"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_METASOUND, .priv_data_size = sizeof(TwinVQContext), .init = metasound_decode_init, .close = ff_twinvq_decode_close, .decode = ff_twinvq_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c index 2f91e9722b..f30068985e 100644 --- a/libavcodec/mfenc.c +++ b/libavcodec/mfenc.c @@ -1151,25 +1151,25 @@ static int mf_close(AVCodecContext *avctx) .option = OPTS, \ .version = LIBAVUTIL_VERSION_INT, \ }; \ - const AVCodec ff_ ## NAME ## _mf_encoder = { \ - .priv_class = &ff_ ## NAME ## _mf_encoder_class, \ - .name = #NAME "_mf", \ - .long_name = NULL_IF_CONFIG_SMALL(#ID " via MediaFoundation"), \ - .type = AVMEDIA_TYPE_ ## MEDIATYPE, \ - .id = AV_CODEC_ID_ ## ID, \ + const FFCodec ff_ ## NAME ## _mf_encoder = { \ + .p.priv_class = &ff_ ## NAME ## _mf_encoder_class, \ + .p.name = #NAME "_mf", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#ID " via MediaFoundation"), \ + .p.type = AVMEDIA_TYPE_ ## MEDIATYPE, \ + .p.id = AV_CODEC_ID_ ## ID, \ .priv_data_size = sizeof(MFContext), \ .init = mf_init, \ .close = mf_close, \ .receive_packet = mf_receive_packet, \ EXTRA \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID | \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID | \ AV_CODEC_CAP_DR1, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | \ FF_CODEC_CAP_INIT_CLEANUP, \ }; #define AFMTS \ - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, \ + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, \ AV_SAMPLE_FMT_NONE }, MF_ENCODER(AUDIO, aac, AAC, NULL, AFMTS); @@ -1204,7 +1204,7 @@ static const AVOption venc_opts[] = { }; #define VFMTS \ - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ AV_PIX_FMT_YUV420P, \ AV_PIX_FMT_NONE }, diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index ae7fddd1f2..0863fe1494 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -369,11 +369,11 @@ static int microdvd_init(AVCodecContext *avctx) alignment); } -const AVCodec ff_microdvd_decoder = { - .name = "microdvd", - .long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_MICRODVD, +const FFCodec ff_microdvd_decoder = { + .p.name = "microdvd", + .p.long_name = NULL_IF_CONFIG_SMALL("MicroDVD subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_MICRODVD, .init = microdvd_init, .decode = microdvd_decode_frame, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c index 6f37bb05bc..fa338c71ec 100644 --- a/libavcodec/midivid.c +++ b/libavcodec/midivid.c @@ -278,16 +278,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mvdv_decoder = { - .name = "mvdv", - .long_name = NULL_IF_CONFIG_SMALL("MidiVid VQ"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MVDV, +const FFCodec ff_mvdv_decoder = { + .p.name = "mvdv", + .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid VQ"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MVDV, .priv_data_size = sizeof(MidiVidContext), .init = decode_init, .decode = decode_frame, .flush = decode_flush, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 760fb77570..377c84c4c2 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -437,16 +437,16 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_mimic_decoder = { - .name = "mimic", - .long_name = NULL_IF_CONFIG_SMALL("Mimic"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MIMIC, +const FFCodec ff_mimic_decoder = { + .p.name = "mimic", + .p.long_name = NULL_IF_CONFIG_SMALL("Mimic"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MIMIC, .priv_data_size = sizeof(MimicContext), .init = mimic_decode_init, .close = mimic_decode_end, .decode = mimic_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .update_thread_context = ONLY_IF_THREADS_ENABLED(mimic_decode_update_thread_context), .caps_internal = FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index b781cc4283..e73ae1d35f 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -157,16 +157,16 @@ read_header: return buf_size; } -const AVCodec ff_mjpegb_decoder = { - .name = "mjpegb", - .long_name = NULL_IF_CONFIG_SMALL("Apple MJPEG-B"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEGB, +const FFCodec ff_mjpegb_decoder = { + .p.name = "mjpegb", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple MJPEG-B"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEGB, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .decode = mjpegb_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 28bd1d1c72..13b56e0b2f 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -3012,20 +3012,20 @@ static const AVClass mjpegdec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mjpeg_decoder = { - .name = "mjpeg", - .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, +const FFCodec ff_mjpeg_decoder = { + .p.name = "mjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, - .max_lowres = 3, - .priv_class = &mjpegdec_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, + .p.priv_class = &mjpegdec_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_SETS_PKT_DTS, .hw_configs = (const AVCodecHWConfigInternal *const []) { @@ -3040,35 +3040,35 @@ const AVCodec ff_mjpeg_decoder = { }; #endif #if CONFIG_THP_DECODER -const AVCodec ff_thp_decoder = { - .name = "thp", - .long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_THP, +const FFCodec ff_thp_decoder = { + .p.name = "thp", + .p.long_name = NULL_IF_CONFIG_SMALL("Nintendo Gamecube THP video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_THP, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, - .max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, }; #endif #if CONFIG_SMVJPEG_DECODER -const AVCodec ff_smvjpeg_decoder = { - .name = "smvjpeg", - .long_name = NULL_IF_CONFIG_SMALL("SMV JPEG"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SMVJPEG, +const FFCodec ff_smvjpeg_decoder = { + .p.name = "smvjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("SMV JPEG"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SMVJPEG, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index e3d7bbcd26..a39b990eea 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -651,24 +651,24 @@ static const AVClass mjpeg_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mjpeg_encoder = { - .name = "mjpeg", - .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, +const FFCodec ff_mjpeg_encoder = { + .p.name = "mjpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = mjpeg_encode_close, - .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, - .priv_class = &mjpeg_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), + .p.priv_class = &mjpeg_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), }; #endif @@ -680,19 +680,19 @@ static const AVClass amv_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_amv_encoder = { - .name = "amv", - .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AMV, +const FFCodec ff_amv_encoder = { + .p.name = "amv", + .p.long_name = NULL_IF_CONFIG_SMALL("AMV Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AMV, .priv_data_size = sizeof(MJPEGEncContext), .init = ff_mpv_encode_init, .encode2 = amv_encode_picture, .close = mjpeg_encode_close, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE }, - .priv_class = &amv_class, + .p.priv_class = &amv_class, }; #endif diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index 2abdb6f81a..e3fbaa62c7 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1416,32 +1416,32 @@ static const AVClass truehd_decoder_class = { }; #if CONFIG_MLP_DECODER -const AVCodec ff_mlp_decoder = { - .name = "mlp", - .long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MLP, +const FFCodec ff_mlp_decoder = { + .p.name = "mlp", + .p.long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MLP, .priv_data_size = sizeof(MLPDecodeContext), - .priv_class = &mlp_decoder_class, + .p.priv_class = &mlp_decoder_class, .init = mlp_decode_init, .decode = read_access_unit, .flush = mlp_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_TRUEHD_DECODER -const AVCodec ff_truehd_decoder = { - .name = "truehd", - .long_name = NULL_IF_CONFIG_SMALL("TrueHD"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TRUEHD, +const FFCodec ff_truehd_decoder = { + .p.name = "truehd", + .p.long_name = NULL_IF_CONFIG_SMALL("TrueHD"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TRUEHD, .priv_data_size = sizeof(MLPDecodeContext), - .priv_class = &truehd_decoder_class, + .p.priv_class = &truehd_decoder_class, .init = mlp_decode_init, .decode = read_access_unit, .flush = mlp_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif /* CONFIG_TRUEHD_DECODER */ diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index 56a129a960..bcb479f2a6 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -2206,42 +2206,42 @@ static av_cold int mlp_encode_close(AVCodecContext *avctx) } #if CONFIG_MLP_ENCODER -const AVCodec ff_mlp_encoder = { - .name ="mlp", - .long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MLP, +const FFCodec ff_mlp_encoder = { + .p.name ="mlp", + .p.long_name = NULL_IF_CONFIG_SMALL("MLP (Meridian Lossless Packing)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MLP, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, .encode2 = mlp_encode_frame, .close = mlp_encode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, - .sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, - .supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, + .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, + .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = ff_mlp_channel_layouts, + .p.channel_layouts = ff_mlp_channel_layouts, #endif - .ch_layouts = ff_mlp_ch_layouts, + .p.ch_layouts = ff_mlp_ch_layouts, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_TRUEHD_ENCODER -const AVCodec ff_truehd_encoder = { - .name ="truehd", - .long_name = NULL_IF_CONFIG_SMALL("TrueHD"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TRUEHD, +const FFCodec ff_truehd_encoder = { + .p.name ="truehd", + .p.long_name = NULL_IF_CONFIG_SMALL("TrueHD"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TRUEHD, .priv_data_size = sizeof(MLPEncodeContext), .init = mlp_encode_init, .encode2 = mlp_encode_frame, .close = mlp_encode_close, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, - .sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, - .supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, + .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE}, + .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, 0}, + .p.channel_layouts = (const uint64_t[]) {AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_5POINT1_BACK, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_5POINT0_BACK, AV_CHANNEL_LAYOUT_5POINT1_BACK, diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c index e0b16ed117..2a56bcae01 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -829,24 +829,24 @@ static const AVClass ffmmal_dec_class = { }; #define FFMMAL_DEC(NAME, ID) \ - const AVCodec ff_##NAME##_mmal_decoder = { \ - .name = #NAME "_mmal", \ - .long_name = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = ID, \ + const FFCodec ff_##NAME##_mmal_decoder = { \ + .p.name = #NAME "_mmal", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (mmal)"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = ID, \ .priv_data_size = sizeof(MMALDecodeContext), \ .init = ffmmal_init_decoder, \ .close = ffmmal_close_decoder, \ .receive_frame = ffmmal_receive_frame, \ .flush = ffmmal_flush, \ - .priv_class = &ffmmal_dec_class, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \ + .p.priv_class = &ffmmal_dec_class, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS, \ - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \ + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \ AV_PIX_FMT_YUV420P, \ AV_PIX_FMT_NONE}, \ .hw_configs = mmal_hw_configs, \ - .wrapper_name = "mmal", \ + .p.wrapper_name = "mmal", \ }; FFMMAL_DEC(h264, AV_CODEC_ID_H264) diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 1c1fe5df18..fcc9602666 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -239,15 +239,15 @@ static av_cold int mm_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_mmvideo_decoder = { - .name = "mmvideo", - .long_name = NULL_IF_CONFIG_SMALL("American Laser Games MM Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MMVIDEO, +const FFCodec ff_mmvideo_decoder = { + .p.name = "mmvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("American Laser Games MM Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MMVIDEO, .priv_data_size = sizeof(MmContext), .init = mm_decode_init, .close = mm_decode_end, .decode = mm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c index ced5cabccc..1f619d6a52 100644 --- a/libavcodec/mobiclip.c +++ b/libavcodec/mobiclip.c @@ -1340,16 +1340,16 @@ static av_cold int mobiclip_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mobiclip_decoder = { - .name = "mobiclip", - .long_name = NULL_IF_CONFIG_SMALL("MobiClip Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MOBICLIP, +const FFCodec ff_mobiclip_decoder = { + .p.name = "mobiclip", + .p.long_name = NULL_IF_CONFIG_SMALL("MobiClip Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MOBICLIP, .priv_data_size = sizeof(MobiClipContext), .init = mobiclip_init, .decode = mobiclip_decode, .flush = mobiclip_flush, .close = mobiclip_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index a89e678bb8..fcc848f59a 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -346,15 +346,15 @@ end: return buf_size; } -const AVCodec ff_motionpixels_decoder = { - .name = "motionpixels", - .long_name = NULL_IF_CONFIG_SMALL("Motion Pixels video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MOTIONPIXELS, +const FFCodec ff_motionpixels_decoder = { + .p.name = "motionpixels", + .p.long_name = NULL_IF_CONFIG_SMALL("Motion Pixels video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MOTIONPIXELS, .priv_data_size = sizeof(MotionPixelsContext), .init = mp_decode_init, .close = mp_decode_end, .decode = mp_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index a8fea3b34a..3ba7043180 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -592,13 +592,13 @@ static const AVClass mov_text_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_movtext_decoder = { - .name = "mov_text", - .long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_MOV_TEXT, +const FFCodec ff_movtext_decoder = { + .p.name = "mov_text", + .p.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_MOV_TEXT, .priv_data_size = sizeof(MovTextContext), - .priv_class = &mov_text_decoder_class, + .p.priv_class = &mov_text_decoder_class, .init = mov_text_init, .decode = mov_text_decode_frame, .close = mov_text_decode_close, diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 57dca6e464..333a23be82 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -699,13 +699,13 @@ static const AVClass mov_text_encoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_movtext_encoder = { - .name = "mov_text", - .long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_MOV_TEXT, +const FFCodec ff_movtext_encoder = { + .p.name = "mov_text", + .p.long_name = NULL_IF_CONFIG_SMALL("3GPP Timed Text subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_MOV_TEXT, .priv_data_size = sizeof(MovTextContext), - .priv_class = &mov_text_encoder_class, + .p.priv_class = &mov_text_encoder_class, .init = mov_text_encode_init, .encode_sub = mov_text_encode_frame, .close = mov_text_encode_close, diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index 4beffe373c..2fb0e38e77 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -310,18 +310,18 @@ static av_cold int mpc7_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mpc7_decoder = { - .name = "mpc7", - .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MUSEPACK7, +const FFCodec ff_mpc7_decoder = { + .p.name = "mpc7", + .p.long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MUSEPACK7, .priv_data_size = sizeof(MPCContext), .init = mpc7_decode_init, .close = mpc7_decode_close, .decode = mpc7_decode_frame, .flush = mpc7_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 869b4152fa..4c5b7fe23e 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -384,17 +384,17 @@ static av_cold void mpc8_decode_flush(AVCodecContext *avctx) c->cur_frame = 0; } -const AVCodec ff_mpc8_decoder = { - .name = "mpc8", - .long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MUSEPACK8, +const FFCodec ff_mpc8_decoder = { + .p.name = "mpc8", + .p.long_name = NULL_IF_CONFIG_SMALL("Musepack SV8"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MUSEPACK8, .priv_data_size = sizeof(MPCContext), .init = mpc8_decode_init, .decode = mpc8_decode_frame, .flush = mpc8_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 715f24ff4f..6110e63af8 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2862,16 +2862,16 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_mpeg1video_decoder = { - .name = "mpeg1video", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, +const FFCodec ff_mpeg1video_decoder = { + .p.name = "mpeg1video", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, .decode = mpeg_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -2879,7 +2879,7 @@ const AVCodec ff_mpeg1video_decoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, - .max_lowres = 3, + .p.max_lowres = 3, .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg_decode_update_thread_context), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG1_NVDEC_HWACCEL @@ -2895,16 +2895,16 @@ const AVCodec ff_mpeg1video_decoder = { }, }; -const AVCodec ff_mpeg2video_decoder = { - .name = "mpeg2video", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, +const FFCodec ff_mpeg2video_decoder = { + .p.name = "mpeg2video", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, .decode = mpeg_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -2912,8 +2912,8 @@ const AVCodec ff_mpeg2video_decoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, - .max_lowres = 3, - .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), + .p.max_lowres = 3, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG2_DXVA2_HWACCEL HWACCEL_DXVA2(mpeg2), @@ -2941,16 +2941,16 @@ const AVCodec ff_mpeg2video_decoder = { }; //legacy decoder -const AVCodec ff_mpegvideo_decoder = { - .name = "mpegvideo", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, +const FFCodec ff_mpegvideo_decoder = { + .p.name = "mpegvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(Mpeg1Context), .init = mpeg_decode_init, .close = mpeg_decode_end, .decode = mpeg_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -2958,7 +2958,7 @@ const AVCodec ff_mpegvideo_decoder = { .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .flush = flush, - .max_lowres = 3, + .p.max_lowres = 3, }; typedef struct IPUContext { @@ -3107,15 +3107,15 @@ static av_cold int ipu_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_ipu_decoder = { - .name = "ipu", - .long_name = NULL_IF_CONFIG_SMALL("IPU Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_IPU, +const FFCodec ff_ipu_decoder = { + .p.name = "ipu", + .p.long_name = NULL_IF_CONFIG_SMALL("IPU Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_IPU, .priv_data_size = sizeof(IPUContext), .init = ipu_decode_init, .decode = ipu_decode_frame, .close = ipu_decode_end, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index c53bcacc90..77cbb60ea1 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -1225,38 +1225,38 @@ static const AVClass mpeg ## x ## _class = { \ mpeg12_class(1) mpeg12_class(2) -const AVCodec ff_mpeg1video_encoder = { - .name = "mpeg1video", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG1VIDEO, +const FFCodec ff_mpeg1video_encoder = { + .p.name = "mpeg1video", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG1VIDEO, .priv_data_size = sizeof(MPEG12EncContext), .init = encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, - .supported_framerates = ff_mpeg12_frame_rate_tab + 1, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.supported_framerates = ff_mpeg12_frame_rate_tab + 1, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &mpeg1_class, + .p.priv_class = &mpeg1_class, }; -const AVCodec ff_mpeg2video_encoder = { - .name = "mpeg2video", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, +const FFCodec ff_mpeg2video_encoder = { + .p.name = "mpeg2video", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(MPEG12EncContext), .init = encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, - .supported_framerates = ff_mpeg2_frame_rate_tab, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.supported_framerates = ff_mpeg2_frame_rate_tab, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &mpeg2_class, + .p.priv_class = &mpeg2_class, }; #endif /* CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER */ diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index cefec7ab3e..5c55de3eb8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3662,16 +3662,16 @@ static const AVClass mpeg4_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mpeg4_decoder = { - .name = "mpeg4", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, +const FFCodec ff_mpeg4_decoder = { + .p.name = "mpeg4", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -3680,12 +3680,12 @@ const AVCodec ff_mpeg4_decoder = { FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = ff_mpeg_flush, - .max_lowres = 3, - .pix_fmts = ff_h263_hwaccel_pixfmt_list_420, - .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), + .p.max_lowres = 3, + .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context), .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context_for_user), - .priv_class = &mpeg4_class, + .p.priv_class = &mpeg4_class, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG4_NVDEC_HWACCEL HWACCEL_NVDEC(mpeg4), diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 2911bf7a3e..1140c33a70 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1394,17 +1394,17 @@ static const AVClass mpeg4enc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mpeg4_encoder = { - .name = "mpeg4", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, +const FFCodec ff_mpeg4_encoder = { + .p.name = "mpeg4", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(MpegEncContext), .init = encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &mpeg4enc_class, + .p.priv_class = &mpeg4enc_class, }; diff --git a/libavcodec/mpegaudiodec_fixed.c b/libavcodec/mpegaudiodec_fixed.c index ad401f5af6..8809fac976 100644 --- a/libavcodec/mpegaudiodec_fixed.c +++ b/libavcodec/mpegaudiodec_fixed.c @@ -61,91 +61,91 @@ static const int32_t csa_table[8][4] = { #include "mpegaudiodec_template.c" #if CONFIG_MP1_DECODER -const AVCodec ff_mp1_decoder = { - .name = "mp1", - .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP1, +const FFCodec ff_mp1_decoder = { + .p.name = "mp1", + .p.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2_DECODER -const AVCodec ff_mp2_decoder = { - .name = "mp2", - .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP2, +const FFCodec ff_mp2_decoder = { + .p.name = "mp2", + .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3_DECODER -const AVCodec ff_mp3_decoder = { - .name = "mp3", - .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3, +const FFCodec ff_mp3_decoder = { + .p.name = "mp3", + .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADU_DECODER -const AVCodec ff_mp3adu_decoder = { - .name = "mp3adu", - .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3ADU, +const FFCodec ff_mp3adu_decoder = { + .p.name = "mp3adu", + .p.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4_DECODER -const AVCodec ff_mp3on4_decoder = { - .name = "mp3on4", - .long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3ON4, +const FFCodec ff_mp3on4_decoder = { + .p.name = "mp3on4", + .p.long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3ON4, .priv_data_size = sizeof(MP3On4DecodeContext), .init = decode_init_mp3on4, .close = decode_close_mp3on4, .decode = decode_frame_mp3on4, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush_mp3on4, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index bef4918a90..c4fd64a85f 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -74,91 +74,91 @@ static const float csa_table[8][4] = { #include "mpegaudiodec_template.c" #if CONFIG_MP1FLOAT_DECODER -const AVCodec ff_mp1float_decoder = { - .name = "mp1float", - .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP1, +const FFCodec ff_mp1float_decoder = { + .p.name = "mp1float", + .p.long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP1, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP2FLOAT_DECODER -const AVCodec ff_mp2float_decoder = { - .name = "mp2float", - .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP2, +const FFCodec ff_mp2float_decoder = { + .p.name = "mp2float", + .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3FLOAT_DECODER -const AVCodec ff_mp3float_decoder = { - .name = "mp3float", - .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3, +const FFCodec ff_mp3float_decoder = { + .p.name = "mp3float", + .p.long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ADUFLOAT_DECODER -const AVCodec ff_mp3adufloat_decoder = { - .name = "mp3adufloat", - .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3ADU, +const FFCodec ff_mp3adufloat_decoder = { + .p.name = "mp3adufloat", + .p.long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3ADU, .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MP3ON4FLOAT_DECODER -const AVCodec ff_mp3on4float_decoder = { - .name = "mp3on4float", - .long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP3ON4, +const FFCodec ff_mp3on4float_decoder = { + .p.name = "mp3on4float", + .p.long_name = NULL_IF_CONFIG_SMALL("MP3onMP4"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP3ON4, .priv_data_size = sizeof(MP3On4DecodeContext), .init = decode_init_mp3on4, .close = decode_close_mp3on4, .decode = decode_frame_mp3on4, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .flush = flush_mp3on4, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c index ad2aa46eb3..2eaa933195 100644 --- a/libavcodec/mpegaudioenc_fixed.c +++ b/libavcodec/mpegaudioenc_fixed.c @@ -23,25 +23,25 @@ #include "codec_internal.h" #include "mpegaudioenc_template.c" -const AVCodec ff_mp2fixed_encoder = { - .name = "mp2fixed", - .long_name = NULL_IF_CONFIG_SMALL("MP2 fixed point (MPEG audio layer 2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP2, +const FFCodec ff_mp2fixed_encoder = { + .p.name = "mp2fixed", + .p.long_name = NULL_IF_CONFIG_SMALL("MP2 fixed point (MPEG audio layer 2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, .encode2 = MPA_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]){ + .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .defaults = mp2_defaults, diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index bfb12ea2b8..9b9c7a442a 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -24,25 +24,25 @@ #include "codec_internal.h" #include "mpegaudioenc_template.c" -const AVCodec ff_mp2_encoder = { - .name = "mp2", - .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MP2, +const FFCodec ff_mp2_encoder = { + .p.name = "mp2", + .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MP2, .priv_data_size = sizeof(MpegAudioContext), .init = MPA_encode_init, .encode2 = MPA_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]){ + .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .defaults = mp2_defaults, diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c index 5031e02c10..bfcd72bf2d 100644 --- a/libavcodec/mpl2dec.c +++ b/libavcodec/mpl2dec.c @@ -82,11 +82,11 @@ static int mpl2_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_mpl2_decoder = { - .name = "mpl2", - .long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_MPL2, +const FFCodec ff_mpl2_decoder = { + .p.name = "mpl2", + .p.long_name = NULL_IF_CONFIG_SMALL("MPL2 subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_MPL2, .decode = mpl2_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/mscc.c b/libavcodec/mscc.c index 37a5dd5e0b..a0cd18adab 100644 --- a/libavcodec/mscc.c +++ b/libavcodec/mscc.c @@ -246,28 +246,28 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mscc_decoder = { - .name = "mscc", - .long_name = NULL_IF_CONFIG_SMALL("Mandsoft Screen Capture Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSCC, +const FFCodec ff_mscc_decoder = { + .p.name = "mscc", + .p.long_name = NULL_IF_CONFIG_SMALL("Mandsoft Screen Capture Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSCC, .priv_data_size = sizeof(MSCCContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_srgc_decoder = { - .name = "srgc", - .long_name = NULL_IF_CONFIG_SMALL("Screen Recorder Gold Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SRGC, +const FFCodec ff_srgc_decoder = { + .p.name = "srgc", + .p.long_name = NULL_IF_CONFIG_SMALL("Screen Recorder Gold Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SRGC, .priv_data_size = sizeof(MSCCContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c index f2eb9cbb33..f0cb11eceb 100644 --- a/libavcodec/msmpeg4dec.c +++ b/libavcodec/msmpeg4dec.c @@ -864,77 +864,77 @@ void ff_msmpeg4_decode_motion(MpegEncContext *s, int *mx_ptr, int *my_ptr) *my_ptr = my; } -const AVCodec ff_msmpeg4v1_decoder = { - .name = "msmpeg4v1", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSMPEG4V1, +const FFCodec ff_msmpeg4v1_decoder = { + .p.name = "msmpeg4v1", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSMPEG4V1, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; -const AVCodec ff_msmpeg4v2_decoder = { - .name = "msmpeg4v2", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSMPEG4V2, +const FFCodec ff_msmpeg4v2_decoder = { + .p.name = "msmpeg4v2", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSMPEG4V2, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; -const AVCodec ff_msmpeg4v3_decoder = { - .name = "msmpeg4", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSMPEG4V3, +const FFCodec ff_msmpeg4v3_decoder = { + .p.name = "msmpeg4", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSMPEG4V3, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; -const AVCodec ff_wmv1_decoder = { - .name = "wmv1", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV1, +const FFCodec ff_wmv1_decoder = { + .p.name = "wmv1", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV1, .priv_data_size = sizeof(MpegEncContext), .init = ff_msmpeg4_decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index 41bc3465d3..dd75cd5746 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -676,13 +676,13 @@ void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n) } } -const AVCodec ff_msmpeg4v2_encoder = { - .name = "msmpeg4v2", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSMPEG4V2, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_msmpeg4v2_encoder = { + .p.name = "msmpeg4v2", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSMPEG4V2, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &ff_mpv_enc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, @@ -690,13 +690,13 @@ const AVCodec ff_msmpeg4v2_encoder = { .close = ff_mpv_encode_end, }; -const AVCodec ff_msmpeg4v3_encoder = { - .name = "msmpeg4", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSMPEG4V3, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_msmpeg4v3_encoder = { + .p.name = "msmpeg4", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSMPEG4V3, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &ff_mpv_enc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, @@ -704,13 +704,13 @@ const AVCodec ff_msmpeg4v3_encoder = { .close = ff_mpv_encode_end, }; -const AVCodec ff_wmv1_encoder = { - .name = "wmv1", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV1, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_wmv1_encoder = { + .p.name = "wmv1", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV1, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.priv_class = &ff_mpv_enc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(MSMPEG4EncContext), .init = ff_mpv_encode_init, diff --git a/libavcodec/msp2dec.c b/libavcodec/msp2dec.c index 8772bff6bc..b0c772ce4f 100644 --- a/libavcodec/msp2dec.c +++ b/libavcodec/msp2dec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" static int msp2_decode_frame(AVCodecContext *avctx, @@ -93,11 +94,11 @@ static int msp2_decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_msp2_decoder = { - .name = "msp2", - .long_name = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP) version 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSP2, +const FFCodec ff_msp2_decoder = { + .p.name = "msp2", + .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP) version 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSP2, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = msp2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index a4c39dfacc..2506fe1acd 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -160,16 +160,16 @@ static av_cold int msrle_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_msrle_decoder = { - .name = "msrle", - .long_name = NULL_IF_CONFIG_SMALL("Microsoft RLE"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSRLE, +const FFCodec ff_msrle_decoder = { + .p.name = "msrle", + .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft RLE"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSRLE, .priv_data_size = sizeof(MsrleContext), .init = msrle_decode_init, .close = msrle_decode_end, .decode = msrle_decode_frame, .flush = msrle_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index 782c79076f..6641bec89b 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -219,15 +219,15 @@ static av_cold int mss1_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_mss1_decoder = { - .name = "mss1", - .long_name = NULL_IF_CONFIG_SMALL("MS Screen 1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSS1, +const FFCodec ff_mss1_decoder = { + .p.name = "mss1", + .p.long_name = NULL_IF_CONFIG_SMALL("MS Screen 1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSS1, .priv_data_size = sizeof(MSS1Context), .init = mss1_decode_init, .close = mss1_decode_end, .decode = mss1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index 2f3ba3b34b..efe656d1f1 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -847,15 +847,15 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_mss2_decoder = { - .name = "mss2", - .long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSS2, +const FFCodec ff_mss2_decoder = { + .p.name = "mss2", + .p.long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSS2, .priv_data_size = sizeof(MSS2Context), .init = mss2_decode_init, .close = mss2_decode_end, .decode = mss2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c index 81f3634470..7b615e9b80 100644 --- a/libavcodec/mss3.c +++ b/libavcodec/mss3.c @@ -860,15 +860,15 @@ static av_cold int mss3_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_msa1_decoder = { - .name = "msa1", - .long_name = NULL_IF_CONFIG_SMALL("MS ATC Screen"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSA1, +const FFCodec ff_msa1_decoder = { + .p.name = "msa1", + .p.long_name = NULL_IF_CONFIG_SMALL("MS ATC Screen"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSA1, .priv_data_size = sizeof(MSS3Context), .init = mss3_decode_init, .close = mss3_decode_end, .decode = mss3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index 9cedfbddb2..2d1953729d 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -605,15 +605,15 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_mts2_decoder = { - .name = "mts2", - .long_name = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MTS2, +const FFCodec ff_mts2_decoder = { + .p.name = "mts2", + .p.long_name = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MTS2, .priv_data_size = sizeof(MSS4Context), .init = mss4_decode_init, .close = mss4_decode_end, .decode = mss4_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 364c35fff0..416f3c5798 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -342,15 +342,15 @@ static av_cold int msvideo1_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_msvideo1_decoder = { - .name = "msvideo1", - .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video 1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSVIDEO1, +const FFCodec ff_msvideo1_decoder = { + .p.name = "msvideo1", + .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video 1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSVIDEO1, .priv_data_size = sizeof(Msvideo1Context), .init = msvideo1_decode_init, .close = msvideo1_decode_end, .decode = msvideo1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/msvideo1enc.c b/libavcodec/msvideo1enc.c index b252de4663..917b7ea907 100644 --- a/libavcodec/msvideo1enc.c +++ b/libavcodec/msvideo1enc.c @@ -302,15 +302,15 @@ static av_cold int encode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_msvideo1_encoder = { - .name = "msvideo1", - .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MSVIDEO1, +const FFCodec ff_msvideo1_encoder = { + .p.name = "msvideo1", + .p.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MSVIDEO1, .priv_data_size = sizeof(Msvideo1EncContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, + .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c index 5fc6d26a8c..fd2acedbb2 100644 --- a/libavcodec/mv30.c +++ b/libavcodec/mv30.c @@ -703,17 +703,17 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mv30_decoder = { - .name = "mv30", - .long_name = NULL_IF_CONFIG_SMALL("MidiVid 3.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MV30, +const FFCodec ff_mv30_decoder = { + .p.name = "mv30", + .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid 3.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MV30, .priv_data_size = sizeof(MV30Context), .init = decode_init, .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mvcdec.c b/libavcodec/mvcdec.c index 83ff0bda18..7d69eaefae 100644 --- a/libavcodec/mvcdec.c +++ b/libavcodec/mvcdec.c @@ -256,29 +256,29 @@ static int mvc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } #if CONFIG_MVC1_DECODER -const AVCodec ff_mvc1_decoder = { - .name = "mvc1", - .long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MVC1, +const FFCodec ff_mvc1_decoder = { + .p.name = "mvc1", + .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MVC1, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, .decode = mvc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_MVC2_DECODER -const AVCodec ff_mvc2_decoder = { - .name = "mvc2", - .long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MVC2, +const FFCodec ff_mvc2_decoder = { + .p.name = "mvc2", + .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics Motion Video Compressor 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MVC2, .priv_data_size = sizeof(MvcContext), .init = mvc_decode_init, .decode = mvc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c index f2a3659a82..c5b5ce0615 100644 --- a/libavcodec/mvha.c +++ b/libavcodec/mvha.c @@ -300,16 +300,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mvha_decoder = { - .name = "mvha", - .long_name = NULL_IF_CONFIG_SMALL("MidiVid Archive Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MVHA, +const FFCodec ff_mvha_decoder = { + .p.name = "mvha", + .p.long_name = NULL_IF_CONFIG_SMALL("MidiVid Archive Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MVHA, .priv_data_size = sizeof(MVHAContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mwsc.c b/libavcodec/mwsc.c index 2a47d5cff4..67fc5a03dd 100644 --- a/libavcodec/mwsc.c +++ b/libavcodec/mwsc.c @@ -170,16 +170,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_mwsc_decoder = { - .name = "mwsc", - .long_name = NULL_IF_CONFIG_SMALL("MatchWare Screen Capture Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MWSC, +const FFCodec ff_mwsc_decoder = { + .p.name = "mwsc", + .p.long_name = NULL_IF_CONFIG_SMALL("MatchWare Screen Capture Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MWSC, .priv_data_size = sizeof(MWSCContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/mxpegdec.c b/libavcodec/mxpegdec.c index 407726fcaa..6fa650124b 100644 --- a/libavcodec/mxpegdec.c +++ b/libavcodec/mxpegdec.c @@ -343,16 +343,16 @@ the_end: return buf_ptr - buf; } -const AVCodec ff_mxpeg_decoder = { - .name = "mxpeg", - .long_name = NULL_IF_CONFIG_SMALL("Mobotix MxPEG video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MXPEG, +const FFCodec ff_mxpeg_decoder = { + .p.name = "mxpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("Mobotix MxPEG video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MXPEG, .priv_data_size = sizeof(MXpegDecodeContext), .init = mxpeg_decode_init, .close = mxpeg_decode_end, .decode = mxpeg_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index 52200ac92c..dfd96da80b 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -187,17 +187,17 @@ static av_cold int decode_end(AVCodecContext * avctx) { return 0; } -const AVCodec ff_nellymoser_decoder = { - .name = "nellymoser", - .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_NELLYMOSER, +const FFCodec ff_nellymoser_decoder = { + .p.name = "nellymoser", + .p.long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_NELLYMOSER, .priv_data_size = sizeof(NellyMoserDecodeContext), .init = decode_init, .close = decode_end, .decode = decode_tag, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index ae894d5ff3..35a30b9942 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -413,19 +413,19 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_nellymoser_encoder = { - .name = "nellymoser", - .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_NELLYMOSER, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_nellymoser_encoder = { + .p.name = "nellymoser", + .p.long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_NELLYMOSER, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(NellyMoserEncodeContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_NONE }, - .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/notchlc.c b/libavcodec/notchlc.c index 2abf38e619..f3c68905c7 100644 --- a/libavcodec/notchlc.c +++ b/libavcodec/notchlc.c @@ -537,15 +537,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_notchlc_decoder = { - .name = "notchlc", - .long_name = NULL_IF_CONFIG_SMALL("NotchLC"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_NOTCHLC, +const FFCodec ff_notchlc_decoder = { + .p.name = "notchlc", + .p.long_name = NULL_IF_CONFIG_SMALL("NotchLC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_NOTCHLC, .priv_data_size = sizeof(NotchLCContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index 00239b4e2b..ab0279ebfc 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -363,15 +363,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_nuv_decoder = { - .name = "nuv", - .long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_NUV, +const FFCodec ff_nuv_decoder = { + .p.name = "nuv", + .p.long_name = NULL_IF_CONFIG_SMALL("NuppelVideo/RTJPEG"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_NUV, .priv_data_size = sizeof(NuvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c index 24942c1996..43a00e2c67 100644 --- a/libavcodec/nvenc_h264.c +++ b/libavcodec/nvenc_h264.c @@ -219,22 +219,22 @@ static const AVClass h264_nvenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_nvenc_encoder = { - .name = "h264_nvenc", - .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_h264_nvenc_encoder = { + .p.name = "h264_nvenc", + .p.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .init = ff_nvenc_encode_init, .receive_packet = ff_nvenc_receive_packet, .close = ff_nvenc_encode_close, .flush = ff_nvenc_encode_flush, .priv_data_size = sizeof(NvencContext), - .priv_class = &h264_nvenc_class, + .p.priv_class = &h264_nvenc_class, .defaults = defaults, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = ff_nvenc_pix_fmts, - .wrapper_name = "nvenc", + .p.pix_fmts = ff_nvenc_pix_fmts, + .p.wrapper_name = "nvenc", .hw_configs = ff_nvenc_hw_configs, }; diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c index d2fd1db4da..9d8a342257 100644 --- a/libavcodec/nvenc_hevc.c +++ b/libavcodec/nvenc_hevc.c @@ -200,22 +200,22 @@ static const AVClass hevc_nvenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hevc_nvenc_encoder = { - .name = "hevc_nvenc", - .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC hevc encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, +const FFCodec ff_hevc_nvenc_encoder = { + .p.name = "hevc_nvenc", + .p.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC hevc encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, .init = ff_nvenc_encode_init, .receive_packet = ff_nvenc_receive_packet, .close = ff_nvenc_encode_close, .flush = ff_nvenc_encode_flush, .priv_data_size = sizeof(NvencContext), - .priv_class = &hevc_nvenc_class, + .p.priv_class = &hevc_nvenc_class, .defaults = defaults, - .pix_fmts = ff_nvenc_pix_fmts, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.pix_fmts = ff_nvenc_pix_fmts, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "nvenc", + .p.wrapper_name = "nvenc", .hw_configs = ff_nvenc_hw_configs, }; diff --git a/libavcodec/omx.c b/libavcodec/omx.c index bc20b1db52..4bf3b4ffdd 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -936,19 +936,19 @@ static const AVClass omx_mpeg4enc_class = { .option = options, .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mpeg4_omx_encoder = { - .name = "mpeg4_omx", - .long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL MPEG-4 video encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, +const FFCodec ff_mpeg4_omx_encoder = { + .p.name = "mpeg4_omx", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL MPEG-4 video encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(OMXCodecContext), .init = omx_encode_init, .encode2 = omx_encode_frame, .close = omx_encode_end, - .pix_fmts = omx_encoder_pix_fmts, - .capabilities = AV_CODEC_CAP_DELAY, + .p.pix_fmts = omx_encoder_pix_fmts, + .p.capabilities = AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &omx_mpeg4enc_class, + .p.priv_class = &omx_mpeg4enc_class, }; static const AVClass omx_h264enc_class = { @@ -957,17 +957,17 @@ static const AVClass omx_h264enc_class = { .option = options, .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_omx_encoder = { - .name = "h264_omx", - .long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL H.264 video encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_h264_omx_encoder = { + .p.name = "h264_omx", + .p.long_name = NULL_IF_CONFIG_SMALL("OpenMAX IL H.264 video encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(OMXCodecContext), .init = omx_encode_init, .encode2 = omx_encode_frame, .close = omx_encode_end, - .pix_fmts = omx_encoder_pix_fmts, - .capabilities = AV_CODEC_CAP_DELAY, + .p.pix_fmts = omx_encoder_pix_fmts, + .p.capabilities = AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &omx_h264enc_class, + .p.priv_class = &omx_h264enc_class, }; diff --git a/libavcodec/on2avc.c b/libavcodec/on2avc.c index 401691d03e..79af3d9692 100644 --- a/libavcodec/on2avc.c +++ b/libavcodec/on2avc.c @@ -1005,17 +1005,17 @@ static av_cold int on2avc_decode_close(AVCodecContext *avctx) } -const AVCodec ff_on2avc_decoder = { - .name = "on2avc", - .long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ON2AVC, +const FFCodec ff_on2avc_decoder = { + .p.name = "on2avc", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 Audio for Video Codec"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ON2AVC, .priv_data_size = sizeof(On2AVCContext), .init = on2avc_decode_init, .decode = on2avc_decode_frame, .close = on2avc_decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/options.c b/libavcodec/options.c index 306625f25e..9cf5b0eb74 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -68,8 +68,10 @@ static const AVClass *codec_child_class_iterate(void **iter) static AVClassCategory get_category(void *ptr) { AVCodecContext* avctx = ptr; - if(avctx->codec && avctx->codec->decode) return AV_CLASS_CATEGORY_DECODER; - else return AV_CLASS_CATEGORY_ENCODER; + if (avctx->codec && ffcodec(avctx->codec)->decode) + return AV_CLASS_CATEGORY_DECODER; + else + return AV_CLASS_CATEGORY_ENCODER; } static const AVClass av_codec_context_class = { @@ -86,6 +88,7 @@ static const AVClass av_codec_context_class = { static int init_context_defaults(AVCodecContext *s, const AVCodec *codec) { + const FFCodec *const codec2 = ffcodec(codec); int flags=0; memset(s, 0, sizeof(AVCodecContext)); @@ -122,8 +125,8 @@ static int init_context_defaults(AVCodecContext *s, const AVCodec *codec) s->sample_fmt = AV_SAMPLE_FMT_NONE; s->reordered_opaque = AV_NOPTS_VALUE; - if(codec && codec->priv_data_size){ - s->priv_data = av_mallocz(codec->priv_data_size); + if(codec && codec2->priv_data_size){ + s->priv_data = av_mallocz(codec2->priv_data_size); if (!s->priv_data) return AVERROR(ENOMEM); if(codec->priv_class){ @@ -131,9 +134,9 @@ static int init_context_defaults(AVCodecContext *s, const AVCodec *codec) av_opt_set_defaults(s->priv_data); } } - if (codec && codec->defaults) { + if (codec && codec2->defaults) { int ret; - const AVCodecDefault *d = codec->defaults; + const AVCodecDefault *d = codec2->defaults; while (d->key) { ret = av_opt_set(s, d->key, d->value, 0); av_assert0(ret >= 0); diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 4bd9555031..8ad53c7cb3 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -705,17 +705,17 @@ static const AVClass opus_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_opus_decoder = { - .name = "opus", - .long_name = NULL_IF_CONFIG_SMALL("Opus"), - .priv_class = &opus_class, - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_OPUS, +const FFCodec ff_opus_decoder = { + .p.name = "opus", + .p.long_name = NULL_IF_CONFIG_SMALL("Opus"), + .p.priv_class = &opus_class, + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OPUS, .priv_data_size = sizeof(OpusContext), .init = opus_decode_init, .close = opus_decode_close, .decode = opus_decode_packet, .flush = opus_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index b220206ab3..28c2ab95db 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -725,26 +725,26 @@ static const AVCodecDefault opusenc_defaults[] = { { NULL }, }; -const AVCodec ff_opus_encoder = { - .name = "opus", - .long_name = NULL_IF_CONFIG_SMALL("Opus"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_OPUS, +const FFCodec ff_opus_encoder = { + .p.name = "opus", + .p.long_name = NULL_IF_CONFIG_SMALL("Opus"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_OPUS, .defaults = opusenc_defaults, - .priv_class = &opusenc_class, + .p.priv_class = &opusenc_class, .priv_data_size = sizeof(OpusEncContext), .init = opus_encode_init, .encode2 = opus_encode_frame, .close = opus_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .capabilities = AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, - .supported_samplerates = (const int []){ 48000, 0 }, + .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY, + .p.supported_samplerates = (const int []){ 48000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0 }, #endif - .ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/pafaudio.c b/libavcodec/pafaudio.c index 793a30e82f..a71b0eb50a 100644 --- a/libavcodec/pafaudio.c +++ b/libavcodec/pafaudio.c @@ -74,13 +74,13 @@ static int paf_audio_decode(AVCodecContext *avctx, void *data, return pkt->size; } -const AVCodec ff_paf_audio_decoder = { - .name = "paf_audio", - .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_PAF_AUDIO, +const FFCodec ff_paf_audio_decoder = { + .p.name = "paf_audio", + .p.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_PAF_AUDIO, .init = paf_audio_init, .decode = paf_audio_decode, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pafvideo.c b/libavcodec/pafvideo.c index 91dd92edec..68f6b9b4df 100644 --- a/libavcodec/pafvideo.c +++ b/libavcodec/pafvideo.c @@ -408,15 +408,15 @@ static int paf_video_decode(AVCodecContext *avctx, void *data, return pkt->size; } -const AVCodec ff_paf_video_decoder = { - .name = "paf_video", - .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PAF_VIDEO, +const FFCodec ff_paf_video_decoder = { + .p.name = "paf_video", + .p.long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PAF_VIDEO, .priv_data_size = sizeof(PAFVideoDecContext), .init = paf_video_init, .close = paf_video_close, .decode = paf_video_decode, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index c81b5f2da0..8ded835d25 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -127,14 +127,14 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_pam_encoder = { - .name = "pam", - .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PAM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_pam_encoder = { + .p.name = "pam", + .p.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PAM, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pam_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c index 6250f25e72..9493b10ecd 100644 --- a/libavcodec/pcm-bluray.c +++ b/libavcodec/pcm-bluray.c @@ -27,6 +27,7 @@ #include "libavutil/channel_layout.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" /* @@ -299,14 +300,14 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data, return retval + 4; } -const AVCodec ff_pcm_bluray_decoder = { - .name = "pcm_bluray", - .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_PCM_BLURAY, +const FFCodec ff_pcm_bluray_decoder = { + .p.name = "pcm_bluray", + .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_PCM_BLURAY, .decode = pcm_bluray_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]){ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c index 1c5b1c6cb8..37b4709df8 100644 --- a/libavcodec/pcm-blurayenc.c +++ b/libavcodec/pcm-blurayenc.c @@ -270,17 +270,17 @@ static int pcm_bluray_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_pcm_bluray_encoder = { - .name = "pcm_bluray", - .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_PCM_BLURAY, +const FFCodec ff_pcm_bluray_encoder = { + .p.name = "pcm_bluray", + .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_PCM_BLURAY, .priv_data_size = sizeof(BlurayPCMEncContext), .init = pcm_bluray_encode_init, .encode2 = pcm_bluray_encode_frame, - .supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, + .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, @@ -293,7 +293,7 @@ const AVCodec ff_pcm_bluray_encoder = { AV_CH_LAYOUT_7POINT1, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_SURROUND, @@ -305,8 +305,8 @@ const AVCodec ff_pcm_bluray_encoder = { AV_CHANNEL_LAYOUT_7POINT0, AV_CHANNEL_LAYOUT_7POINT1, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, }; diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c index 3beaadd925..6c11bb7792 100644 --- a/libavcodec/pcm-dvd.c +++ b/libavcodec/pcm-dvd.c @@ -296,17 +296,17 @@ static int pcm_dvd_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_pcm_dvd_decoder = { - .name = "pcm_dvd", - .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_PCM_DVD, +const FFCodec ff_pcm_dvd_decoder = { + .p.name = "pcm_dvd", + .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_PCM_DVD, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_decode_init, .decode = pcm_dvd_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index 4305ba99b4..d0c328beb0 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -172,29 +172,29 @@ static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_pcm_dvd_encoder = { - .name = "pcm_dvd", - .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_PCM_DVD, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_pcm_dvd_encoder = { + .p.name = "pcm_dvd", + .p.long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for DVD media"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_PCM_DVD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(PCMDVDContext), .init = pcm_dvd_encode_init, .encode2 = pcm_dvd_encode_frame, - .supported_samplerates = (const int[]) { 48000, 96000, 0}, + .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_5POINT1, AV_CHANNEL_LAYOUT_7POINT1, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index c8000d454e..1e83b356ac 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -554,15 +554,15 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, #define PCM_ENCODER_0(id_, sample_fmt_, name_, long_name_) #define PCM_ENCODER_1(id_, sample_fmt_, name_, long_name_) \ -const AVCodec ff_ ## name_ ## _encoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = AV_CODEC_ID_ ## id_, \ - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \ +const FFCodec ff_ ## name_ ## _encoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = AV_CODEC_ID_ ## id_, \ + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \ .init = pcm_encode_init, \ .encode2 = pcm_encode_frame, \ - .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ + .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } @@ -576,16 +576,16 @@ const AVCodec ff_ ## name_ ## _encoder = { \ #define PCM_DECODER_0(id, sample_fmt, name, long_name) #define PCM_DECODER_1(id_, sample_fmt_, name_, long_name_) \ -const AVCodec ff_ ## name_ ## _decoder = { \ - .name = #name_, \ - .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ - .type = AVMEDIA_TYPE_AUDIO, \ - .id = AV_CODEC_ID_ ## id_, \ +const FFCodec ff_ ## name_ ## _decoder = { \ + .p.name = #name_, \ + .p.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ + .p.type = AVMEDIA_TYPE_AUDIO, \ + .p.id = AV_CODEC_ID_ ## id_, \ .priv_data_size = sizeof(PCMDecode), \ .init = pcm_decode_init, \ .decode = pcm_decode_frame, \ - .capabilities = AV_CODEC_CAP_DR1, \ - .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ + .p.capabilities = AV_CODEC_CAP_DR1, \ + .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ AV_SAMPLE_FMT_NONE }, \ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, \ } diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index b8d911be6b..9c36e76343 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "get_bits.h" #include "internal.h" @@ -249,11 +250,11 @@ end: return ret; } -const AVCodec ff_pcx_decoder = { - .name = "pcx", - .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PCX, +const FFCodec ff_pcx_decoder = { + .p.name = "pcx", + .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PCX, .decode = pcx_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index 10bad080e1..1ccd7db92f 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -192,13 +192,13 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_pcx_encoder = { - .name = "pcx", - .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PCX, +const FFCodec ff_pcx_encoder = { + .p.name = "pcx", + .p.long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PCX, .encode2 = pcx_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index fe0a6e226d..4cd5e237f2 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -691,15 +691,15 @@ static const AVClass pgsdec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_pgssub_decoder = { - .name = "pgssub", - .long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_HDMV_PGS_SUBTITLE, +const FFCodec ff_pgssub_decoder = { + .p.name = "pgssub", + .p.long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_HDMV_PGS_SUBTITLE, .priv_data_size = sizeof(PGSSubContext), .init = init_decoder, .close = close_decoder, .decode = decode, - .priv_class = &pgsdec_class, + .p.priv_class = &pgsdec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c index 1d659e82c2..2dba42cafb 100644 --- a/libavcodec/pgxdec.c +++ b/libavcodec/pgxdec.c @@ -22,6 +22,7 @@ #include "avcodec.h" #include "internal.h" #include "bytestream.h" +#include "codec_internal.h" #include "libavutil/imgutils.h" static int pgx_get_number(AVCodecContext *avctx, GetByteContext *g, int *number) { @@ -158,11 +159,11 @@ static int pgx_decode_frame(AVCodecContext *avctx, void *data, return 0; } -const AVCodec ff_pgx_decoder = { - .name = "pgx", - .long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PGX, +const FFCodec ff_pgx_decoder = { + .p.name = "pgx", + .p.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PGX, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = pgx_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c index 293455d1cb..a088ed0fa3 100644 --- a/libavcodec/photocd.c +++ b/libavcodec/photocd.c @@ -457,16 +457,16 @@ static const AVClass photocd_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_photocd_decoder = { - .name = "photocd", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PHOTOCD, +const FFCodec ff_photocd_decoder = { + .p.name = "photocd", + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PHOTOCD, .priv_data_size = sizeof(PhotoCDContext), - .priv_class = &photocd_class, + .p.priv_class = &photocd_class, .init = photocd_decode_init, .close = photocd_decode_close, .decode = photocd_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, - .long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.long_name = NULL_IF_CONFIG_SMALL("Kodak Photo CD"), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index c7b3a335d3..987212e8b7 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -28,6 +28,7 @@ #include "avcodec.h" #include "bytestream.h" #include "cga_data.h" +#include "codec_internal.h" #include "internal.h" typedef struct PicContext { @@ -280,12 +281,12 @@ finish: return avpkt->size; } -const AVCodec ff_pictor_decoder = { - .name = "pictor", - .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PICTOR, +const FFCodec ff_pictor_decoder = { + .p.name = "pictor", + .p.long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PICTOR, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PicContext), .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c index 450cf49dea..daa3383fcc 100644 --- a/libavcodec/pixlet.c +++ b/libavcodec/pixlet.c @@ -693,16 +693,16 @@ static int pixlet_decode_frame(AVCodecContext *avctx, void *data, return pktsize; } -const AVCodec ff_pixlet_decoder = { - .name = "pixlet", - .long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PIXLET, +const FFCodec ff_pixlet_decoder = { + .p.name = "pixlet", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple Pixlet"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PIXLET, .init = pixlet_init, .close = pixlet_close, .decode = pixlet_decode_frame, .priv_data_size = sizeof(PixletContext), - .capabilities = AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index b28eadc386..73fda21ca0 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1719,34 +1719,34 @@ static av_cold int png_dec_end(AVCodecContext *avctx) } #if CONFIG_APNG_DECODER -const AVCodec ff_apng_decoder = { - .name = "apng", - .long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_APNG, +const FFCodec ff_apng_decoder = { + .p.name = "apng", + .p.long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_APNG, .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, .decode = decode_frame_apng, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, }; #endif #if CONFIG_PNG_DECODER -const AVCodec ff_png_decoder = { - .name = "png", - .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PNG, +const FFCodec ff_png_decoder = { + .p.name = "png", + .p.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PNG, .priv_data_size = sizeof(PNGDecContext), .init = png_dec_init, .close = png_dec_end, .decode = decode_frame_png, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 8db5b1fbe6..f67f90cd14 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -1111,17 +1111,17 @@ static const AVClass pngenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_png_encoder = { - .name = "png", - .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PNG, +const FFCodec ff_png_encoder = { + .p.name = "png", + .p.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PNG, .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, .encode2 = encode_png, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_PAL8, @@ -1129,21 +1129,21 @@ const AVCodec ff_png_encoder = { AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, - .priv_class = &pngenc_class, + .p.priv_class = &pngenc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -const AVCodec ff_apng_encoder = { - .name = "apng", - .long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_APNG, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_apng_encoder = { + .p.name = "apng", + .p.long_name = NULL_IF_CONFIG_SMALL("APNG (Animated Portable Network Graphics) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_APNG, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(PNGEncContext), .init = png_enc_init, .close = png_enc_close, .encode2 = encode_apng, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_PAL8, @@ -1151,6 +1151,6 @@ const AVCodec ff_apng_encoder = { AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, AV_PIX_FMT_NONE }, - .priv_class = &pngenc_class, + .p.priv_class = &pngenc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 57c426b0c9..5984b60999 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -22,6 +22,7 @@ #include "config_components.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "put_bits.h" #include "pnm.h" @@ -331,73 +332,73 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, #if CONFIG_PGM_DECODER -const AVCodec ff_pgm_decoder = { - .name = "pgm", - .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PGM, +const FFCodec ff_pgm_decoder = { + .p.name = "pgm", + .p.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PGM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif #if CONFIG_PGMYUV_DECODER -const AVCodec ff_pgmyuv_decoder = { - .name = "pgmyuv", - .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PGMYUV, +const FFCodec ff_pgmyuv_decoder = { + .p.name = "pgmyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PGMYUV, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif #if CONFIG_PPM_DECODER -const AVCodec ff_ppm_decoder = { - .name = "ppm", - .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PPM, +const FFCodec ff_ppm_decoder = { + .p.name = "ppm", + .p.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PPM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif #if CONFIG_PBM_DECODER -const AVCodec ff_pbm_decoder = { - .name = "pbm", - .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PBM, +const FFCodec ff_pbm_decoder = { + .p.name = "pbm", + .p.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PBM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif #if CONFIG_PAM_DECODER -const AVCodec ff_pam_decoder = { - .name = "pam", - .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PAM, +const FFCodec ff_pam_decoder = { + .p.name = "pam", + .p.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PAM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif #if CONFIG_PFM_DECODER -const AVCodec ff_pfm_decoder = { - .name = "pfm", - .long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PFM, +const FFCodec ff_pfm_decoder = { + .p.name = "pfm", + .p.long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PFM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(PNMContext), .decode = pnm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; #endif diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index fbe26ede25..020dbd218c 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -151,14 +151,14 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } #if CONFIG_PGM_ENCODER -const AVCodec ff_pgm_encoder = { - .name = "pgm", - .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PGM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_pgm_encoder = { + .p.name = "pgm", + .p.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PGM, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -166,14 +166,14 @@ const AVCodec ff_pgm_encoder = { #endif #if CONFIG_PGMYUV_ENCODER -const AVCodec ff_pgmyuv_encoder = { - .name = "pgmyuv", - .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PGMYUV, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_pgmyuv_encoder = { + .p.name = "pgmyuv", + .p.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PGMYUV, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -181,14 +181,14 @@ const AVCodec ff_pgmyuv_encoder = { #endif #if CONFIG_PPM_ENCODER -const AVCodec ff_ppm_encoder = { - .name = "ppm", - .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PPM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_ppm_encoder = { + .p.name = "ppm", + .p.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PPM, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, @@ -196,28 +196,28 @@ const AVCodec ff_ppm_encoder = { #endif #if CONFIG_PBM_ENCODER -const AVCodec ff_pbm_encoder = { - .name = "pbm", - .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PBM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_pbm_encoder = { + .p.name = "pbm", + .p.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PBM, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PFM_ENCODER -const AVCodec ff_pfm_encoder = { - .name = "pfm", - .long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PFM, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_pfm_encoder = { + .p.name = "pfm", + .p.long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PFM, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 22fd78ffd8..020206ab22 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -871,18 +871,18 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) } #endif -const AVCodec ff_prores_decoder = { - .name = "prores", - .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, +const FFCodec ff_prores_decoder = { + .p.name = "prores", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = decode_init, .close = decode_close, .decode = decode_frame, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 4f634587a9..2f6bd89efd 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -940,34 +940,34 @@ static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE }; -const AVCodec ff_prores_aw_encoder = { - .name = "prores_aw", - .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .pix_fmts = pix_fmts, +const FFCodec ff_prores_aw_encoder = { + .p.name = "prores_aw", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.pix_fmts = pix_fmts, .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, .encode2 = prores_encode_frame, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .priv_class = &prores_enc_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.priv_class = &prores_enc_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_prores_encoder = { - .name = "prores", - .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .pix_fmts = pix_fmts, +const FFCodec ff_prores_encoder = { + .p.name = "prores", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.pix_fmts = pix_fmts, .priv_data_size = sizeof(ProresContext), .init = prores_encode_init, .close = prores_encode_close, .encode2 = prores_encode_frame, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .priv_class = &prores_enc_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.priv_class = &prores_enc_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 39cd38bcfa..429b623678 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1393,21 +1393,21 @@ static const AVClass proresenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_prores_ks_encoder = { - .name = "prores_ks", - .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, +const FFCodec ff_prores_ks_encoder = { + .p.name = "prores_ks", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, .priv_data_size = sizeof(ProresContext), .init = encode_init, .close = encode_close, .encode2 = encode_frame, - .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE }, - .priv_class = &proresenc_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), + .p.priv_class = &proresenc_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c index 69a31ee9d1..b890a42a32 100644 --- a/libavcodec/prosumer.c +++ b/libavcodec/prosumer.c @@ -366,16 +366,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_prosumer_decoder = { - .name = "prosumer", - .long_name = NULL_IF_CONFIG_SMALL("Brooktree ProSumer Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PROSUMER, +const FFCodec ff_prosumer_decoder = { + .p.name = "prosumer", + .p.long_name = NULL_IF_CONFIG_SMALL("Brooktree ProSumer Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PROSUMER, .priv_data_size = sizeof(ProSumerContext), .init = decode_init, .decode = decode_frame, .close = decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/psd.c b/libavcodec/psd.c index 681d8a83c9..3496759c5b 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -20,6 +20,7 @@ */ #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" enum PsdCompr { @@ -545,12 +546,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_psd_decoder = { - .name = "psd", - .long_name = NULL_IF_CONFIG_SMALL("Photoshop PSD file"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PSD, +const FFCodec ff_psd_decoder = { + .p.name = "psd", + .p.long_name = NULL_IF_CONFIG_SMALL("Photoshop PSD file"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PSD, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(PSDContext), .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, }; diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 41cf03d91f..60ba87dac4 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -60,7 +60,7 @@ static void validate_thread_parameters(AVCodecContext *avctx) } else if (avctx->codec->capabilities & AV_CODEC_CAP_SLICE_THREADS && avctx->thread_type & FF_THREAD_SLICE) { avctx->active_thread_type = FF_THREAD_SLICE; - } else if (!(avctx->codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) { + } else if (!(ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_AUTO_THREADS)) { avctx->thread_count = 1; avctx->active_thread_type = 0; } diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 41ad3c76f5..aa971bd74d 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -68,7 +68,7 @@ enum { enum { UNINITIALIZED, ///< Thread has not been created, AVCodec->close mustn't be called - NEEDS_CLOSE, ///< AVCodec->close needs to be called + NEEDS_CLOSE, ///< FFCodec->close needs to be called INITIALIZED, ///< Thread has been properly set up }; @@ -183,7 +183,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) { PerThreadContext *p = arg; AVCodecContext *avctx = p->avctx; - const AVCodec *codec = avctx->codec; + const FFCodec *codec = ffcodec(avctx->codec); pthread_mutex_lock(&p->mutex); while (1) { @@ -260,9 +260,10 @@ FF_ENABLE_DEPRECATION_WARNINGS */ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, int for_user) { + const FFCodec *const codec = ffcodec(dst->codec); int err = 0; - if (dst != src && (for_user || src->codec->update_thread_context)) { + if (dst != src && (for_user || codec->update_thread_context)) { dst->time_base = src->time_base; dst->framerate = src->framerate; dst->width = src->width; @@ -328,11 +329,11 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (for_user) { - if (dst->codec->update_thread_context_for_user) - err = dst->codec->update_thread_context_for_user(dst, src); + if (codec->update_thread_context_for_user) + err = codec->update_thread_context_for_user(dst, src); } else { - if (dst->codec->update_thread_context) - err = dst->codec->update_thread_context(dst, src); + if (codec->update_thread_context) + err = codec->update_thread_context(dst, src); } return err; @@ -701,7 +702,7 @@ DEFINE_OFFSET_ARRAY(PerThreadContext, per_thread, pthread_init_cnt, void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) { FrameThreadContext *fctx = avctx->internal->thread_ctx; - const AVCodec *codec = avctx->codec; + const FFCodec *codec = ffcodec(avctx->codec); int i; park_frame_worker_threads(fctx, thread_count); @@ -743,7 +744,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_freep(&p->released_buffers); #endif if (ctx->priv_data) { - if (codec->priv_class) + if (codec->p.priv_class) av_opt_free(ctx->priv_data); av_freep(&ctx->priv_data); } @@ -771,7 +772,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) static av_cold int init_thread(PerThreadContext *p, int *threads_to_free, FrameThreadContext *fctx, AVCodecContext *avctx, - const AVCodec *codec, int first) + const FFCodec *codec, int first) { AVCodecContext *copy; int err; @@ -802,8 +803,8 @@ static av_cold int init_thread(PerThreadContext *p, int *threads_to_free, if (!copy->priv_data) return AVERROR(ENOMEM); - if (codec->priv_class) { - *(const AVClass **)copy->priv_data = codec->priv_class; + if (codec->p.priv_class) { + *(const AVClass **)copy->priv_data = codec->p.priv_class; err = av_opt_copy(copy->priv_data, avctx->priv_data); if (err < 0) return err; @@ -848,7 +849,7 @@ static av_cold int init_thread(PerThreadContext *p, int *threads_to_free, int ff_frame_thread_init(AVCodecContext *avctx) { int thread_count = avctx->thread_count; - const AVCodec *codec = avctx->codec; + const FFCodec *codec = ffcodec(avctx->codec); FrameThreadContext *fctx; int err, i = 0; @@ -880,7 +881,7 @@ int ff_frame_thread_init(AVCodecContext *avctx) fctx->async_lock = 1; fctx->delaying = 1; - if (codec->type == AVMEDIA_TYPE_VIDEO) + if (codec->p.type == AVMEDIA_TYPE_VIDEO) avctx->delay = avctx->thread_count - 1; fctx->threads = av_calloc(thread_count, sizeof(*fctx->threads)); @@ -932,8 +933,8 @@ void ff_thread_flush(AVCodecContext *avctx) release_delayed_buffers(p); #endif - if (avctx->codec->flush) - avctx->codec->flush(p->avctx); + if (ffcodec(avctx->codec)->flush) + ffcodec(avctx->codec)->flush(p->avctx); } } @@ -942,7 +943,7 @@ int ff_thread_can_start_frame(AVCodecContext *avctx) PerThreadContext *p = avctx->internal->thread_ctx; FF_DISABLE_DEPRECATION_WARNINGS if ((avctx->active_thread_type&FF_THREAD_FRAME) && atomic_load(&p->state) != STATE_SETTING_UP && - (avctx->codec->update_thread_context + (ffcodec(avctx->codec)->update_thread_context #if FF_API_THREAD_SAFE_CALLBACKS || !THREAD_SAFE_CALLBACKS(avctx) #endif @@ -964,7 +965,7 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int fla p = avctx->internal->thread_ctx; FF_DISABLE_DEPRECATION_WARNINGS if (atomic_load(&p->state) != STATE_SETTING_UP && - (avctx->codec->update_thread_context + (ffcodec(avctx->codec)->update_thread_context #if FF_API_THREAD_SAFE_CALLBACKS || !THREAD_SAFE_CALLBACKS(avctx) #endif @@ -996,7 +997,7 @@ FF_DISABLE_DEPRECATION_WARNINGS pthread_mutex_unlock(&p->progress_mutex); } - if (!THREAD_SAFE_CALLBACKS(avctx) && !avctx->codec->update_thread_context) + if (!THREAD_SAFE_CALLBACKS(avctx) && !ffcodec(avctx->codec)->update_thread_context) ff_thread_finish_setup(avctx); FF_ENABLE_DEPRECATION_WARNINGS #endif @@ -1059,7 +1060,7 @@ int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags) if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); - if (avctx->codec->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS) { + if (ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS) { atomic_int *progress; f->progress = av_buffer_alloc(2 * sizeof(*progress)); if (!f->progress) { diff --git a/libavcodec/pthread_slice.c b/libavcodec/pthread_slice.c index 2645eb4cdc..0ad1965a22 100644 --- a/libavcodec/pthread_slice.c +++ b/libavcodec/pthread_slice.c @@ -156,7 +156,7 @@ int ff_slice_thread_init(AVCodecContext *avctx) } avctx->internal->thread_ctx = c = av_mallocz(sizeof(*c)); - mainfunc = avctx->codec->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF ? &main_function : NULL; + mainfunc = ffcodec(avctx->codec)->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF ? &main_function : NULL; if (!c || (thread_count = avpriv_slicethread_create(&c->thread, avctx, worker_func, mainfunc, thread_count)) <= 1) { if (c) avpriv_slicethread_free(&c->thread); diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 47b8926f73..5f00f7fbee 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, @@ -85,11 +86,11 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return offset + w*h*bytes_per_pixel; } -const AVCodec ff_ptx_decoder = { - .name = "ptx", - .long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PTX, +const FFCodec ff_ptx_decoder = { + .p.name = "ptx", + .p.long_name = NULL_IF_CONFIG_SMALL("V.Flash PTX image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PTX, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = ptx_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 1114dd750a..2338ec240c 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -791,14 +791,14 @@ erasure: return buf_size; } -const AVCodec ff_qcelp_decoder = { - .name = "qcelp", - .long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_QCELP, +const FFCodec ff_qcelp_decoder = { + .p.name = "qcelp", + .p.long_name = NULL_IF_CONFIG_SMALL("QCELP / PureVoice"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_QCELP, .init = qcelp_decode_init, .decode = qcelp_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(QCELPContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index a167e2b25a..b6a3a7be50 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1870,15 +1870,15 @@ static int qdm2_decode_frame(AVCodecContext *avctx, void *data, return s->checksum_size; } -const AVCodec ff_qdm2_decoder = { - .name = "qdm2", - .long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_QDM2, +const FFCodec ff_qdm2_decoder = { + .p.name = "qdm2", + .p.long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_QDM2, .priv_data_size = sizeof(QDM2Context), .init = qdm2_decode_init, .close = qdm2_decode_close, .decode = qdm2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/qdmc.c b/libavcodec/qdmc.c index 9e467246a3..44cb6e3b99 100644 --- a/libavcodec/qdmc.c +++ b/libavcodec/qdmc.c @@ -729,16 +729,16 @@ static int qdmc_decode_frame(AVCodecContext *avctx, void *data, return ret; } -const AVCodec ff_qdmc_decoder = { - .name = "qdmc", - .long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_QDMC, +const FFCodec ff_qdmc_decoder = { + .p.name = "qdmc", + .p.long_name = NULL_IF_CONFIG_SMALL("QDesign Music Codec 1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_QDMC, .priv_data_size = sizeof(QDMCContext), .init = qdmc_decode_init, .close = qdmc_decode_close, .decode = qdmc_decode_frame, .flush = qdmc_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index fcc1de0c62..a4cda83096 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -30,6 +30,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" enum QuickdrawOpcodes { @@ -514,11 +515,11 @@ static int decode_frame(AVCodecContext *avctx, } } -const AVCodec ff_qdraw_decoder = { - .name = "qdraw", - .long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_QDRAW, +const FFCodec ff_qdraw_decoder = { + .p.name = "qdraw", + .p.long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_QDRAW, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 14d9ea945e..658cb028ea 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -353,17 +353,17 @@ static av_cold int decode_init(AVCodecContext *avctx){ return 0; } -const AVCodec ff_qpeg_decoder = { - .name = "qpeg", - .long_name = NULL_IF_CONFIG_SMALL("Q-team QPEG"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_QPEG, +const FFCodec ff_qpeg_decoder = { + .p.name = "qpeg", + .p.long_name = NULL_IF_CONFIG_SMALL("Q-team QPEG"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_QPEG, .priv_data_size = sizeof(QpegContext), .init = decode_init, .close = decode_end, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 1b5bf85cb6..661f15bc75 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -43,6 +43,7 @@ #include "libavutil/film_grain_params.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "decode.h" #include "hwconfig.h" @@ -977,25 +978,25 @@ static const AVClass x##_qsv_class = { \ .option = opt, \ .version = LIBAVUTIL_VERSION_INT, \ }; \ -const AVCodec ff_##x##_qsv_decoder = { \ - .name = #x "_qsv", \ - .long_name = NULL_IF_CONFIG_SMALL(#X " video (Intel Quick Sync Video acceleration)"), \ +const FFCodec ff_##x##_qsv_decoder = { \ + .p.name = #x "_qsv", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#X " video (Intel Quick Sync Video acceleration)"), \ .priv_data_size = sizeof(QSVDecContext), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = AV_CODEC_ID_##X, \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = AV_CODEC_ID_##X, \ .init = qsv_decode_init, \ .decode = qsv_decode_frame, \ .flush = qsv_decode_flush, \ .close = qsv_decode_close, \ .bsfs = bsf_name, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID, \ - .priv_class = &x##_qsv_class, \ - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID, \ + .p.priv_class = &x##_qsv_class, \ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ AV_PIX_FMT_P010, \ AV_PIX_FMT_QSV, \ AV_PIX_FMT_NONE }, \ .hw_configs = qsv_hw_configs, \ - .wrapper_name = "qsv", \ + .p.wrapper_name = "qsv", \ }; \ #define DEFINE_QSV_DECODER(x, X, bsf_name) DEFINE_QSV_DECODER_WITH_OPTION(x, X, bsf_name, options) diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index ec9dd9fded..b870a1596a 100644 --- a/libavcodec/qsvenc_h264.c +++ b/libavcodec/qsvenc_h264.c @@ -177,23 +177,23 @@ static const AVCodecDefault qsv_enc_defaults[] = { { NULL }, }; -const AVCodec ff_h264_qsv_encoder = { - .name = "h264_qsv", - .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"), +const FFCodec ff_h264_qsv_encoder = { + .p.name = "h264_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVH264EncContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .init = qsv_enc_init, .encode2 = qsv_enc_frame, .close = qsv_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = qsv_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "qsv", + .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index 84f41336b5..260d9dabdd 100644 --- a/libavcodec/qsvenc_hevc.c +++ b/libavcodec/qsvenc_hevc.c @@ -291,17 +291,17 @@ static const AVCodecDefault qsv_enc_defaults[] = { { NULL }, }; -const AVCodec ff_hevc_qsv_encoder = { - .name = "hevc_qsv", - .long_name = NULL_IF_CONFIG_SMALL("HEVC (Intel Quick Sync Video acceleration)"), +const FFCodec ff_hevc_qsv_encoder = { + .p.name = "hevc_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("HEVC (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVHEVCEncContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, .init = qsv_enc_init, .encode2 = qsv_enc_frame, .close = qsv_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV, #if QSV_VERSION_ATLEAST(1, 17) @@ -311,9 +311,9 @@ const AVCodec ff_hevc_qsv_encoder = { AV_PIX_FMT_X2RGB10, #endif AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = qsv_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "qsv", + .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c index 1aa63b7f7d..63127a68e0 100644 --- a/libavcodec/qsvenc_jpeg.c +++ b/libavcodec/qsvenc_jpeg.c @@ -79,21 +79,21 @@ static const AVCodecDefault qsv_enc_defaults[] = { { NULL }, }; -const AVCodec ff_mjpeg_qsv_encoder = { - .name = "mjpeg_qsv", - .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Intel Quick Sync Video acceleration)"), +const FFCodec ff_mjpeg_qsv_encoder = { + .p.name = "mjpeg_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVMJPEGEncContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, .init = qsv_enc_init, .encode2 = qsv_enc_frame, .close = qsv_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = qsv_enc_defaults, - .wrapper_name = "qsv", + .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c index 0d7c510b84..b8b2f7b106 100644 --- a/libavcodec/qsvenc_mpeg2.c +++ b/libavcodec/qsvenc_mpeg2.c @@ -92,22 +92,22 @@ static const AVCodecDefault qsv_enc_defaults[] = { { NULL }, }; -const AVCodec ff_mpeg2_qsv_encoder = { - .name = "mpeg2_qsv", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick Sync Video acceleration)"), +const FFCodec ff_mpeg2_qsv_encoder = { + .p.name = "mpeg2_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVMpeg2EncContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, .init = qsv_enc_init, .encode2 = qsv_enc_frame, .close = qsv_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = qsv_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "qsv", + .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c index b8fea9e3a7..73eb3ce546 100644 --- a/libavcodec/qsvenc_vp9.c +++ b/libavcodec/qsvenc_vp9.c @@ -102,23 +102,23 @@ static const AVCodecDefault qsv_enc_defaults[] = { { NULL }, }; -const AVCodec ff_vp9_qsv_encoder = { - .name = "vp9_qsv", - .long_name = NULL_IF_CONFIG_SMALL("VP9 video (Intel Quick Sync Video acceleration)"), +const FFCodec ff_vp9_qsv_encoder = { + .p.name = "vp9_qsv", + .p.long_name = NULL_IF_CONFIG_SMALL("VP9 video (Intel Quick Sync Video acceleration)"), .priv_data_size = sizeof(QSVVP9EncContext), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, .init = qsv_enc_init, .encode2 = qsv_enc_frame, .close = qsv_enc_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV, AV_PIX_FMT_NONE }, - .priv_class = &class, + .p.priv_class = &class, .defaults = qsv_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "qsv", + .p.wrapper_name = "qsv", .hw_configs = ff_qsv_enc_hw_configs, }; diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index d5092f87c4..0e28884b9d 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -582,16 +582,16 @@ static av_cold int qtrle_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_qtrle_decoder = { - .name = "qtrle", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_QTRLE, +const FFCodec ff_qtrle_decoder = { + .p.name = "qtrle", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_QTRLE, .priv_data_size = sizeof(QtrleContext), .init = qtrle_decode_init, .close = qtrle_decode_end, .decode = qtrle_decode_frame, .flush = qtrle_decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index d02fd4f415..04e98185e5 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -399,16 +399,16 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_qtrle_encoder = { - .name = "qtrle", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_QTRLE, +const FFCodec ff_qtrle_encoder = { + .p.name = "qtrle", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_QTRLE, .priv_data_size = sizeof(QtrleEncContext), .init = qtrle_encode_init, .encode2 = qtrle_encode_frame, .close = qtrle_encode_end, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index 77ccf724d8..cfe6401a21 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -104,38 +104,38 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } #if CONFIG_R210_DECODER -const AVCodec ff_r210_decoder = { - .name = "r210", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R210, +const FFCodec ff_r210_decoder = { + .p.name = "r210", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R210, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_R10K_DECODER -const AVCodec ff_r10k_decoder = { - .name = "r10k", - .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R10K, +const FFCodec ff_r10k_decoder = { + .p.name = "r10k", + .p.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R10K, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_AVRP_DECODER -const AVCodec ff_avrp_decoder = { - .name = "avrp", - .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVRP, +const FFCodec ff_avrp_decoder = { + .p.name = "avrp", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVRP, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index ef0d00b97a..88bbd4677d 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -91,41 +91,41 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_GBRP10, AV_PIX_FMT_NONE }; #if CONFIG_R210_ENCODER -const AVCodec ff_r210_encoder = { - .name = "r210", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R210, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_r210_encoder = { + .p.name = "r210", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R210, + .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, .encode2 = encode_frame, - .pix_fmts = pix_fmt, + .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_R10K_ENCODER -const AVCodec ff_r10k_encoder = { - .name = "r10k", - .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_R10K, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_r10k_encoder = { + .p.name = "r10k", + .p.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_R10K, + .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, .encode2 = encode_frame, - .pix_fmts = pix_fmt, + .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_AVRP_ENCODER -const AVCodec ff_avrp_encoder = { - .name = "avrp", - .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AVRP, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_avrp_encoder = { + .p.name = "avrp", + .p.long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AVRP, + .p.capabilities = AV_CODEC_CAP_DR1, .init = encode_init, .encode2 = encode_frame, - .pix_fmts = pix_fmt, + .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/ra144dec.c b/libavcodec/ra144dec.c index 3d5aacb0a6..b3683db549 100644 --- a/libavcodec/ra144dec.c +++ b/libavcodec/ra144dec.c @@ -127,14 +127,14 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *data, return FRAME_SIZE; } -const AVCodec ff_ra_144_decoder = { - .name = "real_144", - .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_RA_144, +const FFCodec ff_ra_144_decoder = { + .p.name = "real_144", + .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_RA_144, .priv_data_size = sizeof(RA144Context), .init = ra144_decode_init, .decode = ra144_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index 7fec6cac7a..ec65621060 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -535,23 +535,23 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } -const AVCodec ff_ra_144_encoder = { - .name = "real_144", - .long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_RA_144, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_ra_144_encoder = { + .p.name = "real_144", + .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 1.0 (14.4K)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_RA_144, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(RA144Context), .init = ra144_encode_init, .encode2 = ra144_encode_frame, .close = ra144_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]){ 8000, 0 }, + .p.supported_samplerates = (const int[]){ 8000, 0 }, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 }, #endif - .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, + .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 51976e0481..ddf9331e39 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -238,14 +238,14 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, return avctx->block_align; } -const AVCodec ff_ra_288_decoder = { - .name = "real_288", - .long_name = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_RA_288, +const FFCodec ff_ra_288_decoder = { + .p.name = "real_288", + .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio 2.0 (28.8K)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_RA_288, .priv_data_size = sizeof(RA288Context), .init = ra288_decode_init, .decode = ra288_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c index 1c8bc29cb2..93970fd1ee 100644 --- a/libavcodec/ralf.c +++ b/libavcodec/ralf.c @@ -514,19 +514,19 @@ static void decode_flush(AVCodecContext *avctx) } -const AVCodec ff_ralf_decoder = { - .name = "ralf", - .long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_RALF, +const FFCodec ff_ralf_decoder = { + .p.name = "ralf", + .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio Lossless"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_RALF, .priv_data_size = sizeof(RALFContext), .init = decode_init, .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/rasc.c b/libavcodec/rasc.c index f132008684..8a4e2b7600 100644 --- a/libavcodec/rasc.c +++ b/libavcodec/rasc.c @@ -799,18 +799,18 @@ static const AVClass rasc_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_rasc_decoder = { - .name = "rasc", - .long_name = NULL_IF_CONFIG_SMALL("RemotelyAnywhere Screen Capture"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RASC, +const FFCodec ff_rasc_decoder = { + .p.name = "rasc", + .p.long_name = NULL_IF_CONFIG_SMALL("RemotelyAnywhere Screen Capture"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RASC, .priv_data_size = sizeof(RASCContext), .init = decode_init, .close = decode_close, .decode = decode_frame, .flush = decode_flush, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &rasc_decoder_class, + .p.priv_class = &rasc_decoder_class, }; diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 872bad75b9..b1c12a500b 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -482,16 +482,16 @@ static av_cold int raw_close_decoder(AVCodecContext *avctx) return 0; } -const AVCodec ff_rawvideo_decoder = { - .name = "rawvideo", - .long_name = NULL_IF_CONFIG_SMALL("raw video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RAWVIDEO, +const FFCodec ff_rawvideo_decoder = { + .p.name = "rawvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("raw video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RAWVIDEO, .priv_data_size = sizeof(RawVideoContext), .init = raw_init_decoder, .close = raw_close_decoder, .decode = raw_decode, - .priv_class = &rawdec_class, - .capabilities = AV_CODEC_CAP_PARAM_CHANGE, + .p.priv_class = &rawdec_class, + .p.capabilities = AV_CODEC_CAP_PARAM_CHANGE, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index 01ce3dd7d0..1aa88d9db0 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -81,12 +81,12 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_rawvideo_encoder = { - .name = "rawvideo", - .long_name = NULL_IF_CONFIG_SMALL("raw video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RAWVIDEO, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, +const FFCodec ff_rawvideo_encoder = { + .p.name = "rawvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("raw video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RAWVIDEO, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .init = raw_encode_init, .encode2 = raw_encode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index 38d21d1f15..4c0694c8ed 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -75,11 +75,11 @@ static int realtext_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_realtext_decoder = { - .name = "realtext", - .long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_REALTEXT, +const FFCodec ff_realtext_decoder = { + .p.name = "realtext", + .p.long_name = NULL_IF_CONFIG_SMALL("RealText subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_REALTEXT, .decode = realtext_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index 19ef108832..d5eab14c09 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -27,9 +27,9 @@ #include #include "avcodec.h" +#include "codec_internal.h" #include "decode.h" #include "hwconfig.h" -#include "internal.h" #include "libavutil/buffer.h" #include "libavutil/common.h" #include "libavutil/frame.h" @@ -561,23 +561,23 @@ static const AVCodecHWConfigInternal *const rkmpp_hw_configs[] = { #define RKMPP_DEC(NAME, ID, BSFS) \ RKMPP_DEC_CLASS(NAME) \ - const AVCodec ff_##NAME##_rkmpp_decoder = { \ - .name = #NAME "_rkmpp", \ - .long_name = NULL_IF_CONFIG_SMALL(#NAME " (rkmpp)"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = ID, \ + const FFCodec ff_##NAME##_rkmpp_decoder = { \ + .p.name = #NAME "_rkmpp", \ + .p.long_name = NULL_IF_CONFIG_SMALL(#NAME " (rkmpp)"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = ID, \ .priv_data_size = sizeof(RKMPPDecodeContext), \ .init = rkmpp_init_decoder, \ .close = rkmpp_close_decoder, \ .receive_frame = rkmpp_receive_frame, \ .flush = rkmpp_flush, \ - .priv_class = &rkmpp_##NAME##_dec_class, \ - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \ + .p.priv_class = &rkmpp_##NAME##_dec_class, \ + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HARDWARE, \ + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, \ AV_PIX_FMT_NONE}, \ .hw_configs = rkmpp_hw_configs, \ .bsfs = BSFS, \ - .wrapper_name = "rkmpp", \ + .p.wrapper_name = "rkmpp", \ }; RKMPP_DEC(h264, AV_CODEC_ID_H264, "h264_mp4toannexb") diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index a51dcfb40f..b4548c0247 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -219,15 +219,15 @@ static av_cold int rl2_decode_end(AVCodecContext *avctx) } -const AVCodec ff_rl2_decoder = { - .name = "rl2", - .long_name = NULL_IF_CONFIG_SMALL("RL2 video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RL2, +const FFCodec ff_rl2_decoder = { + .p.name = "rl2", + .p.long_name = NULL_IF_CONFIG_SMALL("RL2 video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RL2, .priv_data_size = sizeof(Rl2Context), .init = rl2_decode_init, .close = rl2_decode_end, .decode = rl2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index ad127e0a7a..c444c2e635 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -187,17 +187,17 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_roq_dpcm_encoder = { - .name = "roq_dpcm", - .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ROQ_DPCM, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_roq_dpcm_encoder = { + .p.name = "roq_dpcm", + .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ROQ_DPCM, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(ROQDPCMContext), .init = roq_dpcm_encode_init, .encode2 = roq_dpcm_encode_frame, .close = roq_dpcm_encode_close, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index 3496ce7bbf..7ce3dc8b59 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -234,15 +234,15 @@ static av_cold int roq_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_roq_decoder = { - .name = "roqvideo", - .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ROQ, +const FFCodec ff_roq_decoder = { + .p.name = "roqvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ROQ, .priv_data_size = sizeof(RoqContext), .init = roq_decode_init, .close = roq_decode_end, .decode = roq_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index 3098ccee20..ef7861088d 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -1118,17 +1118,17 @@ static const AVClass roq_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_roq_encoder = { - .name = "roqvideo", - .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ROQ, +const FFCodec ff_roq_encoder = { + .p.name = "roqvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ROQ, .priv_data_size = sizeof(RoqEncContext), .init = roq_encode_init, .encode2 = roq_encode_frame, .close = roq_encode_end, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE }, - .priv_class = &roq_class, + .p.priv_class = &roq_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index 9871715902..e3989f7d9f 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -287,15 +287,15 @@ static av_cold int rpza_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_rpza_decoder = { - .name = "rpza", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RPZA, +const FFCodec ff_rpza_decoder = { + .p.name = "rpza", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RPZA, .priv_data_size = sizeof(RpzaContext), .init = rpza_decode_init, .close = rpza_decode_end, .decode = rpza_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c index 6846020d7e..c4c3843f1c 100644 --- a/libavcodec/rpzaenc.c +++ b/libavcodec/rpzaenc.c @@ -843,17 +843,17 @@ static const AVClass rpza_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_rpza_encoder = { - .name = "rpza", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RPZA, +const FFCodec ff_rpza_encoder = { + .p.name = "rpza", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RPZA, .priv_data_size = sizeof(RpzaContext), - .priv_class = &rpza_class, + .p.priv_class = &rpza_class, .init = rpza_encode_init, .encode2 = rpza_encode_frame, .close = rpza_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB555, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, }; diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c index 9470074fc9..bbbf14c6e6 100644 --- a/libavcodec/rscc.c +++ b/libavcodec/rscc.c @@ -363,16 +363,16 @@ end: return ret; } -const AVCodec ff_rscc_decoder = { - .name = "rscc", - .long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RSCC, +const FFCodec ff_rscc_decoder = { + .p.name = "rscc", + .p.long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RSCC, .init = rscc_init, .decode = rscc_decode_frame, .close = rscc_close, .priv_data_size = sizeof(RsccContext), - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index c92e6d80c4..bd707a391b 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -682,38 +682,38 @@ static int rv10_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_rv10_decoder = { - .name = "rv10", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV10, +const FFCodec ff_rv10_decoder = { + .p.name = "rv10", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV10, .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, .close = rv10_decode_end, .decode = rv10_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; -const AVCodec ff_rv20_decoder = { - .name = "rv20", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV20, +const FFCodec ff_rv20_decoder = { + .p.name = "rv20", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV20, .priv_data_size = sizeof(RVDecContext), .init = rv10_decode_init, .close = rv10_decode_end, .decode = rv10_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = ff_mpeg_flush, - .max_lowres = 3, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.max_lowres = 3, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 20168c96ee..8df8f0a060 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -65,16 +65,16 @@ int ff_rv10_encode_picture_header(MpegEncContext *s, int picture_number) return 0; } -const AVCodec ff_rv10_encoder = { - .name = "rv10", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV10, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_rv10_encoder = { + .p.name = "rv10", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV10, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index 21610fd3aa..916f505ecc 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -62,16 +62,16 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number){ } } -const AVCodec ff_rv20_encoder = { - .name = "rv20", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV20, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_rv20_encoder = { + .p.name = "rv20", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV20, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c index a5c348b29a..7d5e1acc97 100644 --- a/libavcodec/rv30.c +++ b/libavcodec/rv30.c @@ -291,19 +291,19 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_rv30_decoder = { - .name = "rv30", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV30, +const FFCodec ff_rv30_decoder = { + .p.name = "rv30", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV30, .priv_data_size = sizeof(RV34DecContext), .init = rv30_decode_init, .close = ff_rv34_decode_end, .decode = ff_rv34_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 4fed7492ff..b95f0d7919 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -574,19 +574,19 @@ static av_cold int rv40_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_rv40_decoder = { - .name = "rv40", - .long_name = NULL_IF_CONFIG_SMALL("RealVideo 4.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_RV40, +const FFCodec ff_rv40_decoder = { + .p.name = "rv40", + .p.long_name = NULL_IF_CONFIG_SMALL("RealVideo 4.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_RV40, .priv_data_size = sizeof(RV34DecContext), .init = rv40_decode_init, .close = ff_rv34_decode_end, .decode = ff_rv34_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_FRAME_THREADS, .flush = ff_mpeg_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 868f2f99af..2c0cfc699a 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -25,6 +25,7 @@ #include "libavutil/opt.h" #include "libavutil/log.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "mathops.h" @@ -226,14 +227,14 @@ static const AVClass s302m_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_s302m_decoder = { - .name = "s302m", - .long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_S302M, +const FFCodec ff_s302m_decoder = { + .p.name = "s302m", + .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_S302M, + .p.priv_class = &s302m_class, .priv_data_size = sizeof(S302Context), .decode = s302m_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, - .priv_class = &s302m_class, }; diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index 5f2c682a5d..ad5186d69c 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -169,21 +169,21 @@ static int s302m_encode2_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -const AVCodec ff_s302m_encoder = { - .name = "s302m", - .long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_S302M, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | +const FFCodec ff_s302m_encoder = { + .p.name = "s302m", + .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE 302M"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_S302M, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, .priv_data_size = sizeof(S302MEncContext), .init = s302m_encode_init, .encode2 = s302m_encode2_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]) { 48000, 0 }, - /* .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, + .p.supported_samplerates = (const int[]) { 48000, 0 }, + /* .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX, diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index b5cd2745f3..2c8c31e4f6 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -181,11 +181,11 @@ static void sami_flush(AVCodecContext *avctx) sami->readorder = 0; } -const AVCodec ff_sami_decoder = { - .name = "sami", - .long_name = NULL_IF_CONFIG_SMALL("SAMI subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SAMI, +const FFCodec ff_sami_decoder = { + .p.name = "sami", + .p.long_name = NULL_IF_CONFIG_SMALL("SAMI subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SAMI, .priv_data_size = sizeof(SAMIContext), .init = sami_init, .close = sami_close, diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index aaac47892e..7d8a45a298 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1516,15 +1516,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, return pkt->size; } -const AVCodec ff_sanm_decoder = { - .name = "sanm", - .long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/Smush video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SANM, +const FFCodec ff_sanm_decoder = { + .p.name = "sanm", + .p.long_name = NULL_IF_CONFIG_SMALL("LucasArts SANM/Smush video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SANM, .priv_data_size = sizeof(SANMVideoContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index 8662e33da6..53e5ce2583 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -367,24 +367,24 @@ static int sbc_decode_frame(AVCodecContext *avctx, return frame_length; } -const AVCodec ff_sbc_decoder = { - .name = "sbc", - .long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SBC, +const FFCodec ff_sbc_decoder = { + .p.name = "sbc", + .p.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SBC, .priv_data_size = sizeof(SBCDecContext), .init = sbc_decode_init, .decode = sbc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, + .p.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, }; diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c index 59fa82d2ed..db1370f1c7 100644 --- a/libavcodec/sbcenc.c +++ b/libavcodec/sbcenc.c @@ -343,26 +343,26 @@ static const AVClass sbc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_sbc_encoder = { - .name = "sbc", - .long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SBC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, +const FFCodec ff_sbc_encoder = { + .p.name = "sbc", + .p.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SBC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SMALL_LAST_FRAME, .priv_data_size = sizeof(SBCEncContext), .init = sbc_encode_init, .encode2 = sbc_encode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, + .p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, 0}, #endif - .ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, + .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, - .priv_class = &sbc_class, - .profiles = NULL_IF_CONFIG_SMALL(ff_sbc_profiles), + .p.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, + .p.priv_class = &sbc_class, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_sbc_profiles), }; diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index 539425d95c..9e10c960b6 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -668,16 +668,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_scpr_decoder = { - .name = "scpr", - .long_name = NULL_IF_CONFIG_SMALL("ScreenPressor"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SCPR, +const FFCodec ff_scpr_decoder = { + .p.name = "scpr", + .p.long_name = NULL_IF_CONFIG_SMALL("ScreenPressor"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SCPR, .priv_data_size = sizeof(SCPRContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c index fd0d469cfd..c51fd513c8 100644 --- a/libavcodec/screenpresso.c +++ b/libavcodec/screenpresso.c @@ -184,16 +184,16 @@ static int screenpresso_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_screenpresso_decoder = { - .name = "screenpresso", - .long_name = NULL_IF_CONFIG_SMALL("Screenpresso"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SCREENPRESSO, +const FFCodec ff_screenpresso_decoder = { + .p.name = "screenpresso", + .p.long_name = NULL_IF_CONFIG_SMALL("Screenpresso"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SCREENPRESSO, .init = screenpresso_init, .decode = screenpresso_decode_frame, .close = screenpresso_close, .priv_data_size = sizeof(ScreenpressoContext), - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/sga.c b/libavcodec/sga.c index 6a594feb2b..566a53ee75 100644 --- a/libavcodec/sga.c +++ b/libavcodec/sga.c @@ -520,15 +520,15 @@ static av_cold int sga_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_sga_decoder = { - .name = "sga", - .long_name = NULL_IF_CONFIG_SMALL("Digital Pictures SGA Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SGA_VIDEO, +const FFCodec ff_sga_decoder = { + .p.name = "sga", + .p.long_name = NULL_IF_CONFIG_SMALL("Digital Pictures SGA Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SGA_VIDEO, .priv_data_size = sizeof(SGAVideoContext), .init = sga_decode_init, .decode = sga_decode_frame, .close = sga_decode_end, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index c7caeff622..8ff6b4f024 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -288,14 +288,14 @@ static av_cold int sgi_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_sgi_decoder = { - .name = "sgi", - .long_name = NULL_IF_CONFIG_SMALL("SGI image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SGI, +const FFCodec ff_sgi_decoder = { + .p.name = "sgi", + .p.long_name = NULL_IF_CONFIG_SMALL("SGI image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SGI, .priv_data_size = sizeof(SgiState), .decode = decode_frame, .init = sgi_decode_init, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index 329b0bfb1f..8a3c1ddde1 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -270,16 +270,16 @@ static const AVClass sgi_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_sgi_encoder = { - .name = "sgi", - .long_name = NULL_IF_CONFIG_SMALL("SGI image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SGI, +const FFCodec ff_sgi_encoder = { + .p.name = "sgi", + .p.long_name = NULL_IF_CONFIG_SMALL("SGI image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SGI, .priv_data_size = sizeof(SgiContext), - .priv_class = &sgi_class, + .p.priv_class = &sgi_class, .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, diff --git a/libavcodec/sgirledec.c b/libavcodec/sgirledec.c index 94d1c36818..fc3231a5b4 100644 --- a/libavcodec/sgirledec.c +++ b/libavcodec/sgirledec.c @@ -132,13 +132,13 @@ static int sgirle_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_sgirle_decoder = { - .name = "sgirle", - .long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics RLE 8-bit video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SGIRLE, +const FFCodec ff_sgirle_decoder = { + .p.name = "sgirle", + .p.long_name = NULL_IF_CONFIG_SMALL("Silicon Graphics RLE 8-bit video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SGIRLE, .init = sgirle_decode_init, .decode = sgirle_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index b1dafb3a8f..8ed48b1cee 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -24,6 +24,7 @@ #include "libavutil/intreadwrite.h" #include "avcodec.h" +#include "codec_internal.h" #include "get_bits.h" #include "thread.h" #include "sheervideodata.h" @@ -1999,13 +2000,13 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_sheervideo_decoder = { - .name = "sheervideo", - .long_name = NULL_IF_CONFIG_SMALL("BitJazz SheerVideo"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SHEERVIDEO, +const FFCodec ff_sheervideo_decoder = { + .p.name = "sheervideo", + .p.long_name = NULL_IF_CONFIG_SMALL("BitJazz SheerVideo"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SHEERVIDEO, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(SheerVideoContext), .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, }; diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index df50d996c3..bbb955c177 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -804,20 +804,20 @@ static av_cold int shorten_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_shorten_decoder = { - .name = "shorten", - .long_name = NULL_IF_CONFIG_SMALL("Shorten"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SHORTEN, +const FFCodec ff_shorten_decoder = { + .p.name = "shorten", + .p.long_name = NULL_IF_CONFIG_SMALL("Shorten"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SHORTEN, .priv_data_size = sizeof(ShortenContext), .init = shorten_decode_init, .close = shorten_decode_close, .decode = shorten_decode_frame, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SUBFRAMES , - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index 447e2448be..67450c94a3 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -563,14 +563,14 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *data, return mode_par->bits_per_frame >> 3; } -const AVCodec ff_sipr_decoder = { - .name = "sipr", - .long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SIPR, +const FFCodec ff_sipr_decoder = { + .p.name = "sipr", + .p.long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SIPR, .priv_data_size = sizeof(SiprContext), .init = sipr_decoder_init, .decode = sipr_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/siren.c b/libavcodec/siren.c index f8f5b26336..96907bfbf1 100644 --- a/libavcodec/siren.c +++ b/libavcodec/siren.c @@ -842,33 +842,33 @@ static av_cold int siren_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_siren_decoder = { - .name = "siren", - .long_name = NULL_IF_CONFIG_SMALL("Siren"), +const FFCodec ff_siren_decoder = { + .p.name = "siren", + .p.long_name = NULL_IF_CONFIG_SMALL("Siren"), .priv_data_size = sizeof(SirenContext), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SIREN, + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SIREN, .init = siren_init, .close = siren_close, .decode = siren_decode, .flush = siren_flush, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_msnsiren_decoder = { - .name = "msnsiren", - .long_name = NULL_IF_CONFIG_SMALL("MSN Siren"), +const FFCodec ff_msnsiren_decoder = { + .p.name = "msnsiren", + .p.long_name = NULL_IF_CONFIG_SMALL("MSN Siren"), .priv_data_size = sizeof(SirenContext), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_MSNSIREN, + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_MSNSIREN, .init = siren_init, .close = siren_close, .decode = siren_decode, .flush = siren_flush, - .capabilities = AV_CODEC_CAP_CHANNEL_CONF | + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index d77d91f49e..c1b94213c0 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -723,26 +723,26 @@ error: return ret; } -const AVCodec ff_smacker_decoder = { - .name = "smackvid", - .long_name = NULL_IF_CONFIG_SMALL("Smacker video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SMACKVIDEO, +const FFCodec ff_smacker_decoder = { + .p.name = "smackvid", + .p.long_name = NULL_IF_CONFIG_SMALL("Smacker video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SMACKVIDEO, .priv_data_size = sizeof(SmackVContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; -const AVCodec ff_smackaud_decoder = { - .name = "smackaud", - .long_name = NULL_IF_CONFIG_SMALL("Smacker audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SMACKAUDIO, +const FFCodec ff_smackaud_decoder = { + .p.name = "smackaud", + .p.long_name = NULL_IF_CONFIG_SMALL("Smacker audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SMACKAUDIO, .init = smka_decode_init, .decode = smka_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 41df4bf7b3..0a32773944 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -469,15 +469,15 @@ static av_cold int smc_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_smc_decoder = { - .name = "smc", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SMC, +const FFCodec ff_smc_decoder = { + .p.name = "smc", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SMC, .priv_data_size = sizeof(SmcContext), .init = smc_decode_init, .close = smc_decode_end, .decode = smc_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c index 6b91019e0a..a9f6c483a7 100644 --- a/libavcodec/smcenc.c +++ b/libavcodec/smcenc.c @@ -548,16 +548,16 @@ static int smc_encode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_smc_encoder = { - .name = "smc", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SMC, +const FFCodec ff_smc_encoder = { + .p.name = "smc", + .p.long_name = NULL_IF_CONFIG_SMALL("QuickTime Graphics (SMC)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SMC, .priv_data_size = sizeof(SMCContext), .init = smc_encode_init, .encode2 = smc_encode_frame, .close = smc_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}, }; diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index ab7989f4d6..d1e11cd5f6 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -654,16 +654,16 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_snow_decoder = { - .name = "snow", - .long_name = NULL_IF_CONFIG_SMALL("Snow"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SNOW, +const FFCodec ff_snow_decoder = { + .p.name = "snow", + .p.long_name = NULL_IF_CONFIG_SMALL("Snow"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SNOW, .priv_data_size = sizeof(SnowContext), .init = ff_snow_common_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, + .p.capabilities = AV_CODEC_CAP_DR1 /*| AV_CODEC_CAP_DRAW_HORIZ_BAND*/, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 1733c33dab..b5a5e57a91 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1912,21 +1912,21 @@ static const AVClass snowenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_snow_encoder = { - .name = "snow", - .long_name = NULL_IF_CONFIG_SMALL("Snow"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SNOW, +const FFCodec ff_snow_encoder = { + .p.name = "snow", + .p.long_name = NULL_IF_CONFIG_SMALL("Snow"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SNOW, .priv_data_size = sizeof(SnowContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, - .priv_class = &snowenc_class, + .p.priv_class = &snowenc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index d1ded0fcea..264a5ff2b3 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -1078,47 +1078,47 @@ static int sonic_decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_sonic_decoder = { - .name = "sonic", - .long_name = NULL_IF_CONFIG_SMALL("Sonic"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SONIC, +const FFCodec ff_sonic_decoder = { + .p.name = "sonic", + .p.long_name = NULL_IF_CONFIG_SMALL("Sonic"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SONIC, .priv_data_size = sizeof(SonicContext), .init = sonic_decode_init, .close = sonic_decode_close, .decode = sonic_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_SONIC_DECODER */ #if CONFIG_SONIC_ENCODER -const AVCodec ff_sonic_encoder = { - .name = "sonic", - .long_name = NULL_IF_CONFIG_SMALL("Sonic"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SONIC, +const FFCodec ff_sonic_encoder = { + .p.name = "sonic", + .p.long_name = NULL_IF_CONFIG_SMALL("Sonic"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SONIC, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, .encode2 = sonic_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_EXPERIMENTAL, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; #endif #if CONFIG_SONIC_LS_ENCODER -const AVCodec ff_sonic_ls_encoder = { - .name = "sonicls", - .long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SONIC_LS, +const FFCodec ff_sonic_ls_encoder = { + .p.name = "sonicls", + .p.long_name = NULL_IF_CONFIG_SMALL("Sonic lossless"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SONIC_LS, .priv_data_size = sizeof(SonicContext), .init = sonic_encode_init, .encode2 = sonic_encode_frame, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - .capabilities = AV_CODEC_CAP_EXPERIMENTAL, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .p.capabilities = AV_CODEC_CAP_EXPERIMENTAL, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index e00cf834e9..99647efa52 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -92,33 +92,33 @@ int ff_sp5x_process_packet(AVCodecContext *avctx, AVPacket *avpkt) } #if CONFIG_SP5X_DECODER -const AVCodec ff_sp5x_decoder = { - .name = "sp5x", - .long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SP5X, +const FFCodec ff_sp5x_decoder = { + .p.name = "sp5x", + .p.long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SP5X, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, - .capabilities = AV_CODEC_CAP_DR1, - .max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, }; #endif #if CONFIG_AMV_DECODER -const AVCodec ff_amv_decoder = { - .name = "amv", - .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AMV, +const FFCodec ff_amv_decoder = { + .p.name = "amv", + .p.long_name = NULL_IF_CONFIG_SMALL("AMV Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AMV, .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, .receive_frame = ff_mjpeg_receive_frame, - .max_lowres = 3, - .capabilities = AV_CODEC_CAP_DR1, + .p.max_lowres = 3, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SETS_PKT_DTS, }; diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c index 8c181466bd..1e441862d9 100644 --- a/libavcodec/speedhq.c +++ b/libavcodec/speedhq.c @@ -726,15 +726,15 @@ static av_cold int speedhq_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_speedhq_decoder = { - .name = "speedhq", - .long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SPEEDHQ, +const FFCodec ff_speedhq_decoder = { + .p.name = "speedhq", + .p.long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SPEEDHQ, .priv_data_size = sizeof(SHQContext), .init = speedhq_decode_init, .decode = speedhq_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif /* CONFIG_SPEEDHQ_DECODER */ diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c index 6a1912a751..22213b823d 100644 --- a/libavcodec/speedhqenc.c +++ b/libavcodec/speedhqenc.c @@ -270,18 +270,18 @@ int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_sli } #if CONFIG_SPEEDHQ_ENCODER -const AVCodec ff_speedhq_encoder = { - .name = "speedhq", - .long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SPEEDHQ, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_speedhq_encoder = { + .p.name = "speedhq", + .p.long_name = NULL_IF_CONFIG_SMALL("NewTek SpeedHQ"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SPEEDHQ, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(MpegEncContext), .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c index b23f601300..940f521686 100644 --- a/libavcodec/speexdec.c +++ b/libavcodec/speexdec.c @@ -1577,15 +1577,15 @@ static av_cold int speex_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_speex_decoder = { - .name = "speex", - .long_name = NULL_IF_CONFIG_SMALL("Speex"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_SPEEX, +const FFCodec ff_speex_decoder = { + .p.name = "speex", + .p.long_name = NULL_IF_CONFIG_SMALL("Speex"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_SPEEX, .init = speex_decode_init, .decode = speex_decode_frame, .close = speex_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .priv_data_size = sizeof(SpeexContext), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c index 20d47931d0..5de360b821 100644 --- a/libavcodec/srtdec.c +++ b/libavcodec/srtdec.c @@ -91,11 +91,11 @@ static int srt_decode_frame(AVCodecContext *avctx, #if CONFIG_SRT_DECODER /* deprecated decoder */ -const AVCodec ff_srt_decoder = { - .name = "srt", - .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBRIP, +const FFCodec ff_srt_decoder = { + .p.name = "srt", + .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, .decode = srt_decode_frame, .flush = ff_ass_decoder_flush, @@ -105,11 +105,11 @@ const AVCodec ff_srt_decoder = { #endif #if CONFIG_SUBRIP_DECODER -const AVCodec ff_subrip_decoder = { - .name = "subrip", - .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBRIP, +const FFCodec ff_subrip_decoder = { + .p.name = "subrip", + .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBRIP, .init = ff_ass_subtitle_header_default, .decode = srt_decode_frame, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 7864ea3386..8ff799b684 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -293,11 +293,11 @@ static int srt_encode_close(AVCodecContext *avctx) #if CONFIG_SRT_ENCODER /* deprecated encoder */ -const AVCodec ff_srt_encoder = { - .name = "srt", - .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBRIP, +const FFCodec ff_srt_encoder = { + .p.name = "srt", + .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, .encode_sub = srt_encode_frame, @@ -307,11 +307,11 @@ const AVCodec ff_srt_encoder = { #endif #if CONFIG_SUBRIP_ENCODER -const AVCodec ff_subrip_encoder = { - .name = "subrip", - .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBRIP, +const FFCodec ff_subrip_encoder = { + .p.name = "subrip", + .p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBRIP, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, .encode_sub = srt_encode_frame, @@ -321,11 +321,11 @@ const AVCodec ff_subrip_encoder = { #endif #if CONFIG_TEXT_ENCODER -const AVCodec ff_text_encoder = { - .name = "text", - .long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_TEXT, +const FFCodec ff_text_encoder = { + .p.name = "text", + .p.long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_TEXT, .priv_data_size = sizeof(SRTContext), .init = srt_encode_init, .encode_sub = text_encode_frame, diff --git a/libavcodec/subviewerdec.c b/libavcodec/subviewerdec.c index d5b6381aec..cbc3056c90 100644 --- a/libavcodec/subviewerdec.c +++ b/libavcodec/subviewerdec.c @@ -66,11 +66,11 @@ static int subviewer_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_subviewer_decoder = { - .name = "subviewer", - .long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBVIEWER, +const FFCodec ff_subviewer_decoder = { + .p.name = "subviewer", + .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBVIEWER, .decode = subviewer_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 7e9a9b0be5..d52a34df0f 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/imgutils.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "sunrast.h" @@ -205,11 +206,11 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, return buf - bufstart; } -const AVCodec ff_sunrast_decoder = { - .name = "sunrast", - .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SUNRAST, +const FFCodec ff_sunrast_decoder = { + .p.name = "sunrast", + .p.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SUNRAST, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = sunrast_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/sunrastenc.c b/libavcodec/sunrastenc.c index 8057844511..acc609c3b6 100644 --- a/libavcodec/sunrastenc.c +++ b/libavcodec/sunrastenc.c @@ -208,16 +208,16 @@ static const AVClass sunrast_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_sunrast_encoder = { - .name = "sunrast", - .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SUNRAST, +const FFCodec ff_sunrast_encoder = { + .p.name = "sunrast", + .p.long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SUNRAST, .priv_data_size = sizeof(SUNRASTContext), .init = sunrast_encode_init, .encode2 = sunrast_encode_frame, - .priv_class = &sunrast_class, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, + .p.priv_class = &sunrast_class, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE, diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 02cf3e30c0..a223cb4da3 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -844,18 +844,18 @@ static void svq1_flush(AVCodecContext *avctx) av_frame_unref(s->prev); } -const AVCodec ff_svq1_decoder = { - .name = "svq1", - .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SVQ1, +const FFCodec ff_svq1_decoder = { + .p.name = "svq1", + .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SVQ1, .priv_data_size = sizeof(SVQ1Context), .init = svq1_decode_init, .close = svq1_decode_end, .decode = svq1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .flush = svq1_flush, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 8e8834e4e8..706bc2e42e 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -676,17 +676,17 @@ static const AVClass svq1enc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_svq1_encoder = { - .name = "svq1", - .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SVQ1, +const FFCodec ff_svq1_encoder = { + .p.name = "svq1", + .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SVQ1, .priv_data_size = sizeof(SVQ1EncContext), - .priv_class = &svq1enc_class, + .p.priv_class = &svq1enc_class, .init = svq1_encode_init, .encode2 = svq1_encode_frame, .close = svq1_encode_end, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 8977f1afc5..7c2d5147b0 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1588,19 +1588,19 @@ static av_cold int svq3_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_svq3_decoder = { - .name = "svq3", - .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_SVQ3, +const FFCodec ff_svq3_decoder = { + .p.name = "svq3", + .p.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_SVQ3, .priv_data_size = sizeof(SVQ3Context), .init = svq3_decode_init, .close = svq3_decode_end, .decode = svq3_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE}, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 57ebb978b7..0ce08b564c 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -942,18 +942,18 @@ static av_cold int tak_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_tak_decoder = { - .name = "tak", - .long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TAK, +const FFCodec ff_tak_decoder = { + .p.name = "tak", + .p.long_name = NULL_IF_CONFIG_SMALL("TAK (Tom's lossless Audio Kompressor)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TAK, .priv_data_size = sizeof(TAKDecContext), .init = tak_decode_init, .close = tak_decode_close, .decode = tak_decode_frame, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/targa.c b/libavcodec/targa.c index b0048621d3..a354bca06e 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -23,6 +23,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" #include "targa.h" @@ -306,12 +307,12 @@ static int decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_targa_decoder = { - .name = "targa", - .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TARGA, +const FFCodec ff_targa_decoder = { + .p.name = "targa", + .p.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TARGA, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(TargaContext), .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index d46292513a..57c8211118 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -74,13 +74,13 @@ static int y216_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_targa_y216_decoder = { - .name = "targa_y216", - .long_name = NULL_IF_CONFIG_SMALL("Pinnacle TARGA CineWave YUV16"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TARGA_Y216, +const FFCodec ff_targa_y216_decoder = { + .p.name = "targa_y216", + .p.long_name = NULL_IF_CONFIG_SMALL("Pinnacle TARGA CineWave YUV16"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TARGA_Y216, .init = y216_decode_init, .decode = y216_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index 7d2ff60362..9170eff956 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -202,16 +202,16 @@ static const AVClass targa_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_targa_encoder = { - .name = "targa", - .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TARGA, +const FFCodec ff_targa_encoder = { + .p.name = "targa", + .p.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TARGA, .priv_data_size = sizeof(TargaContext), - .priv_class = &targa_class, + .p.priv_class = &targa_class, .init = targa_encode_init, .encode2 = targa_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c index a0ae9f1383..d25a4d4dd0 100644 --- a/libavcodec/tdsc.c +++ b/libavcodec/tdsc.c @@ -622,16 +622,16 @@ static int tdsc_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_tdsc_decoder = { - .name = "tdsc", - .long_name = NULL_IF_CONFIG_SMALL("TDSC"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TDSC, +const FFCodec ff_tdsc_decoder = { + .p.name = "tdsc", + .p.long_name = NULL_IF_CONFIG_SMALL("TDSC"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TDSC, .init = tdsc_init, .decode = tdsc_decode_frame, .close = tdsc_close, .priv_data_size = sizeof(TDSCContext), - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c index b77d7c4bdc..075ad632c4 100644 --- a/libavcodec/tests/avcodec.c +++ b/libavcodec/tests/avcodec.c @@ -37,14 +37,14 @@ do { \ #define ERR(msg) ERR_INTERNAL(msg, ) #define ERR_EXT(msg, ...) ERR_INTERNAL(msg, , __VA_ARGS__) -static int priv_data_size_wrong(const AVCodec *codec) +static int priv_data_size_wrong(const FFCodec *codec) { if (codec->priv_data_size < 0 || - codec->priv_class && codec->priv_data_size < sizeof(AVClass*)) + codec->p.priv_class && codec->priv_data_size < sizeof(AVClass*)) return 1; - if (!codec->priv_class || !codec->priv_class->option) + if (!codec->p.priv_class || !codec->p.priv_class->option) return 0; - for (const AVOption *opt = codec->priv_class->option; opt->name; opt++) { + for (const AVOption *opt = codec->p.priv_class->option; opt->name; opt++) { if (opt->offset >= codec->priv_data_size || opt->type == AV_OPT_TYPE_CONST && opt->offset != 0 || opt->type != AV_OPT_TYPE_CONST && (opt->offset < sizeof(AVClass*) || opt->offset < 0)) { @@ -62,6 +62,7 @@ int main(void){ int ret = 0; while (codec = av_codec_iterate(&iter)) { + const FFCodec *const codec2 = ffcodec(codec); const AVCodecDescriptor *desc; int is_decoder, is_encoder; @@ -88,14 +89,14 @@ int main(void){ if (codec->type != AVMEDIA_TYPE_VIDEO) { if (codec->pix_fmts || codec->supported_framerates) ERR("Non-video codec %s has video-only fields set\n"); - if (codec->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING) + if (codec2->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING) ERR("Non-video codec %s exports cropping\n"); } - if (codec->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF && + if (codec2->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF && !(codec->capabilities & AV_CODEC_CAP_SLICE_THREADS)) ERR("Codec %s wants mainfunction despite not being " "slice-threading capable"); - if (codec->caps_internal & FF_CODEC_CAP_AUTO_THREADS && + if (codec2->caps_internal & FF_CODEC_CAP_AUTO_THREADS && !(codec->capabilities & (AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_OTHER_THREADS))) @@ -108,11 +109,11 @@ int main(void){ continue; } if (is_encoder) { - if (codec->type == AVMEDIA_TYPE_SUBTITLE ^ !!codec->encode_sub) + if (codec->type == AVMEDIA_TYPE_SUBTITLE ^ !!codec2->encode_sub) ERR("Encoder %s is both subtitle encoder and not subtitle encoder."); - if (!!codec->encode_sub + !!codec->encode2 + !!codec->receive_packet != 1) + if (!!codec2->encode_sub + !!codec2->encode2 + !!codec2->receive_packet != 1) ERR("Encoder %s does not implement exactly one encode API.\n"); - if (codec->update_thread_context || codec->update_thread_context_for_user || codec->bsfs) + if (codec2->update_thread_context || codec2->update_thread_context_for_user || codec2->bsfs) ERR("Encoder %s has decoder-only thread functions or bsf.\n"); if (codec->type == AVMEDIA_TYPE_AUDIO) { if (!codec->sample_fmts) { @@ -120,7 +121,7 @@ int main(void){ ret = 1; } } - if (codec->caps_internal & (FF_CODEC_CAP_ALLOCATE_PROGRESS | + if (codec2->caps_internal & (FF_CODEC_CAP_ALLOCATE_PROGRESS | FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_EXPORTS_CROPPING | @@ -134,26 +135,26 @@ int main(void){ codec->capabilities & AV_CODEC_CAP_ENCODER_FLUSH) ERR("Frame-threaded encoder %s claims to support flushing\n"); } else { - if (codec->type == AVMEDIA_TYPE_SUBTITLE && !codec->decode) + if (codec->type == AVMEDIA_TYPE_SUBTITLE && !codec2->decode) ERR("Subtitle decoder %s does not implement decode callback\n"); - if (codec->type == AVMEDIA_TYPE_SUBTITLE && codec->bsfs) + if (codec->type == AVMEDIA_TYPE_SUBTITLE && codec2->bsfs) ERR("Automatic bitstream filtering unsupported for subtitles; " "yet decoder %s has it set\n"); - if (!!codec->decode + !!codec->receive_frame != 1) + if (!!codec2->decode + !!codec2->receive_frame != 1) ERR("Decoder %s does not implement exactly one decode API.\n"); if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | AV_CODEC_CAP_ENCODER_FLUSH)) ERR("Decoder %s has encoder-only capabilities\n"); - if (codec->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS && + if (codec2->caps_internal & FF_CODEC_CAP_ALLOCATE_PROGRESS && !(codec->capabilities & AV_CODEC_CAP_FRAME_THREADS)) ERR("Decoder %s wants allocated progress without supporting" "frame threads\n"); } - if (priv_data_size_wrong(codec)) + if (priv_data_size_wrong(codec2)) ERR_EXT("Private context of codec %s is impossibly-sized (size %d).", - codec->priv_data_size); + codec2->priv_data_size); if (!(desc = avcodec_descriptor_get(codec->id))) { ERR("Codec %s lacks a corresponding descriptor\n"); } else if (desc->type != codec->type) diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c index 690c0bbaad..95450a18f7 100644 --- a/libavcodec/textdec.c +++ b/libavcodec/textdec.c @@ -81,15 +81,15 @@ static const AVClass textsub_decoder_class = { }; #if CONFIG_TEXT_DECODER -const AVCodec ff_text_decoder = { - .name = "text", - .long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), +const FFCodec ff_text_decoder = { + .p.name = "text", + .p.long_name = NULL_IF_CONFIG_SMALL("Raw text subtitle"), .priv_data_size = sizeof(TextContext), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_TEXT, + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_TEXT, .decode = text_decode_frame, .init = ff_ass_subtitle_header_default, - .priv_class = &textsub_decoder_class, + .p.priv_class = &textsub_decoder_class, .flush = text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; @@ -105,60 +105,60 @@ static int linebreak_init(AVCodecContext *avctx) } #if CONFIG_VPLAYER_DECODER -const AVCodec ff_vplayer_decoder = { - .name = "vplayer", - .long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitle"), +const FFCodec ff_vplayer_decoder = { + .p.name = "vplayer", + .p.long_name = NULL_IF_CONFIG_SMALL("VPlayer subtitle"), .priv_data_size = sizeof(TextContext), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_VPLAYER, + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_VPLAYER, .decode = text_decode_frame, .init = linebreak_init, - .priv_class = &textsub_decoder_class, + .p.priv_class = &textsub_decoder_class, .flush = text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_STL_DECODER -const AVCodec ff_stl_decoder = { - .name = "stl", - .long_name = NULL_IF_CONFIG_SMALL("Spruce subtitle format"), +const FFCodec ff_stl_decoder = { + .p.name = "stl", + .p.long_name = NULL_IF_CONFIG_SMALL("Spruce subtitle format"), .priv_data_size = sizeof(TextContext), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_STL, + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_STL, .decode = text_decode_frame, .init = linebreak_init, - .priv_class = &textsub_decoder_class, + .p.priv_class = &textsub_decoder_class, .flush = text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_PJS_DECODER -const AVCodec ff_pjs_decoder = { - .name = "pjs", - .long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"), +const FFCodec ff_pjs_decoder = { + .p.name = "pjs", + .p.long_name = NULL_IF_CONFIG_SMALL("PJS subtitle"), .priv_data_size = sizeof(TextContext), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_PJS, + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_PJS, .decode = text_decode_frame, .init = linebreak_init, - .priv_class = &textsub_decoder_class, + .p.priv_class = &textsub_decoder_class, .flush = text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_SUBVIEWER1_DECODER -const AVCodec ff_subviewer1_decoder = { - .name = "subviewer1", - .long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"), +const FFCodec ff_subviewer1_decoder = { + .p.name = "subviewer1", + .p.long_name = NULL_IF_CONFIG_SMALL("SubViewer1 subtitle"), .priv_data_size = sizeof(TextContext), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_SUBVIEWER1, + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_SUBVIEWER1, .decode = text_decode_frame, .init = linebreak_init, - .priv_class = &textsub_decoder_class, + .p.priv_class = &textsub_decoder_class, .flush = text_flush, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/thread.h b/libavcodec/thread.h index 716301b29f..d36dc83bd7 100644 --- a/libavcodec/thread.h +++ b/libavcodec/thread.h @@ -44,10 +44,10 @@ void ff_thread_flush(AVCodecContext *avctx); * Returns the next available frame in picture. *got_picture_ptr * will be 0 if none is available. * The return value on success is the size of the consumed packet for - * compatibility with AVCodec.decode. This means the decoder + * compatibility with FFCodec.decode. This means the decoder * has to consume the full packet. * - * Parameters are the same as AVCodec.decode. + * Parameters are the same as FFCodec.decode. */ int ff_thread_decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt); diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 6648fc4554..d269fb96c9 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -262,15 +262,15 @@ static av_cold int seqvideo_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_tiertexseqvideo_decoder = { - .name = "tiertexseqvideo", - .long_name = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TIERTEXSEQVIDEO, +const FFCodec ff_tiertexseqvideo_decoder = { + .p.name = "tiertexseqvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TIERTEXSEQVIDEO, .priv_data_size = sizeof(SeqVideoContext), .init = seqvideo_decode_init, .close = seqvideo_decode_end, .decode = seqvideo_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 5e5cea42fe..88ac838587 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -2177,16 +2177,16 @@ static const AVClass tiff_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_tiff_decoder = { - .name = "tiff", - .long_name = NULL_IF_CONFIG_SMALL("TIFF image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TIFF, +const FFCodec ff_tiff_decoder = { + .p.name = "tiff", + .p.long_name = NULL_IF_CONFIG_SMALL("TIFF image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TIFF, .priv_data_size = sizeof(TiffContext), .init = tiff_init, .close = tiff_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .priv_class = &tiff_decoder_class, + .p.priv_class = &tiff_decoder_class, }; diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 2152d35f60..17ff542354 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -569,17 +569,17 @@ static const AVClass tiffenc_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_tiff_encoder = { - .name = "tiff", - .long_name = NULL_IF_CONFIG_SMALL("TIFF image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TIFF, +const FFCodec ff_tiff_encoder = { + .p.name = "tiff", + .p.long_name = NULL_IF_CONFIG_SMALL("TIFF image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TIFF, .priv_data_size = sizeof(TiffEncoderContext), .init = encode_init, .close = encode_close, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_YA16LE, @@ -588,6 +588,6 @@ const AVCodec ff_tiff_encoder = { AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, - .priv_class = &tiffenc_class, + .p.priv_class = &tiffenc_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index 5325c246de..f4c7474136 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -87,13 +87,13 @@ static av_cold int tmv_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_tmv_decoder = { - .name = "tmv", - .long_name = NULL_IF_CONFIG_SMALL("8088flex TMV"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TMV, +const FFCodec ff_tmv_decoder = { + .p.name = "tmv", + .p.long_name = NULL_IF_CONFIG_SMALL("8088flex TMV"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TMV, .init = tmv_decode_init, .decode = tmv_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index f14399a9ac..f8da11b6b3 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -911,15 +911,15 @@ static av_cold int truemotion1_decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_truemotion1_decoder = { - .name = "truemotion1", - .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TRUEMOTION1, +const FFCodec ff_truemotion1_decoder = { + .p.name = "truemotion1", + .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 1.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TRUEMOTION1, .priv_data_size = sizeof(TrueMotion1Context), .init = truemotion1_decode_init, .close = truemotion1_decode_end, .decode = truemotion1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 0ceeeade5e..eff7d77e03 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -1009,15 +1009,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_truemotion2_decoder = { - .name = "truemotion2", - .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TRUEMOTION2, +const FFCodec ff_truemotion2_decoder = { + .p.name = "truemotion2", + .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TRUEMOTION2, .priv_data_size = sizeof(TM2Context), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c index ef0fccfcc3..d2a78a35ef 100644 --- a/libavcodec/truemotion2rt.c +++ b/libavcodec/truemotion2rt.c @@ -220,14 +220,14 @@ static av_cold int truemotion2rt_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_truemotion2rt_decoder = { - .name = "truemotion2rt", - .long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0 Real Time"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TRUEMOTION2RT, +const FFCodec ff_truemotion2rt_decoder = { + .p.name = "truemotion2rt", + .p.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0 Real Time"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TRUEMOTION2RT, .priv_data_size = sizeof(TrueMotion2RTContext), .init = truemotion2rt_decode_init, .decode = truemotion2rt_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index ad51e9096e..1d0a8d3f1e 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -357,14 +357,14 @@ static int truespeech_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_truespeech_decoder = { - .name = "truespeech", - .long_name = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TRUESPEECH, +const FFCodec ff_truespeech_decoder = { + .p.name = "truespeech", + .p.long_name = NULL_IF_CONFIG_SMALL("DSP Group TrueSpeech"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TRUESPEECH, .priv_data_size = sizeof(TSContext), .init = truespeech_decode_init, .decode = truespeech_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index dd64cf4f20..83db8b46ff 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -170,15 +170,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_tscc_decoder = { - .name = "camtasia", - .long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TSCC, +const FFCodec ff_tscc_decoder = { + .p.name = "camtasia", + .p.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Capture Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TSCC, .priv_data_size = sizeof(CamtasiaContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index bb8c95e65e..5ff15656ce 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -356,15 +356,15 @@ static av_cold int tscc2_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_tscc2_decoder = { - .name = "tscc2", - .long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Codec 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TSCC2, +const FFCodec ff_tscc2_decoder = { + .p.name = "tscc2", + .p.long_name = NULL_IF_CONFIG_SMALL("TechSmith Screen Codec 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TSCC2, .priv_data_size = sizeof(TSCC2Context), .init = tscc2_decode_init, .close = tscc2_decode_end, .decode = tscc2_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 18b7755c8d..7fa36a6926 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -421,16 +421,16 @@ static const AVClass tta_decoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_tta_decoder = { - .name = "tta", - .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TTA, +const FFCodec ff_tta_decoder = { + .p.name = "tta", + .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TTA, .priv_data_size = sizeof(TTAContext), .init = tta_decode_init, .close = tta_decode_close, .decode = tta_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, - .priv_class = &tta_decoder_class, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, + .p.priv_class = &tta_decoder_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c index aefa2bee00..b52cb21d2c 100644 --- a/libavcodec/ttaenc.c +++ b/libavcodec/ttaenc.c @@ -202,17 +202,17 @@ static av_cold int tta_encode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_tta_encoder = { - .name = "tta", - .long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TTA, +const FFCodec ff_tta_encoder = { + .p.name = "tta", + .p.long_name = NULL_IF_CONFIG_SMALL("TTA (True Audio)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TTA, .priv_data_size = sizeof(TTAEncContext), .init = tta_encode_init, .close = tta_encode_close, .encode2 = tta_encode_frame, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/ttmlenc.c b/libavcodec/ttmlenc.c index 90766f8ea1..98a36caf5c 100644 --- a/libavcodec/ttmlenc.c +++ b/libavcodec/ttmlenc.c @@ -383,11 +383,11 @@ static av_cold int ttml_encode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_ttml_encoder = { - .name = "ttml", - .long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_TTML, +const FFCodec ff_ttml_encoder = { + .p.name = "ttml", + .p.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_TTML, .priv_data_size = sizeof(TTMLContext), .init = ttml_encode_init, .encode_sub = ttml_encode_frame, diff --git a/libavcodec/twinvqdec.c b/libavcodec/twinvqdec.c index 5625d05fae..7f0eeb0bfb 100644 --- a/libavcodec/twinvqdec.c +++ b/libavcodec/twinvqdec.c @@ -414,17 +414,17 @@ static av_cold int twinvq_decode_init(AVCodecContext *avctx) return ff_twinvq_decode_init(avctx); } -const AVCodec ff_twinvq_decoder = { - .name = "twinvq", - .long_name = NULL_IF_CONFIG_SMALL("VQF TwinVQ"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_TWINVQ, +const FFCodec ff_twinvq_decoder = { + .p.name = "twinvq", + .p.long_name = NULL_IF_CONFIG_SMALL("VQF TwinVQ"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_TWINVQ, .priv_data_size = sizeof(TwinVQContext), .init = twinvq_decode_init, .close = ff_twinvq_decode_close, .decode = ff_twinvq_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 93e4fa9605..dec033182c 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "bytestream.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "texturedsp.h" @@ -163,11 +164,11 @@ unsupported: return AVERROR_PATCHWELCOME; } -const AVCodec ff_txd_decoder = { - .name = "txd", - .long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_TXD, +const FFCodec ff_txd_decoder = { + .p.name = "txd", + .p.long_name = NULL_IF_CONFIG_SMALL("Renderware TXD (TeXture Dictionary) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_TXD, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = txd_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 9f0f3d4cdf..fa689a1e89 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -419,15 +419,15 @@ err: return AVERROR_INVALIDDATA; } -const AVCodec ff_ulti_decoder = { - .name = "ultimotion", - .long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ULTI, +const FFCodec ff_ulti_decoder = { + .p.name = "ultimotion", + .p.long_name = NULL_IF_CONFIG_SMALL("IBM UltiMotion"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ULTI, .priv_data_size = sizeof(UltimotionDecodeContext), .init = ulti_decode_init, .close = ulti_decode_end, .decode = ulti_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index b18af6d0a8..1666f5dabb 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -71,13 +71,15 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size) memset(*p, 0, min_size + AV_INPUT_BUFFER_PADDING_SIZE); } -int av_codec_is_encoder(const AVCodec *codec) +int av_codec_is_encoder(const AVCodec *avcodec) { + const FFCodec *const codec = ffcodec(avcodec); return codec && (codec->encode_sub || codec->encode2 || codec->receive_packet); } -int av_codec_is_decoder(const AVCodec *codec) +int av_codec_is_decoder(const AVCodec *avcodec) { + const FFCodec *const codec = ffcodec(avcodec); return codec && (codec->decode || codec->receive_frame); } @@ -435,7 +437,7 @@ void ff_color_frame(AVFrame *frame, const int c[4]) } int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ - return !!(codec->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); + return !!(ffcodec(codec)->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); } const char *avcodec_get_name(enum AVCodecID id) @@ -868,8 +870,9 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b) return i; } -const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index) +const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *avcodec, int index) { + const FFCodec *const codec = ffcodec(avcodec); int i; if (!codec->hw_configs || index < 0) return NULL; diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 30e17ad2c5..4d41da4543 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -1051,15 +1051,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_utvideo_decoder = { - .name = "utvideo", - .long_name = NULL_IF_CONFIG_SMALL("Ut Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_UTVIDEO, +const FFCodec ff_utvideo_decoder = { + .p.name = "utvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Ut Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_UTVIDEO, .priv_data_size = sizeof(UtvideoContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index 44adf09286..e1f7086152 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -643,18 +643,18 @@ static const AVClass utvideo_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_utvideo_encoder = { - .name = "utvideo", - .long_name = NULL_IF_CONFIG_SMALL("Ut Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_UTVIDEO, +const FFCodec ff_utvideo_encoder = { + .p.name = "utvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Ut Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_UTVIDEO, .priv_data_size = sizeof(UtvideoContext), - .priv_class = &utvideo_class, + .p.priv_class = &utvideo_class, .init = utvideo_encode_init, .encode2 = utvideo_encode_frame, .close = utvideo_encode_close, - .capabilities = AV_CODEC_CAP_FRAME_THREADS, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.capabilities = AV_CODEC_CAP_FRAME_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index 38a60eee35..47af2e6655 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -212,17 +212,17 @@ static const AVClass v210dec_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_v210_decoder = { - .name = "v210", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V210, +const FFCodec ff_v210_decoder = { + .p.name = "v210", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V210, .priv_data_size = sizeof(V210DecContext), .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .priv_class = &v210dec_class, + .p.priv_class = &v210dec_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 025bede3f1..2582571823 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -152,15 +152,15 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_v210_encoder = { - .name = "v210", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V210, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, +const FFCodec ff_v210_encoder = { + .p.name = "v210", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V210, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_data_size = sizeof(V210EncContext), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 9ac57938f4..7273694ed8 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -120,13 +120,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_v210x_decoder = { - .name = "v210x", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V210X, +const FFCodec ff_v210x_decoder = { + .p.name = "v210x", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V210X, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index af69a43a26..99b92cc227 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -73,13 +73,13 @@ static int v308_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_v308_decoder = { - .name = "v308", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V308, +const FFCodec ff_v308_decoder = { + .p.name = "v308", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V308, .init = v308_decode_init, .decode = v308_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c index 533583b0db..08e6ddaecb 100644 --- a/libavcodec/v308enc.c +++ b/libavcodec/v308enc.c @@ -70,14 +70,14 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_v308_encoder = { - .name = "v308", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V308, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_v308_encoder = { + .p.name = "v308", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V308, + .p.capabilities = AV_CODEC_CAP_DR1, .init = v308_encode_init, .encode2 = v308_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c index 215a3a1efd..cbddc723de 100644 --- a/libavcodec/v408dec.c +++ b/libavcodec/v408dec.c @@ -83,26 +83,26 @@ static int v408_decode_frame(AVCodecContext *avctx, void *data, } #if CONFIG_AYUV_DECODER -const AVCodec ff_ayuv_decoder = { - .name = "ayuv", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AYUV, +const FFCodec ff_ayuv_decoder = { + .p.name = "ayuv", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AYUV, .init = v408_decode_init, .decode = v408_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_V408_DECODER -const AVCodec ff_v408_decoder = { - .name = "v408", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V408, +const FFCodec ff_v408_decoder = { + .p.name = "v408", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V408, .init = v408_decode_init, .decode = v408_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c index 2077bebca8..52d5e19802 100644 --- a/libavcodec/v408enc.c +++ b/libavcodec/v408enc.c @@ -80,28 +80,28 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt, static const enum AVPixelFormat pix_fmt[] = { AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }; #if CONFIG_AYUV_ENCODER -const AVCodec ff_ayuv_encoder = { - .name = "ayuv", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_AYUV, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_ayuv_encoder = { + .p.name = "ayuv", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_AYUV, + .p.capabilities = AV_CODEC_CAP_DR1, .init = v408_encode_init, .encode2 = v408_encode_frame, - .pix_fmts = pix_fmt, + .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_V408_ENCODER -const AVCodec ff_v408_encoder = { - .name = "v408", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V408, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_v408_encoder = { + .p.name = "v408", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V408, + .p.capabilities = AV_CODEC_CAP_DR1, .init = v408_encode_init, .encode2 = v408_encode_frame, - .pix_fmts = pix_fmt, + .p.pix_fmts = pix_fmt, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 2cb3973e85..a91a3384e6 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -115,14 +115,14 @@ static int v410_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_v410_decoder = { - .name = "v410", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V410, +const FFCodec ff_v410_decoder = { + .p.name = "v410", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V410, .init = v410_decode_init, .decode = v410_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index 54362a258c..32966d9176 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -74,14 +74,14 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_v410_encoder = { - .name = "v410", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_V410, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_v410_encoder = { + .p.name = "v410", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_V410, + .p.capabilities = AV_CODEC_CAP_DR1, .init = v410_encode_init, .encode2 = v410_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c index 2c5a22a976..4c521eba34 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -240,20 +240,20 @@ static const AVOption options[] = { #define M2MDEC(NAME, LONGNAME, CODEC, bsf_name) \ M2MDEC_CLASS(NAME) \ - const AVCodec ff_ ## NAME ## _v4l2m2m_decoder = { \ - .name = #NAME "_v4l2m2m" , \ - .long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = CODEC , \ + const FFCodec ff_ ## NAME ## _v4l2m2m_decoder = { \ + .p.name = #NAME "_v4l2m2m" , \ + .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = CODEC , \ .priv_data_size = sizeof(V4L2m2mPriv), \ - .priv_class = &v4l2_m2m_ ## NAME ## _dec_class, \ + .p.priv_class = &v4l2_m2m_ ## NAME ## _dec_class, \ .init = v4l2_decode_init, \ .receive_frame = v4l2_receive_frame, \ .close = v4l2_decode_close, \ .bsfs = bsf_name, \ - .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ + .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ .caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, \ - .wrapper_name = "v4l2m2m", \ + .p.wrapper_name = "v4l2m2m", \ } M2MDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb"); diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c index feccfe4911..ff5c79c91c 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -421,20 +421,20 @@ static const AVCodecDefault v4l2_m2m_defaults[] = { #define M2MENC(NAME, LONGNAME, OPTIONS_NAME, CODEC) \ M2MENC_CLASS(NAME, OPTIONS_NAME) \ - const AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \ - .name = #NAME "_v4l2m2m" , \ - .long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = CODEC , \ + const FFCodec ff_ ## NAME ## _v4l2m2m_encoder = { \ + .p.name = #NAME "_v4l2m2m" , \ + .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = CODEC , \ .priv_data_size = sizeof(V4L2m2mPriv), \ - .priv_class = &v4l2_m2m_ ## NAME ##_enc_class, \ + .p.priv_class = &v4l2_m2m_ ## NAME ##_enc_class, \ .init = v4l2_encode_init, \ .receive_packet = v4l2_receive_packet, \ .close = v4l2_encode_close, \ .defaults = v4l2_m2m_defaults, \ - .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ + .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ - .wrapper_name = "v4l2m2m", \ + .p.wrapper_name = "v4l2m2m", \ } M2MENC(mpeg4,"MPEG4", mpeg4_options, AV_CODEC_ID_MPEG4); diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 6ca6a63eec..804e3db486 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -1325,24 +1325,24 @@ static const AVClass vaapi_encode_h264_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_vaapi_encoder = { - .name = "h264_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("H.264/AVC (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, +const FFCodec ff_h264_vaapi_encoder = { + .p.name = "h264_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("H.264/AVC (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, .priv_data_size = sizeof(VAAPIEncodeH264Context), .init = &vaapi_encode_h264_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &vaapi_encode_h264_close, - .priv_class = &vaapi_encode_h264_class, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.priv_class = &vaapi_encode_h264_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_h264_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 9d917f7ff4..e508a9146e 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -1302,24 +1302,24 @@ static const AVClass vaapi_encode_h265_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hevc_vaapi_encoder = { - .name = "hevc_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("H.265/HEVC (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, +const FFCodec ff_hevc_vaapi_encoder = { + .p.name = "hevc_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("H.265/HEVC (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, .priv_data_size = sizeof(VAAPIEncodeH265Context), .init = &vaapi_encode_h265_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &vaapi_encode_h265_close, - .priv_class = &vaapi_encode_h265_class, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.priv_class = &vaapi_encode_h265_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_h265_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c index 6ba400975c..df8d62c0bc 100644 --- a/libavcodec/vaapi_encode_mjpeg.c +++ b/libavcodec/vaapi_encode_mjpeg.c @@ -552,23 +552,23 @@ static const AVClass vaapi_encode_mjpeg_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mjpeg_vaapi_encoder = { - .name = "mjpeg_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("MJPEG (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MJPEG, +const FFCodec ff_mjpeg_vaapi_encoder = { + .p.name = "mjpeg_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("MJPEG (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(VAAPIEncodeMJPEGContext), .init = &vaapi_encode_mjpeg_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &vaapi_encode_mjpeg_close, - .priv_class = &vaapi_encode_mjpeg_class, - .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, + .p.priv_class = &vaapi_encode_mjpeg_class, + .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_mjpeg_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c index c0289139cb..47531a3b5b 100644 --- a/libavcodec/vaapi_encode_mpeg2.c +++ b/libavcodec/vaapi_encode_mpeg2.c @@ -690,24 +690,24 @@ static const AVClass vaapi_encode_mpeg2_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mpeg2_vaapi_encoder = { - .name = "mpeg2_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG2VIDEO, +const FFCodec ff_mpeg2_vaapi_encoder = { + .p.name = "mpeg2_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG2VIDEO, .priv_data_size = sizeof(VAAPIEncodeMPEG2Context), .init = &vaapi_encode_mpeg2_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &vaapi_encode_mpeg2_close, - .priv_class = &vaapi_encode_mpeg2_class, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.priv_class = &vaapi_encode_mpeg2_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_mpeg2_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c index d1d086f60b..11fcd2d0b3 100644 --- a/libavcodec/vaapi_encode_vp8.c +++ b/libavcodec/vaapi_encode_vp8.c @@ -245,24 +245,24 @@ static const AVClass vaapi_encode_vp8_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_vp8_vaapi_encoder = { - .name = "vp8_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("VP8 (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, +const FFCodec ff_vp8_vaapi_encoder = { + .p.name = "vp8_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("VP8 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, .priv_data_size = sizeof(VAAPIEncodeVP8Context), .init = &vaapi_encode_vp8_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &ff_vaapi_encode_close, - .priv_class = &vaapi_encode_vp8_class, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.priv_class = &vaapi_encode_vp8_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_vp8_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c index 5a60d2b7c1..e2d200a19f 100644 --- a/libavcodec/vaapi_encode_vp9.c +++ b/libavcodec/vaapi_encode_vp9.c @@ -287,24 +287,24 @@ static const AVClass vaapi_encode_vp9_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_vp9_vaapi_encoder = { - .name = "vp9_vaapi", - .long_name = NULL_IF_CONFIG_SMALL("VP9 (VAAPI)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, +const FFCodec ff_vp9_vaapi_encoder = { + .p.name = "vp9_vaapi", + .p.long_name = NULL_IF_CONFIG_SMALL("VP9 (VAAPI)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, .priv_data_size = sizeof(VAAPIEncodeVP9Context), .init = &vaapi_encode_vp9_init, .receive_packet = &ff_vaapi_encode_receive_packet, .close = &ff_vaapi_encode_close, - .priv_class = &vaapi_encode_vp9_class, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | + .p.priv_class = &vaapi_encode_vp9_class, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .defaults = vaapi_encode_vp9_defaults, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE, }, .hw_configs = ff_vaapi_encode_hw_configs, - .wrapper_name = "vaapi", + .p.wrapper_name = "vaapi", }; diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 0d09e8567b..362221982e 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -279,15 +279,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_vb_decoder = { - .name = "vb", - .long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VB, +const FFCodec ff_vb_decoder = { + .p.name = "vb", + .p.long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VB, .priv_data_size = sizeof(VBDecContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 7118c4d67f..a7646cedcf 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -202,15 +202,15 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_vble_decoder = { - .name = "vble", - .long_name = NULL_IF_CONFIG_SMALL("VBLE Lossless Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VBLE, +const FFCodec ff_vble_decoder = { + .p.name = "vble", + .p.long_name = NULL_IF_CONFIG_SMALL("VBLE Lossless Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VBLE, .priv_data_size = sizeof(VBLEContext), .init = vble_decode_init, .close = vble_decode_close, .decode = vble_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 73a96690c0..e279ffd1c1 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -1202,19 +1202,19 @@ static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { AV_PIX_FMT_NONE }; -const AVCodec ff_vc1_decoder = { - .name = "vc1", - .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1, +const FFCodec ff_vc1_decoder = { + .p.name = "vc1", + .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, .flush = ff_mpeg_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = vc1_hwaccel_pixfmt_list_420, + .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VC1_DXVA2_HWACCEL HWACCEL_DXVA2(vc1), @@ -1236,23 +1236,23 @@ const AVCodec ff_vc1_decoder = { #endif NULL }, - .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) }; #if CONFIG_WMV3_DECODER -const AVCodec ff_wmv3_decoder = { - .name = "wmv3", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3, +const FFCodec ff_wmv3_decoder = { + .p.name = "wmv3", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, .flush = ff_mpeg_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, - .pix_fmts = vc1_hwaccel_pixfmt_list_420, + .p.pix_fmts = vc1_hwaccel_pixfmt_list_420, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_WMV3_DXVA2_HWACCEL HWACCEL_DXVA2(wmv3), @@ -1274,24 +1274,24 @@ const AVCodec ff_wmv3_decoder = { #endif NULL }, - .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) }; #endif #if CONFIG_WMV3IMAGE_DECODER -const AVCodec ff_wmv3image_decoder = { - .name = "wmv3image", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV3IMAGE, +const FFCodec ff_wmv3image_decoder = { + .p.name = "wmv3image", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV3IMAGE, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, @@ -1299,19 +1299,19 @@ const AVCodec ff_wmv3image_decoder = { #endif #if CONFIG_VC1IMAGE_DECODER -const AVCodec ff_vc1image_decoder = { - .name = "vc1image", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VC1IMAGE, +const FFCodec ff_vc1image_decoder = { + .p.name = "vc1image", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 Image v2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VC1IMAGE, .priv_data_size = sizeof(VC1Context), .init = vc1_decode_init, .close = ff_vc1_decode_end, .decode = vc1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vc1_sprite_flush, - .pix_fmts = (const enum AVPixelFormat[]) { + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index ed00648101..bb609762b7 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -1224,18 +1224,18 @@ static const enum AVPixelFormat allowed_pix_fmts[] = { AV_PIX_FMT_NONE }; -const AVCodec ff_vc2_encoder = { - .name = "vc2", - .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_DIRAC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, +const FFCodec ff_vc2_encoder = { + .p.name = "vc2", + .p.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_DIRAC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_data_size = sizeof(VC2EncContext), .init = vc2_encode_init, .close = vc2_encode_end, .encode2 = vc2_encode_frame, - .priv_class = &vc2enc_class, + .p.priv_class = &vc2enc_class, .defaults = vc2enc_defaults, - .pix_fmts = allowed_pix_fmts + .p.pix_fmts = allowed_pix_fmts }; diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index f0f7b7425d..17a1f9b710 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -122,14 +122,14 @@ static int vcr1_decode_frame(AVCodecContext *avctx, void *data, return bytestream - avpkt->data; } -const AVCodec ff_vcr1_decoder = { - .name = "vcr1", - .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VCR1, +const FFCodec ff_vcr1_decoder = { + .p.name = "vcr1", + .p.long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VCR1, .priv_data_size = sizeof(VCR1Context), .init = vcr1_decode_init, .decode = vcr1_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 95be432666..61c24f9110 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -2723,18 +2723,18 @@ static const AVClass h264_videotoolbox_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_h264_videotoolbox_encoder = { - .name = "h264_videotoolbox", - .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_H264, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, +const FFCodec ff_h264_videotoolbox_encoder = { + .p.name = "h264_videotoolbox", + .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.264 Encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_H264, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .priv_data_size = sizeof(VTEncContext), - .pix_fmts = avc_pix_fmts, + .p.pix_fmts = avc_pix_fmts, .init = vtenc_init, .encode2 = vtenc_frame, .close = vtenc_close, - .priv_class = &h264_videotoolbox_class, + .p.priv_class = &h264_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; @@ -2757,22 +2757,22 @@ static const AVClass hevc_videotoolbox_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_hevc_videotoolbox_encoder = { - .name = "hevc_videotoolbox", - .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_HEVC, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_hevc_videotoolbox_encoder = { + .p.name = "hevc_videotoolbox", + .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox H.265 Encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_HEVC, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, .priv_data_size = sizeof(VTEncContext), - .pix_fmts = hevc_pix_fmts, + .p.pix_fmts = hevc_pix_fmts, .init = vtenc_init, .encode2 = vtenc_frame, .close = vtenc_close, - .priv_class = &hevc_videotoolbox_class, + .p.priv_class = &hevc_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "videotoolbox", + .p.wrapper_name = "videotoolbox", }; static const AVOption prores_options[] = { @@ -2796,20 +2796,20 @@ static const AVClass prores_videotoolbox_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_prores_videotoolbox_encoder = { - .name = "prores_videotoolbox", - .long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | +const FFCodec ff_prores_videotoolbox_encoder = { + .p.name = "prores_videotoolbox", + .p.long_name = NULL_IF_CONFIG_SMALL("VideoToolbox ProRes Encoder"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_PRORES, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, .priv_data_size = sizeof(VTEncContext), - .pix_fmts = prores_pix_fmts, + .p.pix_fmts = prores_pix_fmts, .init = vtenc_init, .encode2 = vtenc_frame, .close = vtenc_close, - .priv_class = &prores_videotoolbox_class, + .p.priv_class = &prores_videotoolbox_class, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .wrapper_name = "videotoolbox", + .p.wrapper_name = "videotoolbox", }; diff --git a/libavcodec/vima.c b/libavcodec/vima.c index f181e2d197..9ca4406802 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -208,13 +208,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, return pkt->size; } -const AVCodec ff_adpcm_vima_decoder = { - .name = "adpcm_vima", - .long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_ADPCM_VIMA, +const FFCodec ff_adpcm_vima_decoder = { + .p.name = "adpcm_vima", + .p.long_name = NULL_IF_CONFIG_SMALL("LucasArts VIMA audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_ADPCM_VIMA, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index 69b8494a8a..045a2da410 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -229,14 +229,14 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_vmdaudio_decoder = { - .name = "vmdaudio", - .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_VMDAUDIO, +const FFCodec ff_vmdaudio_decoder = { + .p.name = "vmdaudio", + .p.long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_VMDAUDIO, .priv_data_size = sizeof(VmdAudioContext), .init = vmdaudio_decode_init, .decode = vmdaudio_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vmdvideo.c b/libavcodec/vmdvideo.c index 29b1439a9d..1d39b6a4d8 100644 --- a/libavcodec/vmdvideo.c +++ b/libavcodec/vmdvideo.c @@ -466,15 +466,15 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_vmdvideo_decoder = { - .name = "vmdvideo", - .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VMDVIDEO, +const FFCodec ff_vmdvideo_decoder = { + .p.name = "vmdvideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VMDVIDEO, .priv_data_size = sizeof(VmdVideoContext), .init = vmdvideo_decode_init, .close = vmdvideo_decode_end, .decode = vmdvideo_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index a1a55c0a34..b6884b7aa6 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -573,15 +573,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_vmnc_decoder = { - .name = "vmnc", - .long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VMNC, +const FFCodec ff_vmnc_decoder = { + .p.name = "vmnc", + .p.long_name = NULL_IF_CONFIG_SMALL("VMware Screen Codec / VMware Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VMNC, .priv_data_size = sizeof(VmncContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index cb009d902a..e83a83f641 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1885,22 +1885,22 @@ static av_cold void vorbis_decode_flush(AVCodecContext *avctx) vc->first_frame = 0; } -const AVCodec ff_vorbis_decoder = { - .name = "vorbis", - .long_name = NULL_IF_CONFIG_SMALL("Vorbis"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_VORBIS, +const FFCodec ff_vorbis_decoder = { + .p.name = "vorbis", + .p.long_name = NULL_IF_CONFIG_SMALL("Vorbis"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_VORBIS, .priv_data_size = sizeof(vorbis_context), .init = vorbis_decode_init, .close = vorbis_decode_close, .decode = vorbis_decode_frame, .flush = vorbis_decode_flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, #if FF_API_OLD_CHANNEL_LAYOUT - .channel_layouts = ff_vorbis_channel_layouts, + .p.channel_layouts = ff_vorbis_channel_layouts, #endif - .ch_layouts = ff_vorbis_ch_layouts, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.ch_layouts = ff_vorbis_ch_layouts, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index 2abc3686cd..a6c5cfa8c7 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -1295,17 +1295,17 @@ static av_cold int vorbis_encode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_vorbis_encoder = { - .name = "vorbis", - .long_name = NULL_IF_CONFIG_SMALL("Vorbis"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_VORBIS, +const FFCodec ff_vorbis_encoder = { + .p.name = "vorbis", + .p.long_name = NULL_IF_CONFIG_SMALL("Vorbis"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_VORBIS, .priv_data_size = sizeof(vorbis_enc_context), .init = vorbis_encode_init, .encode2 = vorbis_encode_frame, .close = vorbis_encode_close, - .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_EXPERIMENTAL, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 6ab70ccb3f..d493b331ef 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -3170,16 +3170,16 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return vp3_decode_init(avctx); } -const AVCodec ff_theora_decoder = { - .name = "theora", - .long_name = NULL_IF_CONFIG_SMALL("Theora"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_THEORA, +const FFCodec ff_theora_decoder = { + .p.name = "theora", + .p.long_name = NULL_IF_CONFIG_SMALL("Theora"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_THEORA, .priv_data_size = sizeof(Vp3DecodeContext), .init = theora_decode_init, .close = vp3_decode_end, .decode = vp3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), @@ -3188,16 +3188,16 @@ const AVCodec ff_theora_decoder = { }; #endif -const AVCodec ff_vp3_decoder = { - .name = "vp3", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP3"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP3, +const FFCodec ff_vp3_decoder = { + .p.name = "vp3", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP3"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP3, .priv_data_size = sizeof(Vp3DecodeContext), .init = vp3_decode_init, .close = vp3_decode_end, .decode = vp3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), @@ -3206,16 +3206,16 @@ const AVCodec ff_vp3_decoder = { }; #if CONFIG_VP4_DECODER -const AVCodec ff_vp4_decoder = { - .name = "vp4", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP4"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP4, +const FFCodec ff_vp4_decoder = { + .p.name = "vp4", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP4"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP4, .priv_data_size = sizeof(Vp3DecodeContext), .init = vp3_decode_init, .close = vp3_decode_end, .decode = vp3_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_FRAME_THREADS, .flush = vp3_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context), diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index b67b8439f2..167fda4bfc 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -303,15 +303,15 @@ static av_cold int vp56_free(AVCodecContext *avctx) return ff_vp56_free_context(s); } -const AVCodec ff_vp5_decoder = { - .name = "vp5", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP5"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP5, +const FFCodec ff_vp5_decoder = { + .p.name = "vp5", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP5"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP5, .priv_data_size = sizeof(VP56Context), .init = vp5_decode_init, .close = vp56_free, .decode = ff_vp56_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index bb49cf65dd..313b499623 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -712,43 +712,43 @@ static av_cold void vp6_decode_free_context(VP56Context *s) } } -const AVCodec ff_vp6_decoder = { - .name = "vp6", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP6"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP6, +const FFCodec ff_vp6_decoder = { + .p.name = "vp6", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP6, .priv_data_size = sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, .decode = ff_vp56_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; /* flash version, not flipped upside-down */ -const AVCodec ff_vp6f_decoder = { - .name = "vp6f", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP6F, +const FFCodec ff_vp6f_decoder = { + .p.name = "vp6f", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP6F, .priv_data_size = sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, .decode = ff_vp56_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; /* flash version, not flipped upside-down, with alpha channel */ -const AVCodec ff_vp6a_decoder = { - .name = "vp6a", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP6A, +const FFCodec ff_vp6a_decoder = { + .p.name = "vp6a", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP6 (Flash version, with alpha channel)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP6A, .priv_data_size = 2 /* Main context + alpha context */ * sizeof(VP56Context), .init = vp6_decode_init, .close = vp6_decode_free, .decode = ff_vp56_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 79ad89fc4f..2e7ca63236 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2723,7 +2723,7 @@ int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, s->next_framep[VP56_FRAME_CURRENT] = curframe; - if (avctx->codec->update_thread_context) + if (ffcodec(avctx->codec)->update_thread_context) ff_thread_finish_setup(avctx); if (avctx->hwaccel) { @@ -2939,32 +2939,32 @@ static int vp8_decode_update_thread_context(AVCodecContext *dst, #endif /* CONFIG_VP8_DECODER */ #if CONFIG_VP7_DECODER -const AVCodec ff_vp7_decoder = { - .name = "vp7", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP7"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP7, +const FFCodec ff_vp7_decoder = { + .p.name = "vp7", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP7"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP7, .priv_data_size = sizeof(VP8Context), .init = vp7_decode_init, .close = ff_vp8_decode_free, .decode = vp7_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, .flush = vp8_decode_flush, }; #endif /* CONFIG_VP7_DECODER */ #if CONFIG_VP8_DECODER -const AVCodec ff_vp8_decoder = { - .name = "vp8", - .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP8, +const FFCodec ff_vp8_decoder = { + .p.name = "vp8", + .p.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP8, .priv_data_size = sizeof(VP8Context), .init = ff_vp8_decode_init, .close = ff_vp8_decode_free, .decode = ff_vp8_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_ALLOCATE_PROGRESS, diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 900db5eb44..1b822c4592 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1866,22 +1866,22 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo } #endif -const AVCodec ff_vp9_decoder = { - .name = "vp9", - .long_name = NULL_IF_CONFIG_SMALL("Google VP9"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VP9, +const FFCodec ff_vp9_decoder = { + .p.name = "vp9", + .p.long_name = NULL_IF_CONFIG_SMALL("Google VP9"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VP9, .priv_data_size = sizeof(VP9Context), .init = vp9_decode_init, .close = vp9_decode_free, .decode = vp9_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_SLICE_THREAD_HAS_MF | FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = vp9_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(vp9_decode_update_thread_context), - .profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), + .p.profiles = NULL_IF_CONFIG_SMALL(ff_vp9_profiles), .bsfs = "vp9_superframe_split", .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_VP9_DXVA2_HWACCEL diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index f53d2227a7..7e0ae1a5ad 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -847,16 +847,16 @@ static const AVCodecDefault vqa_defaults[] = { { NULL }, }; -const AVCodec ff_vqa_decoder = { - .name = "vqavideo", - .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WS_VQA, +const FFCodec ff_vqa_decoder = { + .p.name = "vqavideo", + .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WS_VQA, .priv_data_size = sizeof(VqaContext), .init = vqa_decode_init, .close = vqa_decode_end, .decode = vqa_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .defaults = vqa_defaults, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index c1d1c581af..e0ba525893 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1702,18 +1702,18 @@ error: return ret; } -const AVCodec ff_wavpack_decoder = { - .name = "wavpack", - .long_name = NULL_IF_CONFIG_SMALL("WavPack"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WAVPACK, +const FFCodec ff_wavpack_decoder = { + .p.name = "wavpack", + .p.long_name = NULL_IF_CONFIG_SMALL("WavPack"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WAVPACK, .priv_data_size = sizeof(WavpackContext), .init = wavpack_decode_init, .close = wavpack_decode_end, .decode = wavpack_decode_frame, .flush = wavpack_decode_flush, .update_thread_context = ONLY_IF_THREADS_ENABLED(update_thread_context), - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ALLOCATE_PROGRESS, diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 4ce821ee8c..ac14d0c4f3 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -2961,18 +2961,18 @@ static const AVClass wavpack_encoder_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_wavpack_encoder = { - .name = "wavpack", - .long_name = NULL_IF_CONFIG_SMALL("WavPack"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WAVPACK, +const FFCodec ff_wavpack_encoder = { + .p.name = "wavpack", + .p.long_name = NULL_IF_CONFIG_SMALL("WavPack"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WAVPACK, .priv_data_size = sizeof(WavPackEncodeContext), - .priv_class = &wavpack_encoder_class, + .p.priv_class = &wavpack_encoder_class, .init = wavpack_encode_init, .encode2 = wavpack_encode_frame, .close = wavpack_encode_close, - .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, - .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P, + .p.capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, + .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/wcmv.c b/libavcodec/wcmv.c index ef33a3a1be..99584b9da2 100644 --- a/libavcodec/wcmv.c +++ b/libavcodec/wcmv.c @@ -242,16 +242,16 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_wcmv_decoder = { - .name = "wcmv", - .long_name = NULL_IF_CONFIG_SMALL("WinCAM Motion Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WCMV, +const FFCodec ff_wcmv_decoder = { + .p.name = "wcmv", + .p.long_name = NULL_IF_CONFIG_SMALL("WinCAM Motion Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WCMV, .priv_data_size = sizeof(WCMVContext), .init = decode_init, .close = decode_close, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/webp.c b/libavcodec/webp.c index e480a2813b..696868f854 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1556,15 +1556,15 @@ static av_cold int webp_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_webp_decoder = { - .name = "webp", - .long_name = NULL_IF_CONFIG_SMALL("WebP image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WEBP, +const FFCodec ff_webp_decoder = { + .p.name = "webp", + .p.long_name = NULL_IF_CONFIG_SMALL("WebP image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WEBP, .priv_data_size = sizeof(WebPContext), .init = webp_decode_init, .decode = webp_decode_frame, .close = webp_decode_close, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c index 61bf094a64..4ebbc63074 100644 --- a/libavcodec/webvttdec.c +++ b/libavcodec/webvttdec.c @@ -99,11 +99,11 @@ static int webvtt_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_webvtt_decoder = { - .name = "webvtt", - .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_WEBVTT, +const FFCodec ff_webvtt_decoder = { + .p.name = "webvtt", + .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_WEBVTT, .decode = webvtt_decode_frame, .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index f4ec3d48b4..7f514ed940 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -211,11 +211,11 @@ static av_cold int webvtt_encode_init(AVCodecContext *avctx) return s->ass_ctx ? 0 : AVERROR_INVALIDDATA; } -const AVCodec ff_webvtt_encoder = { - .name = "webvtt", - .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_WEBVTT, +const FFCodec ff_webvtt_encoder = { + .p.name = "webvtt", + .p.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_WEBVTT, .priv_data_size = sizeof(WebVTTContext), .init = webvtt_encode_init, .encode_sub = webvtt_encode_frame, diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index db5735eff2..24542ffced 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -1000,35 +1000,35 @@ static av_cold void flush(AVCodecContext *avctx) } #if CONFIG_WMAV1_DECODER -const AVCodec ff_wmav1_decoder = { - .name = "wmav1", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAV1, +const FFCodec ff_wmav1_decoder = { + .p.name = "wmav1", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAV1, .priv_data_size = sizeof(WMACodecContext), .init = wma_decode_init, .close = ff_wma_end, .decode = wma_decode_superframe, .flush = flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_WMAV2_DECODER -const AVCodec ff_wmav2_decoder = { - .name = "wmav2", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAV2, +const FFCodec ff_wmav2_decoder = { + .p.name = "wmav2", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAV2, .priv_data_size = sizeof(WMACodecContext), .init = wma_decode_init, .close = ff_wma_end, .decode = wma_decode_superframe, .flush = flush, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 780cc76734..fd1fb8ad97 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -433,31 +433,31 @@ static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt, } #if CONFIG_WMAV1_ENCODER -const AVCodec ff_wmav1_encoder = { - .name = "wmav1", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAV1, +const FFCodec ff_wmav1_encoder = { + .p.name = "wmav1", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAV1, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, .encode2 = encode_superframe, .close = ff_wma_end, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif #if CONFIG_WMAV2_ENCODER -const AVCodec ff_wmav2_encoder = { - .name = "wmav2", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAV2, +const FFCodec ff_wmav2_encoder = { + .p.name = "wmav2", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAV2, .priv_data_size = sizeof(WMACodecContext), .init = encode_init, .encode2 = encode_superframe, .close = ff_wma_end, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 6971f56e51..7d5753dccd 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -1325,19 +1325,19 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_wmalossless_decoder = { - .name = "wmalossless", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMALOSSLESS, +const FFCodec ff_wmalossless_decoder = { + .p.name = "wmalossless", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMALOSSLESS, .priv_data_size = sizeof(WmallDecodeCtx), .init = decode_init, .close = decode_close, .decode = decode_packet, .flush = flush, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, }; diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 4a011f7b96..a2ee9b0440 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -2087,49 +2087,49 @@ static void xma_flush(AVCodecContext *avctx) /** *@brief wmapro decoder */ -const AVCodec ff_wmapro_decoder = { - .name = "wmapro", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAPRO, +const FFCodec ff_wmapro_decoder = { + .p.name = "wmapro", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 9 Professional"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAPRO, .priv_data_size = sizeof(WMAProDecodeCtx), .init = wmapro_decode_init, .close = wmapro_decode_end, .decode = wmapro_decode_packet, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, .flush = wmapro_flush, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_xma1_decoder = { - .name = "xma1", - .long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 1"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_XMA1, +const FFCodec ff_xma1_decoder = { + .p.name = "xma1", + .p.long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 1"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_XMA1, .priv_data_size = sizeof(XMADecodeCtx), .init = xma_decode_init, .close = xma_decode_end, .decode = xma_decode_packet, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -const AVCodec ff_xma2_decoder = { - .name = "xma2", - .long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 2"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_XMA2, +const FFCodec ff_xma2_decoder = { + .p.name = "xma2", + .p.long_name = NULL_IF_CONFIG_SMALL("Xbox Media Audio 2"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_XMA2, .priv_data_size = sizeof(XMADecodeCtx), .init = xma_decode_init, .close = xma_decode_end, .decode = xma_decode_packet, .flush = xma_flush, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, - .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 61f58be178..c251c9e1ec 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1998,16 +1998,16 @@ static av_cold int wmavoice_decode_end(AVCodecContext *ctx) return 0; } -const AVCodec ff_wmavoice_decoder = { - .name = "wmavoice", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WMAVOICE, +const FFCodec ff_wmavoice_decoder = { + .p.name = "wmavoice", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WMAVOICE, .priv_data_size = sizeof(WMAVoiceContext), .init = wmavoice_decode_init, .close = wmavoice_decode_end, .decode = wmavoice_decode_packet, - .capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, + .p.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .flush = wmavoice_flush, }; diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index 79af6269b7..249200bf23 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -591,17 +591,17 @@ static av_cold int wmv2_decode_end(AVCodecContext *avctx) return ff_h263_decode_end(avctx); } -const AVCodec ff_wmv2_decoder = { - .name = "wmv2", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV2, +const FFCodec ff_wmv2_decoder = { + .p.name = "wmv2", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV2, .priv_data_size = sizeof(WMV2DecContext), .init = wmv2_decode_init, .close = wmv2_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 5f50d9cdb1..a4d15e1d55 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -233,17 +233,17 @@ void ff_wmv2_encode_mb(MpegEncContext *s, int16_t block[6][64], s->p_tex_bits += get_bits_diff(s); } -const AVCodec ff_wmv2_encoder = { - .name = "wmv2", - .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WMV2, - .priv_class = &ff_mpv_enc_class, +const FFCodec ff_wmv2_encoder = { + .p.name = "wmv2", + .p.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WMV2, + .p.priv_class = &ff_mpv_enc_class, .priv_data_size = sizeof(WMV2EncContext), .init = wmv2_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index ae815a65a9..156a8a09a4 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -134,13 +134,13 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_wnv1_decoder = { - .name = "wnv1", - .long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WNV1, +const FFCodec ff_wnv1_decoder = { + .p.name = "wnv1", + .p.long_name = NULL_IF_CONFIG_SMALL("Winnov WNV1"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WNV1, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/wrapped_avframe.c b/libavcodec/wrapped_avframe.c index 2e908c84f7..291f4d5d31 100644 --- a/libavcodec/wrapped_avframe.c +++ b/libavcodec/wrapped_avframe.c @@ -109,20 +109,20 @@ static int wrapped_avframe_decode(AVCodecContext *avctx, void *data, return 0; } -const AVCodec ff_wrapped_avframe_encoder = { - .name = "wrapped_avframe", - .long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WRAPPED_AVFRAME, +const FFCodec ff_wrapped_avframe_encoder = { + .p.name = "wrapped_avframe", + .p.long_name = NULL_IF_CONFIG_SMALL("AVFrame to AVPacket passthrough"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, .encode2 = wrapped_avframe_encode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -const AVCodec ff_wrapped_avframe_decoder = { - .name = "wrapped_avframe", - .long_name = NULL_IF_CONFIG_SMALL("AVPacket to AVFrame passthrough"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_WRAPPED_AVFRAME, +const FFCodec ff_wrapped_avframe_decoder = { + .p.name = "wrapped_avframe", + .p.long_name = NULL_IF_CONFIG_SMALL("AVPacket to AVFrame passthrough"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_WRAPPED_AVFRAME, .decode = wrapped_avframe_decode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index a3b2f94a66..f99f492988 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -171,13 +171,13 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_ws_snd1_decoder = { - .name = "ws_snd1", - .long_name = NULL_IF_CONFIG_SMALL("Westwood Audio (SND1)"), - .type = AVMEDIA_TYPE_AUDIO, - .id = AV_CODEC_ID_WESTWOOD_SND1, +const FFCodec ff_ws_snd1_decoder = { + .p.name = "ws_snd1", + .p.long_name = NULL_IF_CONFIG_SMALL("Westwood Audio (SND1)"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_WESTWOOD_SND1, .init = ws_snd_decode_init, .decode = ws_snd_decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xan.c b/libavcodec/xan.c index ac41e2456c..c7916de569 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -636,15 +636,15 @@ static int xan_decode_frame(AVCodecContext *avctx, return buf_size; } -const AVCodec ff_xan_wc3_decoder = { - .name = "xan_wc3", - .long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XAN_WC3, +const FFCodec ff_xan_wc3_decoder = { + .p.name = "xan_wc3", + .p.long_name = NULL_IF_CONFIG_SMALL("Wing Commander III / Xan"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XAN_WC3, .priv_data_size = sizeof(XanContext), .init = xan_decode_init, .close = xan_decode_end, .decode = xan_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index bed68c33ed..0ea5883024 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -23,6 +23,7 @@ #include "libavutil/avstring.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #include "mathops.h" @@ -136,11 +137,11 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_xbm_decoder = { - .name = "xbm", - .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XBM, +const FFCodec ff_xbm_decoder = { + .p.name = "xbm", + .p.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XBM, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = xbm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c index 05e014a0bf..d578eec930 100644 --- a/libavcodec/xbmenc.c +++ b/libavcodec/xbmenc.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" #include "mathops.h" @@ -74,12 +75,12 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_xbm_encoder = { - .name = "xbm", - .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XBM, +const FFCodec ff_xbm_encoder = { + .p.name = "xbm", + .p.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XBM, .encode2 = xbm_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/xfacedec.c b/libavcodec/xfacedec.c index f165fff9e3..32b484a667 100644 --- a/libavcodec/xfacedec.c +++ b/libavcodec/xfacedec.c @@ -177,14 +177,14 @@ static int xface_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_xface_decoder = { - .name = "xface", - .long_name = NULL_IF_CONFIG_SMALL("X-face image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XFACE, +const FFCodec ff_xface_decoder = { + .p.name = "xface", + .p.long_name = NULL_IF_CONFIG_SMALL("X-face image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XFACE, .priv_data_size = sizeof(XFaceContext), .init = xface_decode_init, .decode = xface_decode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c index ae258f559e..c1beb002cf 100644 --- a/libavcodec/xfaceenc.c +++ b/libavcodec/xfaceenc.c @@ -26,6 +26,7 @@ #include "xface.h" #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" #include "libavutil/avassert.h" @@ -210,13 +211,13 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_xface_encoder = { - .name = "xface", - .long_name = NULL_IF_CONFIG_SMALL("X-face image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XFACE, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_xface_encoder = { + .p.name = "xface", + .p.long_name = NULL_IF_CONFIG_SMALL("X-face image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XFACE, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .priv_data_size = sizeof(XFaceContext), .encode2 = xface_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index 493779e4b4..8b3e950af6 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -128,13 +128,13 @@ static av_cold int decode_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_xl_decoder = { - .name = "xl", - .long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_VIXL, +const FFCodec ff_xl_decoder = { + .p.name = "xl", + .p.long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_VIXL, .init = decode_init, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index a11926ba28..584ffaa995 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -24,6 +24,7 @@ #include "libavutil/parseutils.h" #include "libavutil/avstring.h" #include "avcodec.h" +#include "codec_internal.h" #include "internal.h" #define MIN_ELEMENT ' ' @@ -436,13 +437,13 @@ static av_cold int xpm_decode_close(AVCodecContext *avctx) return 0; } -const AVCodec ff_xpm_decoder = { - .name = "xpm", - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XPM, +const FFCodec ff_xpm_decoder = { + .p.name = "xpm", + .p.long_name = NULL_IF_CONFIG_SMALL("XPM (X PixMap) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XPM, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(XPMDecContext), .close = xpm_decode_close, .decode = xpm_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, - .long_name = NULL_IF_CONFIG_SMALL("XPM (X PixMap) image") }; diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index dbfd1fe400..cb7b7b7cab 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -154,11 +154,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, return buf_size; } -const AVCodec ff_xsub_decoder = { - .name = "xsub", - .long_name = NULL_IF_CONFIG_SMALL("XSUB"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_XSUB, +const FFCodec ff_xsub_decoder = { + .p.name = "xsub", + .p.long_name = NULL_IF_CONFIG_SMALL("XSUB"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_XSUB, .init = decode_init, .decode = decode_frame, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index 4c67566bc5..9069a96437 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -211,11 +211,11 @@ static av_cold int xsub_encoder_init(AVCodecContext *avctx) return 0; } -const AVCodec ff_xsub_encoder = { - .name = "xsub", - .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), - .type = AVMEDIA_TYPE_SUBTITLE, - .id = AV_CODEC_ID_XSUB, +const FFCodec ff_xsub_encoder = { + .p.name = "xsub", + .p.long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), + .p.type = AVMEDIA_TYPE_SUBTITLE, + .p.id = AV_CODEC_ID_XSUB, .init = xsub_encoder_init, .encode_sub = xsub_encode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 7b8228332f..3d86b2b82d 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -25,6 +25,7 @@ #include "libavutil/imgutils.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "internal.h" #include "xwd.h" @@ -247,11 +248,11 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } -const AVCodec ff_xwd_decoder = { - .name = "xwd", - .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XWD, +const FFCodec ff_xwd_decoder = { + .p.name = "xwd", + .p.long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XWD, + .p.capabilities = AV_CODEC_CAP_DR1, .decode = xwd_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, }; diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c index 31a263b8df..0bfe5a2970 100644 --- a/libavcodec/xwdenc.c +++ b/libavcodec/xwdenc.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" #include "bytestream.h" +#include "codec_internal.h" #include "encode.h" #include "xwd.h" @@ -213,14 +214,14 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_xwd_encoder = { - .name = "xwd", - .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XWD, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_xwd_encoder = { + .p.name = "xwd", + .p.long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XWD, + .p.capabilities = AV_CODEC_CAP_DR1, .encode2 = xwd_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index b1948964fa..759ec2c90b 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -434,15 +434,15 @@ static int xan_decode_frame(AVCodecContext *avctx, return avpkt->size; } -const AVCodec ff_xan_wc4_decoder = { - .name = "xan_wc4", - .long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_XAN_WC4, +const FFCodec ff_xan_wc4_decoder = { + .p.name = "xan_wc4", + .p.long_name = NULL_IF_CONFIG_SMALL("Wing Commander IV / Xxan"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_XAN_WC4, .priv_data_size = sizeof(XanContext), .init = xan_decode_init, .close = xan_decode_end, .decode = xan_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index b3c5992acf..507e784d3c 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -82,13 +82,13 @@ static int y41p_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_y41p_decoder = { - .name = "y41p", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_Y41P, +const FFCodec ff_y41p_decoder = { + .p.name = "y41p", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_Y41P, .init = y41p_decode_init, .decode = y41p_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c index e0182481c1..0522de6613 100644 --- a/libavcodec/y41penc.c +++ b/libavcodec/y41penc.c @@ -77,15 +77,15 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_y41p_encoder = { - .name = "y41p", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_Y41P, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_y41p_encoder = { + .p.name = "y41p", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_Y41P, + .p.capabilities = AV_CODEC_CAP_DR1, .init = y41p_encode_init, .encode2 = y41p_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, AV_PIX_FMT_NONE }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c index f9971dd786..b49b960b3a 100644 --- a/libavcodec/ylc.c +++ b/libavcodec/ylc.c @@ -451,15 +451,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_ylc_decoder = { - .name = "ylc", - .long_name = NULL_IF_CONFIG_SMALL("YUY2 Lossless Codec"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_YLC, +const FFCodec ff_ylc_decoder = { + .p.name = "ylc", + .p.long_name = NULL_IF_CONFIG_SMALL("YUY2 Lossless Codec"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_YLC, .priv_data_size = sizeof(YLCContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, + .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 6028cadce9..01090ddbf8 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -266,11 +266,11 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, return avpkt->size; } -const AVCodec ff_yop_decoder = { - .name = "yop", - .long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_YOP, +const FFCodec ff_yop_decoder = { + .p.name = "yop", + .p.long_name = NULL_IF_CONFIG_SMALL("Psygnosis YOP Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_YOP, .priv_data_size = sizeof(YopDecContext), .init = yop_decode_init, .close = yop_decode_close, diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c index 15a89a8f82..83e03ba782 100644 --- a/libavcodec/yuv4dec.c +++ b/libavcodec/yuv4dec.c @@ -74,13 +74,13 @@ static int yuv4_decode_frame(AVCodecContext *avctx, void *data, return avpkt->size; } -const AVCodec ff_yuv4_decoder = { - .name = "yuv4", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_YUV4, +const FFCodec ff_yuv4_decoder = { + .p.name = "yuv4", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_YUV4, .init = yuv4_decode_init, .decode = yuv4_decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c index 11dfc68a0d..3a4d36f40c 100644 --- a/libavcodec/yuv4enc.c +++ b/libavcodec/yuv4enc.c @@ -21,6 +21,7 @@ */ #include "avcodec.h" +#include "codec_internal.h" #include "encode.h" static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, @@ -58,12 +59,12 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; } -const AVCodec ff_yuv4_encoder = { - .name = "yuv4", - .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_YUV4, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_yuv4_encoder = { + .p.name = "yuv4", + .p.long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_YUV4, + .p.capabilities = AV_CODEC_CAP_DR1, + .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .encode2 = yuv4_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index d46a097da0..49b0968129 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -134,17 +134,17 @@ static void zerocodec_decode_flush(AVCodecContext *avctx) av_frame_unref(zc->previous_frame); } -const AVCodec ff_zerocodec_decoder = { - .type = AVMEDIA_TYPE_VIDEO, - .name = "zerocodec", - .long_name = NULL_IF_CONFIG_SMALL("ZeroCodec Lossless Video"), - .id = AV_CODEC_ID_ZEROCODEC, +const FFCodec ff_zerocodec_decoder = { + .p.type = AVMEDIA_TYPE_VIDEO, + .p.name = "zerocodec", + .p.long_name = NULL_IF_CONFIG_SMALL("ZeroCodec Lossless Video"), + .p.id = AV_CODEC_ID_ZEROCODEC, .priv_data_size = sizeof(ZeroCodecContext), .init = zerocodec_decode_init, .decode = zerocodec_decode_frame, .flush = zerocodec_decode_flush, .close = zerocodec_decode_close, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index ee69b66945..86f7f265c6 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -645,15 +645,15 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -const AVCodec ff_zmbv_decoder = { - .name = "zmbv", - .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ZMBV, +const FFCodec ff_zmbv_decoder = { + .p.name = "zmbv", + .p.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ZMBV, .priv_data_size = sizeof(ZmbvContext), .init = decode_init, .close = decode_end, .decode = decode_frame, - .capabilities = AV_CODEC_CAP_DR1, + .p.capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index ee3f26bb6f..89814de800 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -410,17 +410,17 @@ static av_cold int encode_init(AVCodecContext *avctx) return ff_deflate_init(&c->zstream, lvl, avctx); } -const AVCodec ff_zmbv_encoder = { - .name = "zmbv", - .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_ZMBV, - .capabilities = AV_CODEC_CAP_DR1, +const FFCodec ff_zmbv_encoder = { + .p.name = "zmbv", + .p.long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_ZMBV, + .p.capabilities = AV_CODEC_CAP_DR1, .priv_data_size = sizeof(ZmbvEncContext), .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_RGB565LE, #ifdef ZMBV_ENABLE_24BPP diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 2fea29a308..288aa63313 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -54,6 +54,7 @@ #include "libavcodec/avcodec.h" #include "libavcodec/bytestream.h" +#include "libavcodec/codec_internal.h" #include "libavformat/avformat.h" //For FF_SANE_NB_CHANNELS, so we dont waste energy testing things that will get instantly rejected @@ -61,7 +62,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); -extern const AVCodec * codec_list[]; +extern const FFCodec * codec_list[]; static void error(const char *err) { @@ -69,15 +70,15 @@ static void error(const char *err) exit(1); } -static const AVCodec *c = NULL; -static const AVCodec *AVCodecInitialize(enum AVCodecID codec_id) +static const FFCodec *c = NULL; +static const FFCodec *AVCodecInitialize(enum AVCodecID codec_id) { const AVCodec *res; res = avcodec_find_decoder(codec_id); if (!res) error("Failed to find decoder"); - return res; + return ffcodec(res); } static int subtitle_handler(AVCodecContext *avctx, void *frame, @@ -127,11 +128,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { #ifdef FFMPEG_DECODER #define DECODER_SYMBOL0(CODEC) ff_##CODEC##_decoder #define DECODER_SYMBOL(CODEC) DECODER_SYMBOL0(CODEC) - extern AVCodec DECODER_SYMBOL(FFMPEG_DECODER); + extern FFCodec DECODER_SYMBOL(FFMPEG_DECODER); codec_list[0] = &DECODER_SYMBOL(FFMPEG_DECODER); #if FFMPEG_DECODER == tiff || FFMPEG_DECODER == tdsc - extern AVCodec DECODER_SYMBOL(mjpeg); + extern FFCodec DECODER_SYMBOL(mjpeg); codec_list[1] = &DECODER_SYMBOL(mjpeg); #endif @@ -142,17 +143,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { av_log_set_level(AV_LOG_PANIC); } - switch (c->type) { + switch (c->p.type) { case AVMEDIA_TYPE_AUDIO : case AVMEDIA_TYPE_VIDEO : decode_handler = audio_video_handler ; break; case AVMEDIA_TYPE_SUBTITLE: decode_handler = subtitle_handler ; break; } - switch (c->id) { + switch (c->p.id) { case AV_CODEC_ID_APE: maxsamples_per_frame /= 256; break; } maxpixels = maxpixels_per_frame * maxiteration; maxsamples = maxsamples_per_frame * maxiteration; - switch (c->id) { + switch (c->p.id) { case AV_CODEC_ID_AGM: maxpixels /= 1024; break; case AV_CODEC_ID_ARBC: maxpixels /= 1024; break; case AV_CODEC_ID_BINKVIDEO: maxpixels /= 32; break; @@ -231,7 +232,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { maxsamples_per_frame = FFMIN(maxsamples_per_frame, maxsamples); maxpixels_per_frame = FFMIN(maxpixels_per_frame , maxpixels); - AVCodecContext* ctx = avcodec_alloc_context3(c); + AVCodecContext* ctx = avcodec_alloc_context3(&c->p); AVCodecContext* parser_avctx = avcodec_alloc_context3(NULL); if (!ctx || !parser_avctx) error("Failed memory allocation"); @@ -257,7 +258,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { // Try to initialize a parser for this codec, note, this may fail which just means we test without one flags = bytestream2_get_byte(&gbc); if (flags & 1) - parser = av_parser_init(c->id); + parser = av_parser_init(c->p.id); if (flags & 2) ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; if (flags & 4) { @@ -265,7 +266,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (flags & 8) ctx->err_recognition |= AV_EF_EXPLODE; } - if ((flags & 0x10) && c->id != AV_CODEC_ID_H264) + if ((flags & 0x10) && c->p.id != AV_CODEC_ID_H264) ctx->flags2 |= AV_CODEC_FLAG2_FAST; if (flags & 0x80) ctx->flags2 |= AV_CODEC_FLAG2_EXPORT_MVS; @@ -349,7 +350,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ctx->width = ctx->height = 0; } - int res = avcodec_open2(ctx, c, &opts); + int res = avcodec_open2(ctx, &c->p, &opts); if (res < 0) { avcodec_free_context(&ctx); av_free(parser_avctx);