mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-21 07:59:43 +08:00
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.
This commit is contained in:
@@ -349,6 +349,15 @@ int ff_cbs_alloc_unit_content(CodedBitstreamUnit *unit,
|
||||
size_t size,
|
||||
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user