[FFmpeg-user] AVFrame extend life beyond next call to avcodec_decode_video2
Kirill Gavrilov
gavr.mail at gmail.com
Thu Aug 4 10:55:24 CEST 2011
Hi,
I would like to extend the life of AVFrame provided by decode_video beyond
> the next call to decode_video.
>
static void null_release_buffer(AVCodecContext *codec, AVFrame *pic){}
>
I'm not sure but I don't think that this could works.
Decoder probably can reuse the same buffer for next frames.
As a mentioned this strategy doesn't seems to work as the application
> crashes.
>
> Any suggestions?
>
that is an *alien* buffer. You should make a copy if you need.
On Thu, Aug 4, 2011 at 12:44 PM, Robert Nagy <ronag89 at gmail.com> wrote:
> Hi
>
> I would like to extend the life of AVFrame provided by decode_video beyond
> the next call to decode_video.
>
> I have tried overriding release_buffer and defer the release_buffer call to
> after I no longer need the buffer, however this crashes the application.
>
> e.g.
>
> static void null_release_buffer(AVCodecContext *codec, AVFrame *pic){}
>
> ...
>
> old_release_buffer = codec->release_buffer;
> codec->release_buffer = null_release_buffer;
>
> ... several decode_video calls
>
> for all frames:
> old_release_buffer(&frame);
>
> As a mentioned this strategy doesn't seems to work as the application
> crashes.
>
> Any suggestions?
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
-----------------------------------------------
Kirill Gavrilov,
Software designer.
<kirill at sview.ru>
More information about the ffmpeg-user
mailing list