]> git.sesse.net Git - ffmpeg/commitdiff
frame: add a function for removing side data from a frame
authorAnton Khirnov <anton@khirnov.net>
Wed, 19 Feb 2014 19:11:21 +0000 (20:11 +0100)
committerAnton Khirnov <anton@khirnov.net>
Mon, 24 Mar 2014 05:07:51 +0000 (06:07 +0100)
doc/APIchanges
libavutil/frame.c
libavutil/frame.h
libavutil/version.h

index afeec8c3b7919b393f4dedc38be68adece0f5a6a..d8002533df388603d775b8bf8246c596431c911d 100644 (file)
@@ -13,6 +13,10 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-02-xx - xxxxxxx - lavu 53.08.0 - frame.h
+  Add av_frame_remove_side_data() for removing a single side data
+  instance from a frame.
+
 2014-02-xx - xxxxxxx - lavu 53.07.0 - frame.h, replaygain.h
   Add AV_FRAME_DATA_REPLAYGAIN for exporting replaygain tags.
   Add a new header replaygain.h with the AVReplayGain struct.
index f81bbbd13857461467e987e6f97d21a554c05d4c..cc4bfcdf4bdb87364cce55bcf484ada8878948e3 100644 (file)
@@ -526,3 +526,19 @@ int av_frame_copy(AVFrame *dst, const AVFrame *src)
 
     return AVERROR(EINVAL);
 }
+
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
+{
+    int i;
+
+    for (i = 0; i < frame->nb_side_data; i++) {
+        AVFrameSideData *sd = frame->side_data[i];
+        if (sd->type == type) {
+            av_freep(&sd->data);
+            av_dict_free(&sd->metadata);
+            av_freep(&frame->side_data[i]);
+            frame->side_data[i] = frame->side_data[frame->nb_side_data - 1];
+            frame->nb_side_data--;
+        }
+    }
+}
index e9bc6aeb40a5ffefc54392c77bc487e53001f494..3bec8e594845ff7acfd7c4c23a1c34c80f882821 100644 (file)
@@ -562,6 +562,12 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
 AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
                                         enum AVFrameSideDataType type);
 
+/**
+ * If side data of the supplied type exists in the frame, free it and remove it
+ * from the frame.
+ */
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
+
 /**
  * @}
  */
index d6809796297f24aa1e7b75e54992df7bf20bdfc9..7f439d725aa8bf4df7e35df6d36e11b8de4fabc4 100644 (file)
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR  7
+#define LIBAVUTIL_VERSION_MINOR  8
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \