[FFmpeg-devel] [PATCHv2 1/2] avcodec: add decode_error_flags field to AVFrame

Marton Balint cus at passwd.hu
Sun Jul 15 21:50:27 CEST 2012


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 doc/APIchanges       |    3 +++
 libavcodec/avcodec.h |   15 +++++++++++++++
 libavcodec/utils.c   |    1 +
 libavcodec/version.h |    2 +-
 4 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index de05198..87e8550 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2011-04-18
 
 API changes, most recent first:
 
+2012-07-15 - xxxxxxx - lavc 54.41.100
+  Add decode_error_flags field to AVFrame.
+
 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().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 3c18040..21707f0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1322,6 +1322,19 @@ typedef struct AVFrame {
      * - decoding: Set by libavcodec.
      */
     AVDictionary *metadata;
+
+    /**
+     * decode error flags of the frame, set to a combination of
+     * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
+     * were errors during the decoding.
+     * Code outside libavcodec should access this field using:
+     * av_frame_get_decode_error_flags(frame)
+     * - encoding: unused
+     * - decoding: set by libavcodec, read by user.
+     */
+    int decode_error_flags;
+#define FF_DECODE_ERROR_INVALID_BITSTREAM   1
+#define FF_DECODE_ERROR_MISSING_REFERENCE   2
 } AVFrame;
 
 /**
@@ -1341,6 +1354,8 @@ int     av_frame_get_sample_rate          (const AVFrame *frame);
 void    av_frame_set_sample_rate          (AVFrame *frame, int     val);
 AVDictionary *av_frame_get_metadata       (const AVFrame *frame);
 void          av_frame_set_metadata       (AVFrame *frame, AVDictionary *val);
+int     av_frame_get_decode_error_flags   (const AVFrame *frame);
+void    av_frame_set_decode_error_flags   (AVFrame *frame, int     val);
 
 struct AVCodecInternal;
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 78e0e11..35420e7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -726,6 +726,7 @@ 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(AVFrame, frame, int,     decode_error_flags)
 
 MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b146635..d0f5240 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR  40
+#define LIBAVCODEC_VERSION_MINOR 41
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.7.3.4



More information about the ffmpeg-devel mailing list