From 74a6df59e3bc206931e8e7270c4bb6af77c6e5dc Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Wed, 26 May 2010 04:20:32 +0000 Subject: Add an AVSTREAM_PARSE_FULL_ONCE parsing mode to parse headers and combine packets once and only once. Originally committed as revision 23332 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avformat.h | 3 ++- libavformat/utils.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 47b017815b..0b122d1a02 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -22,7 +22,7 @@ #define AVFORMAT_AVFORMAT_H #define LIBAVFORMAT_VERSION_MAJOR 52 -#define LIBAVFORMAT_VERSION_MINOR 65 +#define LIBAVFORMAT_VERSION_MINOR 66 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ @@ -377,6 +377,7 @@ enum AVStreamParseType { AVSTREAM_PARSE_FULL, /**< full parsing and repack */ AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */ AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */ + AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */ }; typedef struct AVIndexEntry { diff --git a/libavformat/utils.c b/libavformat/utils.c index 62c56e490c..d1b77705e5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1117,6 +1117,8 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) st->need_parsing = AVSTREAM_PARSE_NONE; }else if(st->need_parsing == AVSTREAM_PARSE_HEADERS){ st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; + }else if(st->need_parsing == AVSTREAM_PARSE_FULL_ONCE){ + st->parser->flags |= PARSER_FLAG_ONCE; } if(st->parser && (s->iformat->flags & AVFMT_GENERIC_INDEX)){ st->parser->next_frame_offset= -- cgit v1.2.3