1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-06-30 22:24:04 +02:00

lavc: deprecate avcodec_alloc_frame().

This commit is contained in:
Anton Khirnov
2013-11-09 10:09:21 +01:00
parent 5b9c3b4505
commit b9fb59d2ab
2 changed files with 6 additions and 5 deletions

View File

@ -3096,14 +3096,13 @@ const AVClass *avcodec_get_class(void);
*/ */
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
#if FF_API_AVFRAME_LAVC
/** /**
* Allocate an AVFrame and set its fields to default values. The resulting * @deprecated use av_frame_alloc()
* struct must be freed using avcodec_free_frame().
*
* @return An AVFrame filled with default values or NULL on failure.
* @see avcodec_get_frame_defaults
*/ */
attribute_deprecated
AVFrame *avcodec_alloc_frame(void); AVFrame *avcodec_alloc_frame(void);
#endif
/** /**
* Set the fields of the given AVFrame to default values. * Set the fields of the given AVFrame to default values.

View File

@ -815,6 +815,7 @@ void avcodec_get_frame_defaults(AVFrame *frame)
frame->extended_data = frame->data; frame->extended_data = frame->data;
} }
#if FF_API_AVFRAME_LAVC
AVFrame *avcodec_alloc_frame(void) AVFrame *avcodec_alloc_frame(void)
{ {
AVFrame *frame = av_mallocz(sizeof(AVFrame)); AVFrame *frame = av_mallocz(sizeof(AVFrame));
@ -826,6 +827,7 @@ AVFrame *avcodec_alloc_frame(void)
return frame; return frame;
} }
#endif
void avcodec_free_frame(AVFrame **frame) void avcodec_free_frame(AVFrame **frame)
{ {