[FFmpeg-devel] [PATCH v0 05/14] avutil/frame: add helper for clearing out side data sets

Jan Ekström jeebjp at gmail.com
Tue Mar 21 01:33:59 EET 2023


---
 libavutil/frame.c | 5 +++++
 libavutil/frame.h | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 019613e4d2..24038cc0fa 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -90,6 +90,11 @@ static void wipe_side_data_from_frame(AVFrame *frame) {
     wipe_side_data(&frame->side_data, &frame->nb_side_data);
 }
 
+void av_side_data_set_wipe(AVFrameSideDataSet *set)
+{
+    wipe_side_data(&set->side_data, &set->nb_side_data);
+}
+
 AVFrame *av_frame_alloc(void)
 {
     AVFrame *frame = av_malloc(sizeof(*frame));
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 45024c2a03..734ac3fe75 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -991,6 +991,13 @@ int av_frame_apply_cropping(AVFrame *frame, int flags);
  */
 const char *av_frame_side_data_name(enum AVFrameSideDataType type);
 
+/**
+ * Clear all side data from a side data set
+ *
+ * @param set the set which should be cleared
+ */
+void av_side_data_set_wipe(AVFrameSideDataSet *set);
+
 /**
  * @}
  */
-- 
2.39.2



More information about the ffmpeg-devel mailing list