diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2002-10-21 15:54:49 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2002-10-21 15:54:49 +0000 |
commit | 916c80e94ab242489f06c2e578a792b56678134f (patch) | |
tree | 0bdbffbb64645a0cd9901a6459dac3c7b839356d /libav/avformat.h | |
parent | 3f9bff71b5beae8ccd42f86d8e93ef30842401f8 (diff) | |
download | ffmpeg-916c80e94ab242489f06c2e578a792b56678134f.tar.gz |
AV synchronisation API
Originally committed as revision 1054 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/avformat.h')
-rw-r--r-- | libav/avformat.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libav/avformat.h b/libav/avformat.h index 2fb64e4d26..d8679d164d 100644 --- a/libav/avformat.h +++ b/libav/avformat.h @@ -14,7 +14,7 @@ #define AV_NOPTS_VALUE 0 typedef struct AVPacket { - INT64 pts; + INT64 pts; /* presentation time stamp in stream units (set av_set_pts_info) */ UINT8 *data; int size; int stream_index; @@ -28,6 +28,19 @@ int av_new_packet(AVPacket *pkt, int size); void av_free_packet(AVPacket *pkt); /*************************************************/ +/* fractional numbers for exact pts handling */ + +/* the exact value of the fractional number is: 'val + num / den'. num + is assumed to be such as 0 <= num < den */ +typedef struct AVFrac { + INT64 val, num, den; +} AVFrac; + +void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den); +void av_frac_add(AVFrac *f, INT64 incr); +void av_frac_set(AVFrac *f, INT64 val); + +/*************************************************/ /* input/output formats */ struct AVFormatContext; @@ -151,6 +164,9 @@ typedef struct AVFormatContext { char copyright[512]; char comment[512]; int flags; /* format specific flags */ + /* private data for pts handling (do not modify directly) */ + int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */ + int pts_num, pts_den; /* value to convert to seconds */ /* This buffer is only needed when packets were already buffered but not decoded, for example to get the codec parameters in mpeg streams */ @@ -276,6 +292,8 @@ int av_find_stream_info(AVFormatContext *ic); int av_read_packet(AVFormatContext *s, AVPacket *pkt); void av_close_input_file(AVFormatContext *s); AVStream *av_new_stream(AVFormatContext *s, int id); +void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits, + int pts_num, int pts_den); /* media file output */ int av_write_header(AVFormatContext *s); |