summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-25 17:49:56 +0100
committerJames Almer <jamrial@gmail.com>2021-04-27 10:42:59 -0300
commit0f247986ad51d693d69728b8889d8f105ede9e05 (patch)
treed9ce57d8e5f7ff6cce4e97b0e8e18b6a3ee97a5b /libavformat/utils.c
parent1137ddf3302ef12525c9c95767e6daa0c1031ce7 (diff)
avcodec, avformat: Remove old BSF API
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d4ec3d0190..02768aca1f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5669,64 +5669,6 @@ int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *a
return 1;
}
-#if FF_API_OLD_BSF
-FF_DISABLE_DEPRECATION_WARNINGS
-int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
- AVBitStreamFilterContext *bsfc)
-{
- int ret = 0;
- while (bsfc) {
- AVPacket new_pkt = *pkt;
- int a = av_bitstream_filter_filter(bsfc, codec, NULL,
- &new_pkt.data, &new_pkt.size,
- pkt->data, pkt->size,
- pkt->flags & AV_PKT_FLAG_KEY);
- if (a == 0 && new_pkt.size == 0 && new_pkt.side_data_elems == 0) {
- av_packet_unref(pkt);
- memset(pkt, 0, sizeof(*pkt));
- return 0;
- }
- if(a == 0 && new_pkt.data != pkt->data) {
- uint8_t *t = av_malloc(new_pkt.size + AV_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow
- if (t) {
- memcpy(t, new_pkt.data, new_pkt.size);
- memset(t + new_pkt.size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
- new_pkt.data = t;
- new_pkt.buf = NULL;
- a = 1;
- } else {
- a = AVERROR(ENOMEM);
- }
- }
- if (a > 0) {
- new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
- av_buffer_default_free, NULL, 0);
- if (new_pkt.buf) {
- pkt->side_data = NULL;
- pkt->side_data_elems = 0;
- av_packet_unref(pkt);
- } else {
- av_freep(&new_pkt.data);
- a = AVERROR(ENOMEM);
- }
- }
- if (a < 0) {
- av_log(codec, AV_LOG_ERROR,
- "Failed to open bitstream filter %s for stream %d with codec %s",
- bsfc->filter->name, pkt->stream_index,
- codec->codec ? codec->codec->name : "copy");
- ret = a;
- break;
- }
- *pkt = new_pkt;
-
- bsfc = bsfc->next;
- }
- return ret;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options)
{
if (!s->oformat)