comparison avformat.h @ 346:e154eb1b7149 libavformat

caching of timestamps for mpeg-ps so seeking is faster move (av_)find_stream_index() to utils.c as its usefull outside mpeg.c assert checking enabled, to find bugs quicker, should obviously be disabled later (av_)add_index_entry() inserts new entries so that the list stays ordered and updates entries if already in it (av_)index_search_timestamp() cleanup (kill ugly goto) and shorter
author michael
date Tue, 13 Jan 2004 22:02:49 +0000
parents 6f50cb0ead51
children 6770ca07abe2
comparison
equal deleted inserted replaced
345:d94c6fd7b95e 346:e154eb1b7149
193 193
194 typedef struct AVIndexEntry { 194 typedef struct AVIndexEntry {
195 int64_t pos; 195 int64_t pos;
196 int64_t timestamp; 196 int64_t timestamp;
197 #define AVINDEX_KEYFRAME 0x0001 197 #define AVINDEX_KEYFRAME 0x0001
198 /* the following 2 flags indicate that the next/prev keyframe is known, and scaning for it isnt needed */
199 #define AVINDEX_NEXT_KNOWN 0x0002
200 #define AVINDEX_PREV_KNOWN 0x0004
198 int flags; 201 int flags;
199 } AVIndexEntry; 202 } AVIndexEntry;
200 203
201 typedef struct AVStream { 204 typedef struct AVStream {
202 int index; /* stream index in AVFormatContext */ 205 int index; /* stream index in AVFormatContext */
542 void av_close_input_file(AVFormatContext *s); 545 void av_close_input_file(AVFormatContext *s);
543 AVStream *av_new_stream(AVFormatContext *s, int id); 546 AVStream *av_new_stream(AVFormatContext *s, int id);
544 void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits, 547 void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits,
545 int pts_num, int pts_den); 548 int pts_num, int pts_den);
546 549
550 int av_find_default_stream_index(AVFormatContext *s);
551 int av_index_search_timestamp(AVStream *st, int timestamp);
552 void av_add_index_entry(AVStream *st,
553 int64_t pos, int64_t timestamp, int flags);
554
547 /* media file output */ 555 /* media file output */
548 int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); 556 int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
549 int av_write_header(AVFormatContext *s); 557 int av_write_header(AVFormatContext *s);
550 int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf, 558 int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
551 int size); 559 int size);