diff --git a/doc/APIchanges b/doc/APIchanges index 3e728c9ef1..cf0555d5e0 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-06-25 - xxxxxxxxxx - lavu 59.26.100 - stereo3d.h + Add av_stereo3d_alloc_size(). + 2024-06-19 - xxxxxxxxxx - lavu 59.25.100 - dovi_meta.h Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7. diff --git a/libavutil/stereo3d.c b/libavutil/stereo3d.c index ad6064e5d9..7ea3dceb33 100644 --- a/libavutil/stereo3d.c +++ b/libavutil/stereo3d.c @@ -33,6 +33,11 @@ static void get_defaults(AVStereo3D *stereo) } AVStereo3D *av_stereo3d_alloc(void) +{ + return av_stereo3d_alloc_size(NULL); +} + +AVStereo3D *av_stereo3d_alloc_size(size_t *size) { AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D)); if (!stereo) @@ -40,6 +45,9 @@ AVStereo3D *av_stereo3d_alloc(void) get_defaults(stereo); + if (size) + *size = sizeof(*stereo); + return stereo; } diff --git a/libavutil/stereo3d.h b/libavutil/stereo3d.h index d8b191118c..386455a5a4 100644 --- a/libavutil/stereo3d.h +++ b/libavutil/stereo3d.h @@ -237,6 +237,14 @@ typedef struct AVStereo3D { */ AVStereo3D *av_stereo3d_alloc(void); +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +AVStereo3D *av_stereo3d_alloc_size(size_t *size); + /** * Allocate a complete AVFrameSideData and add it to the frame. * diff --git a/libavutil/version.h b/libavutil/version.h index 78e6431642..9c1a2dfe39 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 25 +#define LIBAVUTIL_VERSION_MINOR 26 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \