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 |    6 ++++--
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 8efee0c..75ba38e 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.24.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 43abcd8..1ea96a6 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 0bd1781..7262c81 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -21,7 +21,7 @@
 #define AVCODEC_VERSION_H
 
 #define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR 23
+#define LIBAVCODEC_VERSION_MINOR 24
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -110,6 +110,8 @@
 #ifndef FF_API_TIFFENC_COMPLEVEL
 #define FF_API_TIFFENC_COMPLEVEL (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