comparison avcodec.h @ 925:7fccaa0d699d libavcodec

AVVideoFrame -> AVFrame
author michaelni
date Mon, 09 Dec 2002 12:03:43 +0000
parents 3814e9115672
children 176fd8c8e8a8
comparison
equal deleted inserted replaced
924:3814e9115672 925:7fccaa0d699d
3 3
4 #include "common.h" 4 #include "common.h"
5 5
6 #define LIBAVCODEC_VERSION_INT 0x000406 6 #define LIBAVCODEC_VERSION_INT 0x000406
7 #define LIBAVCODEC_VERSION "0.4.6" 7 #define LIBAVCODEC_VERSION "0.4.6"
8 #define LIBAVCODEC_BUILD 4644 8 #define LIBAVCODEC_BUILD 4645
9 #define LIBAVCODEC_BUILD_STR "4644" 9 #define LIBAVCODEC_BUILD_STR "4645"
10 10
11 enum CodecID { 11 enum CodecID {
12 CODEC_ID_NONE, 12 CODEC_ID_NONE,
13 CODEC_ID_MPEG1VIDEO, 13 CODEC_ID_MPEG1VIDEO,
14 CODEC_ID_H263, 14 CODEC_ID_H263,
157 #define CODEC_CAP_PARSE_ONLY 0x0004 157 #define CODEC_CAP_PARSE_ONLY 0x0004
158 #define CODEC_CAP_TRUNCATED 0x0008 158 #define CODEC_CAP_TRUNCATED 0x0008
159 159
160 #define FRAME_RATE_BASE 10000 160 #define FRAME_RATE_BASE 10000
161 161
162 #define FF_COMMON_PICTURE \ 162 #define FF_COMMON_FRAME \
163 uint8_t *data[4];\ 163 uint8_t *data[4];\
164 int linesize[4];\ 164 int linesize[4];\
165 /**\ 165 /**\
166 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\ 166 * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
167 * this isnt used by lavc unless the default get/release_buffer() is used\ 167 * this isnt used by lavc unless the default get/release_buffer() is used\
277 #define FF_I_TYPE 1 // Intra 277 #define FF_I_TYPE 1 // Intra
278 #define FF_P_TYPE 2 // Predicted 278 #define FF_P_TYPE 2 // Predicted
279 #define FF_B_TYPE 3 // Bi-dir predicted 279 #define FF_B_TYPE 3 // Bi-dir predicted
280 #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4 280 #define FF_S_TYPE 4 // S(GMC)-VOP MPEG4
281 281
282 typedef struct AVVideoFrame { 282 typedef struct AVFrame {
283 FF_COMMON_PICTURE 283 FF_COMMON_FRAME
284 } AVVideoFrame; 284 } AVFrame;
285 285
286 typedef struct AVCodecContext { 286 typedef struct AVCodecContext {
287 /** 287 /**
288 * the average bitrate 288 * the average bitrate
289 * encoding: set by user. unused for constant quantizer encoding 289 * encoding: set by user. unused for constant quantizer encoding
393 int frame_size; /* in samples, initialized when calling 'init' */ 393 int frame_size; /* in samples, initialized when calling 'init' */
394 int frame_number; /* audio or video frame number */ 394 int frame_number; /* audio or video frame number */
395 int real_pict_num; /* returns the real picture number of 395 int real_pict_num; /* returns the real picture number of
396 previous encoded frame */ 396 previous encoded frame */
397 397
398 /**
399 * 1 -> keyframe, 0-> not (this if for audio only, for video, AVVideoFrame.key_frame should be used)
400 * encoding: set by lavc (for the outputed bitstream, not the input frame)
401 * decoding: set by lavc (for the decoded bitstream, not the displayed frame)
402 */
403 int key_frame;
404
405 /** 398 /**
406 * number of frames the decoded output will be delayed relative to 399 * number of frames the decoded output will be delayed relative to
407 * the encoded input 400 * the encoded input
408 * encoding: set by lavc. 401 * encoding: set by lavc.
409 * decoding: unused 402 * decoding: unused
572 * called at the beginning of each frame to get a buffer for it. 565 * called at the beginning of each frame to get a buffer for it.
573 * if pic.reference is set then the frame will be read later by lavc 566 * if pic.reference is set then the frame will be read later by lavc
574 * encoding: unused 567 * encoding: unused
575 * decoding: set by lavc, user can override 568 * decoding: set by lavc, user can override
576 */ 569 */
577 int (*get_buffer)(struct AVCodecContext *c, AVVideoFrame *pic); 570 int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
578 571
579 /** 572 /**
580 * called to release buffers which where allocated with get_buffer. 573 * called to release buffers which where allocated with get_buffer.
581 * a released buffer can be reused in get_buffer() 574 * a released buffer can be reused in get_buffer()
582 * pic.data[*] must be set to NULL 575 * pic.data[*] must be set to NULL
583 * encoding: unused 576 * encoding: unused
584 * decoding: set by lavc, user can override 577 * decoding: set by lavc, user can override
585 */ 578 */
586 void (*release_buffer)(struct AVCodecContext *c, AVVideoFrame *pic); 579 void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
587 580
588 /** 581 /**
589 * is 1 if the decoded stream contains b frames, 0 otherwise 582 * is 1 if the decoded stream contains b frames, 0 otherwise
590 * encoding: unused 583 * encoding: unused
591 * decoding: set by lavc 584 * decoding: set by lavc
818 /** 811 /**
819 * the picture in the bitstream 812 * the picture in the bitstream
820 * encoding: set by lavc 813 * encoding: set by lavc
821 * decoding: set by lavc 814 * decoding: set by lavc
822 */ 815 */
823 AVVideoFrame *coded_picture; 816 AVFrame *coded_frame;
824 817
825 /** 818 /**
826 * debug 819 * debug
827 * encoding: set by user. 820 * encoding: set by user.
828 * decoding: set by user. 821 * decoding: set by user.
999 AVCodec *avcodec_find_decoder_by_name(const char *name); 992 AVCodec *avcodec_find_decoder_by_name(const char *name);
1000 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); 993 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
1001 994
1002 void avcodec_get_context_defaults(AVCodecContext *s); 995 void avcodec_get_context_defaults(AVCodecContext *s);
1003 AVCodecContext *avcodec_alloc_context(void); 996 AVCodecContext *avcodec_alloc_context(void);
1004 AVVideoFrame *avcodec_alloc_picture(void); 997 AVFrame *avcodec_alloc_frame(void);
1005 998
1006 int avcodec_default_get_buffer(AVCodecContext *s, AVVideoFrame *pic); 999 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
1007 void avcodec_default_release_buffer(AVCodecContext *s, AVVideoFrame *pic); 1000 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
1008 1001
1009 int avcodec_open(AVCodecContext *avctx, AVCodec *codec); 1002 int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
1010 int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples, 1003 int avcodec_decode_audio(AVCodecContext *avctx, INT16 *samples,
1011 int *frame_size_ptr, 1004 int *frame_size_ptr,
1012 UINT8 *buf, int buf_size); 1005 UINT8 *buf, int buf_size);
1013 int avcodec_decode_video(AVCodecContext *avctx, AVVideoFrame *picture, 1006 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
1014 int *got_picture_ptr, 1007 int *got_picture_ptr,
1015 UINT8 *buf, int buf_size); 1008 UINT8 *buf, int buf_size);
1016 int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata, 1009 int avcodec_parse_frame(AVCodecContext *avctx, UINT8 **pdata,
1017 int *data_size_ptr, 1010 int *data_size_ptr,
1018 UINT8 *buf, int buf_size); 1011 UINT8 *buf, int buf_size);
1019 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size, 1012 int avcodec_encode_audio(AVCodecContext *avctx, UINT8 *buf, int buf_size,
1020 const short *samples); 1013 const short *samples);
1021 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, 1014 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size,
1022 const AVVideoFrame *pict); 1015 const AVFrame *pict);
1023 1016
1024 int avcodec_close(AVCodecContext *avctx); 1017 int avcodec_close(AVCodecContext *avctx);
1025 1018
1026 void avcodec_register_all(void); 1019 void avcodec_register_all(void);
1027 1020