#include "avcodec.h"#include "mpegvideo.h"#include "mpegaudio.h"

Go to the source code of this file.
Data Structures | |
| struct | ParseContext1 |
| struct | MpegAudioParseContext |
Defines | |
| #define | PICTURE_START_CODE 0x00000100 |
| #define | SEQ_START_CODE 0x000001b3 |
| #define | EXT_START_CODE 0x000001b5 |
| #define | SLICE_MIN_START_CODE 0x00000101 |
| #define | SLICE_MAX_START_CODE 0x000001af |
| #define | MPEG1_FRAME_RATE_BASE 1001 |
| #define | MPA_HEADER_SIZE 4 |
| #define | SAME_HEADER_MASK (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19)) |
Functions | |
| void | av_register_codec_parser (AVCodecParser *parser) |
| AVCodecParserContext * | av_parser_init (int codec_id) |
| int | av_parser_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int64_t pts, int64_t dts) |
| int | av_parser_change (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) |
| void | av_parser_close (AVCodecParserContext *s) |
| int | ff_combine_frame (ParseContext *pc, int next, uint8_t **buf, int *buf_size) |
| static int | find_start_code (const uint8_t **pbuf_ptr, const uint8_t *buf_end) |
| static void | mpegvideo_extract_headers (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
| static int | mpegvideo_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) |
| static int | mpegvideo_split (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
| void | ff_parse_close (AVCodecParserContext *s) |
| static void | parse1_close (AVCodecParserContext *s) |
| static int | av_mpeg4_decode_header (AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
| static int | mpeg4video_parse_init (AVCodecParserContext *s) |
| static int | mpeg4video_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) |
| static int | mpeg4video_split (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
| static int | mpegaudio_parse_init (AVCodecParserContext *s1) |
| static int | mpegaudio_parse (AVCodecParserContext *s1, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) |
Variables | |
| AVCodecParser * | av_first_parser = NULL |
| static const int | frame_rate_tab [16] |
| AVCodecParser | mpegvideo_parser |
| AVCodecParser | mpeg4video_parser |
| AVCodecParser | mpegaudio_parser |
| #define MPA_HEADER_SIZE 4 |
| #define MPEG1_FRAME_RATE_BASE 1001 |
| #define SAME_HEADER_MASK (0xffe00000 | (3 << 17) | (3 << 10) | (3 << 19)) |
| static int av_mpeg4_decode_header | ( | AVCodecParserContext * | s1, | |
| AVCodecContext * | avctx, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 487 of file parser.c.
References avcodec_set_dimensions(), MpegEncContext::avctx, MpegEncContext::current_picture, MpegEncContext::current_picture_ptr, ParseContext1::enc, AVCodecContext::extradata, AVCodecContext::extradata_size, ff_mpeg4_decode_picture_header(), ParseContext1::first_picture, MpegEncContext::height, init_get_bits(), AVCodecParserContext::priv_data, s, and MpegEncContext::width.
Referenced by mpeg4video_parse().

| int av_parser_change | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int | keyframe | |||
| ) |
Definition at line 149 of file parser.c.
References av_malloc(), CODEC_FLAG2_LOCAL_HEADER, CODEC_FLAG_GLOBAL_HEADER, AVCodecContext::extradata, AVCodecContext::extradata_size, FF_INPUT_BUFFER_PADDING_SIZE, AVCodecContext::flags, AVCodecContext::flags2, memcpy, AVCodecParserContext::parser, and AVCodecParser::split.
Referenced by output_packet().

| void av_parser_close | ( | AVCodecParserContext * | s | ) |
Definition at line 181 of file parser.c.
References av_free(), AVCodecParserContext::parser, AVCodecParser::parser_close, and AVCodecParserContext::priv_data.

| AVCodecParserContext* av_parser_init | ( | int | codec_id | ) |
Definition at line 32 of file parser.c.
References av_free(), av_mallocz(), CODEC_ID_NONE, AVCodecParser::codec_ids, AVCodecParserContext::fetch_timestamp, AVCodecParser::next, NULL, AVCodecParserContext::parser, AVCodecParser::parser_init, AVCodecParserContext::priv_data, AVCodecParser::priv_data_size, and s.

| int av_parser_parse | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int64_t | pts, | |||
| int64_t | dts | |||
| ) |
Definition at line 74 of file parser.c.
References AV_NOPTS_VALUE, AV_PARSER_PTS_NB, AVCodecParserContext::cur_frame_dts, AVCodecParserContext::cur_frame_offset, AVCodecParserContext::cur_frame_pts, AVCodecParserContext::cur_frame_start_index, AVCodecParserContext::cur_offset, AVCodecParserContext::dts, AVCodecParserContext::fetch_timestamp, FF_INPUT_BUFFER_PADDING_SIZE, AVCodecParserContext::frame_offset, AVCodecParserContext::last_dts, AVCodecParserContext::last_frame_offset, AVCodecParserContext::last_pts, AVCodecParserContext::parser, AVCodecParser::parser_parse, and AVCodecParserContext::pts.
| void av_register_codec_parser | ( | AVCodecParser * | parser | ) |
Definition at line 26 of file parser.c.
References AVCodecParser::next.
Referenced by avcodec_register_all().
| int ff_combine_frame | ( | ParseContext * | pc, | |
| int | next, | |||
| uint8_t ** | buf, | |||
| int * | buf_size | |||
| ) |
combines the (truncated) bitstream to a complete frame
Definition at line 216 of file parser.c.
References av_fast_realloc(), ParseContext::buffer, ParseContext::buffer_size, END_NOT_FOUND, FF_INPUT_BUFFER_PADDING_SIZE, ParseContext::index, ParseContext::last_index, memcpy, ParseContext::overread, ParseContext::overread_index, and ParseContext::state.
Referenced by decode_frame(), ff_h263_decode_frame(), h261_parse(), h263_parse(), h264_parse(), jpeg_parse(), mpeg4video_parse(), mpeg_decode_frame(), mpegvideo_parse(), and pnm_parse().

| void ff_parse_close | ( | AVCodecParserContext * | s | ) |
Definition at line 468 of file parser.c.
References av_free(), ParseContext::buffer, and AVCodecParserContext::priv_data.

| static int find_start_code | ( | const uint8_t ** | pbuf_ptr, | |
| const uint8_t * | buf_end | |||
| ) | [static] |
| static int mpeg4video_parse | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 524 of file parser.c.
References av_mpeg4_decode_header(), ff_combine_frame(), ff_mpeg4_find_frame_end(), NULL, and AVCodecParserContext::priv_data.

| static int mpeg4video_parse_init | ( | AVCodecParserContext * | s | ) | [static] |
Definition at line 513 of file parser.c.
References av_mallocz(), ParseContext1::enc, ParseContext1::first_picture, and AVCodecParserContext::priv_data.

| static int mpeg4video_split | ( | AVCodecContext * | avctx, | |
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static int mpegaudio_parse | ( | AVCodecParserContext * | s1, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 586 of file parser.c.
References decode_header(), MpegAudioParseContext::frame_size, MpegAudioParseContext::free_format_frame_size, MpegAudioParseContext::free_format_next_header, MpegAudioParseContext::header, header, MpegAudioParseContext::header_count, MpegAudioParseContext::inbuf, MpegAudioParseContext::inbuf_ptr, memcpy, mpa_decode_header(), MPA_HEADER_SIZE, MPA_MAX_CODED_FRAME_SIZE, NULL, AVCodecParserContext::priv_data, s, SAME_HEADER_MASK, and AVCodecContext::sample_rate.

| static int mpegaudio_parse_init | ( | AVCodecParserContext * | s1 | ) | [static] |
Definition at line 579 of file parser.c.
References MpegAudioParseContext::inbuf, MpegAudioParseContext::inbuf_ptr, AVCodecParserContext::priv_data, and s.
| static void mpegvideo_extract_headers | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 322 of file parser.c.
References avcodec_set_dimensions(), AVCodecContext::bit_rate, AVCodecContext::codec_id, CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, AVRational::den, EXT_START_CODE, find_start_code(), ParseContext1::frame_rate, frame_rate_tab, AVCodecContext::has_b_frames, ParseContext1::height, MPEG1_FRAME_RATE_BASE, AVRational::num, AVCodecParserContext::pict_type, PICTURE_START_CODE, AVCodecParserContext::priv_data, ParseContext1::progressive_sequence, AVCodecParserContext::repeat_pict, SEQ_START_CODE, SLICE_MAX_START_CODE, SLICE_MIN_START_CODE, AVCodecContext::sub_id, AVCodecContext::time_base, top_field_first, and ParseContext1::width.
Referenced by mpegvideo_parse().

| static int mpegvideo_parse | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 424 of file parser.c.
References AVRational::den, ff_combine_frame(), ff_mpeg1_find_frame_end(), mpegvideo_extract_headers(), NULL, AVRational::num, ParseContext1::pc, AVCodecParserContext::pict_type, AVCodecParserContext::priv_data, AVCodecParserContext::repeat_pict, and AVCodecContext::time_base.

| static int mpegvideo_split | ( | AVCodecContext * | avctx, | |
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static void parse1_close | ( | AVCodecParserContext * | s | ) | [static] |
Definition at line 475 of file parser.c.
References av_free(), ParseContext::buffer, ParseContext1::enc, ParseContext1::pc, and AVCodecParserContext::priv_data.

| AVCodecParser* av_first_parser = NULL |
const int frame_rate_tab[16] [static] |
Initial value:
{
{ CODEC_ID_MPEG4 },
sizeof(ParseContext1),
mpeg4video_parse_init,
mpeg4video_parse,
parse1_close,
mpeg4video_split,
}
Definition at line 838 of file parser.c.
Referenced by avcodec_register_all().
Initial value:
{
{ CODEC_ID_MP2, CODEC_ID_MP3 },
sizeof(MpegAudioParseContext),
mpegaudio_parse_init,
mpegaudio_parse,
NULL,
}
Definition at line 847 of file parser.c.
Referenced by avcodec_register_all().
Initial value:
{
{ CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
sizeof(ParseContext1),
NULL,
mpegvideo_parse,
parse1_close,
mpegvideo_split,
}
Definition at line 829 of file parser.c.
Referenced by avcodec_register_all().
1.5.5