comparison avcodec.h @ 581:8adda0af04e2 libavcodec

added proposed API for parse_only mode to extract compressed frames from compressed streams
author bellard
date Thu, 25 Jul 2002 16:25:36 +0000
parents b0f52172f4c5
children d6955d0d7d27
comparison
equal deleted inserted replaced
580:0b706debf55d 581:8adda0af04e2
111 /* codec capabilities */ 111 /* codec capabilities */
112 112
113 /* decoder can use draw_horiz_band callback */ 113 /* decoder can use draw_horiz_band callback */
114 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 114 #define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
115 #define CODEC_CAP_DR1 0x0002 /* direct rendering method 1 */ 115 #define CODEC_CAP_DR1 0x0002 /* direct rendering method 1 */
116 /* if 'parse_only' field is true, then avcodec_parse_frame() can be
117 used */
118 #define CODEC_CAP_PARSE_ONLY 0x0004
116 119
117 #define FRAME_RATE_BASE 10000 120 #define FRAME_RATE_BASE 10000
118 121
119 typedef struct AVCodecContext { 122 typedef struct AVCodecContext {
120 int bit_rate; 123 int bit_rate;
256 #define MBR 96 259 #define MBR 96
257 #endif 260 #endif
258 #define QP_TYPE int //FIXME note xxx this might be changed to int8_t 261 #define QP_TYPE int //FIXME note xxx this might be changed to int8_t
259 262
260 QP_TYPE *quant_store; /* field for communicating with external postprocessing */ 263 QP_TYPE *quant_store; /* field for communicating with external postprocessing */
264
261 unsigned qstride; 265 unsigned qstride;
262
263 uint8_t *dr_buffer[3]; 266 uint8_t *dr_buffer[3];
264 int dr_stride; 267 int dr_stride;
265 void *dr_opaque_frame; 268 void *dr_opaque_frame;
266 void (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type); 269 void (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type);
267 270
268 int has_b_frames; // is 1 if the decoded stream contains b frames 271 int has_b_frames; // is 1 if the decoded stream contains b frames
269 int dr_uvstride; 272 int dr_uvstride;
270 int dr_ip_buffer_count; 273 int dr_ip_buffer_count;
271 int block_align; /* currently only for adpcm codec in wav/avi */ 274 int block_align; /* currently only for adpcm codec in wav/avi */
275
276 int parse_only; /* decoding only: if true, only parsing is done
277 (function avcodec_parse_frame()). The frame
278 data is returned. Only MPEG codecs support this now. */
272 279
273 //FIXME this should be reordered after kabis API is finished ... 280 //FIXME this should be reordered after kabis API is finished ...
274 /* 281 /*
275 Note: Below are located reserved fields for further usage 282 Note: Below are located reserved fields for further usage
276 It requires for ABI !!! 283 It requires for ABI !!!
290 *ptr_res6; 297 *ptr_res6;
291 unsigned long int 298 unsigned long int
292 ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5, 299 ul_res0,ul_res1,ul_res2,ul_res3,ul_res4,ul_res5,
293 ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12; 300 ul_res6,ul_res7,ul_res8,ul_res9,ul_res10,ul_res11,ul_res12;
294 unsigned int 301 unsigned int
295 ui_res0,ui_res1; 302 ui_res0;
296 unsigned short int 303 unsigned short int
297 us_res0,us_res1,us_res2,us_res3,us_res4,us_res5, 304 us_res0,us_res1,us_res2,us_res3,us_res4,us_res5,
298 us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12; 305 us_res6,us_res7,us_res8,us_res9,us_res10,us_res11,us_res12;
299 unsigned char 306 unsigned char
300 uc_res0,uc_res1,uc_res2,uc_res3,uc_res4,uc_res5, 307 uc_res0,uc_res1,uc_res2,uc_res3,uc_res4,uc_res5,
457 int *frame_size_ptr, 464 int *frame_size_ptr,
458 UINT8 *buf, int buf_size); 465 UINT8 *buf, int buf_size);
459 int avcodec_decode_video(AVCodecContext *avctx, AVPicture *picture, 466 int avcodec_decode_video(AVCodecContext *avctx, AVPicture *picture,
460 int *got_picture_ptr, 467 int *got_picture_ptr,
461 UINT8 *buf, int buf_size); 468 UINT8 *buf, int buf_size);
469 int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata,
470 int *data_size_ptr,
471 UINT8 *buf, int buf_size);
462 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, 472 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size,
463 const short *samples); 473 const short *samples);
464 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, 474 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
465 const AVPicture *pict); 475 const AVPicture *pict);
466 476