comparison avcodec.h @ 1696:f5af91b8be17 libavcodec

pts and dts support in parser API
author bellard
date Tue, 16 Dec 2003 11:17:06 +0000
parents 04b759af8bd4
children 3ba5c493db6f
comparison
equal deleted inserted replaced
1695:2d11403fde4e 1696:f5af91b8be17
15 #include "rational.h" 15 #include "rational.h"
16 #include <sys/types.h> /* size_t */ 16 #include <sys/types.h> /* size_t */
17 17
18 #define FFMPEG_VERSION_INT 0x000408 18 #define FFMPEG_VERSION_INT 0x000408
19 #define FFMPEG_VERSION "0.4.8" 19 #define FFMPEG_VERSION "0.4.8"
20 #define LIBAVCODEC_BUILD 4696 20 #define LIBAVCODEC_BUILD 4697
21 21
22 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT 22 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
23 #define LIBAVCODEC_VERSION FFMPEG_VERSION 23 #define LIBAVCODEC_VERSION FFMPEG_VERSION
24 24
25 #define AV_STRINGIFY(s) AV_TOSTRING(s) 25 #define AV_STRINGIFY(s) AV_TOSTRING(s)
1930 (incremented by each av_parser_parse()) */ 1930 (incremented by each av_parser_parse()) */
1931 int64_t last_frame_offset; /* offset of the last frame */ 1931 int64_t last_frame_offset; /* offset of the last frame */
1932 /* video info */ 1932 /* video info */
1933 int pict_type; /* XXX: put it back in AVCodecContext */ 1933 int pict_type; /* XXX: put it back in AVCodecContext */
1934 int repeat_pict; /* XXX: put it back in AVCodecContext */ 1934 int repeat_pict; /* XXX: put it back in AVCodecContext */
1935 int64_t pts; /* in us, if given by the codec (used by raw mpeg4) */ 1935 int64_t pts; /* pts of the current frame */
1936 int64_t dts; /* in us, if given by the codec (used by raw mpeg4) */ 1936 int64_t dts; /* dts of the current frame */
1937
1938 /* private data */
1939 int64_t last_pts;
1940 int64_t last_dts;
1941
1942 #define AV_PARSER_PTS_NB 4
1943 int cur_frame_start_index;
1944 int64_t cur_frame_offset[AV_PARSER_PTS_NB];
1945 int64_t cur_frame_pts[AV_PARSER_PTS_NB];
1946 int64_t cur_frame_dts[AV_PARSER_PTS_NB];
1937 } AVCodecParserContext; 1947 } AVCodecParserContext;
1938 1948
1939 typedef struct AVCodecParser { 1949 typedef struct AVCodecParser {
1940 int codec_ids[3]; /* several codec IDs are permitted */ 1950 int codec_ids[3]; /* several codec IDs are permitted */
1941 int priv_data_size; 1951 int priv_data_size;
1953 void av_register_codec_parser(AVCodecParser *parser); 1963 void av_register_codec_parser(AVCodecParser *parser);
1954 AVCodecParserContext *av_parser_init(int codec_id); 1964 AVCodecParserContext *av_parser_init(int codec_id);
1955 int av_parser_parse(AVCodecParserContext *s, 1965 int av_parser_parse(AVCodecParserContext *s,
1956 AVCodecContext *avctx, 1966 AVCodecContext *avctx,
1957 uint8_t **poutbuf, int *poutbuf_size, 1967 uint8_t **poutbuf, int *poutbuf_size,
1958 const uint8_t *buf, int buf_size); 1968 const uint8_t *buf, int buf_size,
1969 int64_t pts, int64_t dts);
1959 void av_parser_close(AVCodecParserContext *s); 1970 void av_parser_close(AVCodecParserContext *s);
1960 1971
1961 extern AVCodecParser mpegvideo_parser; 1972 extern AVCodecParser mpegvideo_parser;
1962 extern AVCodecParser mpeg4video_parser; 1973 extern AVCodecParser mpeg4video_parser;
1963 extern AVCodecParser h263_parser; 1974 extern AVCodecParser h263_parser;