[libav-devel] [PATCH 01/10] avcodec: change AVFrame.data[4]/base[4] to [8] at next major bump.

Justin Ruggles justin.ruggles at gmail.com
Tue Nov 22 01:52:30 CET 2011


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

diff --git a/doc/APIchanges b/doc/APIchanges
index 026e5ad..80d51aa 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 - lavc 53.21.0
   Move some AVCodecContext fields to a new private struct, AVCodecInternal,
   which is accessed from a new field, AVCodecContext.internal.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 67bbdf8..1936b37 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -896,13 +896,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.
@@ -910,7 +915,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.
@@ -3144,7 +3149,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 35e8958..b1f814a 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 21
+#define LIBAVCODEC_VERSION_MINOR 22
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -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



More information about the libav-devel mailing list