This will be helpful when adding new SEI to an existing access unit.
---
libavcodec/cbs.c | 10 +++++-----
libavcodec/cbs.h | 7 +++++++
2 files changed, 12 insertions(+), 5 deletions(-)
@@ -680,9 +680,9 @@ int ff_cbs_alloc_unit_data(CodedBitstreamContext *ctx,
return 0;
}
-static int cbs_insert_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
- int position)
+int ff_cbs_insert_unit(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *frag,
+ int position)
{
CodedBitstreamUnit *units;
@@ -742,7 +742,7 @@ int ff_cbs_insert_unit_content(CodedBitstreamContext *ctx,
content_ref = NULL;
}
- err = cbs_insert_unit(ctx, frag, position);
+ err = ff_cbs_insert_unit(ctx, frag, position);
if (err < 0) {
av_buffer_unref(&content_ref);
return err;
@@ -781,7 +781,7 @@ int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
return AVERROR(ENOMEM);
}
- err = cbs_insert_unit(ctx, frag, position);
+ err = ff_cbs_insert_unit(ctx, frag, position);
if (err < 0) {
av_buffer_unref(&data_ref);
return err;
@@ -370,6 +370,13 @@ int ff_cbs_alloc_unit_data(CodedBitstreamContext *ctx,
CodedBitstreamUnit *unit,
size_t size);
+/**
+ * Insert a new empty unit into a fragment.
+ */
+int ff_cbs_insert_unit(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *frag,
+ int position);
+
/**
* Insert a new unit into a fragment with the given content.
*