]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cbs_h264.h
avcodec/imgconvert: fix possible null pointer dereference
[ffmpeg] / libavcodec / cbs_h264.h
index 14ea69ae286df97beb24741260cba59447fba2e9..2219d9da8d7a4b3c34608b972bc9c7a7dc7cc57e 100644 (file)
@@ -1,18 +1,18 @@
 /*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -22,6 +22,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "cbs.h"
 #include "cbs_h2645.h"
 #include "h264.h"
 
@@ -194,7 +195,9 @@ typedef struct H264RawPPS {
     uint8_t slice_group_change_direction_flag;
     uint16_t slice_group_change_rate_minus1;
     uint16_t pic_size_in_map_units_minus1;
-    uint8_t slice_group_id[H264_MAX_MB_PIC_SIZE];
+
+    uint8_t *slice_group_id;
+    AVBufferRef *slice_group_id_ref;
 
     uint8_t num_ref_idx_l0_default_active_minus1;
     uint8_t num_ref_idx_l1_default_active_minus1;
@@ -405,6 +408,12 @@ typedef struct H264RawSlice {
     AVBufferRef *data_ref;
 } H264RawSlice;
 
+typedef struct H264RawFiller {
+    H264RawNALUnitHeader nal_unit_header;
+
+    uint32_t filler_size;
+} H264RawFiller;
+
 
 typedef struct CodedBitstreamH264Context {
     // Reader/writer context in common with the H.265 implementation.
@@ -428,4 +437,22 @@ typedef struct CodedBitstreamH264Context {
 } CodedBitstreamH264Context;
 
 
+/**
+ * Add an SEI message to an access unit.
+ */
+int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx,
+                                CodedBitstreamFragment *access_unit,
+                                const H264RawSEIPayload *payload);
+
+/**
+ * Delete an SEI message from an access unit.
+ *
+ * Deletes from nal_unit, which must be an SEI NAL unit.  If this is the
+ * last message in nal_unit, also deletes it from access_unit.
+ */
+int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
+                                   CodedBitstreamFragment *access_unit,
+                                   CodedBitstreamUnit *nal_unit,
+                                   int position);
+
 #endif /* AVCODEC_CBS_H264_H */