123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- \input texinfo @c -*- texinfo -*-
- @settitle Developer Documentation
- @titlepage
- @sp 7
- @center @titlefont{Developer Documentation}
- @sp 3
- @end titlepage
- @chapter Developers Guide
- @section API
- @itemize @bullet
- @item libavcodec is the library containing the codecs (both encoding and
- decoding). Look at @file{libavcodec/apiexample.c} to see how to use it.
- @item libavformat is the library containing the file format handling (mux and
- demux code for several formats). Look at @file{ffplay.c} to use it in a
- player. See @file{libavformat/output-example.c} to use it to generate
- audio or video streams.
- @end itemize
- @section Integrating libavcodec or libavformat in your program
- You can integrate all the source code of the libraries to link them
- statically to avoid any version problem. All you need is to provide a
- 'config.mak' and a 'config.h' in the parent directory. See the defines
- generated by ./configure to understand what is needed.
- You can use libavcodec or libavformat in your commercial program, but
- @emph{any patch you make must be published}. The best way to proceed is
- to send your patches to the FFmpeg mailing list.
- @anchor{Coding Rules}
- @section Coding Rules
- FFmpeg is programmed in the ISO C90 language with a few additional
- features from ISO C99, namely:
- @itemize @bullet
- @item
- the @samp{inline} keyword;
- @item
- @samp{//} comments;
- @item
- designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
- @item
- compound literals (@samp{x = (struct s) @{ 17, 23 @};})
- @end itemize
- These features are supported by all compilers we care about, so we will not
- accept patches to remove their use unless they absolutely do not impair
- clarity and performance.
- All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also
- compiles with several other compilers, such as the Compaq ccc compiler
- or Sun Studio 9, and we would like to keep it that way unless it would
- be exceedingly involved. To ensure compatibility, please do not use any
- additional C99 features or GCC extensions. Especially watch out for:
- @itemize @bullet
- @item
- mixing statements and declarations;
- @item
- @samp{long long} (use @samp{int64_t} instead);
- @item
- @samp{__attribute__} not protected by @samp
|