diff options
author | Harald Axmann <harald.axmann@hotmail.com> | 2012-12-02 19:27:21 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-15 21:28:45 +0100 |
commit | 2d74dea84f3d2dea04c77a9c02b01efab4d03a3b (patch) | |
tree | d0ae909ab717970874fc3b0f1dedf420a4f17b31 /libavformat/avformat.h | |
parent | 388241efa2dfc4937fa5c9940ed0bc078e484b9d (diff) | |
download | ffmpeg-2d74dea84f3d2dea04c77a9c02b01efab4d03a3b.tar.gz |
lavf: Provide a monotonic timestamp to the outside world
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7500881330..c907d4e961 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -630,6 +630,13 @@ typedef struct AVIndexEntry { #define AV_DISPOSITION_ATTACHED_PIC 0x0400 /** + * Options for behavior on timestamp wrap detection. + */ +#define AV_PTS_WRAP_IGNORE 0 ///< ignore the wrap +#define AV_PTS_WRAP_ADD_OFFSET 1 ///< add the format specific offset on wrap detection +#define AV_PTS_WRAP_SUB_OFFSET -1 ///< subtract the format specific offset on wrap detection + +/** * Stream structure. * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major @@ -847,6 +854,23 @@ typedef struct AVStream { */ int64_t mux_ts_offset; + /** + * Internal data to check for wrapping of the time stamp + */ + int64_t pts_wrap_reference; + + /** + * Options for behavior, when a wrap is detected. + * + * Defined by AV_PTS_WRAP_ values. + * + * If correction is enabled, there are two possibilities: + * If the first time stamp is near the wrap point, the wrap offset + * will be subtracted, which will create negative time stamps. + * Otherwise the offset will be added. + */ + int pts_wrap_behavior; + } AVStream; #define AV_PROGRAM_RUNNING 1 @@ -878,6 +902,9 @@ typedef struct AVProgram { */ int64_t start_time; int64_t end_time; + + int64_t pts_wrap_reference; ///< reference dts for wrap detection + int pts_wrap_behavior; ///< behavior on wrap detection } AVProgram; #define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present @@ -1169,6 +1196,13 @@ typedef struct AVFormatContext { */ unsigned int skip_initial_bytes; + /** + * Correct single timestamp overflows + * - encoding: unused + * - decoding: Set by user via AVOPtions (NO direct access) + */ + unsigned int correct_ts_overflow; + /***************************************************************** * All fields below this line are not part of the public API. They * may not be used outside of libavformat and can be changed and |