Mercurial > libavcodec.hg
comparison utils.c @ 925:7fccaa0d699d libavcodec
AVVideoFrame -> AVFrame
author | michaelni |
---|---|
date | Mon, 09 Dec 2002 12:03:43 +0000 |
parents | 3814e9115672 |
children | 60241e4290e3 |
comparison
equal
deleted
inserted
replaced
924:3814e9115672 | 925:7fccaa0d699d |
---|---|
118 typedef struct DefaultPicOpaque{ | 118 typedef struct DefaultPicOpaque{ |
119 int last_pic_num; | 119 int last_pic_num; |
120 uint8_t *data[4]; | 120 uint8_t *data[4]; |
121 }DefaultPicOpaque; | 121 }DefaultPicOpaque; |
122 | 122 |
123 int avcodec_default_get_buffer(AVCodecContext *s, AVVideoFrame *pic){ | 123 int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ |
124 int i; | 124 int i; |
125 const int width = s->width; | 125 const int width = s->width; |
126 const int height= s->height; | 126 const int height= s->height; |
127 DefaultPicOpaque *opaque; | 127 DefaultPicOpaque *opaque; |
128 | 128 |
200 } | 200 } |
201 | 201 |
202 return 0; | 202 return 0; |
203 } | 203 } |
204 | 204 |
205 void avcodec_default_release_buffer(AVCodecContext *s, AVVideoFrame *pic){ | 205 void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){ |
206 int i; | 206 int i; |
207 | 207 |
208 assert(pic->type==FF_BUFFER_TYPE_INTERNAL); | 208 assert(pic->type==FF_BUFFER_TYPE_INTERNAL); |
209 | 209 |
210 for(i=0; i<3; i++) | 210 for(i=0; i<3; i++) |
247 | 247 |
248 return avctx; | 248 return avctx; |
249 } | 249 } |
250 | 250 |
251 /** | 251 /** |
252 * allocates a AVPicture and set it to defaults. | 252 * allocates a AVPFrame and set it to defaults. |
253 * this can be deallocated by simply calling free() | 253 * this can be deallocated by simply calling free() |
254 */ | 254 */ |
255 AVVideoFrame *avcodec_alloc_picture(void){ | 255 AVFrame *avcodec_alloc_frame(void){ |
256 AVVideoFrame *pic= av_mallocz(sizeof(AVVideoFrame)); | 256 AVFrame *pic= av_mallocz(sizeof(AVFrame)); |
257 | 257 |
258 return pic; | 258 return pic; |
259 } | 259 } |
260 | 260 |
261 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) | 261 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) |
288 avctx->frame_number++; | 288 avctx->frame_number++; |
289 return ret; | 289 return ret; |
290 } | 290 } |
291 | 291 |
292 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, | 292 int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, |
293 const AVVideoFrame *pict) | 293 const AVFrame *pict) |
294 { | 294 { |
295 int ret; | 295 int ret; |
296 | 296 |
297 ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict); | 297 ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict); |
298 | 298 |
303 } | 303 } |
304 | 304 |
305 /* decode a frame. return -1 if error, otherwise return the number of | 305 /* decode a frame. return -1 if error, otherwise return the number of |
306 bytes used. If no frame could be decompressed, *got_picture_ptr is | 306 bytes used. If no frame could be decompressed, *got_picture_ptr is |
307 zero. Otherwise, it is non zero */ | 307 zero. Otherwise, it is non zero */ |
308 int avcodec_decode_video(AVCodecContext *avctx, AVVideoFrame *picture, | 308 int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture, |
309 int *got_picture_ptr, | 309 int *got_picture_ptr, |
310 UINT8 *buf, int buf_size) | 310 UINT8 *buf, int buf_size) |
311 { | 311 { |
312 int ret; | 312 int ret; |
313 | 313 |
670 case CODEC_ID_H263I: | 670 case CODEC_ID_H263I: |
671 case CODEC_ID_SVQ1: | 671 case CODEC_ID_SVQ1: |
672 for(i=0; i<MAX_PICTURE_COUNT; i++){ | 672 for(i=0; i<MAX_PICTURE_COUNT; i++){ |
673 if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL | 673 if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL |
674 || s->picture[i].type == FF_BUFFER_TYPE_USER)) | 674 || s->picture[i].type == FF_BUFFER_TYPE_USER)) |
675 avctx->release_buffer(avctx, (AVVideoFrame*)&s->picture[i]); | 675 avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]); |
676 } | 676 } |
677 break; | 677 break; |
678 default: | 678 default: |
679 //FIXME | 679 //FIXME |
680 break; | 680 break; |