mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
avformat: add needs_parsing type to enable codec TS use.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
696452e4c5
commit
a6b3471c44
@ -574,6 +574,7 @@ enum AVStreamParseType {
|
|||||||
AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not 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_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 */
|
AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
|
||||||
|
AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp generation for raw */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct AVIndexEntry {
|
typedef struct AVIndexEntry {
|
||||||
|
@ -1316,6 +1316,8 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
|
|||||||
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
|
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
|
||||||
} else if(st->need_parsing == AVSTREAM_PARSE_FULL_ONCE) {
|
} else if(st->need_parsing == AVSTREAM_PARSE_FULL_ONCE) {
|
||||||
st->parser->flags |= PARSER_FLAG_ONCE;
|
st->parser->flags |= PARSER_FLAG_ONCE;
|
||||||
|
} else if(st->need_parsing == AVSTREAM_PARSE_FULL_RAW) {
|
||||||
|
st->parser->flags |= PARSER_FLAG_USE_CODEC_TS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2456,8 +2458,12 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
//only for the split stuff
|
//only for the split stuff
|
||||||
if (!st->parser && !(ic->flags & AVFMT_FLAG_NOPARSE)) {
|
if (!st->parser && !(ic->flags & AVFMT_FLAG_NOPARSE)) {
|
||||||
st->parser = av_parser_init(st->codec->codec_id);
|
st->parser = av_parser_init(st->codec->codec_id);
|
||||||
if(st->need_parsing == AVSTREAM_PARSE_HEADERS && st->parser){
|
if(st->parser){
|
||||||
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
|
if(st->need_parsing == AVSTREAM_PARSE_HEADERS){
|
||||||
|
st->parser->flags |= PARSER_FLAG_COMPLETE_FRAMES;
|
||||||
|
} else if(st->need_parsing == AVSTREAM_PARSE_FULL_RAW) {
|
||||||
|
st->parser->flags |= PARSER_FLAG_USE_CODEC_TS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
codec = st->codec->codec ? st->codec->codec :
|
codec = st->codec->codec ? st->codec->codec :
|
||||||
|
Loading…
Reference in New Issue
Block a user