diff mbox series

[FFmpeg-devel,02/12] fifo: hide the definition of AVFifoBuffer in next+1 major bump

Message ID 20200224123739.31154-3-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/12] fifo: uninline av_fifo_peek2() on the next major bump
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Anton Khirnov Feb. 24, 2020, 12:37 p.m. UTC
There is no reason whatsoever for it to be public.
---
 libavutil/fifo.c       | 9 +++++++++
 libavutil/fifo.h       | 8 ++++++--
 libavutil/tests/fifo.c | 2 +-
 libavutil/version.h    | 3 +++
 4 files changed, 19 insertions(+), 3 deletions(-)

Comments

Andreas Rheinhardt Feb. 24, 2020, 1:08 p.m. UTC | #1
Anton Khirnov:
> There is no reason whatsoever for it to be public.
> ---

The flac-parser (and maybe other code) uses it directly.

- Andreas
diff mbox series

Patch

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 0baaadc521..f58530a26e 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -25,6 +25,15 @@ 
 #include "fifo.h"
 #include "version.h"
 
+#if !FF_API_FIFO
+struct AVFifoBuffer
+{
+    uint8_t *buffer;
+    uint8_t *rptr, *wptr, *end;
+    uint32_t rndx, wndx;
+};
+#endif
+
 static AVFifoBuffer *fifo_alloc_common(void *buffer, size_t size)
 {
     AVFifoBuffer *f;
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 8cd964ef45..6c0e806c80 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -29,11 +29,15 @@ 
 #include "attributes.h"
 #include "version.h"
 
-typedef struct AVFifoBuffer {
+typedef struct AVFifoBuffer
+#if FF_API_FIFO
+{
     uint8_t *buffer;
     uint8_t *rptr, *wptr, *end;
     uint32_t rndx, wndx;
-} AVFifoBuffer;
+} AVFifoBuffer
+#endif
+;
 
 /**
  * Initialize an AVFifoBuffer.
diff --git a/libavutil/tests/fifo.c b/libavutil/tests/fifo.c
index 8a550e088b..5982d63bba 100644
--- a/libavutil/tests/fifo.c
+++ b/libavutil/tests/fifo.c
@@ -18,7 +18,7 @@ 
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "libavutil/fifo.h"
+#include "libavutil/fifo.c"
 
 int main(void)
 {
diff --git a/libavutil/version.h b/libavutil/version.h
index 90cc55b9ac..c271e85d29 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -129,6 +129,9 @@ 
 #ifndef FF_API_PSEUDOPAL
 #define FF_API_PSEUDOPAL                (LIBAVUTIL_VERSION_MAJOR < 57)
 #endif
+#ifndef FF_API_FIFO
+#define FF_API_FIFO                     (LIBAVUTIL_VERSION_MAJOR < 58)
+#endif
 
 
 /**