avutil/fifo: Deprecate old FIFO API

Users should switch to the superior AVFifo API.

Unfortunately AVFifoBuffer fields cannot be marked as deprecated because
it would trigger a warning wherever fifo.h is #included, due to
inlined av_fifo_peek2().
This commit is contained in:
Anton Khirnov
2021-12-30 13:49:12 +01:00
committed by Andreas Rheinhardt
parent e6469e68cc
commit a10f1aec1f
4 changed files with 58 additions and 2 deletions

View File

@@ -287,6 +287,8 @@ void av_fifo_freep2(AVFifo **f)
}
#if FF_API_FIFO_OLD_API
FF_DISABLE_DEPRECATION_WARNINGS
#define OLD_FIFO_SIZE_MAX (size_t)FFMIN3(INT_MAX, UINT32_MAX, SIZE_MAX)
AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size)
@@ -499,3 +501,5 @@ void av_fifo_drain(AVFifoBuffer *f, int size)
f->rptr -= f->end - f->buffer;
f->rndx += size;
}
FF_ENABLE_DEPRECATION_WARNINGS
#endif