diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-10-10 22:05:43 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-10-10 22:05:43 +0000 |
commit | 3ba1438dec553ab106aac8895ddebc01e42c5b71 (patch) | |
tree | c3675504b449b68aa6b99a8429a1abb740507ae2 /libavformat/avformat.h | |
parent | ac8b03c0a807f9cc9d9bd4a14f290efb98bd87ec (diff) | |
download | ffmpeg-3ba1438dec553ab106aac8895ddebc01e42c5b71.tar.gz |
use native timebase for seeking
direction flag for seeking
Originally committed as revision 3577 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 4cd9da59e8..997756b539 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -5,7 +5,7 @@ extern "C" { #endif -#define LIBAVFORMAT_BUILD 4618 +#define LIBAVFORMAT_BUILD 4619 #define LIBAVFORMAT_VERSION_INT FFMPEG_VERSION_INT #define LIBAVFORMAT_VERSION FFMPEG_VERSION @@ -165,10 +165,15 @@ typedef struct AVInputFormat { /* close the stream. The AVFormatContext and AVStreams are not freed by this function */ int (*read_close)(struct AVFormatContext *); - /* seek at or before a given timestamp (given in AV_TIME_BASE - units) relative to the frames in stream component stream_index */ + /** + * seek to a given timestamp relative to the frames in + * stream component stream_index + * @param stream_index must not be -1 + * @param flags selects which direction should be preferred if no exact + * match is available + */ int (*read_seek)(struct AVFormatContext *, - int stream_index, int64_t timestamp); + int stream_index, int64_t timestamp, int flags); /** * gets the next timestamp in AV_TIME_BASE units. */ @@ -553,7 +558,7 @@ AVFormatContext *av_alloc_format_context(void); int av_find_stream_info(AVFormatContext *ic); int av_read_packet(AVFormatContext *s, AVPacket *pkt); int av_read_frame(AVFormatContext *s, AVPacket *pkt); -int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp); +int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags); int av_read_play(AVFormatContext *s); int av_read_pause(AVFormatContext *s); void av_close_input_file(AVFormatContext *s); @@ -561,11 +566,14 @@ AVStream *av_new_stream(AVFormatContext *s, int id); void av_set_pts_info(AVStream *s, int pts_wrap_bits, int pts_num, int pts_den); +#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward +#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes + int av_find_default_stream_index(AVFormatContext *s); -int av_index_search_timestamp(AVStream *st, int timestamp); +int av_index_search_timestamp(AVStream *st, int timestamp, int flags); int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int distance, int flags); -int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts); +int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags); /* media file output */ int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); |