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

James Almer git at videolan.org
Thu Apr 11 18:02:29 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 22 18:39:20 2024 -0300| [662dbf826dda23567874f9439a4bc0d9c7475192] | committer: James Almer

avutil/frame: add helper to remove side data of a given type from an array

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=662dbf826dda23567874f9439a4bc0d9c7475192
---

 libavutil/frame.c | 6 ++++++
 libavutil/frame.h | 5 +++++
 2 files changed, 11 insertions(+)

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
@@ -1149,6 +1149,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);
 /**
  * @}
  */



More information about the ffmpeg-cvslog mailing list