[FFmpeg-devel] [PATCH 0/2]: allow hwaccel vda module to manage its buffers lifetime.
Sebastien Zwickert
dilaroga at gmail.com
Thu May 23 09:14:22 CEST 2013
On May 23, 2013, at 8:29 AM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Wed, May 22, 2013 at 9:53 PM, Sebastien Zwickert <dilaroga at gmail.com> wrote:
>> This patchset fixes memory leaks of vda core video buffers while seeking.
>> It allows hwaccel modules to set a custom callback for freeing av buffers.
>> Then vda decoder can flush correctly dropped frames.
>>
>> Thanks to Xidorn Quan who gives me good feebacks about the patch I shared
>> with him in private.
>>
>> Sebastien Zwickert (2):
>> hwaccel: allow to set a user-defined callback for releasing private
>> av buffer.
>> vda: use hwaccel custom callback for releasing private picture
>> context.
>>
>> libavcodec/avcodec.h | 12 ++++++++++++
>> libavcodec/h264.c | 9 ++++++++-
>> libavcodec/mpegvideo.c | 9 ++++++++-
>> libavcodec/vda.h | 12 +++++++++++-
>> libavcodec/vda_h264.c | 18 ++++++++++++++++++
>> 5 files changed, 57 insertions(+), 3 deletions(-)
>>
>> --
>> 1.7.9.6 (Apple Git-31.1)
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> You set frame->data[3] to the same buffer that needs freeing, why not
> simply also set frame->buf appropriately to a AVBufferRef you create,
> so that it gets free'ed with a callback there?
> No extra release buffer callback needed from where i stand.
I'm not sure to understand correctly but the vda buffer is part of
Core Video SDK which is based on a ref counted memory management
and must be released with CVPixelBufferRelease().
So custom callback for freeing Core Video types is necessary.
More information about the ffmpeg-devel
mailing list