diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2018-04-20 05:30:03 +0100 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2018-06-21 16:34:06 +0100 |
commit | 7062e4dbc8240389bf64f46f527eabfc5adcd58b (patch) | |
tree | de88a476f69a6e2dfc29a32f70c633877439da3e /libavutil/hwcontext.c | |
parent | deb9a04d54045c8021816cfe019bf2bba0e9595d (diff) | |
download | ffmpeg-7062e4dbc8240389bf64f46f527eabfc5adcd58b.tar.gz |
hwcontext_internal: add ff_hwframe_map_replace
Used to fix unmapping when no direct interop exists between APIs.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r-- | libavutil/hwcontext.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index 745016ed7e..f1e404ab20 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -870,3 +870,10 @@ fail: av_buffer_unref(&dst_ref); return ret; } + +int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src) +{ + HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data; + av_frame_unref(hwmap->source); + return av_frame_ref(hwmap->source, src); +} |