diff mbox series

[FFmpeg-devel,v6,13/22] cbs: Expose the function to insert a new empty unit into a fragment

Message ID 20200727163237.23371-14-sw@jkqxz.net
State New
Headers show
Series CBS unit type tables and assorted related stuff
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Mark Thompson July 27, 2020, 4:32 p.m. UTC
This will be helpful when adding new SEI to an existing access unit.
---
 libavcodec/cbs.c | 8 ++++----
 libavcodec/cbs.h | 6 ++++++
 2 files changed, 10 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c
index 7c1aa005c2..6677442d10 100644
--- a/libavcodec/cbs.c
+++ b/libavcodec/cbs.c
@@ -674,8 +674,8 @@  int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
     return 0;
 }
 
-static int cbs_insert_unit(CodedBitstreamFragment *frag,
-                           int position)
+int ff_cbs_insert_unit(CodedBitstreamFragment *frag,
+                       int position)
 {
     CodedBitstreamUnit *units;
 
@@ -734,7 +734,7 @@  int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag,
         content_ref = NULL;
     }
 
-    err = cbs_insert_unit(frag, position);
+    err = ff_cbs_insert_unit(frag, position);
     if (err < 0) {
         av_buffer_unref(&content_ref);
         return err;
@@ -772,7 +772,7 @@  int ff_cbs_insert_unit_data(CodedBitstreamFragment *frag,
         return AVERROR(ENOMEM);
     }
 
-    err = cbs_insert_unit(frag, position);
+    err = ff_cbs_insert_unit(frag, position);
     if (err < 0) {
         av_buffer_unref(&data_ref);
         return err;
diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h
index 3a054aa8f3..9152d655d2 100644
--- a/libavcodec/cbs.h
+++ b/libavcodec/cbs.h
@@ -366,6 +366,12 @@  int ff_cbs_alloc_unit_content2(CodedBitstreamContext *ctx,
 int ff_cbs_alloc_unit_data(CodedBitstreamUnit *unit,
                            size_t size);
 
+/**
+ * Insert a new empty unit into a fragment.
+ */
+int ff_cbs_insert_unit(CodedBitstreamFragment *frag,
+                       int position);
+
 /**
  * Insert a new unit into a fragment with the given content.
  *