Add AV_NUM_DATA_POINTERS to simplify the bump transition.
This will allow for supporting more planar audio channels without having to
allocate separate pointer arrays.
---
 doc/APIchanges       |    4 ++++
 libavcodec/avcodec.h |   11 ++++++++---
 libavcodec/version.h |    3 +++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 8efee0c..7efc013 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil:   2011-04-18
 
 API changes, most recent first:
 
+2011-xx-xx - xxxxxxx - lavc 53.22.0
+  Change AVFrame.data[4]/base[4] to [8] at next major bump.
+  Add AV_NUM_DATA_POINTERS to simplify the bump transition.
+
 2011-xx-xx - xxxxxxx - lavu 51.18.0
   Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
   av_samples_alloc(), to samplefmt.h.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index dc794b0..8b071fb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -927,13 +927,18 @@ typedef struct AVPacket {
  * sizeof(AVFrame) must not be used outside libav*.
  */
 typedef struct AVFrame {
+#if FF_API_DATA_POINTERS
+#define AV_NUM_DATA_POINTERS 4
+#else
+#define AV_NUM_DATA_POINTERS 8
+#endif
     /**
      * pointer to the picture planes.
      * This might be different from the first allocated byte
      * - encoding:
      * - decoding:
      */
-    uint8_t *data[4];
+    uint8_t *data[AV_NUM_DATA_POINTERS];
     int linesize[4];
     /**
      * pointer to the first allocated byte of the picture. Can be used in 
get_buffer/release_buffer.
@@ -941,7 +946,7 @@ typedef struct AVFrame {
      * - encoding:
      * - decoding:
      */
-    uint8_t *base[4];
+    uint8_t *base[AV_NUM_DATA_POINTERS];
     /**
      * 1 -> keyframe, 0-> not
      * - encoding: Set by libavcodec.
@@ -3175,7 +3180,7 @@ typedef struct AVHWAccel {
  * the last component is alpha
  */
 typedef struct AVPicture {
-    uint8_t *data[4];
+    uint8_t *data[AV_NUM_DATA_POINTERS];
     int linesize[4];       ///< number of bytes per line
 } AVPicture;
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3f5c42e..b1f814a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -107,5 +107,8 @@
 #ifndef FF_API_INTERNAL_CONTEXT
 #define FF_API_INTERNAL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_API_DATA_POINTERS
+#define FF_API_DATA_POINTERS (LIBAVCODEC_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to