diff options
author | James Almer <jamrial@gmail.com> | 2024-01-20 12:26:08 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-03-07 08:53:30 -0300 |
commit | 65ddc74988245a01421a63c5cffa4d900c47117c (patch) | |
tree | 72bd32783aca75dff15c038cd0a69d724514b31c /libavcodec | |
parent | a12cd3be98e8aba6e74274192ec6532988aa9444 (diff) | |
download | ffmpeg-65ddc74988245a01421a63c5cffa4d900c47117c.tar.gz |
avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
55 files changed, 2 insertions, 471 deletions
diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c index 83d515b5a8..9305b4c50f 100644 --- a/libavcodec/aac_ac3_parser.c +++ b/libavcodec/aac_ac3_parser.c @@ -135,12 +135,6 @@ get_next: avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; avctx->ch_layout.nb_channels = hdr.channels; } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = hdr.channel_layout; -FF_ENABLE_DEPRECATION_WARNINGS -#endif } s1->duration = hdr.num_blocks * 256; avctx->audio_service_type = hdr.bitstream_mode; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index fa2187b61a..97e51dd72a 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -564,7 +564,6 @@ const FFCodec ff_aac_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) .p.ch_layouts = ff_aac_ch_layout, .flush = flush, .p.priv_class = &aac_decoder_class, @@ -590,7 +589,6 @@ const FFCodec ff_aac_latm_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) .p.ch_layouts = ff_aac_ch_layout, .flush = flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), diff --git a/libavcodec/aacdec_common.c b/libavcodec/aacdec_common.c index 75368b7075..145c718047 100644 --- a/libavcodec/aacdec_common.c +++ b/libavcodec/aacdec_common.c @@ -92,23 +92,6 @@ const int16_t ff_aac_channel_map[3][4][6] = { }, }; -#if FF_API_OLD_CHANNEL_LAYOUT -const uint64_t ff_aac_channel_layout[] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_7POINT1_WIDE_BACK, - AV_CH_LAYOUT_6POINT1_BACK, - AV_CH_LAYOUT_7POINT1, - AV_CH_LAYOUT_22POINT2, - AV_CH_LAYOUT_7POINT1_TOP_BACK, - 0, -}; -#endif - const AVChannelLayout ff_aac_ch_layout[] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 5d5ae34838..305bb0ba9a 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -508,7 +508,6 @@ const FFCodec ff_aac_fixed_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) .p.ch_layouts = ff_aac_ch_layout, .p.priv_class = &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 3d96ed6f29..7e2798787d 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -469,13 +469,6 @@ static int output_configure(AACDecContext *ac, } // Try to sniff a reasonable channel order, otherwise output the // channels in the order the PCE declared them. -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout == AV_CH_LAYOUT_NATIVE) - ac->output_channel_order = CHANNEL_ORDER_CODED; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (ac->output_channel_order == CHANNEL_ORDER_DEFAULT) layout = sniff_channel_order(layout_map, tags); for (i = 0; i < tags; i++) { diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index 7079b061fc..184508f2f3 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -49,10 +49,6 @@ extern const uint8_t ff_aac_channel_layout_map[16][16][3]; extern const int16_t ff_aac_channel_map[3][4][6]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_aac_channel_layout[]; -#endif - extern const AVChannelLayout ff_aac_ch_layout[]; FF_VISIBILITY_POP_HIDDEN diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ee50138605..eb67efda62 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -190,14 +190,6 @@ static void ac3_downmix(AVCodecContext *avctx) const AVChannelLayout stereo = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; /* allow downmixing to stereo or mono */ -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout) { - av_channel_layout_uninit(&s->downmix_layout); - av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (avctx->ch_layout.nb_channels > 1 && !av_channel_layout_compare(&s->downmix_layout, &mono)) { av_channel_layout_uninit(&avctx->ch_layout); diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 825c17c506..ff43088df5 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -150,30 +150,6 @@ static uint8_t exponent_group_tab[2][3][256]; /** * List of supported channel layouts. */ -#if FF_API_OLD_CHANNEL_LAYOUT -const uint64_t ff_ac3_channel_layouts[19] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_2_1, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_2_2, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT0_BACK, - (AV_CH_LAYOUT_MONO | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_2_1 | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_2_2 | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_QUAD | AV_CH_LOW_FREQUENCY), - (AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY), - AV_CH_LAYOUT_5POINT1, - AV_CH_LAYOUT_5POINT1_BACK, - 0 -}; -#endif - const AVChannelLayout ff_ac3_ch_layouts[19] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h index 55e88d69e4..1cb1aac4b2 100644 --- a/libavcodec/ac3enc.h +++ b/libavcodec/ac3enc.h @@ -268,9 +268,6 @@ typedef struct AC3EncodeContext { void (*output_frame_header)(struct AC3EncodeContext *s); } AC3EncodeContext; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_ac3_channel_layouts[19]; -#endif extern const AVChannelLayout ff_ac3_ch_layouts[19]; extern const AVOption ff_ac3_enc_options[]; extern const AVClass ff_ac3enc_class; diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index 079a43dc39..7fd6084aaf 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -122,7 +122,6 @@ const FFCodec ff_ac3_fixed_encoder = { .p.priv_class = &ff_ac3enc_class, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = ff_ac3_sample_rate_tab, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, }; diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index 9664adbf63..27a89e79df 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -125,7 +125,6 @@ const FFCodec ff_ac3_encoder = { AV_SAMPLE_FMT_NONE }, .p.priv_class = &ff_ac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 9598e5861e..f43adb57f9 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -617,21 +617,6 @@ static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return 0; } -#if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t alac_channel_layouts[ALAC_MAX_CHANNELS + 1] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_6POINT1_BACK, - AV_CH_LAYOUT_7POINT1_WIDE_BACK, - 0 -}; -#endif - - #define OFFSET(x) offsetof(AlacEncodeContext, x) #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { @@ -660,7 +645,6 @@ const FFCodec ff_alac_encoder = { .init = alac_encode_init, FF_CODEC_ENCODE_CB(alac_encode_frame), .close = alac_encode_close, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(alac_channel_layouts) .p.ch_layouts = ff_alac_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P, diff --git a/libavcodec/aptxdec.c b/libavcodec/aptxdec.c index 3ae7a00803..4b083b6558 100644 --- a/libavcodec/aptxdec.c +++ b/libavcodec/aptxdec.c @@ -183,7 +183,6 @@ const FFCodec ff_aptx_decoder = { .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -200,7 +199,6 @@ const FFCodec ff_aptx_hd_decoder = { .init = ff_aptx_init, FF_CODEC_DECODE_CB(aptx_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/aptxenc.c b/libavcodec/aptxenc.c index 6deebaf2cb..5e041b9a1b 100644 --- a/libavcodec/aptxenc.c +++ b/libavcodec/aptxenc.c @@ -276,7 +276,6 @@ const FFCodec ff_aptx_encoder = { .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, @@ -295,7 +294,6 @@ const FFCodec ff_aptx_hd_encoder = { .init = aptx_encode_init, FF_CODEC_ENCODE_CB(aptx_encode_frame), .close = aptx_close, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 9eefb7a92d..2c65101fdc 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -648,7 +648,6 @@ static const AVOption options[] = { .p.priv_class = &ffat_##NAME##_enc_class, \ .p.capabilities = AV_CODEC_CAP_DELAY | \ AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \ .p.ch_layouts = CH_LAYOUTS, \ .p.sample_fmts = (const enum AVSampleFormat[]) { \ AV_SAMPLE_FMT_S16, \ @@ -674,24 +673,6 @@ static const AVChannelLayout aac_at_ch_layouts[] = { { 0 }, }; -#if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t aac_at_channel_layouts[] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1, - AV_CH_LAYOUT_6POINT0, - AV_CH_LAYOUT_6POINT1, - AV_CH_LAYOUT_7POINT0, - AV_CH_LAYOUT_7POINT1_WIDE_BACK, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_OCTAGONAL, - 0, -}; -#endif - FFAT_ENC(aac, AV_CODEC_ID_AAC, aac_profiles, , aac_at_channel_layouts, aac_at_ch_layouts) //FFAT_ENC(adpcm_ima_qt, AV_CODEC_ID_ADPCM_IMA_QT, NULL) FFAT_ENC(alac, AV_CODEC_ID_ALAC, NULL, , NULL, NULL) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index a231bfd689..a9a87bb58c 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -241,26 +241,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code goto free_and_end; } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - /* compat wrapper for old-style callers */ - if (avctx->channel_layout && !avctx->channels) - avctx->channels = av_popcount64(avctx->channel_layout); - - if ((avctx->channels && avctx->ch_layout.nb_channels != avctx->channels) || - (avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || - avctx->ch_layout.u.mask != avctx->channel_layout))) { - av_channel_layout_uninit(&avctx->ch_layout); - if (avctx->channel_layout) { - av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); - } else { - avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - } - avctx->ch_layout.nb_channels = avctx->channels; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - /* AV_CODEC_CAP_CHANNEL_CONF is a decoder-only flag; so the code below * in particular checks that nb_channels is set for all audio encoders. */ if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && !avctx->ch_layout.nb_channels @@ -345,15 +325,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!avctx->bit_rate) avctx->bit_rate = get_bit_rate(avctx); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - /* update the deprecated fields for old-style callers */ - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - /* validate channel layout from the decoder */ if ((avctx->ch_layout.nb_channels && !av_channel_layout_check(&avctx->ch_layout)) || avctx->ch_layout.nb_channels > FF_SANE_NB_CHANNELS) { diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a035d48283..9eb98e7db4 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1049,15 +1049,6 @@ typedef struct AVCodecContext { /* audio only */ int sample_rate; ///< samples per second -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * number of audio channels - * @deprecated use ch_layout.nb_channels - */ - attribute_deprecated - int channels; -#endif - /** * audio sample format * - encoding: Set by user. @@ -1090,26 +1081,6 @@ typedef struct AVCodecContext { */ int cutoff; -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - * @deprecated use ch_layout - */ - attribute_deprecated - uint64_t channel_layout; - - /** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated use "downmix" codec private option - */ - attribute_deprecated - uint64_t request_channel_layout; -#endif - /** * Type of service that the audio stream conveys. * - encoding: Set by user. diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 8034f1a53c..6f9b42760d 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -209,13 +209,6 @@ typedef struct AVCodec { const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * @deprecated use ch_layouts instead - */ - attribute_deprecated - const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 -#endif const AVClass *priv_class; ///< AVClass for the private context const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h index 130a7dc3cd..d6757e2def 100644 --- a/libavcodec/codec_internal.h +++ b/libavcodec/codec_internal.h @@ -284,25 +284,6 @@ typedef struct FFCodec { .update_thread_context_for_user = NULL #endif -#if FF_API_OLD_CHANNEL_LAYOUT -#define CODEC_OLD_CHANNEL_LAYOUTS(...) CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(((const uint64_t[]) { __VA_ARGS__, 0 })) -#if defined(__clang__) -#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) \ - FF_DISABLE_DEPRECATION_WARNINGS \ - .p.channel_layouts = (array), \ - FF_ENABLE_DEPRECATION_WARNINGS -#else -#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) .p.channel_layouts = (array), -#endif -#else -/* This is only provided to allow to test disabling FF_API_OLD_CHANNEL_LAYOUT - * without removing all the FF_API_OLD_CHANNEL_LAYOUT codeblocks. - * It is of course still expected to be removed when FF_API_OLD_CHANNEL_LAYOUT - * will be finally removed (along with all usages of these macros). */ -#define CODEC_OLD_CHANNEL_LAYOUTS(...) -#define CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(array) -#endif - #define FF_CODEC_DECODE_CB(func) \ .cb_type = FF_CODEC_CB_TYPE_DECODE, \ .cb.decode = (func) diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c index abaac63841..212cb97d77 100644 --- a/libavcodec/codec_par.c +++ b/libavcodec/codec_par.c @@ -168,32 +168,9 @@ int avcodec_parameters_from_context(AVCodecParameters *par, break; case AVMEDIA_TYPE_AUDIO: par->format = codec->sample_fmt; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - // if the old/new fields are set inconsistently, prefer the old ones - if ((codec->channels && codec->channels != codec->ch_layout.nb_channels) || - (codec->channel_layout && (codec->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || - codec->ch_layout.u.mask != codec->channel_layout))) { - if (codec->channel_layout) - av_channel_layout_from_mask(&par->ch_layout, codec->channel_layout); - else { - par->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - par->ch_layout.nb_channels = codec->channels; - } -FF_ENABLE_DEPRECATION_WARNINGS - } else { -#endif ret = av_channel_layout_copy(&par->ch_layout, &codec->ch_layout); if (ret < 0) return ret; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - } - par->channel_layout = par->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - par->ch_layout.u.mask : 0; - par->channels = par->ch_layout.nb_channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif par->sample_rate = codec->sample_rate; par->block_align = codec->block_align; par->frame_size = codec->frame_size; @@ -255,32 +232,9 @@ int avcodec_parameters_to_context(AVCodecContext *codec, break; case AVMEDIA_TYPE_AUDIO: codec->sample_fmt = par->format; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - // if the old/new fields are set inconsistently, prefer the old ones - if ((par->channels && par->channels != par->ch_layout.nb_channels) || - (par->channel_layout && (par->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || - par->ch_layout.u.mask != par->channel_layout))) { - if (par->channel_layout) - av_channel_layout_from_mask(&codec->ch_layout, par->channel_layout); - else { - codec->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - codec->ch_layout.nb_channels = par->channels; - } -FF_ENABLE_DEPRECATION_WARNINGS - } else { -#endif ret = av_channel_layout_copy(&codec->ch_layout, &par->ch_layout); if (ret < 0) return ret; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - } - codec->channel_layout = codec->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - codec->ch_layout.u.mask : 0; - codec->channels = codec->ch_layout.nb_channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif codec->sample_rate = par->sample_rate; codec->block_align = par->block_align; codec->frame_size = par->frame_size; diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h index f42dd3b1d5..fa6851294f 100644 --- a/libavcodec/codec_par.h +++ b/libavcodec/codec_par.h @@ -149,22 +149,6 @@ typedef struct AVCodecParameters { */ int video_delay; -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * Audio only. The channel layout bitmask. May be 0 if the channel layout is - * unknown or unspecified, otherwise the number of bits set must be equal to - * the channels field. - * @deprecated use ch_layout - */ - attribute_deprecated - uint64_t channel_layout; - /** - * Audio only. The number of audio channels. - * @deprecated use ch_layout.nb_channels - */ - attribute_deprecated - int channels; -#endif /** * Audio only. The number of audio samples per second. */ diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 03dbf299fc..8a62d3b870 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -352,18 +352,6 @@ static av_cold int dcadec_init(AVCodecContext *avctx) s->crctab = av_crc_get_table(AV_CRC_16_CCITT); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout & AV_CH_LAYOUT_NATIVE) - s->output_channel_order = CHANNEL_ORDER_CODED; - - if (avctx->request_channel_layout & ~AV_CH_LAYOUT_NATIVE) { - av_channel_layout_uninit(&s->downmix_layout); - av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout & ~AV_CH_LAYOUT_NATIVE); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (s->downmix_layout.nb_channels) { if (!av_channel_layout_compare(&s->downmix_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO) || !av_channel_layout_compare(&s->downmix_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX)) { diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index c731d79381..192121524b 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -1325,9 +1325,6 @@ const FFCodec ff_dca_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = sample_rates, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 960cf56a92..1f47e44d10 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -92,39 +92,6 @@ static int apply_param_change(AVCodecContext *avctx, const AVPacket *avpkt) flags = bytestream_get_le32(&data); size -= 4; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) { - if (size < 4) - goto fail; - val = bytestream_get_le32(&data); - if (val <= 0 || val > INT_MAX) { - av_log(avctx, AV_LOG_ERROR, "Invalid channel count"); - ret = AVERROR_INVALIDDATA; - goto fail2; - } - av_channel_layout_uninit(&avctx->ch_layout); - avctx->ch_layout.nb_channels = val; - avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - size -= 4; - } - if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) { - if (size < 8) - goto fail; - av_channel_layout_uninit(&avctx->ch_layout); - ret = av_channel_layout_from_mask(&avctx->ch_layout, bytestream_get_le64(&data)); - if (ret < 0) - goto fail2; - size -= 8; - } - if (flags & (AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT | - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)) { - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? - avctx->ch_layout.u.mask : 0; - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) { if (size < 4) goto fail; @@ -582,15 +549,6 @@ static int fill_frame_props(const AVCodecContext *avctx, AVFrame *frame) if (ret < 0) return ret; } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (!frame->channel_layout) - frame->channel_layout = avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ? - avctx->ch_layout.u.mask : 0; - if (!frame->channels) - frame->channels = avctx->ch_layout.nb_channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (!frame->sample_rate) frame->sample_rate = avctx->sample_rate; } @@ -1633,15 +1591,6 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags) goto fail; } } else if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - /* compat layer for old-style get_buffer() implementations */ - avctx->channels = avctx->ch_layout.nb_channels; - avctx->channel_layout = (avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE) ? - avctx->ch_layout.u.mask : 0; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (frame->nb_samples * (int64_t)avctx->ch_layout.nb_channels > avctx->max_samples) { av_log(avctx, AV_LOG_ERROR, "samples per frame %d, exceeds max_samples %"PRId64"\n", frame->nb_samples, avctx->max_samples); ret = AVERROR(EINVAL); diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c index dddab1fc4c..f9332b78a6 100644 --- a/libavcodec/dolby_e.c +++ b/libavcodec/dolby_e.c @@ -1272,13 +1272,6 @@ static av_cold int dolby_e_init(AVCodecContext *avctx) if (!(s->fdsp = avpriv_float_dsp_alloc(0))) return AVERROR(ENOMEM); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout & AV_CH_LAYOUT_NATIVE) - s->dectx.metadata.output_channel_order = CHANNEL_ORDER_CODED; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - s->dectx.metadata.multi_prog_warned = s->dectx.metadata.output_channel_order == CHANNEL_ORDER_CODED; s->dectx.avctx = s->avctx = avctx; return 0; diff --git a/libavcodec/eac3enc.c b/libavcodec/eac3enc.c index 4b3236d4e5..527f77e33a 100644 --- a/libavcodec/eac3enc.c +++ b/libavcodec/eac3enc.c @@ -263,7 +263,6 @@ const FFCodec ff_eac3_encoder = { AV_SAMPLE_FMT_NONE }, .p.priv_class = &eac3enc_class, .p.supported_samplerates = ff_ac3_sample_rate_tab, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts) .p.ch_layouts = ff_ac3_ch_layouts, .defaults = ff_ac3_enc_defaults, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c index 47811cee4d..2f19a1b29a 100644 --- a/libavcodec/g722enc.c +++ b/libavcodec/g722enc.c @@ -382,7 +382,6 @@ const FFCodec ff_adpcm_g722_encoder = { .close = g722_encode_close, FF_CODEC_ENCODE_CB(g722_encode_frame), .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, diff --git a/libavcodec/get_buffer.c b/libavcodec/get_buffer.c index 647f8a3df7..46c20781af 100644 --- a/libavcodec/get_buffer.c +++ b/libavcodec/get_buffer.c @@ -70,12 +70,6 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { int planar = av_sample_fmt_is_planar(frame->format); ch = frame->ch_layout.nb_channels; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (!ch) - ch = frame->channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif planes = planar ? ch : 1; } diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index 83f68e85c7..b8fa396fac 100644 --- a/libavcodec/libcodec2.c +++ b/libavcodec/libcodec2.c @@ -189,7 +189,6 @@ const FFCodec ff_libcodec2_decoder = { .init = libcodec2_init_decoder, .close = libcodec2_close, FF_CODEC_DECODE_CB(libcodec2_decode), - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; const FFCodec ff_libcodec2_encoder = { @@ -208,5 +207,4 @@ const FFCodec ff_libcodec2_encoder = { .init = libcodec2_init_encoder, .close = libcodec2_close, FF_CODEC_ENCODE_CB(libcodec2_encode), - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) }; diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c index e9488cd3ef..fa9d771c4e 100644 --- a/libavcodec/libfdk-aacdec.c +++ b/libavcodec/libfdk-aacdec.c @@ -264,14 +264,6 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx) return AVERROR_UNKNOWN; } -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout) { - av_channel_layout_uninit(&s->downmix_layout); - av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif if (s->downmix_layout.nb_channels > 0 && s->downmix_layout.order != AV_CHANNEL_ORDER_NATIVE) { int downmix_channels = -1; diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index 1bacd6cd76..fe3ba14ee8 100644 --- a/libavcodec/libfdk-aacenc.c +++ b/libavcodec/libfdk-aacenc.c @@ -557,28 +557,6 @@ static const FFCodecDefault aac_encode_defaults[] = { { NULL } }; -#if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t aac_channel_layout[] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, -#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 - AV_CH_LAYOUT_6POINT1_BACK, -#endif -#if FDKENC_VER_AT_LEAST(3, 4) // 3.4.12 - AV_CH_LAYOUT_7POINT1_WIDE_BACK, - AV_CH_LAYOUT_7POINT1, -#endif -#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 - AV_CH_LAYOUT_7POINT1_TOP_BACK, -#endif - 0, -}; -#endif /* FF_API_OLD_CHANNEL_LAYOUT */ - static const AVChannelLayout aac_ch_layouts[16] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, @@ -625,6 +603,5 @@ const FFCodec ff_libfdk_aac_encoder = { .p.profiles = profiles, .p.supported_samplerates = aac_sample_rates, .p.wrapper_name = "libfdk", - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) .p.ch_layouts = aac_ch_layouts, }; diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c index 640954491a..505b6afb07 100644 --- a/libavcodec/libgsmenc.c +++ b/libavcodec/libgsmenc.c @@ -127,7 +127,6 @@ const FFCodec ff_libgsm_encoder = { FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, @@ -146,7 +145,6 @@ const FFCodec ff_libgsm_ms_encoder = { FF_CODEC_ENCODE_CB(libgsm_encode_frame), .close = libgsm_encode_close, .defaults = libgsm_defaults, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 312bc4230f..d3810eb2ab 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -352,7 +352,6 @@ const FFCodec ff_libmp3lame_encoder = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libmp3lame_sample_rates, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 2f6a9233e0..333d86f774 100644 --- a/libavcodec/libshine.c +++ b/libavcodec/libshine.c @@ -140,7 +140,6 @@ const FFCodec ff_libshine_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = libshine_sample_rates, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 9fdb247863..4c12cef255 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -354,7 +354,6 @@ const FFCodec ff_libspeex_encoder = { .close = encode_close, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 }, diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c index aa092ea96d..f3bd4771d7 100644 --- a/libavcodec/libtwolame.c +++ b/libavcodec/libtwolame.c @@ -228,7 +228,6 @@ const FFCodec ff_libtwolame_encoder = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/mlp.c b/libavcodec/mlp.c index 3f54b2e448..33045c08c7 100644 --- a/libavcodec/mlp.c +++ b/libavcodec/mlp.c @@ -57,15 +57,6 @@ const ChannelInformation ff_mlp_ch_info[21] = { { 0x3F, 0x04, 0x02, 0x00 }, }; -#if FF_API_OLD_CHANNEL_LAYOUT -const uint64_t ff_mlp_channel_layouts[12] = { - AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2_1, - AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_5POINT0_BACK, AV_CH_LAYOUT_3POINT1, - AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_5POINT1_BACK, 0, -}; -#endif - const AVChannelLayout ff_mlp_ch_layouts[12] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_2_1, AV_CHANNEL_LAYOUT_QUAD, AV_CHANNEL_LAYOUT_2POINT1, AV_CHANNEL_LAYOUT_SURROUND, diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h index cf12ac08fd..bec414c680 100644 --- a/libavcodec/mlp.h +++ b/libavcodec/mlp.h @@ -146,9 +146,6 @@ typedef struct { */ extern const ChannelInformation ff_mlp_ch_info[21]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_mlp_channel_layouts[12]; -#endif extern const AVChannelLayout ff_mlp_ch_layouts[12]; /** MLP uses checksums that seem to be based on the standard CRC algorithm, but diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index ead5ecee76..305c5d2b36 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -306,15 +306,6 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx) m->substream[substr].lossless_check_data = 0xffffffff; ff_mlpdsp_init(&m->dsp); -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (avctx->request_channel_layout) { - av_channel_layout_uninit(&m->downmix_layout); - av_channel_layout_from_mask(&m->downmix_layout, avctx->request_channel_layout); - } -FF_ENABLE_DEPRECATION_WARNINGS -#endif - if (m->downmix_layout.nb_channels) { if (!av_channel_layout_compare(&m->downmix_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO) || !av_channel_layout_compare(&m->downmix_layout, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO_DOWNMIX)) { diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index c2e7238f32..67e0e109aa 100644 --- a/libavcodec/mlpenc.c +++ b/libavcodec/mlpenc.c @@ -2309,7 +2309,6 @@ const FFCodec ff_mlp_encoder = { .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts) .p.ch_layouts = ff_mlp_ch_layouts, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; @@ -2330,7 +2329,6 @@ const FFCodec ff_truehd_encoder = { .p.priv_class = &mlp_class, .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE}, .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2POINT1, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_3POINT1, AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_4POINT1, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c index a523b5d533..cdfc0b9958 100644 --- a/libavcodec/mpegaudioenc_fixed.c +++ b/libavcodec/mpegaudioenc_fixed.c @@ -37,7 +37,6 @@ const FFCodec ff_mp2fixed_encoder = { .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index 6a13d09573..f94ab54e89 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -38,7 +38,6 @@ const FFCodec ff_mp2_encoder = { .p.supported_samplerates = (const int[]){ 44100, 48000, 32000, 22050, 24000, 16000, 0 }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index aa9f766984..7155a335c1 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -94,9 +94,6 @@ static const AVOption avcodec_options[] = { {"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT_MAX}, {"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E}, {"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E}, -#if FF_API_OLD_CHANNEL_LAYOUT -{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E}, -#endif {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E}, {"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|E}, {"frame_number", NULL, OFFSET(frame_num), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, @@ -269,10 +266,6 @@ static const AVOption avcodec_options[] = { {"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.i64 = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX}, {"ch_layout", NULL, OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL }, 0, 0, A|E|D, .unit = "ch_layout"}, -#if FF_API_OLD_CHANNEL_LAYOUT -{"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = DEFAULT }, 0, UINT64_MAX, A|E|D, .unit = "channel_layout"}, -{"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = DEFAULT }, 0, UINT64_MAX, A|D, .unit = "request_channel_layout"}, -#endif {"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, 0.0, FLT_MAX, V|E}, {"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), AV_OPT_TYPE_FLOAT, {.dbl = 3 }, 0.0, FLT_MAX, V|E}, #if FF_API_TICKS_PER_FRAME diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 4de0a5f5f0..379d0e0c5d 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -745,7 +745,6 @@ const FFCodec ff_opus_encoder = { .close = opus_encode_end, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .p.supported_samplerates = (const int []){ 48000, 0 }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, diff --git a/libavcodec/packet.h b/libavcodec/packet.h index 8558ae849e..b0ba3baea2 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -596,13 +596,6 @@ typedef struct AVPacketList { #define AV_PKT_FLAG_DISPOSABLE 0x0010 enum AVSideDataParamChangeFlags { -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * @deprecated those are not used by any decoder - */ - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, -#endif AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, }; diff --git a/libavcodec/pcm-blurayenc.c b/libavcodec/pcm-blurayenc.c index bfbfa91d7a..7147c804ad 100644 --- a/libavcodec/pcm-blurayenc.c +++ b/libavcodec/pcm-blurayenc.c @@ -279,17 +279,6 @@ const FFCodec ff_pcm_bluray_encoder = { .init = pcm_bluray_encode_init, FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, - CODEC_OLD_CHANNEL_LAYOUTS( - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_2_1, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_2_2, - AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1, - AV_CH_LAYOUT_7POINT0, - AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c index a2e5cbdc2e..1e7ee644f6 100644 --- a/libavcodec/pcm-dvdenc.c +++ b/libavcodec/pcm-dvdenc.c @@ -182,8 +182,6 @@ const FFCodec ff_pcm_dvd_encoder = { .init = pcm_dvd_encode_init, FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT1) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, AV_CHANNEL_LAYOUT_5POINT1, diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 8253bab774..cffcced99a 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -311,12 +311,6 @@ FF_ENABLE_DEPRECATION_WARNINGS dst->sample_rate = src->sample_rate; dst->sample_fmt = src->sample_fmt; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - dst->channels = src->channels; - dst->channel_layout = src->channel_layout; -FF_ENABLE_DEPRECATION_WARNINGS -#endif err = av_channel_layout_copy(&dst->ch_layout, &src->ch_layout); if (err < 0) return err; diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c index ea537f3f80..92c35ac12c 100644 --- a/libavcodec/ra144enc.c +++ b/libavcodec/ra144enc.c @@ -549,6 +549,5 @@ const FFCodec ff_ra_144_encoder = { .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .p.supported_samplerates = (const int[]){ 8000, 0 }, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO) .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, }; diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c index fd7c2e5e80..033a8380d6 100644 --- a/libavcodec/sbcdec.c +++ b/libavcodec/sbcdec.c @@ -371,7 +371,6 @@ const FFCodec ff_sbc_decoder = { .init = sbc_decode_init, FF_CODEC_DECODE_CB(sbc_decode_frame), .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c index 6e1dd88c72..f2c4fbe329 100644 --- a/libavcodec/sbcenc.c +++ b/libavcodec/sbcenc.c @@ -354,7 +354,6 @@ const FFCodec ff_sbc_encoder = { .priv_data_size = sizeof(SBCEncContext), .init = sbc_encode_init, FF_CODEC_ENCODE_CB(sbc_encode_frame), - CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO) .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, { 0 } }, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1ad91c3237..e91a5d6d2e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -784,12 +784,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) { int channels = avctx->ch_layout.nb_channels; int duration; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (!channels) - channels = avctx->channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif + duration = get_audio_frame_duration(avctx->codec_id, avctx->sample_rate, channels, avctx->block_align, avctx->codec_tag, avctx->bits_per_coded_sample, @@ -802,12 +797,7 @@ int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes) { int channels = par->ch_layout.nb_channels; int duration; -#if FF_API_OLD_CHANNEL_LAYOUT -FF_DISABLE_DEPRECATION_WARNINGS - if (!channels) - channels = par->channels; -FF_ENABLE_DEPRECATION_WARNINGS -#endif + duration = get_audio_frame_duration(par->codec_id, par->sample_rate, channels, par->block_align, par->codec_tag, par->bits_per_coded_sample, diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c index 1ebe146d8f..d7edc695c1 100644 --- a/libavcodec/vorbis_data.c +++ b/libavcodec/vorbis_data.c @@ -34,20 +34,6 @@ const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { { 0, 2, 1, 7, 5, 6, 3, 4 }, }; -#if FF_API_OLD_CHANNEL_LAYOUT -const uint64_t ff_vorbis_channel_layouts[9] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER, - AV_CH_LAYOUT_7POINT1, - 0 -}; -#endif - const AVChannelLayout ff_vorbis_ch_layouts[9] = { AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, diff --git a/libavcodec/vorbis_data.h b/libavcodec/vorbis_data.h index 0fe19e509f..51c91c9e04 100644 --- a/libavcodec/vorbis_data.h +++ b/libavcodec/vorbis_data.h @@ -26,9 +26,6 @@ extern const float ff_vorbis_floor1_inverse_db_table[256]; extern const float * const ff_vorbis_vwin[8]; extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_vorbis_channel_layouts[9]; -#endif extern const AVChannelLayout ff_vorbis_ch_layouts[9]; #endif /* AVCODEC_VORBIS_DATA_H */ diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index faeaeadde7..6f807b9d66 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1890,7 +1890,6 @@ 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_OLD_CHANNEL_LAYOUTS_ARRAY(ff_vorbis_channel_layouts) .p.ch_layouts = ff_vorbis_ch_layouts, .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, |