Go to the documentation of this file.
193 const int *subscripts,
213 const int *subscripts,
461 uint8_t *
data,
size_t data_size,
527 const char *str,
const int *subscripts,
538 const char *str,
const int *subscripts,
void * content_ref
If content is reference counted, a RefStruct reference backing content.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
void * priv_data
Internal codec-specific data.
This struct describes the properties of an encoded stream.
int ff_cbs_make_unit_refcounted(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit refcounted.
const struct CodedBitstreamType * codec
Internal codec-specific hooks.
void * content
Pointer to the decomposed form of this unit.
int ff_cbs_init(CodedBitstreamContext **ctx, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
uint8_t * write_buffer
Write buffer.
Context structure for coded bitstream operations.
void(* CBSTraceWriteCallback)(void *trace_context, struct PutBitContext *pbc, int start_position, const char *name, const int *subscripts, int64_t value)
Callback type for write tracing.
int ff_cbs_read_packet_side_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
CodedBitstreamUnitType type
Codec-specific type of this unit.
int ff_cbs_read_packet(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
Read the data bitstream from a packet into a fragment, then split into units and decompose.
Coded bitstream unit structure.
int ff_cbs_write_packet(CodedBitstreamContext *ctx, AVPacket *pkt, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to a packet.
void * log_ctx
Logging context to be passed to all av_log() calls associated with this context.
@ DISCARD_FLAG_KEEP_NON_VCL
keep non-vcl units even if the picture has been dropped.
void ff_cbs_discard_units(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, enum AVDiscard skip, int flags)
Discard units accroding to 'skip'.
void ff_cbs_fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
void ff_cbs_trace_read_log(void *trace_context, struct GetBitContext *gbc, int length, const char *str, const int *subscripts, int64_t value)
Helper function for read tracing which formats the syntax element and logs the result.
CBSTraceReadCallback trace_read_callback
Callback for read tracing.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
int trace_level
Log level to use for default trace output.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
Coded bitstream fragment structure, combining one or more units.
size_t data_size
The number of bytes in the bitstream.
int ff_cbs_read(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const uint8_t *data, size_t size)
Read a bitstream from a memory region into a fragment, then split into units and decompose.
int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, int position, CodedBitstreamUnitType type, void *content, void *content_ref)
Insert a new unit into a fragment with the given content.
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
void ff_cbs_fragment_reset(CodedBitstreamFragment *frag)
Free the units contained in a fragment as well as the fragment's own data buffer, but not the units a...
void ff_cbs_trace_write_log(void *trace_context, struct PutBitContext *pbc, int length, const char *str, const int *subscripts, int64_t value)
Helper function for write tracing which formats the syntax element and logs the result.
void * trace_context
User context pointer to pass to trace callbacks.
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
int ff_cbs_append_unit_data(CodedBitstreamFragment *frag, CodedBitstreamUnitType type, uint8_t *data, size_t data_size, AVBufferRef *data_buf)
Add a new unit to a fragment with the given data bitstream.
AVCodecID
Identify the syntax and semantics of the bitstream.
uint8_t * data
Pointer to the bitstream form of this fragment.
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
int ff_cbs_write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
CBSTraceWriteCallback trace_write_callback
Callback for write tracing.
int ff_cbs_read_extradata(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVCodecParameters *par)
Read the extradata bitstream found in codec parameters into a fragment, then split into units and dec...
void(* CBSTraceReadCallback)(void *trace_context, struct GetBitContext *gbc, int start_position, const char *name, const int *subscripts, int64_t value)
Callback type for read tracing.
void ff_cbs_flush(CodedBitstreamContext *ctx)
Reset all internal state in a context.
void ff_cbs_delete_unit(CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
void ff_cbs_close(CodedBitstreamContext **ctx)
Close a context and free all internal state.
AVBufferRef * data_ref
A reference to the buffer containing data.
enum AVCodecID ff_cbs_all_codec_ids[]
Table of all supported codec IDs.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
int nb_units_allocated
Number of allocated units.
main external API structure.
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
int trace_enable
Enable trace output during read/write operations.
A reference to a data buffer.
int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit writable so that internal fields can be modified.
This structure stores compressed data.
int nb_decompose_unit_types
Length of the decompose_unit_types array.
const CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
#define flags(name, subs,...)
AVBufferRef * data_ref
A reference to the buffer containing data.
int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Write the content of the fragment to its own internal buffer.
int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const struct AVCodecContext *avctx)
Read the extradata bitstream found in a codec context into a fragment, then split into units and deco...
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
int nb_units
Number of units in this fragment.