[FFmpeg-devel] On need in AVFrame accessors

Andrey Utkin andrey.krieger.utkin at gmail.com
Wed Aug 22 13:55:11 CEST 2012

I've found that libavcodec has such functions constructed by macro.
They're located at avcodec.h:3060 (declarations),
libavcodec/utils.c:702 (definitions).
This code was added in April, 2012.
The reason to have them was to... ehm, likely, to make faster
accessing these fields than through av_opt_ptr, and ability to make
accessors non-trivial if needed. Still all these "access methods" are
trivial. Thus, no difference/benefit in them comparing with direct
get/set operation.
If we can have checks on setting such fields, i think better way is to
add warning in documentation of fields, instead of adding mention of
special accessor method here.
It is not that these accessors disturb me so much, i can just ignore
them if i want to. I just wonder why such thing exist in ffmpeg libs,
being pretty inconsistent to the style of these libs.
Are fields having accessors so probable to change that major version
bump on their change will hurt more than supporting accessors? I don't
think so.

Andrey Utkin

More information about the ffmpeg-devel mailing list