avcodec/codec_internal: Avoid deprecation warnings for channel_layouts

AVCodec.channel_layouts is deprecated and Clang (unlike GCC)
warns when setting this field in a codec definition.
Fortunately, Clang (unlike GCC) allows to use
FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec),
so that one can create simple macros to set AVCodec.channel_layouts
that also suppress deprecation warnings for Clang.

(Notice that some of the codec definitions were already
inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not
guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed.
Also notice that setting AVCodec.channel_layouts was not guarded
by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it
it without removing all the codeblocks would not have worked.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/388/head
Andreas Rheinhardt 2 years ago
parent 4393331250
commit fdff1b9cbf
  1. 8
      libavcodec/aacdec.c
  2. 4
      libavcodec/aacdec_fixed.c
  3. 6
      libavcodec/ac3enc_fixed.c
  4. 6
      libavcodec/ac3enc_float.c
  5. 6
      libavcodec/alacenc.c
  6. 8
      libavcodec/aptxdec.c
  7. 8
      libavcodec/aptxenc.c
  8. 2
      libavcodec/audiotoolboxenc.c
  9. 19
      libavcodec/codec_internal.h
  10. 11
      libavcodec/dcaenc.c
  11. 6
      libavcodec/eac3enc.c
  12. 4
      libavcodec/g722enc.c
  13. 8
      libavcodec/libcodec2.c
  14. 4
      libavcodec/libfdk-aacenc.c
  15. 8
      libavcodec/libgsmenc.c
  16. 6
      libavcodec/libmp3lame.c
  17. 6
      libavcodec/libshine.c
  18. 6
      libavcodec/libspeexenc.c
  19. 7
      libavcodec/libtwolame.c
  20. 8
      libavcodec/mlpenc.c
  21. 6
      libavcodec/mpegaudioenc_fixed.c
  22. 6
      libavcodec/mpegaudioenc_float.c
  23. 5
      libavcodec/opusenc.c
  24. 7
      libavcodec/pcm-blurayenc.c
  25. 9
      libavcodec/pcm-dvdenc.c
  26. 4
      libavcodec/ra144enc.c
  27. 5
      libavcodec/s302menc.c
  28. 5
      libavcodec/sbcdec.c
  29. 5
      libavcodec/sbcenc.c
  30. 4
      libavcodec/vorbisdec.c

@ -566,9 +566,7 @@ const FFCodec ff_aac_decoder = {
},
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = aac_channel_layout,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
.p.ch_layouts = aac_ch_layout,
.flush = flush,
.p.priv_class = &aac_decoder_class,
@ -594,9 +592,7 @@ const FFCodec ff_aac_latm_decoder = {
},
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = aac_channel_layout,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
.p.ch_layouts = aac_ch_layout,
.flush = flush,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),

@ -464,9 +464,7 @@ const FFCodec ff_aac_fixed_decoder = {
},
.p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = aac_channel_layout,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
.p.ch_layouts = aac_ch_layout,
.p.priv_class = &aac_decoder_class,
.p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),

@ -119,7 +119,6 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext *avctx)
}
FF_DISABLE_DEPRECATION_WARNINGS
const FFCodec ff_ac3_fixed_encoder = {
.p.name = "ac3_fixed",
CODEC_LONG_NAME("ATSC A/52A (AC-3)"),
@ -135,10 +134,7 @@ 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,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = ff_ac3_channel_layouts,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts)
.p.ch_layouts = ff_ac3_ch_layouts,
.defaults = ff_ac3_enc_defaults,
};
FF_ENABLE_DEPRECATION_WARNINGS

@ -123,7 +123,6 @@ av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
return ff_ac3_encode_init(avctx);
}
FF_DISABLE_DEPRECATION_WARNINGS
const FFCodec ff_ac3_encoder = {
.p.name = "ac3",
CODEC_LONG_NAME("ATSC A/52A (AC-3)"),
@ -138,11 +137,8 @@ const FFCodec ff_ac3_encoder = {
AV_SAMPLE_FMT_NONE },
.p.priv_class = &ff_ac3enc_class,
.p.supported_samplerates = ff_ac3_sample_rate_tab,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = ff_ac3_channel_layouts,
#endif
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,
};
FF_ENABLE_DEPRECATION_WARNINGS

