ffmpeg开发者文档中的命名规范

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

1 所有名字都用下划线而非以大小写来区分的骆驼命名法。当然结构体和共用体的名字用骆驼命名法来命名。

2 变量和函数的命名规范

There are the following conventions for naming variables and functions:

  • For local variables no prefix is required.
  • 1 局部变量不用带前缀
  • For file-scope variables and functions declared as static, no prefix is required.
  • 2 定义为static的文件作用域内的变量和函数不用带前缀
  • 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’.
  • 3 在文件作用域可见但是只在库内部使用的,使用ff_前缀
  • For variables and functions visible outside of file scope, used internally across multiple libraries, use avpriv_ as prefix, for example, ‘avpriv_aac_parse_header’.
  • 4 在文件作用域可见,同时跨多个库内部使用,使用avpriv_前缀
  • 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.
  • 5 除了广泛使用的av_前缀之外,每一个库有它自己的前缀和公用符号,其中libavformat库有avformat_,libavcodec库有avcodec_,libswresample库有swr_前缀等。

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.

 

转载于:https://my.oschina.net/u/1024767/blog/356579

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值