[FFmpeg-devel] [PATCH 1/6] lavfi/buffersink: add accessors for the stream properties.

wm4 nfxjfg at googlemail.com
Wed Dec 21 15:52:22 EET 2016


On Wed, 21 Dec 2016 01:56:59 +0100
Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> wrote:

> On 20.12.2016 15:46, wm4 wrote:
> > In general, replacing public fields with macro-generated accessors is
> > really just a rename. Admittedly, it removes a confusing indirection
> > (though ->inputs[0]) in this case, but in general the improvements are
> > very minor. What does it matter if whether there are 100 fields or 100
> > set/get functions?  
> 
> There are several benefits of using accessors:
>  * It is much easier to keep the ABI stable for accessor functions than
>    for public structs, because the order of members doesn't affect them.
>  * It is much easier to check which binary uses which ABI, because the
>    functions are listed in the symbols table, while checking which
>    struct member is accessed requires disassembling.
>  * Having the struct private means it can't be allocated on the stack
>    by API users, preventing problems when the struct size changes.

Acknowledged. I was talking mostly about API.


More information about the ffmpeg-devel mailing list