@ -648,7 +648,6 @@ static const AVClass alacenc_class = {
.version = LIBAVUTIL_VERSION_INT,
};
FF_DISABLE_DEPRECATION_WARNINGS
const FFCodec ff_alac_encoder = {
.p.name = "alac",
CODEC_LONG_NAME("ALAC (Apple Lossless Audio Codec)"),
@ -660,12 +659,9 @@ const FFCodec ff_alac_encoder = {
.init = alac_encode_init,
FF_CODEC_ENCODE_CB(alac_encode_frame),
.close = alac_encode_close,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = alac_channel_layouts,
#endif
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,
AV_SAMPLE_FMT_NONE },
};
FF_ENABLE_DEPRECATION_WARNINGS

@ -183,9 +183,7 @@ const FFCodec ff_aptx_decoder = {
.init = ff_aptx_init,
FF_CODEC_DECODE_CB(aptx_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
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 },
@ -202,9 +200,7 @@ const FFCodec ff_aptx_hd_decoder = {
.init = ff_aptx_init,
FF_CODEC_DECODE_CB(aptx_decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
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 },

@ -276,9 +276,7 @@ const FFCodec ff_aptx_encoder = {
.init = aptx_encode_init,
FF_CODEC_ENCODE_CB(aptx_encode_frame),
.close = aptx_close,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
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 },
@ -297,9 +295,7 @@ const FFCodec ff_aptx_hd_encoder = {
.init = aptx_encode_init,
FF_CODEC_ENCODE_CB(aptx_encode_frame),
.close = aptx_close,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_STEREO, 0},
#endif
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 },

@ -627,7 +627,7 @@ static const AVOption options[] = {
.p.priv_class = &ffat_##NAME##_enc_class, \
.p.capabilities = AV_CODEC_CAP_DELAY | \
AV_CODEC_CAP_ENCODER_FLUSH CAPS, \
.p.channel_layouts = CHANNEL_LAYOUTS, \
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \
.p.ch_layouts = CH_LAYOUTS, \
.p.sample_fmts = (const enum AVSampleFormat[]) { \
AV_SAMPLE_FMT_S16, \

@ -276,6 +276,25 @@ 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)

@ -1324,14 +1324,9 @@ const FFCodec ff_dca_encoder = {
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32,
AV_SAMPLE_FMT_NONE },
.p.supported_samplerates = sample_rates,
#if FF_API_OLD_CHANNEL_LAYOUT
.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
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,

@ -249,7 +249,6 @@ void ff_eac3_output_frame_header(AC3EncodeContext *s)
}
FF_DISABLE_DEPRECATION_WARNINGS
const FFCodec ff_eac3_encoder = {
.p.name = "eac3",
CODEC_LONG_NAME("ATSC A/52 E-AC-3"),
@ -264,11 +263,8 @@ const FFCodec ff_eac3_encoder = {
AV_SAMPLE_FMT_NONE },
.p.priv_class = &eac3enc_class,
.p.supported_samplerates = ff_ac3_sample_rate_tab,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = ff_ac3_channel_layouts,
#endif
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,
};
FF_ENABLE_DEPRECATION_WARNINGS

@ -381,9 +381,7 @@ 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 },
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 },
#endif
CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO)
.p.ch_layouts = (const AVChannelLayout[]){
AV_CHANNEL_LAYOUT_MONO, { 0 }
},

@ -189,9 +189,7 @@ const FFCodec ff_libcodec2_decoder = {
.init = libcodec2_init_decoder,
.close = libcodec2_close,
FF_CODEC_DECODE_CB(libcodec2_decode),
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
#endif
CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO)
};
const FFCodec ff_libcodec2_encoder = {
@ -209,7 +207,5 @@ const FFCodec ff_libcodec2_encoder = {
.init = libcodec2_init_encoder,
.close = libcodec2_close,
FF_CODEC_ENCODE_CB(libcodec2_encode),
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
#endif
CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO)
};

@ -494,8 +494,6 @@ const FFCodec ff_libfdk_aac_encoder = {
.p.profiles = profiles,
.p.supported_samplerates = aac_sample_rates,
.p.wrapper_name = "libfdk",
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = aac_channel_layout,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
.p.ch_layouts = aac_ch_layouts,
};

@ -127,9 +127,7 @@ const FFCodec ff_libgsm_encoder = {
FF_CODEC_ENCODE_CB(libgsm_encode_frame),
.close = libgsm_encode_close,
.defaults = libgsm_defaults,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
#endif
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 },
@ -148,9 +146,7 @@ const FFCodec ff_libgsm_ms_encoder = {
FF_CODEC_ENCODE_CB(libgsm_encode_frame),
.close = libgsm_encode_close,
.defaults = libgsm_defaults,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
#endif
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 },

@ -345,11 +345,7 @@ const FFCodec ff_libmp3lame_encoder = {
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.p.supported_samplerates = libmp3lame_sample_rates,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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 },

@ -140,11 +140,7 @@ 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,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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 },

@ -354,11 +354,7 @@ const FFCodec ff_libspeex_encoder = {
.close = encode_close,
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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 },

@ -228,12 +228,7 @@ const FFCodec ff_libtwolame_encoder = {
AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE
},
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) {
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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,

@ -2252,9 +2252,7 @@ const FFCodec ff_mlp_encoder = {
.close = mlp_encode_close,
.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
.p.channel_layouts = ff_mlp_channel_layouts,
#endif
CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_mlp_channel_layouts)
.p.ch_layouts = ff_mlp_ch_layouts,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
@ -2274,9 +2272,7 @@ const FFCodec ff_truehd_encoder = {
.close = mlp_encode_close,
.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
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1, 0 },
#endif
CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_5POINT0, AV_CH_LAYOUT_5POINT1)
.p.ch_layouts = (const AVChannelLayout[]) {
AV_CHANNEL_LAYOUT_MONO,
AV_CHANNEL_LAYOUT_STEREO,

@ -37,11 +37,7 @@ const FFCodec ff_mp2fixed_encoder = {
.p.supported_samplerates = (const int[]){
44100, 48000, 32000, 22050, 24000, 16000, 0
},
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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 } },

@ -38,11 +38,7 @@ const FFCodec ff_mp2_encoder = {
.p.supported_samplerates = (const int[]){
44100, 48000, 32000, 22050, 24000, 16000, 0
},
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
0 },
#endif
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 } },

@ -743,10 +743,7 @@ const FFCodec ff_opus_encoder = {
.close = opus_encode_end,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.p.supported_samplerates = (const int []){ 48000, 0 },
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t []){ AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO, 0 },
#endif
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,

@ -279,8 +279,7 @@ 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 },
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) {
CODEC_OLD_CHANNEL_LAYOUTS(
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_SURROUND,
@ -290,9 +289,7 @@ const FFCodec ff_pcm_bluray_encoder = {
AV_CH_LAYOUT_5POINT0,
AV_CH_LAYOUT_5POINT1,
AV_CH_LAYOUT_7POINT0,
AV_CH_LAYOUT_7POINT1,
0 },
#endif
AV_CH_LAYOUT_7POINT1)
.p.ch_layouts = (const AVChannelLayout[]) {
AV_CHANNEL_LAYOUT_MONO,
AV_CHANNEL_LAYOUT_STEREO,

@ -181,13 +181,8 @@ 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},
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
AV_CH_LAYOUT_5POINT1,
AV_CH_LAYOUT_7POINT1,
0 },
#endif
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,

@ -549,8 +549,6 @@ 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 },
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
#endif
CODEC_OLD_CHANNEL_LAYOUTS(AV_CH_LAYOUT_MONO)
.p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
};

@ -184,9 +184,4 @@ const FFCodec ff_s302m_encoder = {
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.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,
0 }, */
};

@ -374,10 +374,7 @@ 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,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO, 0},
#endif
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 } },

@ -352,10 +352,7 @@ const FFCodec ff_sbc_encoder = {
.priv_data_size = sizeof(SBCEncContext),
.init = sbc_encode_init,
FF_CODEC_ENCODE_CB(sbc_encode_frame),
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO, 0},
#endif
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 } },

@ -1876,9 +1876,7 @@ 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,
#if FF_API_OLD_CHANNEL_LAYOUT
.p.channel_layouts = ff_vorbis_channel_layouts,
#endif
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 },

Loading…
Cancel
Save