[FFmpeg-devel] [PATCH 2/4 v2] avutil/frame: change av_frame_new_side_data() size parameter type to size_t
James Almer
jamrial at gmail.com
Mon Jun 1 20:25:37 EEST 2020
Signed-off-by: James Almer <jamrial at 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 --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
--
2.26.2
More information about the ffmpeg-devel
mailing list