[Ffmpeg-devel] Naming conventions

Robert Swain robert.swain
Tue Mar 6 14:12:51 CET 2007

Michael Niedermayer wrote:
> avpicture_get_size would that be av_picture_get_size or av_picture_size_get ?
> i think giving functions natural english names is better
> av_get_size_of_picture maybe?

av_get_picture_size would make more sense to me.

> or lets try av_set_pts_info()
> should that become av_pts_info_set() or av_info_pts_set() or
> maybe av_stream_timebase_set() ?
> none is strictly correct its type is timebase and related variables

It depends what you think is more logical - hierarchical naming or grammatical 

The grammatical seems to follow something like 

Regarding av_set_pts_info, this would suggest to me that the information being 
set pertains to pts and nothing more, that is, pts is the type and info is the 
property. I'm not sure this is what should be the case though. Similarly 
av_set_stream_timebase, the timebase is 'of' the stream, so the stream is the 
type and the timebase is the property of the thing of that type.

My conclusion for av_set_pts_info is that if info is a subset of pts then it's 
correct, else it should probably be called av_set_info_pts.

Also, I don't really like using 'type' in the above definition. At the risk of 
getting shot, I would be inclined to think of this as the following:

av_<action>_<class hierarchy>_<property>

But what do I know? :)


More information about the ffmpeg-devel mailing list