[FFmpeg-cvslog] lavc: add metadata to AVFrame

Thomas Kühnel git at videolan.org
Sat Jul 14 13:09:48 CEST 2012


ffmpeg | branch: master | Thomas Kühnel <kuehnelth at googlemail.com> | Mon Sep 26 22:26:13 2011 +0200| [f49ec1b40406b4ccc51578f2f11131ceb3eb838c] | committer: Stefano Sabatini

lavc: add metadata to AVFrame

See thread:
Subject: [libav-devel] [PATCH 1/3] avcodec: add metadata to AVFrame
Date: Tue,  4 Oct 2011 00:19:51 +0200

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

 doc/APIchanges       |    4 ++++
 libavcodec/avcodec.h |   11 +++++++++++
 libavcodec/utils.c   |    1 +
 libavcodec/version.h |    2 +-
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 6587010..de05198 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-07-14 - xxxxxxx - lavc 54.38.100 - avcodec.h
+  Add metadata to AVFrame, and the accessor functions
+  av_frame_get_metadata() and av_frame_set_metadata().
+
 2012-07-10 - xxxxxxx - lavc 54.33.100
   Add av_fast_padded_mallocz().
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c007175..26b732f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1313,6 +1313,15 @@ typedef struct AVFrame {
      * - decoding: Read by user.
      */
     int64_t pkt_duration;
+
+    /**
+     * metadata.
+     * Code outside libavcodec should access this field using:
+     * av_frame_get_metadata(frame)
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVDictionary *metadata;
 } AVFrame;
 
 /**
@@ -1325,11 +1334,13 @@ int64_t av_frame_get_pkt_duration         (const AVFrame *frame);
 int64_t av_frame_get_pkt_pos              (const AVFrame *frame);
 int64_t av_frame_get_channel_layout       (const AVFrame *frame);
 int     av_frame_get_sample_rate          (const AVFrame *frame);
+AVDictionary *av_frame_get_metadata       (const AVFrame *frame);
 void    av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
 void    av_frame_set_pkt_duration         (AVFrame *frame, int64_t val);
 void    av_frame_set_pkt_pos              (AVFrame *frame, int64_t val);
 void    av_frame_set_channel_layout       (AVFrame *frame, int64_t val);
 void    av_frame_set_sample_rate          (AVFrame *frame, int     val);
+void    av_frame_set_metadata             (AVFrame *frame, AVDictionary *val);
 
 struct AVCodecInternal;
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index d6c1e00..2d87fa8 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -725,6 +725,7 @@ MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_duration)
 MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_pos)
 MAKE_ACCESSORS(AVFrame, frame, int64_t, channel_layout)
 MAKE_ACCESSORS(AVFrame, frame, int,     sample_rate)
+MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata)
 
 MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index a95c5b1..30d64e2 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR  37
+#define LIBAVCODEC_VERSION_MINOR  38
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list