Hi,

I'm trying to understand avcodec_decode_video.
In particular I'd like to know if I can store the filled frame in a 
queue and decode further frames.

For example can I do something like this:

AVFrame *pFrame;
int frameFinished;

pFrame = avcodec_alloc_frame();
for(...) {
    avcodec_decode_video(codec, pFrame, &frameFinished, data, size);
    if(frameFinished)
       store_the_frame_ptr_for_later_use(pFrame);
       pFrame = avcodec_alloc_frame();
    }
}


I ask because avcodec_alloc_frame() just allocates the struct but not 
the data array. So avcodec_decode_video has to allocate the memory. Is 
that allocation done from a static buffer, which would mean I have to 
copy the frame?
If its an internal buffer, is there some way to quarantee for example, 
that I can store at least n AVFrames until the first one gets overwritten?

Thanks a lot
Stefan Klug



_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to