diff avformat.h @ 555:0a997108f384 libavformat

use native timebase for seeking direction flag for seeking
author michael
date Sun, 10 Oct 2004 22:05:43 +0000
parents e1f17fcfb92c
children 89bd76208427
line wrap: on
line diff
--- a/avformat.h	Fri Oct 08 20:09:52 2004 +0000
+++ b/avformat.h	Sun Oct 10 22:05:43 2004 +0000
@@ -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 @@
     /* 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 @@
 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 @@
 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);