[FFmpeg-devel] [PATCH] vsrc_buffer.h: remove API dependency on libavcodec/AVFrame

Francesco Pretto ceztkoml at gmail.com
Mon Apr 4 00:36:53 CEST 2011

Michael Niedermayer <michaelni <at> gmx.at> writes:

> With AVFrame fields can be added, with a function like this they
> cannot.
> And i think we will want to access quite a few other fields from
> AVFrame. For example in filters to vissualize motion vectors, mb types
> and many other things

This a comment from an api user perspective: I really prefer the first Stefano's
approach (requiring buffer pointers, buffer size, width, height, pixel
The reasons are these:
- If I'm asked to provide an AVFrame, and I don't really have one, the first
questions in the mind of the api user is: how do I allocate/init an AVFrame
*properly*? Which fields of AVFrame I should fill? Which not (because maybe is
dangerous or it would lead to unexpected results)?
- The same objections stand for having a function that asks for

In short, the api would be more opaque, and libav api is already badly opaque
here and there (and it's the main reason because I'm finding it hard to use). So
in these cases, I really prefer to be asked to what the function really need to
work . If you need an "overloaded" function that accept and AVFrame or
AVFilterBufferRef, I think nothing is stopping you to define it somewhere else.


More information about the ffmpeg-devel mailing list