[FFmpeg-devel] [PATCH 2/5] avutil/frame: add helper to remove side data of a given type from an array

James Almer jamrial at gmail.com
Sat Mar 23 01:31:26 EET 2024


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavutil/frame.c | 6 ++++++
 libavutil/frame.h | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 0717d89711..3e225ce5a4 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -847,6 +847,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 e3733ce928..671f75698c 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -1093,6 +1093,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);
 /**
  * @}
  */
-- 
2.44.0



More information about the ffmpeg-devel mailing list