X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fh2645_parse.h;h=2c29ca517c8b341fc8e4c2c5e98465bf595c7c72;hb=648f5c93820ed204bdc477562b61055068c412fe;hp=2e29ad26cbca5ea4b8622e1e6ef571a01bd04c48;hpb=3eea8edf618079e44719fe059ddd953b21ef1ba9;p=ffmpeg diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h index 2e29ad26cbc..2c29ca517c8 100644 --- a/libavcodec/h2645_parse.h +++ b/libavcodec/h2645_parse.h @@ -23,6 +23,7 @@ #include +#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; @@ -86,10 +88,21 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp, /** * Split an input packet into NAL units. + * + * If data == raw_data holds true for a NAL unit of the returned pkt, then + * said NAL unit does not contain any emulation_prevention_three_byte and + * 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.