avcodec: Don't set AVCodec.sample_fmts,ch_layouts for decoders

It is pointless for them given that these values will
be overridden by the decoder lateron anyway.
The only exceptions to this are scenarios where the decoder
actually checks request_sample_fmt or where there are both
fixed- and floating point decoders.

(IMO something like get_format() for audio would be better for
both cases.)

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2026-02-06 23:16:29 +01:00
parent 028d9d3997
commit 12c2a4e117
38 changed files with 0 additions and 48 deletions

View file

@ -198,7 +198,6 @@ const FFCodec ff_eightsvx_fib_decoder = {
FF_CODEC_DECODE_CB(eightsvx_decode_frame),
.close = eightsvx_decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P),
};
#endif
#if CONFIG_EIGHTSVX_EXP_DECODER
@ -212,6 +211,5 @@ const FFCodec ff_eightsvx_exp_decoder = {
FF_CODEC_DECODE_CB(eightsvx_decode_frame),
.close = eightsvx_decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P),
};
#endif

View file

@ -265,5 +265,4 @@ const FFCodec ff_adpcm_adx_decoder = {
.flush = adx_decode_flush,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};

View file

@ -1104,5 +1104,4 @@ const FFCodec ff_amrnb_decoder = {
.init = amrnb_decode_init,
FF_CODEC_DECODE_CB(amrnb_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -1308,5 +1308,4 @@ const FFCodec ff_amrwb_decoder = {
.init = amrwb_decode_init,
FF_CODEC_DECODE_CB(amrwb_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -271,5 +271,4 @@ const FFCodec ff_apac_decoder = {
.p.capabilities = AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P),
};

View file

@ -1764,6 +1764,5 @@ const FFCodec ff_ape_decoder = {
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.flush = ape_flush,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P),
.p.priv_class = &ape_decoder_class,
};

View file

@ -399,6 +399,5 @@ const FFCodec ff_atrac1_decoder = {
.close = atrac1_decode_end,
FF_CODEC_DECODE_CB(atrac1_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -1028,7 +1028,6 @@ const FFCodec ff_atrac3_decoder = {
.close = atrac3_decode_close,
FF_CODEC_DECODE_CB(atrac3_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@ -1042,6 +1041,5 @@ const FFCodec ff_atrac3al_decoder = {
.close = atrac3_decode_close,
FF_CODEC_DECODE_CB(atrac3al_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -429,5 +429,4 @@ const FFCodec ff_bonk_decoder = {
.p.capabilities = AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};

View file

@ -173,7 +173,6 @@ const FFCodec ff_comfortnoise_decoder = {
FF_CODEC_DECODE_CB(cng_decode_frame),
.flush = cng_decode_flush,
.close = cng_decode_close,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -1308,6 +1308,5 @@ const FFCodec ff_cook_decoder = {
.close = cook_decode_close,
FF_CODEC_DECODE_CB(cook_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -416,7 +416,6 @@ const FFCodec ff_dca_decoder = {
.close = dcadec_close,
.flush = dcadec_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP),
.p.priv_class = &dcadec_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,

View file

@ -1310,6 +1310,5 @@ const FFCodec ff_dolby_e_decoder = {
.close = dolby_e_close,
.flush = dolby_e_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -126,7 +126,6 @@ const FFCodec ff_ ## name_ ## _decoder = { \
.init = decode_init, \
FF_CODEC_DECODE_CB(decode_frame), \
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), \
};
DSD_DECODER(DSD_LSBF, dsd_lsbf, "DSD (Direct Stream Digital), least significant bit first")

View file

@ -392,5 +392,4 @@ const FFCodec ff_dst_decoder = {
.init = decode_init,
FF_CODEC_DECODE_CB(decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT),
};

View file

@ -196,5 +196,4 @@ const FFCodec ff_fastaudio_decoder = {
FF_CODEC_DECODE_CB(fastaudio_decode),
.close = fastaudio_close,
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -635,5 +635,4 @@ const FFCodec ff_hca_decoder = {
.close = decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -1033,7 +1033,6 @@ const FFCodec ff_imc_decoder = {
FF_CODEC_DECODE_CB(imc_decode_frame),
.flush = flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif
@ -1049,7 +1048,6 @@ const FFCodec ff_iac_decoder = {
FF_CODEC_DECODE_CB(imc_decode_frame),
.flush = flush,
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif

View file

@ -182,9 +182,6 @@ const FFCodec ff_libcodec2_decoder = {
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_CODEC2,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLERATES(8000),
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16),
CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO),
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE,
.priv_data_size = sizeof(LibCodec2Context),
.init = libcodec2_init_decoder,

View file

@ -293,7 +293,6 @@ const FFCodec ff_mace3_decoder = {
.init = mace_decode_init,
FF_CODEC_DECODE_CB(mace_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};
const FFCodec ff_mace6_decoder = {
@ -305,5 +304,4 @@ const FFCodec ff_mace6_decoder = {
.init = mace_decode_init,
FF_CODEC_DECODE_CB(mace_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};

View file

@ -374,6 +374,5 @@ const FFCodec ff_metasound_decoder = {
.close = ff_twinvq_decode_close,
FF_CODEC_DECODE_CB(ff_twinvq_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -181,5 +181,4 @@ const FFCodec ff_misc4_decoder = {
FF_CODEC_DECODE_CB(misc4_decode),
.p.capabilities = AV_CODEC_CAP_DR1 |
AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16),
};

View file

@ -324,5 +324,4 @@ const FFCodec ff_mpc7_decoder = {
FF_CODEC_DECODE_CB(mpc7_decode_frame),
.flush = mpc7_decode_flush,
.p.capabilities = AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};

View file

@ -399,5 +399,4 @@ const FFCodec ff_mpc8_decoder = {
FF_CODEC_DECODE_CB(mpc8_decode_frame),
.flush = mpc8_decode_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
};

View file

@ -202,5 +202,4 @@ const FFCodec ff_nellymoser_decoder = {
.close = decode_end,
FF_CODEC_DECODE_CB(decode_tag),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT),
};

View file

@ -1023,5 +1023,4 @@ const FFCodec ff_on2avc_decoder = {
.close = on2avc_decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -495,6 +495,5 @@ const FFCodec ff_osq_decoder = {
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P),
.flush = osq_flush,
};

View file

@ -307,5 +307,4 @@ const FFCodec ff_pcm_bluray_decoder = {
.p.id = AV_CODEC_ID_PCM_BLURAY,
FF_CODEC_DECODE_CB(pcm_bluray_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32),
};

View file

@ -305,5 +305,4 @@ const FFCodec ff_pcm_dvd_decoder = {
FF_CODEC_DECODE_CB(pcm_dvd_decode_frame),
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32),
};

View file

@ -165,5 +165,4 @@ const FFCodec ff_qoa_decoder = {
FF_CODEC_DECODE_CB(qoa_decode_frame),
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16),
};

View file

@ -523,6 +523,5 @@ const FFCodec ff_ralf_decoder = {
.flush = decode_flush,
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -817,5 +817,4 @@ const FFCodec ff_shorten_decoder = {
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF |
AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_DR1,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_U8P),
};

View file

@ -953,5 +953,4 @@ const FFCodec ff_tak_decoder = {
FF_CODEC_DECODE_CB(tak_decode_frame),
UPDATE_THREAD_CONTEXT(update_thread_context),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P),
};

View file

@ -423,6 +423,5 @@ const FFCodec ff_twinvq_decoder = {
.close = ff_twinvq_decode_close,
FF_CODEC_DECODE_CB(ff_twinvq_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};

View file

@ -1896,6 +1896,4 @@ const FFCodec ff_vorbis_decoder = {
.flush = vorbis_decode_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_CH_LAYOUTS_ARRAY(ff_vorbis_ch_layouts),
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
};

View file

@ -1023,7 +1023,6 @@ const FFCodec ff_wmav1_decoder = {
FF_CODEC_DECODE_CB(wma_decode_superframe),
.flush = flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif
@ -1039,7 +1038,6 @@ const FFCodec ff_wmav2_decoder = {
FF_CODEC_DECODE_CB(wma_decode_superframe),
.flush = flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
#endif

View file

@ -1337,5 +1337,4 @@ const FFCodec ff_wmalossless_decoder = {
.flush = flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P),
};

View file

@ -2097,7 +2097,6 @@ const FFCodec ff_wmapro_decoder = {
FF_CODEC_DECODE_CB(wmapro_decode_packet),
.p.capabilities = AV_CODEC_CAP_DR1,
.flush = wmapro_flush,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@ -2112,7 +2111,6 @@ const FFCodec ff_xma1_decoder = {
FF_CODEC_DECODE_CB(xma_decode_packet),
.flush = xma_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@ -2127,6 +2125,5 @@ const FFCodec ff_xma2_decoder = {
FF_CODEC_DECODE_CB(xma_decode_packet),
.flush = xma_flush,
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP),
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};