diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-02-25 12:59:17 +0100 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2025-03-28 14:33:08 -0300 |
commit | b306683d1228b1642a0d88a29071de5bdee999ff (patch) | |
tree | 05134719034a16ddd3e65512691b9aa468548403 /libavutil/frame.c | |
parent | d6b215052b84c4142db626907631f1bc1ffb53cc (diff) | |
download | ffmpeg-b306683d1228b1642a0d88a29071de5bdee999ff.tar.gz |
avutil/frame: Port AVFrame.private_ref to RefStruct API
This is possible without deprecation period, because said field
is documented as only for our libav* libraries and not the general
public.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index a529de7561..dcfc835626 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -19,12 +19,11 @@ #include "channel_layout.h" #include "avassert.h" #include "buffer.h" -#include "common.h" -#include "cpu.h" #include "dict.h" #include "frame.h" #include "imgutils.h" #include "mem.h" +#include "refstruct.h" #include "samplefmt.h" #include "side_data.h" #include "hwcontext.h" @@ -219,8 +218,6 @@ int av_frame_get_buffer(AVFrame *frame, int align) static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) { - int ret; - dst->pict_type = src->pict_type; dst->sample_aspect_ratio = src->sample_aspect_ratio; dst->crop_top = src->crop_top; @@ -272,9 +269,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0); } - ret = av_buffer_replace(&dst->opaque_ref, src->opaque_ref); - ret |= av_buffer_replace(&dst->private_ref, src->private_ref); - return ret; + av_refstruct_replace(&dst->private_ref, src->private_ref); + return av_buffer_replace(&dst->opaque_ref, src->opaque_ref); } int av_frame_ref(AVFrame *dst, const AVFrame *src) @@ -516,7 +512,7 @@ void av_frame_unref(AVFrame *frame) av_buffer_unref(&frame->hw_frames_ctx); av_buffer_unref(&frame->opaque_ref); - av_buffer_unref(&frame->private_ref); + av_refstruct_unref(&frame->private_ref); if (frame->extended_data != frame->data) av_freep(&frame->extended_data); |