aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-03-22 18:39:20 -0300
committerJames Almer <jamrial@gmail.com>2024-04-11 09:18:19 -0300
commit662dbf826dda23567874f9439a4bc0d9c7475192 (patch)
tree494c0547670719ac9e622621c2192595a6b28588
parent55621f6fae766dd337b792a99ec0cae3a1e69cb9 (diff)
downloadffmpeg-662dbf826dda23567874f9439a4bc0d9c7475192.tar.gz
avutil/frame: add helper to remove side data of a given type from an array
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavutil/frame.c6
-rw-r--r--libavutil/frame.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index d37f1511e8..10b9f7fa94 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -937,6 +937,12 @@ const AVFrameSideData *av_frame_side_data_get_c(const AVFrameSideData * const *s
return NULL;
}
+void av_frame_side_data_remove(AVFrameSideData ***sd, int *nb_sd,
+ enum AVFrameSideDataType type)
+{
+ remove_side_data(sd, nb_sd, type);
+}
+
AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
enum AVFrameSideDataType type)
{
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 4885600dce..68a2ad1555 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -1150,6 +1150,11 @@ const AVFrameSideData *av_frame_side_data_get(AVFrameSideData * const *sd,
}
/**
+ * Remove and free all side data instances of the given type from an array.
+ */
+void av_frame_side_data_remove(AVFrameSideData ***sd, int *nb_sd,
+ enum AVFrameSideDataType type);
+/**
* @}
*/