diff options
author | Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> | 2018-11-28 01:24:09 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2019-01-23 22:33:43 +0000 |
commit | 992532ee3122d7938a7581988eea401b57de8189 (patch) | |
tree | 2f7386fde20a32210a00fbdcf96f88caa5a9e6e1 /libavcodec/h2645_parse.h | |
parent | cf81284b1c14ef28d3f94e6d28c46188ba4e82f2 (diff) | |
download | ffmpeg-992532ee3122d7938a7581988eea401b57de8189.tar.gz |
h2645_parse: Make ff_h2645_packet_split reference-compatible
This is in preparation for a patch for cbs_h2645. Now the packet's
rbsp_buffer can be owned by an AVBuffer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Diffstat (limited to 'libavcodec/h2645_parse.h')
-rw-r--r-- | libavcodec/h2645_parse.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h index 6dbba8fe4a..2c29ca517c 100644 --- a/libavcodec/h2645_parse.h +++ b/libavcodec/h2645_parse.h @@ -23,6 +23,7 @@ #include <stdint.h> +#include "libavutil/buffer.h" #include "avcodec.h" #include "get_bits.h" @@ -66,6 +67,7 @@ typedef struct H2645NAL { typedef struct H2645RBSP { uint8_t *rbsp_buffer; + AVBufferRef *rbsp_buffer_ref; int rbsp_buffer_alloc_size; int rbsp_buffer_size; } H2645RBSP; @@ -92,10 +94,15 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp, * the data is contained in the input buffer pointed to by buf. * Otherwise, the unescaped data is part of the rbsp_buffer described by the * packet's H2645RBSP. + * + * If the packet's rbsp_buffer_ref is not NULL, the underlying AVBuffer must + * own rbsp_buffer. If not and rbsp_buffer is not NULL, use_ref must be 0. + * If use_ref is set, rbsp_buffer will be reference-counted and owned by + * the underlying AVBuffer of rbsp_buffer_ref. */ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, void *logctx, int is_nalff, int nal_length_size, - enum AVCodecID codec_id, int small_padding); + enum AVCodecID codec_id, int small_padding, int use_ref); /** * Free all the allocated memory in the packet. |