Commit e6baf4f3 authored by James Almer's avatar James Almer

avutil/stereo3d: add a new allocator function that returns a size

av_stereo3d_alloc() is not useful in scenarios where you need to know the
runtime size of AVStereo3D.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 1034296e
...@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 ...@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first: 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 2024-06-19 - xxxxxxxxxx - lavu 59.25.100 - dovi_meta.h
Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7. Add AVDOVIRpuDataHeader.ext_mapping_idc_0_4 and ext_mapping_idc_5_7.
......
...@@ -33,6 +33,11 @@ static void get_defaults(AVStereo3D *stereo) ...@@ -33,6 +33,11 @@ static void get_defaults(AVStereo3D *stereo)
} }
AVStereo3D *av_stereo3d_alloc(void) 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)); AVStereo3D *stereo = av_mallocz(sizeof(AVStereo3D));
if (!stereo) if (!stereo)
...@@ -40,6 +45,9 @@ AVStereo3D *av_stereo3d_alloc(void) ...@@ -40,6 +45,9 @@ AVStereo3D *av_stereo3d_alloc(void)
get_defaults(stereo); get_defaults(stereo);
if (size)
*size = sizeof(*stereo);
return stereo; return stereo;
} }
......
...@@ -237,6 +237,14 @@ typedef struct AVStereo3D { ...@@ -237,6 +237,14 @@ typedef struct AVStereo3D {
*/ */
AVStereo3D *av_stereo3d_alloc(void); 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. * Allocate a complete AVFrameSideData and add it to the frame.
* *
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
*/ */
#define LIBAVUTIL_VERSION_MAJOR 59 #define LIBAVUTIL_VERSION_MAJOR 59
#define LIBAVUTIL_VERSION_MINOR 25 #define LIBAVUTIL_VERSION_MINOR 26
#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment