1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avutil/frame: add helper for freeing arrays of side data

This commit is contained in:
Jan Ekström 2023-03-19 11:25:54 +02:00
parent d5104b3401
commit 919c9cdbe6
2 changed files with 16 additions and 0 deletions

View File

@ -78,6 +78,11 @@ static void frame_side_data_wipe(AVFrame *frame)
wipe_side_data(&frame->side_data, &frame->nb_side_data);
}
void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd)
{
wipe_side_data(sd, nb_sd);
}
AVFrame *av_frame_alloc(void)
{
AVFrame *frame = av_malloc(sizeof(*frame));

View File

@ -988,6 +988,17 @@ int av_frame_apply_cropping(AVFrame *frame, int flags);
*/
const char *av_frame_side_data_name(enum AVFrameSideDataType type);
/**
* Free all side data entries and their contents, then zeroes out the
* values which the pointers are pointing to.
*
* @param sd pointer to array of side data to free. Will be set to NULL
* upon return.
* @param nb_sd pointer to an integer containing the number of entries in
* the array. Will be set to 0 upon return.
*/
void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd);
/**
* @}
*/