[FFmpeg-cvslog] avcodec/audiotoolboxenc: add missing AVCodec.ch_layouts
James Almer
git at videolan.org
Tue Mar 15 15:57:39 EET 2022
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar 15 10:57:08 2022 -0300| [f0be7c1057c8db35f71e02a59025316686ae7255] | committer: James Almer
avcodec/audiotoolboxenc: add missing AVCodec.ch_layouts
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0be7c1057c8db35f71e02a59025316686ae7255
---
libavcodec/audiotoolboxenc.c | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 2092b7a26a..78ff45f972 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -610,7 +610,7 @@ static const AVOption options[] = {
.version = LIBAVUTIL_VERSION_INT, \
};
-#define FFAT_ENC(NAME, ID, PROFILES, ...) \
+#define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS) \
FFAT_ENC_CLASS(NAME) \
const AVCodec ff_##NAME##_at_encoder = { \
.name = #NAME "_at", \
@@ -624,7 +624,9 @@ static const AVOption options[] = {
.flush = ffat_encode_flush, \
.priv_class = &ffat_##NAME##_enc_class, \
.capabilities = AV_CODEC_CAP_DELAY | \
- AV_CODEC_CAP_ENCODER_FLUSH __VA_ARGS__, \
+ AV_CODEC_CAP_ENCODER_FLUSH CAPS, \
+ .channel_layouts= CHANNEL_LAYOUTS, \
+ .ch_layouts = CH_LAYOUTS, \
.sample_fmts = (const enum AVSampleFormat[]) { \
AV_SAMPLE_FMT_S16, \
AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \
@@ -634,6 +636,23 @@ static const AVOption options[] = {
.wrapper_name = "at", \
};
+static const AVChannelLayout aac_at_ch_layouts[] = {
+ AV_CHANNEL_LAYOUT_MONO,
+ AV_CHANNEL_LAYOUT_STEREO,
+ AV_CHANNEL_LAYOUT_SURROUND,
+ AV_CHANNEL_LAYOUT_4POINT0,
+ AV_CHANNEL_LAYOUT_5POINT0,
+ AV_CHANNEL_LAYOUT_5POINT1,
+ AV_CHANNEL_LAYOUT_6POINT0,
+ AV_CHANNEL_LAYOUT_6POINT1,
+ AV_CHANNEL_LAYOUT_7POINT0,
+ AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK,
+ AV_CHANNEL_LAYOUT_QUAD,
+ AV_CHANNEL_LAYOUT_OCTAGONAL,
+ { 0 },
+};
+
+#if FF_API_OLD_CHANNEL_LAYOUT
static const uint64_t aac_at_channel_layouts[] = {
AV_CH_LAYOUT_MONO,
AV_CH_LAYOUT_STEREO,
@@ -649,10 +668,11 @@ static const uint64_t aac_at_channel_layouts[] = {
AV_CH_LAYOUT_OCTAGONAL,
0,
};
+#endif
-FFAT_ENC(aac, AV_CODEC_ID_AAC, aac_profiles, , .channel_layouts = aac_at_channel_layouts)
+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, | AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
-FFAT_ENC(ilbc, AV_CODEC_ID_ILBC, NULL)
-FFAT_ENC(pcm_alaw, AV_CODEC_ID_PCM_ALAW, NULL)
-FFAT_ENC(pcm_mulaw, AV_CODEC_ID_PCM_MULAW, NULL)
+FFAT_ENC(alac, AV_CODEC_ID_ALAC, NULL, | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, NULL, NULL)
+FFAT_ENC(ilbc, AV_CODEC_ID_ILBC, NULL, , NULL, NULL)
+FFAT_ENC(pcm_alaw, AV_CODEC_ID_PCM_ALAW, NULL, , NULL, NULL)
+FFAT_ENC(pcm_mulaw, AV_CODEC_ID_PCM_MULAW, NULL, , NULL, NULL)
More information about the ffmpeg-cvslog
mailing list