【发布时间】:2015-07-15 03:34:36
【问题描述】:
我需要帮助理解 AVBuffer 和 AVFrame 之间的关系。我陷入这种困惑的原因是我正在尝试制作帧队列,并且我知道它可以通过“引用计数”来完成。
这是我的理解:
- 在 AVCondecContext 中设置 refcounted_frame = 1 可以通过 avcodec_framde_decode2() 启用引用计数/传递。
- 每次调用 avcodec_frame_decode2() 时,我都会在 AVFrame->buf 中获得一个新缓冲区。
我感到困惑的是:
- 引用的帧基本上是“以前的”AVFrame->data??
- 如果上述情况属实,我将如何引用计数的帧?我想通过 AVFrame->buf[i]?
非常感谢任何澄清。
-T
【问题讨论】:
-
这里是一个使用引用计数的例子:ffmpeg.org/doxygen/trunk/demuxing__decoding_8c_source.html