https://wiki.multimedia.cx/index.php?title=FFmpeg_programming_conventions&feed=atom&action=historyFFmpeg programming conventions - Revision history2024-03-28T17:15:59ZRevision history for this page on the wikiMediaWiki 1.39.5https://wiki.multimedia.cx/index.php?title=FFmpeg_programming_conventions&diff=7584&oldid=prevGatoatigrado at 19:10, 7 April 20072007-04-07T19:10:58Z<p></p>
<p><b>New page</b></p><div>: ''please make this page more complete if you can, thanks''<br />
<br />
== Memory allocation ==<br />
<br />
: av_malloc / av_free / av_realloc - correspond to malloc functions, currently only used as wrappers<br />
: av_fast_realloc - a shortcut to common buffer reallocation functions<br />
<br />
== Debug printing ==<br />
<br />
: av_log(avctx, print_type, [same argument style as printf])<br />
some options for print_type are AV_LOG_VERBOSE / AV_LOG_ERROR.<br />
: dprintf(avctx, [same argument style as printf]) is an alias for AV_LOG_DEBUG<br />
<br />
== Stream and array operations ==<br />
<br />
: AV_RB / AV_RL - read little endian or big endian from an array. e.g. int result = AV_RB32(&array[offset])<br />
<br />
functions that automatically increment arguments<br />
: bytestream_get_buffer(&buffer, destination, length) - copies from buffer. buffer type is uint8_t **.<br />
: bytestream_get_le16/24/32(&buffer) - get an int.<br />
<br />
: get_byte(pb) - get a byte, where pb is the ByteIOContext in a demuxer (typically), in (AVFormatContext) &s->pb<br />
: get_be/get_le 16/24/32(pb) - get an integer<br />
: get_buffer(pb, buffer, length) - get an array, returns number of bytes read. typically, return if number of bytes read != length<br />
<br />
== see also ==<br />
<br />
* [[FFmpeg codec howto]]<br />
* [[FFmpeg demuxer howto]]</div>Gatoatigrado