[FFmpeg-devel] On need in AVFrame accessors

Andrey Utkin andrey.krieger.utkin at gmail.com
Wed Aug 22 14:33:49 CEST 2012

2012/8/22 Nicolas George <nicolas.george at normalesup.org>:
> The direct get/set operations are forbidden

Having looked at AVFrame documentation comment, i've understood the
situation about it (although i don't like it).
But i was intrigued initially by accessor to
AVCodecContext.pkt_timebase; AVCodecContext description does not
contain same warning as AVFrame.
Of course, it is not so important issue, and thanks to Nicolas for
explanation, but i'm happy i have worded my opinion. And my opinion is
that complication is creeping :)

P.S. I would not open such topic if not necessity to copy&paste
function avpriv_set_pts_info() into muxer, which i want to compile out
of ffmpeg tree. Looking at avpriv_set_pts_info() code i have
discovered this new thing. Maybe we should make such function public
(and patch is welcome)? Or building muxers out of tree is not
supported? I remember i have built filters out of tree finely.

 * main external API structure.
 * New fields can be added to the end with minor version bumps.
 * Removal, reordering and changes to existing fields require a major
 * version bump.
 * Please use AVOptions (av_opt* / av_set/get*()) to access these
fields from user
 * applications.
 * sizeof(AVCodecContext) must not be used outside libav*.
typedef struct AVCodecContext {

MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *,

Andrey Utkin

More information about the ffmpeg-devel mailing list