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.

Best regards,
Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to