lavu/frame: allow calling av_frame_make_writable() on non-refcounted frames

This is an easy way to make a refcounted frame from a non-refcounted
one.
This commit is contained in:
Anton Khirnov 2022-07-16 17:48:11 +02:00
parent d9cd192ddd
commit eede1d2927
4 changed files with 8 additions and 5 deletions

View File

@ -14,6 +14,11 @@ libavutil: 2021-04-27
API changes, most recent first:
2022-08-xx - xxxxxxxxxx - lavu 57.31.100 - frame.h
av_frame_make_writable() may now be called on non-refcounted
frames and will make a refcounted copy out of them.
Previously an error was returned in such cases.
2022-07-xx - xxxxxxxxx - lavc 59.40.100 - avcodec.h
Add the AV_CODEC_FLAG2_ICC_PROFILES flag to AVCodecContext, to enable
automatic reading and writing of embedded ICC profiles in image files.

View File

@ -552,9 +552,6 @@ int av_frame_make_writable(AVFrame *frame)
AVFrame tmp;
int ret;
if (!frame->buf[0])
return AVERROR(EINVAL);
if (av_frame_is_writable(frame))
return 0;

View File

@ -828,7 +828,8 @@ int av_frame_is_writable(AVFrame *frame);
* Ensure that the frame data is writable, avoiding data copy if possible.
*
* Do nothing if the frame is writable, allocate new buffers and copy the data
* if it is not.
* if it is not. Non-refcounted frames behave as non-writable, i.e. a copy
* is always made.
*
* @return 0 on success, a negative AVERROR on error.
*

View File

@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 30
#define LIBAVUTIL_VERSION_MINOR 31
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \