[Ffmpeg-devel] Naming conventions

Diego Biurrun diego
Mon Mar 5 17:22:52 CET 2007


On Mon, Mar 05, 2007 at 04:16:16PM +0100, Panagiotis Issaris wrote:
> 
> I think all agree that all public API functions should be prefixed with
> at least "av" and possibly "av_".

I prefer the latter.

> Personally, I see various possibilities for structuring function names.
> 
> The names could in some way include:
> 
> * The name of the library: So, a prefix such as avc, avu and avf. It has
> the disadvantage that if functions are migrated to another library,
> they'll have to be renamed and thus cause ABI breakage. Libavcodec in
> some way seems to use this convention: avcodec_thread_init,
> avcodec_version, ... Libavformat and libavutil do not.

Since we have a history of moving things around, I don't think we should
use different prefixes for different libs.

> * The name of the type "it works on". Libavformat uses this for some of
> its functions: av_parser_init, av_parser_parse, av_parser_change,
> av_bitstream_filter_init, avpicture_alloc, avpicture_free, ...
> 
> * And of course the actual description of what the function does, the
> action.
> 
> How should these possibly included parts be ordered? The previously
> mentioned functionnames used the "type_action" order, but there also
> appear functions which do not use this order:
> av_init_packet, av_new_packet, av_get_packet, av_dup_packet,
> av_free_packet, ...
> 
> 
> _Personally_, I prefer the "type_action" type of names, and having all
> of them prefixed with some FFmpeg specific part, so that the chance of
> namecollisions is greatly reduced.

I prefer type_action as well.

Diego




More information about the ffmpeg-devel mailing list