comparison avcodec.h @ 1613:0279c6c61f11 libavcodec

new audio/video parser API
author bellard
date Mon, 10 Nov 2003 15:29:20 +0000
parents b0fe2a0adf49
children 721a76648a4b
comparison
equal deleted inserted replaced
1612:0d2b59cf9f45 1613:0279c6c61f11
14 #include "common.h" 14 #include "common.h"
15 #include "rational.h" 15 #include "rational.h"
16 16
17 #define FFMPEG_VERSION_INT 0x000408 17 #define FFMPEG_VERSION_INT 0x000408
18 #define FFMPEG_VERSION "0.4.8" 18 #define FFMPEG_VERSION "0.4.8"
19 #define LIBAVCODEC_BUILD 4691 19 #define LIBAVCODEC_BUILD 4692
20 20
21 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT 21 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
22 #define LIBAVCODEC_VERSION FFMPEG_VERSION 22 #define LIBAVCODEC_VERSION FFMPEG_VERSION
23 23
24 #define AV_STRINGIFY(s) AV_TOSTRING(s) 24 #define AV_STRINGIFY(s) AV_TOSTRING(s)
1837 * \returns command status - eventually for query command it might return 1837 * \returns command status - eventually for query command it might return
1838 * integer resulting value 1838 * integer resulting value
1839 */ 1839 */
1840 int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout); 1840 int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout);
1841 1841
1842 /* frame parsing */
1843 typedef struct AVCodecParserContext {
1844 void *priv_data;
1845 struct AVCodecParser *parser;
1846 int64_t frame_offset; /* offset of the current frame */
1847 int64_t cur_offset; /* current offset
1848 (incremented by each av_parser_parse()) */
1849 int64_t last_frame_offset; /* offset of the last frame */
1850 /* video info */
1851 int pict_type; /* XXX: put it back in AVCodecContext */
1852 int repeat_pict; /* XXX: put it back in AVCodecContext */
1853 int64_t pts; /* in us, if given by the codec (used by raw mpeg4) */
1854 int64_t dts; /* in us, if given by the codec (used by raw mpeg4) */
1855 } AVCodecParserContext;
1856
1857 typedef struct AVCodecParser {
1858 int codec_ids[3]; /* several codec IDs are permitted */
1859 int priv_data_size;
1860 int (*parser_init)(AVCodecParserContext *s);
1861 int (*parser_parse)(AVCodecParserContext *s,
1862 AVCodecContext *avctx,
1863 uint8_t **poutbuf, int *poutbuf_size,
1864 const uint8_t *buf, int buf_size);
1865 void (*parser_close)(AVCodecParserContext *s);
1866 struct AVCodecParser *next;
1867 } AVCodecParser;
1868
1869 extern AVCodecParser *av_first_parser;
1870
1871 void av_register_codec_parser(AVCodecParser *parser);
1872 AVCodecParserContext *av_parser_init(int codec_id);
1873 int av_parser_parse(AVCodecParserContext *s,
1874 AVCodecContext *avctx,
1875 uint8_t **poutbuf, int *poutbuf_size,
1876 const uint8_t *buf, int buf_size);
1877 void av_parser_close(AVCodecParserContext *s);
1878
1879 extern AVCodecParser mpegvideo_parser;
1880 extern AVCodecParser mpeg4video_parser;
1881 extern AVCodecParser h263_parser;
1882 extern AVCodecParser h264_parser;
1883 extern AVCodecParser mpegaudio_parser;
1884 extern AVCodecParser ac3_parser;
1885
1842 /* memory */ 1886 /* memory */
1843 void *av_malloc(unsigned int size); 1887 void *av_malloc(unsigned int size);
1844 void *av_mallocz(unsigned int size); 1888 void *av_mallocz(unsigned int size);
1845 void *av_realloc(void *ptr, unsigned int size); 1889 void *av_realloc(void *ptr, unsigned int size);
1846 void av_free(void *ptr); 1890 void av_free(void *ptr);