diff options
author | Mark Thompson <sw@jkqxz.net> | 2020-07-27 17:32:18 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2020-09-02 00:00:57 +0100 |
commit | bc7a7e0d65bd72b317b2c4b84fac505ba3db7556 (patch) | |
tree | 888843bef0e087fa2a0725649b0dcd337ec5bc85 /libavcodec/cbs.h | |
parent | 1fe77d4a637c4033180a35b6ebf13b5a4707d2a4 (diff) | |
download | ffmpeg-bc7a7e0d65bd72b317b2c4b84fac505ba3db7556.tar.gz |
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.
Diffstat (limited to 'libavcodec/cbs.h')
-rw-r--r-- | libavcodec/cbs.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index 07faf18c5b..ea8d942894 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -350,6 +350,15 @@ int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit, void (*free)(void *opaque, uint8_t *content)); /** + * Allocate a new internal content buffer matching the type of the unit. + * + * The content will be zeroed. + */ +int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + + +/** * Allocate a new internal data buffer of the given size in the unit. * * The data buffer will have input padding. |