aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-20 12:26:08 -0300
committerJames Almer <jamrial@gmail.com>2024-03-07 08:53:30 -0300
commit65ddc74988245a01421a63c5cffa4d900c47117c (patch)
tree72bd32783aca75dff15c038cd0a69d724514b31c /libavformat
parenta12cd3be98e8aba6e74274192ec6532988aa9444 (diff)
downloadffmpeg-65ddc74988245a01421a63c5cffa4d900c47117c.tar.gz
avutil: remove deprecated FF_API_OLD_CHANNEL_LAYOUT
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/demux.c19
-rw-r--r--libavformat/demux_utils.c20
-rw-r--r--libavformat/dfpwmdec.c17
-rw-r--r--libavformat/dump.c25
-rw-r--r--libavformat/mux.c16
-rw-r--r--libavformat/nutdec.c4
-rw-r--r--libavformat/nutenc.c15
-rw-r--r--libavformat/pcmdec.c20
8 files changed, 1 insertions, 135 deletions
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 2e1d0ed66d..a0028bfeec 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -199,18 +199,6 @@ static int update_stream_avctx(AVFormatContext *s)
sti->parser = NULL;
}
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (st->codecpar->ch_layout.nb_channels &&
- !st->codecpar->channels) {
- st->codecpar->channels = st->codecpar->ch_layout.nb_channels;
- st->codecpar->channel_layout = st->codecpar->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ?
- st->codecpar->ch_layout.u.mask : 0;
-
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
/* update internal codec context, for the parser */
ret = avcodec_parameters_to_context(sti->avctx, st->codecpar);
if (ret < 0)
@@ -1452,13 +1440,6 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
return ret;
st->codecpar->sample_rate = sti->avctx->sample_rate;
st->codecpar->bit_rate = sti->avctx->bit_rate;
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- st->codecpar->channels = sti->avctx->ch_layout.nb_channels;
- st->codecpar->channel_layout = sti->avctx->ch_layout.order == AV_CHANNEL_ORDER_NATIVE ?
- sti->avctx->ch_layout.u.mask : 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
ret = av_channel_layout_copy(&st->codecpar->ch_layout, &sti->avctx->ch_layout);
if (ret < 0)
return ret;
diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c
index 56cc6e15d8..b16bc47a96 100644
--- a/libavformat/demux_utils.c
+++ b/libavformat/demux_utils.c
@@ -158,18 +158,6 @@ int ff_add_param_change(AVPacket *pkt, int32_t channels,
if (!pkt)
return AVERROR(EINVAL);
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (channels) {
- size += 4;
- flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT;
- }
- if (channel_layout) {
- size += 8;
- flags |= AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT;
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (sample_rate) {
size += 4;
flags |= AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE;
@@ -182,14 +170,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!data)
return AVERROR(ENOMEM);
bytestream_put_le32(&data, flags);
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- if (channels)
- bytestream_put_le32(&data, channels);
- if (channel_layout)
- bytestream_put_le64(&data, channel_layout);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
if (sample_rate)
bytestream_put_le32(&data, sample_rate);
if (width || height) {
diff --git a/libavformat/dfpwmdec.c b/libavformat/dfpwmdec.c
index b92b00f13a..4c998bea48 100644
--- a/libavformat/dfpwmdec.c
+++ b/libavformat/dfpwmdec.c
@@ -31,9 +31,6 @@
typedef struct DFPWMAudioDemuxerContext {
AVClass *class;
int sample_rate;
-#if FF_API_OLD_CHANNEL_LAYOUT
- int channels;
-#endif
AVChannelLayout ch_layout;
} DFPWMAudioDemuxerContext;
@@ -52,16 +49,9 @@ static int dfpwm_read_header(AVFormatContext *s)
par->codec_type = AVMEDIA_TYPE_AUDIO;
par->codec_id = AV_CODEC_ID_DFPWM;
par->sample_rate = s1->sample_rate;
-#if FF_API_OLD_CHANNEL_LAYOUT
- if (s1->ch_layout.nb_channels) {
-#endif
ret = av_channel_layout_copy(&par->ch_layout, &s1->ch_layout);
if (ret < 0)
return ret;
-#if FF_API_OLD_CHANNEL_LAYOUT
- } else
- par->ch_layout.nb_channels = s1->channels;
-#endif
par->bits_per_coded_sample = 1;
par->block_align = 1;
@@ -71,13 +61,8 @@ static int dfpwm_read_header(AVFormatContext *s)
static const AVOption dfpwm_options[] = {
{ "sample_rate", "", offsetof(DFPWMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 48000}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-#if FF_API_OLD_CHANNEL_LAYOUT
- { "channels", "", offsetof(DFPWMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_DEPRECATED },
- { "ch_layout", "", offsetof(DFPWMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#else
{ "ch_layout", "", offsetof(DFPWMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "mono"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#endif
- { NULL },
+{ NULL },
};
static const AVClass dfpwm_demuxer_class = {
.class_name = "dfpwm demuxer",
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 49be8deeca..ca47d733f7 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -177,10 +177,6 @@ static void dump_paramchange(void *ctx, const AVPacketSideData *sd, int log_leve
int size = sd->size;
const uint8_t *data = sd->data;
uint32_t flags, sample_rate, width, height;
-#if FF_API_OLD_CHANNEL_LAYOUT
- uint32_t channels;
- uint64_t layout;
-#endif
if (!data || sd->size < 4)
goto fail;
@@ -189,27 +185,6 @@ static void dump_paramchange(void *ctx, const AVPacketSideData *sd, int log_leve
data += 4;
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;
- channels = AV_RL32(data);
- data += 4;
- size -= 4;
- av_log(ctx, log_level, "channel count %"PRIu32", ", channels);
- }
- if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
- if (size < 8)
- goto fail;
- layout = AV_RL64(data);
- data += 8;
- size -= 8;
- av_log(ctx, log_level,
- "channel layout: %s, ", av_get_channel_name(layout));
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_OLD_CHANNEL_LAYOUT */
if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
if (size < 4)
goto fail;
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 93280f9047..71da698642 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -233,22 +233,6 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
goto fail;
}
-#if FF_API_OLD_CHANNEL_LAYOUT
-FF_DISABLE_DEPRECATION_WARNINGS
- /* if the caller is using the deprecated channel layout API,
- * convert it to the new style */
- if (!par->ch_layout.nb_channels &&
- par->channels) {
- if (par->channel_layout) {
- av_channel_layout_from_mask(&par->ch_layout, par->channel_layout);
- } else {
- par->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
- par->ch_layout.nb_channels = par->channels;
- }
- }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
if (!par->block_align)
par->block_align = par->ch_layout.nb_channels *
av_get_bits_per_sample(par->codec_id) >> 3;
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index afa27b827c..e2b39ccffb 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -969,10 +969,6 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
if (!dst)
return AVERROR(ENOMEM);
bytestream_put_le32(&dst,
-#if FF_API_OLD_CHANNEL_LAYOUT
- AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT*(!!channels) +
- AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT*(!!channel_layout) +
-#endif
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE*(!!sample_rate) +
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS*(!!(width|height))
);
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 9048bac883..2a33f1581b 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -916,21 +916,6 @@ static int write_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
break;
case AV_PKT_DATA_PARAM_CHANGE:
flags = bytestream_get_le32(&data);
-#if FF_API_OLD_CHANNEL_LAYOUT
- if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) {
- put_str(dyn_bc, "Channels");
- put_s(dyn_bc, bytestream_get_le32(&data));
- sm_data_count++;
- }
- if (flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) {
- put_str(dyn_bc, "ChannelLayout");
- put_s(dyn_bc, -2);
- put_str(dyn_bc, "u64");
- put_v(dyn_bc, 8);
- avio_write(dyn_bc, data, 8); data+=8;
- sm_data_count++;
- }
-#endif
if (flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) {
put_str(dyn_bc, "SampleRate");
put_s(dyn_bc, bytestream_get_le32(&data));
diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index 11ba0b5c0c..377e6d80a1 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -33,9 +33,6 @@
typedef struct PCMAudioDemuxerContext {
AVClass *class;
int sample_rate;
-#if FF_API_OLD_CHANNEL_LAYOUT
- int channels;
-#endif
AVChannelLayout ch_layout;
} PCMAudioDemuxerContext;
@@ -55,16 +52,9 @@ static int pcm_read_header(AVFormatContext *s)
par->codec_type = AVMEDIA_TYPE_AUDIO;
par->codec_id = s->iformat->raw_codec_id;
par->sample_rate = s1->sample_rate;
-#if FF_API_OLD_CHANNEL_LAYOUT
- if (s1->ch_layout.nb_channels) {
-#endif
ret = av_channel_layout_copy(&par->ch_layout, &s1->ch_layout);
if (ret < 0)
return ret;
-#if FF_API_OLD_CHANNEL_LAYOUT
- } else
- par->ch_layout.nb_channels = s1->channels;
-#endif
av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);
if (mime_type && s->iformat->mime_type) {
@@ -114,12 +104,7 @@ static int pcm_read_header(AVFormatContext *s)
static const AVOption pcm_options[] = {
{ "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 44100}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-#if FF_API_OLD_CHANNEL_LAYOUT
- { "channels", "", offsetof(PCMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_DEPRECATED },
- { "ch_layout", "", offsetof(PCMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#else
{ "ch_layout", "", offsetof(PCMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "mono"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#endif
{ NULL },
};
static const AVClass pcm_demuxer_class = {
@@ -180,12 +165,7 @@ PCMDEF(vidc, "PCM Archimedes VIDC", NULL, VIDC)
#if CONFIG_SLN_DEMUXER
static const AVOption sln_options[] = {
{ "sample_rate", "", offsetof(PCMAudioDemuxerContext, sample_rate), AV_OPT_TYPE_INT, {.i64 = 8000}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
-#if FF_API_OLD_CHANNEL_LAYOUT
- { "channels", "", offsetof(PCMAudioDemuxerContext, channels), AV_OPT_TYPE_INT, {.i64 = 1}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_DEPRECATED },
- { "ch_layout", "", offsetof(PCMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#else
{ "ch_layout", "", offsetof(PCMAudioDemuxerContext, ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = "mono"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-#endif
{ NULL },
};