[Ffmpeg-devel] Naming conventions

Michael Niedermayer michaelni
Tue Mar 6 13:21:36 CET 2007


Hi

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 av_


> 
> 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

iam against avc_ avu_ avf_


[...]
> * 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.
> 
> 
> What do you think?

i do prefer av_get_packet over av_packet_get as its more natural
what actually what is the advantage of type_action?

also based on this more significant name first policy you would end with
names like

AVContextCodec

and what about

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?


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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070306/d40167e4/attachment.pgp>



More information about the ffmpeg-devel mailing list