[libav-api] FF_INPUT_BUFFER_PADDING_SIZE with av_read_frame
Ronald S. Bultje
rsbultje at gmail.com
Sat Mar 26 20:18:12 CET 2011
On Sat, Mar 26, 2011 at 3:00 PM, Chris Stankevitz
<chrisstankevitz at yahoo.com> wrote:
> Please identify any false statements:
> 1. I am supposed to use avcodec_decode_video2 and not avcodec_decode_video
> 2. avcodec_decode_video2 takes as input a AVPacket (and not a uint8* buffer as avcodec_decode_video does)
> 3. avcodec_decode_video2 requires "The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end."
> 4. (3) Is referring to AVPacket::buffer
> 5. I do not allocate AVPacket::buffer
> 6. somebody_else allocates AVPacket::buffer (av_read_frame?)
> 7. (3) should be adhered to by somebody_else.
> 8. I can safely ignore (3)
> 9. avcodec_decode_video2 requires "The end of the input buffer buf should be set to 0 to ensure that no overreading happens for damaged MPEG streams."
> 10. For similar reasons, I can also safely ignore (9)
All correct. If you use libav-API for all of this, libav-API takes
care of it all. It's only relevant if you manually allocated
More information about the libav-api