diff mbox series

[FFmpeg-devel,2/4,v2] avutil/frame: change av_frame_new_side_data() size parameter type to size_t

Message ID 20200601172539.17081-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4,v2] avutil/buffer: change public function and struct size parameter types to size_t
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

James Almer June 1, 2020, 5:25 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
No changes since v1.

 doc/APIchanges    | 4 ++--
 libavutil/frame.c | 4 ++++
 libavutil/frame.h | 8 ++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index 9de23744c0..dbf21c1d1e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -16,8 +16,8 @@  libavutil:     2017-10-21
 API changes, most recent first:
 
 2020-06-xx - xxxxxxxxxx
-  Change AVBufferRef related function and struct size parameter and fields
-  type to size_t at next major bump.
+  Change AVBufferRef and relevant AVFrameSideData function and struct size
+  parameter and fields type to size_t at next major bump.
 
 2020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h
   Move AVCodec-related public API to new header codec.h.
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 2e952edd29..489e46dd93 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -726,7 +726,11 @@  AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame,
 
 AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
                                         enum AVFrameSideDataType type,
+#if FF_API_BUFFER_SIZE_T
                                         int size)
+#else
+                                        size_t size)
+#endif
 {
     AVFrameSideData *ret;
     AVBufferRef *buf = av_buffer_alloc(size);
diff --git a/libavutil/frame.h b/libavutil/frame.h
index fc67db0f6c..fa4931edb8 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -206,7 +206,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;
@@ -899,7 +903,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