diff mbox series

[FFmpeg-devel,4/7,v4] avutil/frame: add helper to remove side data of a given type from an array

Message ID 20240328031210.21407-4-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/7,v4] avutil/frame: add a flag to allow overwritting existing entries | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer March 28, 2024, 3:12 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/frame.c | 6 ++++++
 libavutil/frame.h | 5 +++++
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/libavutil/frame.c b/libavutil/frame.c
index d27998d1f4..f54c1fa472 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -965,6 +965,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 3e5d170a5b..da78aeea7f 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -1156,6 +1156,11 @@  const AVFrameSideData *av_frame_side_data_get(AVFrameSideData * const *sd,
                                     nb_sd, type);
 }
 
+/**
+ * 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);
 /**
  * @}
  */