[Libav-user] Queuing of AVFrame
wm4
nfxjfg at googlemail.com
Fri Jul 25 18:57:52 CEST 2014
On Fri, 25 Jul 2014 03:58:38 +0300
volich at ukr.net wrote:
> Thank you for reply.
>
> frame.c:
>
> int av_frame_ref(AVFrame *dst, const AVFrame *src)
> {
> ...
>
> /* duplicate the frame data if it's not refcounted */
> if (!src->buf[0]) {
> ret = av_frame_get_buffer(dst, 32);
> if (ret < 0)
> return ret;
>
> ret = av_frame_copy(dst, src);
> if (ret < 0)
> av_frame_unref(dst);
>
> return ret;
> }
>
> ...
> }
>
> After avcodec_decode_video2 my frame is not refcounted, so call of av_frame_ref gives me copy of frame.
> I just want to my frame is refcounted. How to make this?
By default, reference counting is disabled (just for compatibility
reasons - nothing else). Set AVCodecContext.refcounted_frames to 1 to
enable it.
More information about the Libav-user
mailing list