developer.html 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. Developer Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. Developer Documentation
  17. </h1>
  18. <div class="top-level-extent" id="SEC_Top">
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Notes-for-external-developers" href="#Notes-for-external-developers">1 Notes for external developers</a></li>
  24. <li><a id="toc-Contributing" href="#Contributing">2 Contributing</a></li>
  25. <li><a id="toc-Coding-Rules-1" href="#Coding-Rules-1">3 Coding Rules</a>
  26. <ul class="toc-numbered-mark">
  27. <li><a id="toc-Code-formatting-conventions" href="#Code-formatting-conventions">3.1 Code formatting conventions</a></li>
  28. <li><a id="toc-Comments" href="#Comments">3.2 Comments</a></li>
  29. <li><a id="toc-C-language-features" href="#C-language-features">3.3 C language features</a></li>
  30. <li><a id="toc-Naming-conventions" href="#Naming-conventions">3.4 Naming conventions</a></li>
  31. <li><a id="toc-Miscellaneous-conventions" href="#Miscellaneous-conventions">3.5 Miscellaneous conventions</a></li>
  32. <li><a id="toc-Editor-configuration" href="#Editor-configuration">3.6 Editor configuration</a></li>
  33. </ul></li>
  34. <li><a id="toc-Development-Policy" href="#Development-Policy">4 Development Policy</a>
  35. <ul class="toc-numbered-mark">
  36. <li><a id="toc-Patches_002fCommitting" href="#Patches_002fCommitting">4.1 Patches/Committing</a></li>
  37. <li><a id="toc-Code" href="#Code">4.2 Code</a></li>
  38. <li><a id="toc-Documentation_002fOther" href="#Documentation_002fOther">4.3 Documentation/Other</a></li>
  39. </ul></li>
  40. <li><a id="toc-Code-of-conduct" href="#Code-of-conduct">5 Code of conduct</a></li>
  41. <li><a id="toc-Submitting-patches-1" href="#Submitting-patches-1">6 Submitting patches</a></li>
  42. <li><a id="toc-New-codecs-or-formats-checklist" href="#New-codecs-or-formats-checklist">7 New codecs or formats checklist</a></li>
  43. <li><a id="toc-Patch-submission-checklist" href="#Patch-submission-checklist">8 Patch submission checklist</a></li>
  44. <li><a id="toc-Patch-review-process" href="#Patch-review-process">9 Patch review process</a></li>
  45. <li><a id="toc-Regression-tests-1" href="#Regression-tests-1">10 Regression tests</a>
  46. <ul class="toc-numbered-mark">
  47. <li><a id="toc-Adding-files-to-the-fate_002dsuite-dataset" href="#Adding-files-to-the-fate_002dsuite-dataset">10.1 Adding files to the fate-suite dataset</a></li>
  48. <li><a id="toc-Visualizing-Test-Coverage" href="#Visualizing-Test-Coverage">10.2 Visualizing Test Coverage</a></li>
  49. <li><a id="toc-Using-Valgrind" href="#Using-Valgrind">10.3 Using Valgrind</a></li>
  50. </ul></li>
  51. <li><a id="toc-Release-process-1" href="#Release-process-1">11 Release process</a>
  52. <ul class="toc-numbered-mark">
  53. <li><a id="toc-Criteria-for-Point-Releases-1" href="#Criteria-for-Point-Releases-1">11.1 Criteria for Point Releases</a></li>
  54. <li><a id="toc-Release-Checklist" href="#Release-Checklist">11.2 Release Checklist</a></li>
  55. </ul></li>
  56. </ul>
  57. </div>
  58. </div>
  59. <ul class="mini-toc">
  60. <li><a href="#Notes-for-external-developers" accesskey="1">Notes for external developers</a></li>
  61. <li><a href="#Contributing" accesskey="2">Contributing</a></li>
  62. <li><a href="#Coding-Rules-1" accesskey="3">Coding Rules</a></li>
  63. <li><a href="#Development-Policy" accesskey="4">Development Policy</a></li>
  64. <li><a href="#Code-of-conduct" accesskey="5">Code of conduct</a></li>
  65. <li><a href="#Submitting-patches-1" accesskey="6">Submitting patches</a></li>
  66. <li><a href="#New-codecs-or-formats-checklist" accesskey="7">New codecs or formats checklist</a></li>
  67. <li><a href="#Patch-submission-checklist" accesskey="8">Patch submission checklist</a></li>
  68. <li><a href="#Patch-review-process" accesskey="9">Patch review process</a></li>
  69. <li><a href="#Regression-tests-1">Regression tests</a></li>
  70. <li><a href="#Release-process-1">Release process</a></li>
  71. </ul>
  72. <div class="chapter-level-extent" id="Notes-for-external-developers">
  73. <h2 class="chapter"><span>1 Notes for external developers<a class="copiable-link" href="#Notes-for-external-developers"> &para;</a></span></h2>
  74. <p>This document is mostly useful for internal FFmpeg developers.
  75. External developers who need to use the API in their application should
  76. refer to the API doxygen documentation in the public headers, and
  77. check the examples in <samp class="file">doc/examples</samp> and in the source code to
  78. see how the public API is employed.
  79. </p>
  80. <p>You can use the FFmpeg libraries in your commercial program, but you
  81. are encouraged to <em class="emph">publish any patch you make</em>. In this case the
  82. best way to proceed is to send your patches to the ffmpeg-devel
  83. mailing list following the guidelines illustrated in the remainder of
  84. this document.
  85. </p>
  86. <p>For more detailed legal information about the use of FFmpeg in
  87. external programs read the <samp class="file">LICENSE</samp> file in the source tree and
  88. consult <a class="url" href="https://ffmpeg.org/legal.html">https://ffmpeg.org/legal.html</a>.
  89. </p>
  90. </div>
  91. <div class="chapter-level-extent" id="Contributing">
  92. <h2 class="chapter"><span>2 Contributing<a class="copiable-link" href="#Contributing"> &para;</a></span></h2>
  93. <p>There are 2 ways by which code gets into FFmpeg:
  94. </p><ul class="itemize mark-bullet">
  95. <li>Submitting patches to the ffmpeg-devel mailing list.
  96. See <a class="ref" href="#Submitting-patches">Submitting patches</a> for details.
  97. </li><li>Directly committing changes to the main tree.
  98. </li></ul>
  99. <p>Whichever way, changes should be reviewed by the maintainer of the code
  100. before they are committed. And they should follow the <a class="ref" href="#Coding-Rules">Coding Rules</a>.
  101. The developer making the commit and the author are responsible for their changes
  102. and should try to fix issues their commit causes.
  103. </p>
  104. <a class="anchor" id="Coding-Rules"></a></div>
  105. <div class="chapter-level-extent" id="Coding-Rules-1">
  106. <h2 class="chapter"><span>3 Coding Rules<a class="copiable-link" href="#Coding-Rules-1"> &para;</a></span></h2>
  107. <ul class="mini-toc">
  108. <li><a href="#Code-formatting-conventions" accesskey="1">Code formatting conventions</a></li>
  109. <li><a href="#Comments" accesskey="2">Comments</a></li>
  110. <li><a href="#C-language-features" accesskey="3">C language features</a></li>
  111. <li><a href="#Naming-conventions" accesskey="4">Naming conventions</a></li>
  112. <li><a href="#Miscellaneous-conventions" accesskey="5">Miscellaneous conventions</a></li>
  113. <li><a href="#Editor-configuration" accesskey="6">Editor configuration</a></li>
  114. </ul>
  115. <div class="section-level-extent" id="Code-formatting-conventions">
  116. <h3 class="section"><span>3.1 Code formatting conventions<a class="copiable-link" href="#Code-formatting-conventions"> &para;</a></span></h3>
  117. <p>There are the following guidelines regarding the indentation in files:
  118. </p>
  119. <ul class="itemize mark-bullet">
  120. <li>Indent size is 4.
  121. </li><li>The TAB character is forbidden outside of Makefiles as is any
  122. form of trailing whitespace. Commits containing either will be
  123. rejected by the git repository.
  124. </li><li>You should try to limit your code lines to 80 characters; however, do so if
  125. and only if this improves readability.
  126. </li><li>K&amp;R coding style is used.
  127. </li></ul>
  128. <p>The presentation is one inspired by &rsquo;indent -i4 -kr -nut&rsquo;.
  129. </p>
  130. <p>The main priority in FFmpeg is simplicity and small code size in order to
  131. minimize the bug count.
  132. </p>
  133. </div>
  134. <div class="section-level-extent" id="Comments">
  135. <h3 class="section"><span>3.2 Comments<a class="copiable-link" href="#Comments"> &para;</a></span></h3>
  136. <p>Use the JavaDoc/Doxygen format (see examples below) so that code documentation
  137. can be generated automatically. All nontrivial functions should have a comment
  138. above them explaining what the function does, even if it is just one sentence.
  139. All structures and their member variables should be documented, too.
  140. </p>
  141. <p>Avoid Qt-style and similar Doxygen syntax with <code class="code">!</code> in it, i.e. replace
  142. <code class="code">//!</code> with <code class="code">///</code> and similar. Also @ syntax should be employed
  143. for markup commands, i.e. use <code class="code">@param</code> and not <code class="code">\param</code>.
  144. </p>
  145. <div class="example">
  146. <pre class="example-preformatted">/**
  147. * @file
  148. * MPEG codec.
  149. * @author ...
  150. */
  151. /**
  152. * Summary sentence.
  153. * more text ...
  154. * ...
  155. */
  156. typedef struct Foobar {
  157. int var1; /**&lt; var1 description */
  158. int var2; ///&lt; var2 description
  159. /** var3 description */
  160. int var3;
  161. } Foobar;
  162. /**
  163. * Summary sentence.
  164. * more text ...
  165. * ...
  166. * @param my_parameter description of my_parameter
  167. * @return return value description
  168. */
  169. int myfunc(int my_parameter)
  170. ...
  171. </pre></div>
  172. </div>
  173. <div class="section-level-extent" id="C-language-features">
  174. <h3 class="section"><span>3.3 C language features<a class="copiable-link" href="#C-language-features"> &para;</a></span></h3>
  175. <p>FFmpeg is programmed in the ISO C90 language with a few additional
  176. features from ISO C99, namely:
  177. </p>
  178. <ul class="itemize mark-bullet">
  179. <li>the &lsquo;<samp class="samp">inline</samp>&rsquo; keyword;
  180. </li><li>&lsquo;<samp class="samp">//</samp>&rsquo; comments;
  181. </li><li>designated struct initializers (&lsquo;<samp class="samp">struct s x = { .i = 17 };</samp>&rsquo;);
  182. </li><li>compound literals (&lsquo;<samp class="samp">x = (struct s) { 17, 23 };</samp>&rsquo;).
  183. </li><li>for loops with variable definition (&lsquo;<samp class="samp">for (int i = 0; i &lt; 8; i++)</samp>&rsquo;);
  184. </li><li>Variadic macros (&lsquo;<samp class="samp">#define ARRAY(nb, ...) (int[nb + 1]){ nb, __VA_ARGS__ }</samp>&rsquo;);
  185. </li><li>Implementation defined behavior for signed integers is assumed to match the
  186. expected behavior for two&rsquo;s complement. Non representable values in integer
  187. casts are binary truncated. Shift right of signed values uses sign extension.
  188. </li></ul>
  189. <p>These features are supported by all compilers we care about, so we will not
  190. accept patches to remove their use unless they absolutely do not impair
  191. clarity and performance.
  192. </p>
  193. <p>All code must compile with recent versions of GCC and a number of other
  194. currently supported compilers. To ensure compatibility, please do not use
  195. additional C99 features or GCC extensions. Especially watch out for:
  196. </p>
  197. <ul class="itemize mark-bullet">
  198. <li>mixing statements and declarations;
  199. </li><li>&lsquo;<samp class="samp">long long</samp>&rsquo; (use &lsquo;<samp class="samp">int64_t</samp>&rsquo; instead);
  200. </li><li>&lsquo;<samp class="samp">__attribute__</samp>&rsquo; not protected by &lsquo;<samp class="samp">#ifdef __GNUC__</samp>&rsquo; or similar;
  201. </li><li>GCC statement expressions (&lsquo;<samp class="samp">(x = ({ int y = 4; y; })</samp>&rsquo;).
  202. </li></ul>
  203. </div>
  204. <div class="section-level-extent" id="Naming-conventions">
  205. <h3 class="section"><span>3.4 Naming conventions<a class="copiable-link" href="#Naming-conventions"> &para;</a></span></h3>
  206. <p>All names should be composed with underscores (_), not CamelCase. For example,
  207. &lsquo;<samp class="samp">avfilter_get_video_buffer</samp>&rsquo; is an acceptable function name and
  208. &lsquo;<samp class="samp">AVFilterGetVideo</samp>&rsquo; is not. The exception from this are type names, like
  209. for example structs and enums; they should always be in CamelCase.
  210. </p>
  211. <p>There are the following conventions for naming variables and functions:
  212. </p>
  213. <ul class="itemize mark-bullet">
  214. <li>For local variables no prefix is required.
  215. </li><li>For file-scope variables and functions declared as <code class="code">static</code>, no prefix
  216. is required.
  217. </li><li>For variables and functions visible outside of file scope, but only used
  218. internally by a library, an <code class="code">ff_</code> prefix should be used,
  219. e.g. &lsquo;<samp class="samp">ff_w64_demuxer</samp>&rsquo;.
  220. </li><li>For variables and functions visible outside of file scope, used internally
  221. across multiple libraries, use <code class="code">avpriv_</code> as prefix, for example,
  222. &lsquo;<samp class="samp">avpriv_report_missing_feature</samp>&rsquo;.
  223. </li><li>Each library has its own prefix for public symbols, in addition to the
  224. commonly used <code class="code">av_</code> (<code class="code">avformat_</code> for libavformat,
  225. <code class="code">avcodec_</code> for libavcodec, <code class="code">swr_</code> for libswresample, etc).
  226. Check the existing code and choose names accordingly.
  227. Note that some symbols without these prefixes are also exported for
  228. retro-compatibility reasons. These exceptions are declared in the
  229. <code class="code">lib&lt;name&gt;/lib&lt;name&gt;.v</code> files.
  230. </li></ul>
  231. <p>Furthermore, name space reserved for the system should not be invaded.
  232. Identifiers ending in <code class="code">_t</code> are reserved by
  233. <a class="url" href="http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html#tag_02_02_02">POSIX</a>.
  234. Also avoid names starting with <code class="code">__</code> or <code class="code">_</code> followed by an uppercase
  235. letter as they are reserved by the C standard. Names starting with <code class="code">_</code>
  236. are reserved at the file level and may not be used for externally visible
  237. symbols. If in doubt, just avoid names starting with <code class="code">_</code> altogether.
  238. </p>
  239. </div>
  240. <div class="section-level-extent" id="Miscellaneous-conventions">
  241. <h3 class="section"><span>3.5 Miscellaneous conventions<a class="copiable-link" href="#Miscellaneous-conventions"> &para;</a></span></h3>
  242. <ul class="itemize mark-bullet">
  243. <li>fprintf and printf are forbidden in libavformat and libavcodec,
  244. please use av_log() instead.
  245. </li><li>Casts should be used only when necessary. Unneeded parentheses
  246. should also be avoided if they don&rsquo;t make the code easier to understand.
  247. </li></ul>
  248. </div>
  249. <div class="section-level-extent" id="Editor-configuration">
  250. <h3 class="section"><span>3.6 Editor configuration<a class="copiable-link" href="#Editor-configuration"> &para;</a></span></h3>
  251. <p>In order to configure Vim to follow FFmpeg formatting conventions, paste
  252. the following snippet into your <samp class="file">.vimrc</samp>:
  253. </p><div class="example">
  254. <pre class="example-preformatted">&quot; indentation rules for FFmpeg: 4 spaces, no tabs
  255. set expandtab
  256. set shiftwidth=4
  257. set softtabstop=4
  258. set cindent
  259. set cinoptions=(0
  260. &quot; Allow tabs in Makefiles.
  261. autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
  262. &quot; Trailing whitespace and tabs are forbidden, so highlight them.
  263. highlight ForbiddenWhitespace ctermbg=red guibg=red
  264. match ForbiddenWhitespace /\s\+$\|\t/
  265. &quot; Do not highlight spaces at the end of line while typing on that line.
  266. autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@&lt;!$/
  267. </pre></div>
  268. <p>For Emacs, add these roughly equivalent lines to your <samp class="file">.emacs.d/init.el</samp>:
  269. </p><div class="example lisp">
  270. <pre class="lisp-preformatted">(c-add-style &quot;ffmpeg&quot;
  271. '(&quot;k&amp;r&quot;
  272. (c-basic-offset . 4)
  273. (indent-tabs-mode . nil)
  274. (show-trailing-whitespace . t)
  275. (c-offsets-alist
  276. (statement-cont . (c-lineup-assignments +)))
  277. )
  278. )
  279. (setq c-default-style &quot;ffmpeg&quot;)
  280. </pre></div>
  281. </div>
  282. </div>
  283. <div class="chapter-level-extent" id="Development-Policy">
  284. <h2 class="chapter"><span>4 Development Policy<a class="copiable-link" href="#Development-Policy"> &para;</a></span></h2>
  285. <ul class="mini-toc">
  286. <li><a href="#Patches_002fCommitting" accesskey="1">Patches/Committing</a></li>
  287. <li><a href="#Code" accesskey="2">Code</a></li>
  288. <li><a href="#Documentation_002fOther" accesskey="3">Documentation/Other</a></li>
  289. </ul>
  290. <div class="section-level-extent" id="Patches_002fCommitting">
  291. <h3 class="section"><span>4.1 Patches/Committing<a class="copiable-link" href="#Patches_002fCommitting"> &para;</a></span></h3>
  292. <h4 class="subheading" id="Licenses-for-patches-must-be-compatible-with-FFmpeg_002e"><span>Licenses for patches must be compatible with FFmpeg.<a class="copiable-link" href="#Licenses-for-patches-must-be-compatible-with-FFmpeg_002e"> &para;</a></span></h4>
  293. <p>Contributions should be licensed under the
  294. <a class="uref" href="http://www.gnu.org/licenses/lgpl-2.1.html">LGPL 2.1</a>,
  295. including an &quot;or any later version&quot; clause, or, if you prefer
  296. a gift-style license, the
  297. <a class="uref" href="http://opensource.org/licenses/isc-license.txt">ISC</a> or
  298. <a class="uref" href="http://mit-license.org/">MIT</a> license.
  299. <a class="uref" href="http://www.gnu.org/licenses/gpl-2.0.html">GPL 2</a> including
  300. an &quot;or any later version&quot; clause is also acceptable, but LGPL is
  301. preferred.
  302. If you add a new file, give it a proper license header. Do not copy and
  303. paste it from a random place, use an existing file as template.
  304. </p>
  305. <h4 class="subheading" id="You-must-not-commit-code-which-breaks-FFmpeg_0021"><span>You must not commit code which breaks FFmpeg!<a class="copiable-link" href="#You-must-not-commit-code-which-breaks-FFmpeg_0021"> &para;</a></span></h4>
  306. <p>This means unfinished code which is enabled and breaks compilation,
  307. or compiles but does not work/breaks the regression tests. Code which
  308. is unfinished but disabled may be permitted under-circumstances, like
  309. missing samples or an implementation with a small subset of features.
  310. Always check the mailing list for any reviewers with issues and test
  311. FATE before you push.
  312. </p>
  313. <h4 class="subheading" id="Keep-the-main-commit-message-short-with-an-extended-description-below_002e"><span>Keep the main commit message short with an extended description below.<a class="copiable-link" href="#Keep-the-main-commit-message-short-with-an-extended-description-below_002e"> &para;</a></span></h4>
  314. <p>The commit message should have a short first line in the form of
  315. a &lsquo;<samp class="samp">topic: short description</samp>&rsquo; as a header, separated by a newline
  316. from the body consisting of an explanation of why the change is necessary.
  317. If the commit fixes a known bug on the bug tracker, the commit message
  318. should include its bug ID. Referring to the issue on the bug tracker does
  319. not exempt you from writing an excerpt of the bug in the commit message.
  320. </p>
  321. <h4 class="subheading" id="Testing-must-be-adequate-but-not-excessive_002e"><span>Testing must be adequate but not excessive.<a class="copiable-link" href="#Testing-must-be-adequate-but-not-excessive_002e"> &para;</a></span></h4>
  322. <p>If it works for you, others, and passes FATE then it should be OK to commit
  323. it, provided it fits the other committing criteria. You should not worry about
  324. over-testing things. If your code has problems (portability, triggers
  325. compiler bugs, unusual environment etc) they will be reported and eventually
  326. fixed.
  327. </p>
  328. <h4 class="subheading" id="Do-not-commit-unrelated-changes-together_002e"><span>Do not commit unrelated changes together.<a class="copiable-link" href="#Do-not-commit-unrelated-changes-together_002e"> &para;</a></span></h4>
  329. <p>They should be split them into self-contained pieces. Also do not forget
  330. that if part B depends on part A, but A does not depend on B, then A can
  331. and should be committed first and separate from B. Keeping changes well
  332. split into self-contained parts makes reviewing and understanding them on
  333. the commit log mailing list easier. This also helps in case of debugging
  334. later on.
  335. Also if you have doubts about splitting or not splitting, do not hesitate to
  336. ask/discuss it on the developer mailing list.
  337. </p>
  338. <h4 class="subheading" id="Ask-before-you-change-the-build-system-_0028configure_002c-etc_0029_002e"><span>Ask before you change the build system (configure, etc).<a class="copiable-link" href="#Ask-before-you-change-the-build-system-_0028configure_002c-etc_0029_002e"> &para;</a></span></h4>
  339. <p>Do not commit changes to the build system (Makefiles, configure script)
  340. which change behavior, defaults etc, without asking first. The same
  341. applies to compiler warning fixes, trivial looking fixes and to code
  342. maintained by other developers. We usually have a reason for doing things
  343. the way we do. Send your changes as patches to the ffmpeg-devel mailing
  344. list, and if the code maintainers say OK, you may commit. This does not
  345. apply to files you wrote and/or maintain.
  346. </p>
  347. <h4 class="subheading" id="Cosmetic-changes-should-be-kept-in-separate-patches_002e"><span>Cosmetic changes should be kept in separate patches.<a class="copiable-link" href="#Cosmetic-changes-should-be-kept-in-separate-patches_002e"> &para;</a></span></h4>
  348. <p>We refuse source indentation and other cosmetic changes if they are mixed
  349. with functional changes, such commits will be rejected and removed. Every
  350. developer has his own indentation style, you should not change it. Of course
  351. if you (re)write something, you can use your own style, even though we would
  352. prefer if the indentation throughout FFmpeg was consistent (Many projects
  353. force a given indentation style - we do not.). If you really need to make
  354. indentation changes (try to avoid this), separate them strictly from real
  355. changes.
  356. </p>
  357. <p>NOTE: If you had to put if(){ .. } over a large (&gt; 5 lines) chunk of code,
  358. then either do NOT change the indentation of the inner part within (do not
  359. move it to the right)! or do so in a separate commit
  360. </p>
  361. <h4 class="subheading" id="Commit-messages-should-always-be-filled-out-properly_002e"><span>Commit messages should always be filled out properly.<a class="copiable-link" href="#Commit-messages-should-always-be-filled-out-properly_002e"> &para;</a></span></h4>
  362. <p>Always fill out the commit log message. Describe in a few lines what you
  363. changed and why. You can refer to mailing list postings if you fix a
  364. particular bug. Comments such as &quot;fixed!&quot; or &quot;Changed it.&quot; are unacceptable.
  365. Recommended format:
  366. </p>
  367. <div class="example">
  368. <pre class="example-preformatted">area changed: Short 1 line description
  369. details describing what and why and giving references.
  370. </pre></div>
  371. <h4 class="subheading" id="Credit-the-author-of-the-patch_002e"><span>Credit the author of the patch.<a class="copiable-link" href="#Credit-the-author-of-the-patch_002e"> &para;</a></span></h4>
  372. <p>Make sure the author of the commit is set correctly. (see git commit &ndash;author)
  373. If you apply a patch, send an
  374. answer to ffmpeg-devel (or wherever you got the patch from) saying that
  375. you applied the patch.
  376. </p>
  377. <h4 class="subheading" id="Complex-patches-should-refer-to-discussion-surrounding-them_002e"><span>Complex patches should refer to discussion surrounding them.<a class="copiable-link" href="#Complex-patches-should-refer-to-discussion-surrounding-them_002e"> &para;</a></span></h4>
  378. <p>When applying patches that have been discussed (at length) on the mailing
  379. list, reference the thread in the log message.
  380. </p>
  381. <h4 class="subheading" id="Always-wait-long-enough-before-pushing-changes"><span>Always wait long enough before pushing changes<a class="copiable-link" href="#Always-wait-long-enough-before-pushing-changes"> &para;</a></span></h4>
  382. <p>Do NOT commit to code actively maintained by others without permission.
  383. Send a patch to ffmpeg-devel. If no one answers within a reasonable
  384. time-frame (12h for build failures and security fixes, 3 days small changes,
  385. 1 week for big patches) then commit your patch if you think it is OK.
  386. Also note, the maintainer can simply ask for more time to review!
  387. </p>
  388. </div>
  389. <div class="section-level-extent" id="Code">
  390. <h3 class="section"><span>4.2 Code<a class="copiable-link" href="#Code"> &para;</a></span></h3>
  391. <h4 class="subheading" id="API_002fABI-changes-should-be-discussed-before-they-are-made_002e"><span>API/ABI changes should be discussed before they are made.<a class="copiable-link" href="#API_002fABI-changes-should-be-discussed-before-they-are-made_002e"> &para;</a></span></h4>
  392. <p>Do not change behavior of the programs (renaming options etc) or public
  393. API or ABI without first discussing it on the ffmpeg-devel mailing list.
  394. Do not remove widely used functionality or features (redundant code can be removed).
  395. </p>
  396. <h4 class="subheading" id="Remember-to-check-if-you-need-to-bump-versions-for-libav_002a_002e"><span>Remember to check if you need to bump versions for libav*.<a class="copiable-link" href="#Remember-to-check-if-you-need-to-bump-versions-for-libav_002a_002e"> &para;</a></span></h4>
  397. <p>Depending on the change, you may need to change the version integer.
  398. Incrementing the first component means no backward compatibility to
  399. previous versions (e.g. removal of a function from the public API).
  400. Incrementing the second component means backward compatible change
  401. (e.g. addition of a function to the public API or extension of an
  402. existing data structure).
  403. Incrementing the third component means a noteworthy binary compatible
  404. change (e.g. encoder bug fix that matters for the decoder). The third
  405. component always starts at 100 to distinguish FFmpeg from Libav.
  406. </p>
  407. <h4 class="subheading" id="Warnings-for-correct-code-may-be-disabled-if-there-is-no-other-option_002e"><span>Warnings for correct code may be disabled if there is no other option.<a class="copiable-link" href="#Warnings-for-correct-code-may-be-disabled-if-there-is-no-other-option_002e"> &para;</a></span></h4>
  408. <p>Compiler warnings indicate potential bugs or code with bad style. If a type of
  409. warning always points to correct and clean code, that warning should
  410. be disabled, not the code changed.
  411. Thus the remaining warnings can either be bugs or correct code.
  412. If it is a bug, the bug has to be fixed. If it is not, the code should
  413. be changed to not generate a warning unless that causes a slowdown
  414. or obfuscates the code.
  415. </p>
  416. <h4 class="subheading" id="Check-untrusted-input-properly_002e"><span>Check untrusted input properly.<a class="copiable-link" href="#Check-untrusted-input-properly_002e"> &para;</a></span></h4>
  417. <p>Never write to unallocated memory, never write over the end of arrays,
  418. always check values read from some untrusted source before using them
  419. as array index or other risky things.
  420. </p>
  421. </div>
  422. <div class="section-level-extent" id="Documentation_002fOther">
  423. <h3 class="section"><span>4.3 Documentation/Other<a class="copiable-link" href="#Documentation_002fOther"> &para;</a></span></h3>
  424. <h4 class="subheading" id="Subscribe-to-the-ffmpeg_002ddevel-mailing-list_002e"><span>Subscribe to the ffmpeg-devel mailing list.<a class="copiable-link" href="#Subscribe-to-the-ffmpeg_002ddevel-mailing-list_002e"> &para;</a></span></h4>
  425. <p>It is important to be subscribed to the
  426. <a class="uref" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel">ffmpeg-devel</a>
  427. mailing list. Almost any non-trivial patch is to be sent there for review.
  428. Other developers may have comments about your contribution. We expect you see
  429. those comments, and to improve it if requested. (N.B. Experienced committers
  430. have other channels, and may sometimes skip review for trivial fixes.) Also,
  431. discussion here about bug fixes and FFmpeg improvements by other developers may
  432. be helpful information for you. Finally, by being a list subscriber, your
  433. contribution will be posted immediately to the list, without the moderation
  434. hold which messages from non-subscribers experience.
  435. </p>
  436. <p>However, it is more important to the project that we receive your patch than
  437. that you be subscribed to the ffmpeg-devel list. If you have a patch, and don&rsquo;t
  438. want to subscribe and discuss the patch, then please do send it to the list
  439. anyway.
  440. </p>
  441. <h4 class="subheading" id="Subscribe-to-the-ffmpeg_002dcvslog-mailing-list_002e"><span>Subscribe to the ffmpeg-cvslog mailing list.<a class="copiable-link" href="#Subscribe-to-the-ffmpeg_002dcvslog-mailing-list_002e"> &para;</a></span></h4>
  442. <p>Diffs of all commits are sent to the
  443. <a class="uref" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-cvslog">ffmpeg-cvslog</a>
  444. mailing list. Some developers read this list to review all code base changes
  445. from all sources. Subscribing to this list is not mandatory.
  446. </p>
  447. <h4 class="subheading" id="Keep-the-documentation-up-to-date_002e"><span>Keep the documentation up to date.<a class="copiable-link" href="#Keep-the-documentation-up-to-date_002e"> &para;</a></span></h4>
  448. <p>Update the documentation if you change behavior or add features. If you are
  449. unsure how best to do this, send a patch to ffmpeg-devel, the documentation
  450. maintainer(s) will review and commit your stuff.
  451. </p>
  452. <h4 class="subheading" id="Important-discussions-should-be-accessible-to-all_002e"><span>Important discussions should be accessible to all.<a class="copiable-link" href="#Important-discussions-should-be-accessible-to-all_002e"> &para;</a></span></h4>
  453. <p>Try to keep important discussions and requests (also) on the public
  454. developer mailing list, so that all developers can benefit from them.
  455. </p>
  456. <h4 class="subheading" id="Check-your-entries-in-MAINTAINERS_002e"><span>Check your entries in MAINTAINERS.<a class="copiable-link" href="#Check-your-entries-in-MAINTAINERS_002e"> &para;</a></span></h4>
  457. <p>Make sure that no parts of the codebase that you maintain are missing from the
  458. <samp class="file">MAINTAINERS</samp> file. If something that you want to maintain is missing add it with
  459. your name after it.
  460. If at some point you no longer want to maintain some code, then please help in
  461. finding a new maintainer and also don&rsquo;t forget to update the <samp class="file">MAINTAINERS</samp> file.
  462. </p>
  463. <p>We think our rules are not too hard. If you have comments, contact us.
  464. </p>
  465. </div>
  466. </div>
  467. <div class="chapter-level-extent" id="Code-of-conduct">
  468. <h2 class="chapter"><span>5 Code of conduct<a class="copiable-link" href="#Code-of-conduct"> &para;</a></span></h2>
  469. <p>Be friendly and respectful towards others and third parties.
  470. Treat others the way you yourself want to be treated.
  471. </p>
  472. <p>Be considerate. Not everyone shares the same viewpoint and priorities as you do.
  473. Different opinions and interpretations help the project.
  474. Looking at issues from a different perspective assists development.
  475. </p>
  476. <p>Do not assume malice for things that can be attributed to incompetence. Even if
  477. it is malice, it&rsquo;s rarely good to start with that as initial assumption.
  478. </p>
  479. <p>Stay friendly even if someone acts contrarily. Everyone has a bad day
  480. once in a while.
  481. If you yourself have a bad day or are angry then try to take a break and reply
  482. once you are calm and without anger if you have to.
  483. </p>
  484. <p>Try to help other team members and cooperate if you can.
  485. </p>
  486. <p>The goal of software development is to create technical excellence, not for any
  487. individual to be better and &quot;win&quot; against the others. Large software projects
  488. are only possible and successful through teamwork.
  489. </p>
  490. <p>If someone struggles do not put them down. Give them a helping hand
  491. instead and point them in the right direction.
  492. </p>
  493. <p>Finally, keep in mind the immortal words of Bill and Ted,
  494. &quot;Be excellent to each other.&quot;
  495. </p>
  496. <a class="anchor" id="Submitting-patches"></a></div>
  497. <div class="chapter-level-extent" id="Submitting-patches-1">
  498. <h2 class="chapter"><span>6 Submitting patches<a class="copiable-link" href="#Submitting-patches-1"> &para;</a></span></h2>
  499. <p>First, read the <a class="ref" href="#Coding-Rules">Coding Rules</a> above if you did not yet, in particular
  500. the rules regarding patch submission.
  501. </p>
  502. <p>When you submit your patch, please use <code class="code">git format-patch</code> or
  503. <code class="code">git send-email</code>. We cannot read other diffs :-).
  504. </p>
  505. <p>Also please do not submit a patch which contains several unrelated changes.
  506. Split it into separate, self-contained pieces. This does not mean splitting
  507. file by file. Instead, make the patch as small as possible while still
  508. keeping it as a logical unit that contains an individual change, even
  509. if it spans multiple files. This makes reviewing your patches much easier
  510. for us and greatly increases your chances of getting your patch applied.
  511. </p>
  512. <p>Use the patcheck tool of FFmpeg to check your patch.
  513. The tool is located in the tools directory.
  514. </p>
  515. <p>Run the <a class="ref" href="#Regression-tests">Regression tests</a> before submitting a patch in order to verify
  516. it does not cause unexpected problems.
  517. </p>
  518. <p>It also helps quite a bit if you tell us what the patch does (for example
  519. &rsquo;replaces lrint by lrintf&rsquo;), and why (for example &rsquo;*BSD isn&rsquo;t C99 compliant
  520. and has no lrint()&rsquo;)
  521. </p>
  522. <p>Also please if you send several patches, send each patch as a separate mail,
  523. do not attach several unrelated patches to the same mail.
  524. </p>
  525. <p>Patches should be posted to the
  526. <a class="uref" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel">ffmpeg-devel</a>
  527. mailing list. Use <code class="code">git send-email</code> when possible since it will properly
  528. send patches without requiring extra care. If you cannot, then send patches
  529. as base64-encoded attachments, so your patch is not trashed during
  530. transmission. Also ensure the correct mime type is used
  531. (text/x-diff or text/x-patch or at least text/plain) and that only one
  532. patch is inline or attached per mail.
  533. You can check <a class="url" href="https://patchwork.ffmpeg.org">https://patchwork.ffmpeg.org</a>, if your patch does not show up, its mime type
  534. likely was wrong.
  535. </p>
  536. <h4 class="subheading" id="How-to-setup-git-send_002demail_003f"><span>How to setup git send-email?<a class="copiable-link" href="#How-to-setup-git-send_002demail_003f"> &para;</a></span></h4>
  537. <p>Please see <a class="url" href="https://git-send-email.io/">https://git-send-email.io/</a>.
  538. For gmail additionally see <a class="url" href="https://shallowsky.com/blog/tech/email/gmail-app-passwds.html">https://shallowsky.com/blog/tech/email/gmail-app-passwds.html</a>.
  539. </p>
  540. <h4 class="subheading" id="Sending-patches-from-email-clients"><span>Sending patches from email clients<a class="copiable-link" href="#Sending-patches-from-email-clients"> &para;</a></span></h4>
  541. <p>Using <code class="code">git send-email</code> might not be desirable for everyone. The
  542. following trick allows to send patches via email clients in a safe
  543. way. It has been tested with Outlook and Thunderbird (with X-Unsent
  544. extension) and might work with other applications.
  545. </p>
  546. <p>Create your patch like this:
  547. </p>
  548. <pre class="verbatim">git format-patch -s -o &quot;outputfolder&quot; --add-header &quot;X-Unsent: 1&quot; --suffix .eml --to ffmpeg-devel@ffmpeg.org -1 1a2b3c4d
  549. </pre>
  550. <p>Now you&rsquo;ll just need to open the eml file with the email application
  551. and execute &rsquo;Send&rsquo;.
  552. </p>
  553. <h4 class="subheading" id="Reviews"><span>Reviews<a class="copiable-link" href="#Reviews"> &para;</a></span></h4>
  554. <p>Your patch will be reviewed on the mailing list. You will likely be asked
  555. to make some changes and are expected to send in an improved version that
  556. incorporates the requests from the review. This process may go through
  557. several iterations. Once your patch is deemed good enough, some developer
  558. will pick it up and commit it to the official FFmpeg tree.
  559. </p>
  560. <p>Give us a few days to react. But if some time passes without reaction,
  561. send a reminder by email. Your patch should eventually be dealt with.
  562. </p>
  563. </div>
  564. <div class="chapter-level-extent" id="New-codecs-or-formats-checklist">
  565. <h2 class="chapter"><span>7 New codecs or formats checklist<a class="copiable-link" href="#New-codecs-or-formats-checklist"> &para;</a></span></h2>
  566. <ol class="enumerate">
  567. <li> Did you use av_cold for codec initialization and close functions?
  568. </li><li> Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or
  569. AVInputFormat/AVOutputFormat struct?
  570. </li><li> Did you bump the minor version number (and reset the micro version
  571. number) in <samp class="file">libavcodec/version.h</samp> or <samp class="file">libavformat/version.h</samp>?
  572. </li><li> Did you register it in <samp class="file">allcodecs.c</samp> or <samp class="file">allformats.c</samp>?
  573. </li><li> Did you add the AVCodecID to <samp class="file">avcodec.h</samp>?
  574. When adding new codec IDs, also add an entry to the codec descriptor
  575. list in <samp class="file">libavcodec/codec_desc.c</samp>.
  576. </li><li> If it has a FourCC, did you add it to <samp class="file">libavformat/riff.c</samp>,
  577. even if it is only a decoder?
  578. </li><li> Did you add a rule to compile the appropriate files in the Makefile?
  579. Remember to do this even if you&rsquo;re just adding a format to a file that is
  580. already being compiled by some other rule, like a raw demuxer.
  581. </li><li> Did you add an entry to the table of supported formats or codecs in
  582. <samp class="file">doc/general.texi</samp>?
  583. </li><li> Did you add an entry in the Changelog?
  584. </li><li> If it depends on a parser or a library, did you add that dependency in
  585. configure?
  586. </li><li> Did you <code class="code">git add</code> the appropriate files before committing?
  587. </li><li> Did you make sure it compiles standalone, i.e. with
  588. <code class="code">configure --disable-everything --enable-decoder=foo</code>
  589. (or <code class="code">--enable-demuxer</code> or whatever your component is)?
  590. </li></ol>
  591. </div>
  592. <div class="chapter-level-extent" id="Patch-submission-checklist">
  593. <h2 class="chapter"><span>8 Patch submission checklist<a class="copiable-link" href="#Patch-submission-checklist"> &para;</a></span></h2>
  594. <ol class="enumerate">
  595. <li> Does <code class="code">make fate</code> pass with the patch applied?
  596. </li><li> Was the patch generated with git format-patch or send-email?
  597. </li><li> Did you sign-off your patch? (<code class="code">git commit -s</code>)
  598. See <a class="uref" href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/submitting-patches.rst">Sign your work</a> for the meaning
  599. of <em class="dfn">sign-off</em>.
  600. </li><li> Did you provide a clear git commit log message?
  601. </li><li> Is the patch against latest FFmpeg git master branch?
  602. </li><li> Are you subscribed to ffmpeg-devel?
  603. (the list is subscribers only due to spam)
  604. </li><li> Have you checked that the changes are minimal, so that the same cannot be
  605. achieved with a smaller patch and/or simpler final code?
  606. </li><li> If the change is to speed critical code, did you benchmark it?
  607. </li><li> If you did any benchmarks, did you provide them in the mail?
  608. </li><li> Have you checked that the patch does not introduce buffer overflows or
  609. other security issues?
  610. </li><li> Did you test your decoder or demuxer against damaged data? If no, see
  611. tools/trasher, the noise bitstream filter, and
  612. <a class="uref" href="http://caca.zoy.org/wiki/zzuf">zzuf</a>. Your decoder or demuxer
  613. should not crash, end in a (near) infinite loop, or allocate ridiculous
  614. amounts of memory when fed damaged data.
  615. </li><li> Did you test your decoder or demuxer against sample files?
  616. Samples may be obtained at <a class="url" href="https://samples.ffmpeg.org">https://samples.ffmpeg.org</a>.
  617. </li><li> Does the patch not mix functional and cosmetic changes?
  618. </li><li> Did you add tabs or trailing whitespace to the code? Both are forbidden.
  619. </li><li> Is the patch attached to the email you send?
  620. </li><li> Is the mime type of the patch correct? It should be text/x-diff or
  621. text/x-patch or at least text/plain and not application/octet-stream.
  622. </li><li> If the patch fixes a bug, did you provide a verbose analysis of the bug?
  623. </li><li> If the patch fixes a bug, did you provide enough information, including
  624. a sample, so the bug can be reproduced and the fix can be verified?
  625. Note please do not attach samples &gt;100k to mails but rather provide a
  626. URL, you can upload to <a class="url" href="https://streams.videolan.org/upload/">https://streams.videolan.org/upload/</a>.
  627. </li><li> Did you provide a verbose summary about what the patch does change?
  628. </li><li> Did you provide a verbose explanation why it changes things like it does?
  629. </li><li> Did you provide a verbose summary of the user visible advantages and
  630. disadvantages if the patch is applied?
  631. </li><li> Did you provide an example so we can verify the new feature added by the
  632. patch easily?
  633. </li><li> If you added a new file, did you insert a license header? It should be
  634. taken from FFmpeg, not randomly copied and pasted from somewhere else.
  635. </li><li> You should maintain alphabetical order in alphabetically ordered lists as
  636. long as doing so does not break API/ABI compatibility.
  637. </li><li> Lines with similar content should be aligned vertically when doing so
  638. improves readability.
  639. </li><li> Consider adding a regression test for your code.
  640. </li><li> If you added YASM code please check that things still work with &ndash;disable-yasm.
  641. </li><li> Make sure you check the return values of function and return appropriate
  642. error codes. Especially memory allocation functions like <code class="code">av_malloc()</code>
  643. are notoriously left unchecked, which is a serious problem.
  644. </li><li> Test your code with valgrind and or Address Sanitizer to ensure it&rsquo;s free
  645. of leaks, out of array accesses, etc.
  646. </li></ol>
  647. </div>
  648. <div class="chapter-level-extent" id="Patch-review-process">
  649. <h2 class="chapter"><span>9 Patch review process<a class="copiable-link" href="#Patch-review-process"> &para;</a></span></h2>
  650. <p>All patches posted to ffmpeg-devel will be reviewed, unless they contain a
  651. clear note that the patch is not for the git master branch.
  652. Reviews and comments will be posted as replies to the patch on the
  653. mailing list. The patch submitter then has to take care of every comment,
  654. that can be by resubmitting a changed patch or by discussion. Resubmitted
  655. patches will themselves be reviewed like any other patch. If at some point
  656. a patch passes review with no comments then it is approved, that can for
  657. simple and small patches happen immediately while large patches will generally
  658. have to be changed and reviewed many times before they are approved.
  659. After a patch is approved it will be committed to the repository.
  660. </p>
  661. <p>We will review all submitted patches, but sometimes we are quite busy so
  662. especially for large patches this can take several weeks.
  663. </p>
  664. <p>If you feel that the review process is too slow and you are willing to try to
  665. take over maintainership of the area of code you change then just clone
  666. git master and maintain the area of code there. We will merge each area from
  667. where its best maintained.
  668. </p>
  669. <p>When resubmitting patches, please do not make any significant changes
  670. not related to the comments received during review. Such patches will
  671. be rejected. Instead, submit significant changes or new features as
  672. separate patches.
  673. </p>
  674. <p>Everyone is welcome to review patches. Also if you are waiting for your patch
  675. to be reviewed, please consider helping to review other patches, that is a great
  676. way to get everyone&rsquo;s patches reviewed sooner.
  677. </p>
  678. <a class="anchor" id="Regression-tests"></a></div>
  679. <div class="chapter-level-extent" id="Regression-tests-1">
  680. <h2 class="chapter"><span>10 Regression tests<a class="copiable-link" href="#Regression-tests-1"> &para;</a></span></h2>
  681. <p>Before submitting a patch (or committing to the repository), you should at least
  682. test that you did not break anything.
  683. </p>
  684. <p>Running &rsquo;make fate&rsquo; accomplishes this, please see <a class="url" href="fate.html">fate.html</a> for details.
  685. </p>
  686. <p>[Of course, some patches may change the results of the regression tests. In
  687. this case, the reference results of the regression tests shall be modified
  688. accordingly].
  689. </p>
  690. <ul class="mini-toc">
  691. <li><a href="#Adding-files-to-the-fate_002dsuite-dataset" accesskey="1">Adding files to the fate-suite dataset</a></li>
  692. <li><a href="#Visualizing-Test-Coverage" accesskey="2">Visualizing Test Coverage</a></li>
  693. <li><a href="#Using-Valgrind" accesskey="3">Using Valgrind</a></li>
  694. </ul>
  695. <div class="section-level-extent" id="Adding-files-to-the-fate_002dsuite-dataset">
  696. <h3 class="section"><span>10.1 Adding files to the fate-suite dataset<a class="copiable-link" href="#Adding-files-to-the-fate_002dsuite-dataset"> &para;</a></span></h3>
  697. <p>When there is no muxer or encoder available to generate test media for a
  698. specific test then the media has to be included in the fate-suite.
  699. First please make sure that the sample file is as small as possible to test the
  700. respective decoder or demuxer sufficiently. Large files increase network
  701. bandwidth and disk space requirements.
  702. Once you have a working fate test and fate sample, provide in the commit
  703. message or introductory message for the patch series that you post to
  704. the ffmpeg-devel mailing list, a direct link to download the sample media.
  705. </p>
  706. </div>
  707. <div class="section-level-extent" id="Visualizing-Test-Coverage">
  708. <h3 class="section"><span>10.2 Visualizing Test Coverage<a class="copiable-link" href="#Visualizing-Test-Coverage"> &para;</a></span></h3>
  709. <p>The FFmpeg build system allows visualizing the test coverage in an easy
  710. manner with the coverage tools <code class="code">gcov</code>/<code class="code">lcov</code>. This involves
  711. the following steps:
  712. </p>
  713. <ol class="enumerate">
  714. <li> Configure to compile with instrumentation enabled:
  715. <code class="code">configure --toolchain=gcov</code>.
  716. </li><li> Run your test case, either manually or via FATE. This can be either
  717. the full FATE regression suite, or any arbitrary invocation of any
  718. front-end tool provided by FFmpeg, in any combination.
  719. </li><li> Run <code class="code">make lcov</code> to generate coverage data in HTML format.
  720. </li><li> View <code class="code">lcov/index.html</code> in your preferred HTML viewer.
  721. </li></ol>
  722. <p>You can use the command <code class="code">make lcov-reset</code> to reset the coverage
  723. measurements. You will need to rerun <code class="code">make lcov</code> after running a
  724. new test.
  725. </p>
  726. </div>
  727. <div class="section-level-extent" id="Using-Valgrind">
  728. <h3 class="section"><span>10.3 Using Valgrind<a class="copiable-link" href="#Using-Valgrind"> &para;</a></span></h3>
  729. <p>The configure script provides a shortcut for using valgrind to spot bugs
  730. related to memory handling. Just add the option
  731. <code class="code">--toolchain=valgrind-memcheck</code> or <code class="code">--toolchain=valgrind-massif</code>
  732. to your configure line, and reasonable defaults will be set for running
  733. FATE under the supervision of either the <strong class="strong">memcheck</strong> or the
  734. <strong class="strong">massif</strong> tool of the valgrind suite.
  735. </p>
  736. <p>In case you need finer control over how valgrind is invoked, use the
  737. <code class="code">--target-exec='valgrind &lt;your_custom_valgrind_options&gt;</code> option in
  738. your configure line instead.
  739. </p>
  740. <a class="anchor" id="Release-process"></a></div>
  741. </div>
  742. <div class="chapter-level-extent" id="Release-process-1">
  743. <h2 class="chapter"><span>11 Release process<a class="copiable-link" href="#Release-process-1"> &para;</a></span></h2>
  744. <p>FFmpeg maintains a set of <strong class="strong">release branches</strong>, which are the
  745. recommended deliverable for system integrators and distributors (such as
  746. Linux distributions, etc.). At regular times, a <strong class="strong">release
  747. manager</strong> prepares, tests and publishes tarballs on the
  748. <a class="url" href="https://ffmpeg.org">https://ffmpeg.org</a> website.
  749. </p>
  750. <p>There are two kinds of releases:
  751. </p>
  752. <ol class="enumerate">
  753. <li> <strong class="strong">Major releases</strong> always include the latest and greatest
  754. features and functionality.
  755. </li><li> <strong class="strong">Point releases</strong> are cut from <strong class="strong">release</strong> branches,
  756. which are named <code class="code">release/X</code>, with <code class="code">X</code> being the release
  757. version number.
  758. </li></ol>
  759. <p>Note that we promise to our users that shared libraries from any FFmpeg
  760. release never break programs that have been <strong class="strong">compiled</strong> against
  761. previous versions of <strong class="strong">the same release series</strong> in any case!
  762. </p>
  763. <p>However, from time to time, we do make API changes that require adaptations
  764. in applications. Such changes are only allowed in (new) major releases and
  765. require further steps such as bumping library version numbers and/or
  766. adjustments to the symbol versioning file. Please discuss such changes
  767. on the <strong class="strong">ffmpeg-devel</strong> mailing list in time to allow forward planning.
  768. </p>
  769. <a class="anchor" id="Criteria-for-Point-Releases"></a><ul class="mini-toc">
  770. <li><a href="#Criteria-for-Point-Releases-1" accesskey="1">Criteria for Point Releases</a></li>
  771. <li><a href="#Release-Checklist" accesskey="2">Release Checklist</a></li>
  772. </ul>
  773. <div class="section-level-extent" id="Criteria-for-Point-Releases-1">
  774. <h3 class="section"><span>11.1 Criteria for Point Releases<a class="copiable-link" href="#Criteria-for-Point-Releases-1"> &para;</a></span></h3>
  775. <p>Changes that match the following criteria are valid candidates for
  776. inclusion into a point release:
  777. </p>
  778. <ol class="enumerate">
  779. <li> Fixes a security issue, preferably identified by a <strong class="strong">CVE
  780. number</strong> issued by <a class="url" href="http://cve.mitre.org/">http://cve.mitre.org/</a>.
  781. </li><li> Fixes a documented bug in <a class="url" href="https://trac.ffmpeg.org">https://trac.ffmpeg.org</a>.
  782. </li><li> Improves the included documentation.
  783. </li><li> Retains both source code and binary compatibility with previous
  784. point releases of the same release branch.
  785. </li></ol>
  786. <p>The order for checking the rules is (1 OR 2 OR 3) AND 4.
  787. </p>
  788. </div>
  789. <div class="section-level-extent" id="Release-Checklist">
  790. <h3 class="section"><span>11.2 Release Checklist<a class="copiable-link" href="#Release-Checklist"> &para;</a></span></h3>
  791. <p>The release process involves the following steps:
  792. </p>
  793. <ol class="enumerate">
  794. <li> Ensure that the <samp class="file">RELEASE</samp> file contains the version number for
  795. the upcoming release.
  796. </li><li> Add the release at <a class="url" href="https://trac.ffmpeg.org/admin/ticket/versions">https://trac.ffmpeg.org/admin/ticket/versions</a>.
  797. </li><li> Announce the intent to do a release to the mailing list.
  798. </li><li> Make sure all relevant security fixes have been backported. See
  799. <a class="url" href="https://ffmpeg.org/security.html">https://ffmpeg.org/security.html</a>.
  800. </li><li> Ensure that the FATE regression suite still passes in the release
  801. branch on at least <strong class="strong">i386</strong> and <strong class="strong">amd64</strong>
  802. (cf. <a class="ref" href="#Regression-tests">Regression tests</a>).
  803. </li><li> Prepare the release tarballs in <code class="code">bz2</code> and <code class="code">gz</code> formats, and
  804. supplementing files that contain <code class="code">gpg</code> signatures
  805. </li><li> Publish the tarballs at <a class="url" href="https://ffmpeg.org/releases">https://ffmpeg.org/releases</a>. Create and
  806. push an annotated tag in the form <code class="code">nX</code>, with <code class="code">X</code>
  807. containing the version number.
  808. </li><li> Propose and send a patch to the <strong class="strong">ffmpeg-devel</strong> mailing list
  809. with a news entry for the website.
  810. </li><li> Publish the news entry.
  811. </li><li> Send an announcement to the mailing list.
  812. </li></ol>
  813. </div>
  814. </div>
  815. </div>
  816. <p style="font-size: small;">
  817. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  818. </p>
  819. </div>
  820. </body>
  821. </html>