]> git.sesse.net Git - ffmpeg/commit
cbs: Describe allocate/free methods in tabular form
authorMark Thompson <sw@jkqxz.net>
Mon, 27 Jul 2020 16:32:18 +0000 (17:32 +0100)
committerMark Thompson <sw@jkqxz.net>
Tue, 1 Sep 2020 23:00:57 +0000 (00:00 +0100)
commitbc7a7e0d65bd72b317b2c4b84fac505ba3db7556
tree888843bef0e087fa2a0725649b0dcd337ec5bc85
parent1fe77d4a637c4033180a35b6ebf13b5a4707d2a4
cbs: Describe allocate/free methods in tabular form

Unit types are split into three categories, depending on how their
content is managed:
* POD structure - these require no special treatment.
* Structure containing references to refcounted buffers - these can use
  a common free function when the offsets of all the internal references
  are known.
* More complex structures - these still require ad-hoc treatment.

For each codec we can then maintain a table of descriptors for each set of
equivalent unit types, defining the mechanism needed to allocate/free that
unit content.  This is not required to be used immediately - a new alloc
function supports this, but does not replace the old one which works without
referring to these tables.
libavcodec/cbs.c
libavcodec/cbs.h
libavcodec/cbs_internal.h