aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorIvan Schreter <schreter@gmx.net>2009-02-24 22:19:09 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-02-24 22:19:09 +0000
commit27ca0a79c9d68059cdac610cdddb7039e6281529 (patch)
tree47514685538f6f49152e10898168b4bf90193f4e /libavcodec
parent4d8f8301254c7734182acd129c7e232e53bbca08 (diff)
downloadffmpeg-27ca0a79c9d68059cdac610cdddb7039e6281529.tar.gz
Add timestamp computation if values are exported by decoder.
Patch by Ivan Schreter, schreter gmx net Originally committed as revision 17574 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h43
-rw-r--r--libavcodec/parser.c3
2 files changed, 45 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d4bbe29b82..5a81a379e3 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -30,7 +30,7 @@
#include "libavutil/avutil.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 18
+#define LIBAVCODEC_VERSION_MINOR 19
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -3147,6 +3147,47 @@ typedef struct AVCodecParserContext {
* subtitles are correctly displayed after seeking.
*/
int64_t convergence_duration;
+
+ // Timestamp generation support:
+ /**
+ * Synchronization point for start of timestamp generation.
+ *
+ * Set to >0 for sync point, 0 for no sync point and <0 for undefined
+ * (default).
+ *
+ * For example, this corresponds to presence of H.264 buffering period
+ * SEI message.
+ */
+ int dts_sync_point;
+
+ /**
+ * Offset of the current timestamp against last timestamp sync point in
+ * units of AVCodecContext.time_base.
+ *
+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ * contain a valid timestamp offset.
+ *
+ * Note that the timestamp of sync point has usually a nonzero
+ * dts_ref_dts_delta, which refers to the previous sync point. Offset of
+ * the next frame after timestamp sync point will be usually 1.
+ *
+ * For example, this corresponds to H.264 cpb_removal_delay.
+ */
+ int dts_ref_dts_delta;
+
+ /**
+ * Presentation delay of current frame in units of AVCodecContext.time_base.
+ *
+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+ * contain valid non-negative timestamp delta (presentation time of a frame
+ * must not lie in the past).
+ *
+ * This delay represents the difference between decoding and presentation
+ * time of the frame.
+ *
+ * For example, this corresponds to H.264 dpb_output_delay.
+ */
+ int pts_dts_delta;
} AVCodecParserContext;
typedef struct AVCodecParser {
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index a0d604dabe..d738a62b83 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -75,6 +75,9 @@ AVCodecParserContext *av_parser_init(int codec_id)
s->pict_type = FF_I_TYPE;
s->key_frame = -1;
s->convergence_duration = AV_NOPTS_VALUE;
+ s->dts_sync_point = INT_MIN;
+ s->dts_ref_dts_delta = INT_MIN;
+ s->pts_dts_delta = INT_MIN;
return s;
}