avutil/frame: add av_frame_replace

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2021-08-10 18:59:59 -03:00
parent 63767b79a5
commit 01d444c077
4 changed files with 142 additions and 1 deletions

View file

@ -836,6 +836,19 @@ void av_frame_free(AVFrame **frame);
*/
int av_frame_ref(AVFrame *dst, const AVFrame *src);
/**
* Ensure the destination frame refers to the same data described by the source
* frame, either by creating a new reference for each AVBufferRef from src if
* they differ from those in dst, by allocating new buffers and copying data if
* src is not reference counted, or by unrefencing it if src is empty.
*
* Frame properties on dst will be replaced by those from src.
*
* @return 0 on success, a negative AVERROR on error. On error, dst is
* unreferenced.
*/
int av_frame_replace(AVFrame *dst, const AVFrame *src);
/**
* Create a new frame that references the same data as src.
*