Mercurial > libavcodec.hg
comparison avcodec.h @ 2756:d8874c8749ec libavcodec
subtitle codec type support
| author | bellard |
|---|---|
| date | Fri, 03 Jun 2005 13:59:38 +0000 |
| parents | aeea63c97878 |
| children | 2b37bcabe608 |
comparison
equal
deleted
inserted
replaced
| 2755:975074f04b95 | 2756:d8874c8749ec |
|---|---|
| 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 0x000409 | 18 #define FFMPEG_VERSION_INT 0x000409 |
| 19 #define FFMPEG_VERSION "0.4.9-pre1" | 19 #define FFMPEG_VERSION "0.4.9-pre1" |
| 20 #define LIBAVCODEC_BUILD 4755 | 20 #define LIBAVCODEC_BUILD 4756 |
| 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) |
| 173 CODEC_ID_ALAC, | 173 CODEC_ID_ALAC, |
| 174 CODEC_ID_WESTWOOD_SND1, | 174 CODEC_ID_WESTWOOD_SND1, |
| 175 CODEC_ID_GSM, | 175 CODEC_ID_GSM, |
| 176 | 176 |
| 177 CODEC_ID_OGGTHEORA= 0x16000, | 177 CODEC_ID_OGGTHEORA= 0x16000, |
| 178 | |
| 179 /* subtitle codecs */ | |
| 180 CODEC_ID_DVD_SUBTITLE= 0x17000, | |
| 181 CODEC_ID_DVB_SUBTITLE, | |
| 178 | 182 |
| 179 CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport | 183 CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport |
| 180 stream (only used by libavformat) */ | 184 stream (only used by libavformat) */ |
| 181 }; | 185 }; |
| 182 | 186 |
| 186 enum CodecType { | 190 enum CodecType { |
| 187 CODEC_TYPE_UNKNOWN = -1, | 191 CODEC_TYPE_UNKNOWN = -1, |
| 188 CODEC_TYPE_VIDEO, | 192 CODEC_TYPE_VIDEO, |
| 189 CODEC_TYPE_AUDIO, | 193 CODEC_TYPE_AUDIO, |
| 190 CODEC_TYPE_DATA, | 194 CODEC_TYPE_DATA, |
| 195 CODEC_TYPE_SUBTITLE, | |
| 191 }; | 196 }; |
| 192 | 197 |
| 193 /** | 198 /** |
| 194 * Pixel format. Notes: | 199 * Pixel format. Notes: |
| 195 * | 200 * |
| 1877 * the palette data comes from a IBM VGA native format, the component | 1882 * the palette data comes from a IBM VGA native format, the component |
| 1878 * data is probably 6 bits in size and needs to be scaled */ | 1883 * data is probably 6 bits in size and needs to be scaled */ |
| 1879 unsigned int palette[AVPALETTE_COUNT]; | 1884 unsigned int palette[AVPALETTE_COUNT]; |
| 1880 | 1885 |
| 1881 } AVPaletteControl; | 1886 } AVPaletteControl; |
| 1887 | |
| 1888 typedef struct AVSubtitle { | |
| 1889 uint16_t format; /* 0 = graphics */ | |
| 1890 uint16_t x; | |
| 1891 uint16_t y; | |
| 1892 uint16_t w; | |
| 1893 uint16_t h; | |
| 1894 uint16_t nb_colors; | |
| 1895 uint32_t start_display_time; /* relative to packet pts, in ms */ | |
| 1896 uint32_t end_display_time; /* relative to packet pts, in ms */ | |
| 1897 int linesize; | |
| 1898 uint32_t *rgba_palette; | |
| 1899 uint8_t *bitmap; | |
| 1900 } AVSubtitle; | |
| 1882 | 1901 |
| 1883 extern AVCodec ac3_encoder; | 1902 extern AVCodec ac3_encoder; |
| 1884 extern AVCodec mp2_encoder; | 1903 extern AVCodec mp2_encoder; |
| 1885 extern AVCodec mp3lame_encoder; | 1904 extern AVCodec mp3lame_encoder; |
| 1886 extern AVCodec oggvorbis_encoder; | 1905 extern AVCodec oggvorbis_encoder; |
| 2065 | 2084 |
| 2066 /* the following codecs use external GPL libs */ | 2085 /* the following codecs use external GPL libs */ |
| 2067 extern AVCodec ac3_decoder; | 2086 extern AVCodec ac3_decoder; |
| 2068 extern AVCodec dts_decoder; | 2087 extern AVCodec dts_decoder; |
| 2069 | 2088 |
| 2089 /* subtitles */ | |
| 2090 extern AVCodec dvdsub_decoder; | |
| 2091 extern AVCodec dvbsub_encoder; | |
| 2092 | |
| 2070 /* resample.c */ | 2093 /* resample.c */ |
| 2071 | 2094 |
| 2072 struct ReSampleContext; | 2095 struct ReSampleContext; |
| 2073 struct AVResampleContext; | 2096 struct AVResampleContext; |
| 2074 | 2097 |
| 2202 int *frame_size_ptr, | 2225 int *frame_size_ptr, |
| 2203 uint8_t *buf, int buf_size); | 2226 uint8_t *buf, int buf_size); |
| 2204 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, | 2227 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, |
| 2205 int *got_picture_ptr, | 2228 int *got_picture_ptr, |
| 2206 uint8_t *buf, int buf_size); | 2229 uint8_t *buf, int buf_size); |
| 2230 int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub, | |
| 2231 int *got_sub_ptr, | |
| 2232 const uint8_t *buf, int buf_size); | |
| 2207 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, | 2233 int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, |
| 2208 int *data_size_ptr, | 2234 int *data_size_ptr, |
| 2209 uint8_t *buf, int buf_size); | 2235 uint8_t *buf, int buf_size); |
| 2210 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, | 2236 int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, |
| 2211 const short *samples); | 2237 const short *samples); |
| 2212 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, | 2238 int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, |
| 2213 const AVFrame *pict); | 2239 const AVFrame *pict); |
| 2240 int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, | |
| 2241 const AVSubtitle *sub); | |
| 2214 | 2242 |
| 2215 int avcodec_close(AVCodecContext *avctx); | 2243 int avcodec_close(AVCodecContext *avctx); |
| 2216 | 2244 |
| 2217 void avcodec_register_all(void); | 2245 void avcodec_register_all(void); |
| 2218 | 2246 |
| 2308 extern AVCodecParser h264_parser; | 2336 extern AVCodecParser h264_parser; |
| 2309 extern AVCodecParser mjpeg_parser; | 2337 extern AVCodecParser mjpeg_parser; |
| 2310 extern AVCodecParser pnm_parser; | 2338 extern AVCodecParser pnm_parser; |
| 2311 extern AVCodecParser mpegaudio_parser; | 2339 extern AVCodecParser mpegaudio_parser; |
| 2312 extern AVCodecParser ac3_parser; | 2340 extern AVCodecParser ac3_parser; |
| 2341 extern AVCodecParser dvdsub_parser; | |
| 2313 | 2342 |
| 2314 /* memory */ | 2343 /* memory */ |
| 2315 void *av_malloc(unsigned int size); | 2344 void *av_malloc(unsigned int size); |
| 2316 void *av_mallocz(unsigned int size); | 2345 void *av_mallocz(unsigned int size); |
| 2317 void *av_realloc(void *ptr, unsigned int size); | 2346 void *av_realloc(void *ptr, unsigned int size); |
