[FFmpeg-cvslog] avutil/frame: change av_frame_new_side_data() size parameter type to size_t

James Almer git at videolan.org
Thu Mar 11 01:43:46 EET 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Mar  6 12:35:48 2021 -0300| [dbd47b7990efb48dd2f8ab2d396a6aff2a98c250] | committer: James Almer

avutil/frame: change av_frame_new_side_data() size parameter type to size_t

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbd47b7990efb48dd2f8ab2d396a6aff2a98c250
---

 doc/APIchanges    | 6 +++---
 libavutil/frame.c | 2 +-
 libavutil/frame.h | 8 ++++++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 80e9b849c8..7fa4ab7052 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,9 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
-2021-03-10 - xxxxxxxxxx - lavu 56.68.100 - buffer.h
-  Change AVBufferRef related function and struct size parameter and fields
-  type to size_t at next major bump.
+2021-03-10 - xxxxxxxxxx - lavu 56.68.100 - buffer.h frame.h
+  Change AVBufferRef and relevant AVFrame function and struct size
+  parameter and fields type to size_t at next major bump.
 
 2021-03-04 - xxxxxxxxxx - lavc 58.128.101 - avcodec.h
   Enable err_recognition to be set for encoders.
diff --git a/libavutil/frame.c b/libavutil/frame.c
index eab51b6a32..75e347bf2f 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -725,7 +725,7 @@ AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame,
 
 AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
                                         enum AVFrameSideDataType type,
-                                        int size)
+                                        buffer_size_t size)
 {
     AVFrameSideData *ret;
     AVBufferRef *buf = av_buffer_alloc(size);
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 1aeafef6de..7d1f8e2935 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -220,7 +220,11 @@ enum AVActiveFormatDescription {
 typedef struct AVFrameSideData {
     enum AVFrameSideDataType type;
     uint8_t *data;
+#if FF_API_BUFFER_SIZE_T
     int      size;
+#else
+    size_t   size;
+#endif
     AVDictionary *metadata;
     AVBufferRef *buf;
 } AVFrameSideData;
@@ -913,7 +917,11 @@ AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
  */
 AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
                                         enum AVFrameSideDataType type,
+#if FF_API_BUFFER_SIZE_T
                                         int size);
+#else
+                                        size_t size);
+#endif
 
 /**
  * Add a new side data to a frame from an existing AVBufferRef



More information about the ffmpeg-cvslog mailing list