X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Finternal.h;h=f15940cf4edd0a27483bc1416214b93e2f3b6241;hb=c12e1bd1bc7f0dd0dae2937d7f8c564e887c84ff;hp=72f15d3362741ae79f3eb0fdd560a54c160873f0;hpb=3e1a7ae44a97f20bbc9da0eba000663ef74e1890;p=ffmpeg diff --git a/libavformat/internal.h b/libavformat/internal.h index 72f15d33627..f15940cf4ed 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -71,8 +71,9 @@ void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i /** * Add packet to AVFormatContext->packet_buffer list, determining its * interleaved position using compare() function argument. + * @return 0, or < 0 on error */ -void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, +int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int (*compare)(AVFormatContext *, AVPacket *, AVPacket *)); void ff_read_frame_flush(AVFormatContext *s); @@ -223,8 +224,8 @@ int ff_add_index_entry(AVIndexEntry **index_entries, * * @return AVChapter or NULL on error */ -AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, - int64_t start, int64_t end, const char *title); +AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base, + int64_t start, int64_t end, const char *title); /** * Ensure the index uses less memory than the maximum specified in @@ -251,4 +252,37 @@ enum CodecID ff_guess_image2_codec(const char *filename); */ int64_t ff_iso8601_to_unix_time(const char *datestr); +/** + * Perform a binary search using av_index_search_timestamp() and + * AVInputFormat.read_timestamp(). + * + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int ff_seek_frame_binary(AVFormatContext *s, int stream_index, + int64_t target_ts, int flags); + +/** + * Update cur_dts of all streams based on the given timestamp and AVStream. + * + * Stream ref_st unchanged, others set cur_dts in their native time base. + * Only needed for timestamp wrapping or if (dts not set and pts!=dts). + * @param timestamp new dts expressed in time_base of param ref_st + * @param ref_st reference stream giving time_base of param timestamp + */ +void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); + +/** + * Perform a binary search using read_timestamp(). + * + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int64_t ff_gen_search(AVFormatContext *s, int stream_index, + int64_t target_ts, int64_t pos_min, + int64_t pos_max, int64_t pos_limit, + int64_t ts_min, int64_t ts_max, + int flags, int64_t *ts_ret, + int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); + #endif /* AVFORMAT_INTERNAL_H */