All names should be composed with underscores (_), not CamelCase. For example, ‘avfilter_get_video_buffer’ is an acceptable function name and ‘AVFilterGetVideo’ is not. The exception from this are type names, like for example structs and enums; they should always be in the CamelCase
There are the following conventions for naming variables and functions:
- For local variables no prefix is required.
- For file-scope variables and functions declared as static, no prefix is required.
- For variables and functions visible outside of file scope, but only used internally by a library, an ff_ prefix should be used, e.g. ‘ff_w64_demuxer’.
- For variables and functions visible outside of file scope, used internally across multiple libraries, use avpriv_ as prefix, for example, ‘avpriv_aac_parse_header’.
- Each library has its own prefix for public symbols, in addition to the commonly used av_ (avformat_ for libavformat, avcodec_ for libavcodec, swr_ for libswresample, etc). Check the existing code and choose names accordingly. Note that some symbols without these prefixes are also exported for retro-compatibility reasons. These exceptions are declared in the lib<name>/lib<name>.v files.
Furthermore, name space reserved for the system should not be invaded. Identifiers ending in _t are reserved by POSIX. Also avoid names starting with __ or _followed by an uppercase letter as they are reserved by the C standard. Names starting with _ are reserved at the file level and may not be used for externally visible symbols. If in doubt, just avoid names starting with _ altogether.