[FFmpeg-cvslog] lavf: add av_stream_get_side_data

Janne Grunau git at videolan.org
Tue May 20 03:51:10 CEST 2014


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Mon May 19 16:29:30 2014 +0200| [c23c96b638cbf6c489fd301e6b3d5555632fba37] | committer: Janne Grunau

lavf: add av_stream_get_side_data

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

 doc/APIchanges         |    4 ++++
 libavformat/avformat.h |   11 +++++++++++
 libavformat/utils.c    |   15 +++++++++++++++
 libavformat/version.h  |    4 ++--
 4 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index b5defe4..92b8fda 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-05-19 - xxxxxxx - lavf 55.18.0 - avformat.h
+  Add av_stream_get_side_data() to access stream-level side data
+  in the same way as av_packet_get_side_data().
+
 2014-05-xx - xxxxxxx - lavu 53.15.0 - frame.h, display.h
   Add AV_FRAME_DATA_DISPLAYMATRIX for exporting frame-level
   spatial rendering on video frames for proper display.
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 5ed50f4..f6b38d5 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1326,6 +1326,17 @@ const AVClass *avformat_get_class(void);
  */
 AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
 
+/**
+ * Get side information from stream.
+ *
+ * @param stream stream
+ * @param type desired side information type
+ * @param size pointer for side information size to store (optional)
+ * @return pointer to data if present or NULL otherwise
+ */
+uint8_t *av_stream_get_side_data(AVStream *stream,
+                                 enum AVPacketSideDataType type, int *size);
+
 AVProgram *av_new_program(AVFormatContext *s, int id);
 
 /**
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c89d7ad..de66c6b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3474,3 +3474,18 @@ int ff_generate_avci_extradata(AVStream *st)
 
     return 0;
 }
+
+uint8_t *av_stream_get_side_data(AVStream *st, enum AVPacketSideDataType type,
+                                 int *size)
+{
+    int i;
+
+    for (i = 0; i < st->nb_side_data; i++) {
+        if (st->side_data[i].type == type) {
+            if (size)
+                *size = st->side_data[i].size;
+            return st->side_data[i].data;
+        }
+    }
+    return NULL;
+}
diff --git a/libavformat/version.h b/libavformat/version.h
index dd945ac..20a58d2 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 55
-#define LIBAVFORMAT_VERSION_MINOR 17
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MINOR 18
+#define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list