gpt4 book ai didi

FFmpeg, av_frame_free - 不释放 av_frame_clone 分配的所有内存

转载 作者:行者123 更新时间:2023-12-04 23:25:07 24 4
gpt4 key购买 nike

我要克隆 AVFrame .为此,我调用 av_frame_clone 功能。
然后我想释放旧 AVFrame 分配的所有内存。为此,我调用 av_frame_free 功能。 未释放数据指针的内存av_frame_free 功能。那么在 ffmpeg 中克隆和删除 AVFrame 的正确方法是什么?

感谢您的回复。

最佳答案

av_frame_clone() 的文档说:

Create a new frame that references the same data as src. This is a shortcut for av_frame_alloc()+av_frame_ref().



那些 av_frame_free() 说:

Free the frame and any dynamically allocated objects in it, e.g. extended_data. If the frame is reference counted, it will be unreferenced first.



因此,将这两个功能结合起来看起来是正确的。

原始框架会发生什么?可能它需要一个unref?

关于FFmpeg, av_frame_free - 不释放 av_frame_clone 分配的所有内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51197006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com