Go to the documentation of this file.
33 #define CBS_PREFIX cbs
36 #define CBS_FUNC_PREFIX_NAME(prefix, name) ff_ ## prefix ## _ ## name
37 #define CBS_FUNC_NAME(prefix, name) CBS_FUNC_PREFIX_NAME(prefix, name)
38 #define CBS_FUNC(name) CBS_FUNC_NAME(CBS_PREFIX, name)
200 const int *subscripts,
220 const int *subscripts,
468 uint8_t *
data,
size_t data_size,
534 const char *str,
const int *subscripts,
545 const char *str,
const int *subscripts,
void CBS_FUNC() 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 * 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.
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.
int CBS_FUNC() 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...
int CBS_FUNC() write_fragment_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Write the content of the fragment to its own internal buffer.
const struct CodedBitstreamType * codec
Internal codec-specific hooks.
void * content
Pointer to the decomposed form of this unit.
uint8_t * write_buffer
Write buffer.
Context structure for coded bitstream operations.
CodedBitstreamUnitType type
Codec-specific type of this unit.
Coded bitstream unit structure.
void * log_ctx
Logging context to be passed to all av_log() calls associated with this context.
int CBS_FUNC() 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.
CBSTraceReadCallback trace_read_callback
Callback for read tracing.
int CBS_FUNC() 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.
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.
void CBS_FUNC() discard_units(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, enum AVDiscard skip, int flags)
Discard units accroding to 'skip'.
int CBS_FUNC() make_unit_refcounted(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit refcounted.
int trace_level
Log level to use for default trace output.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
int CBS_FUNC() alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
void CBS_FUNC() flush(CodedBitstreamContext *ctx)
Reset all internal state in a context.
Coded bitstream fragment structure, combining one or more units.
size_t data_size
The number of bytes in the bitstream.
int CBS_FUNC() init(CodedBitstreamContext **ctx, enum AVCodecID codec_id, void *log_ctx)
Create and initialise a new context for the given codec.
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
int CBS_FUNC() write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
void * trace_context
User context pointer to pass to trace callbacks.
int CBS_FUNC() 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...
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
int CBS_FUNC() make_unit_writable(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit writable so that internal fields can be modified.
AVCodecID
Identify the syntax and semantics of the bitstream.
void CBS_FUNC() close(CodedBitstreamContext **ctx)
Close a context and free all internal state.
int CBS_FUNC() 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.
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.
CBSTraceWriteCallback trace_write_callback
Callback for write tracing.
void CBS_FUNC() 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.
AVBufferRef * data_ref
A reference to the buffer containing data.
void CBS_FUNC() 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.
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.
int CBS_FUNC() read_packet_side_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
main external API structure.
@ DISCARD_FLAG_KEEP_NON_VCL
keep non-vcl units even if the picture has been dropped.
int trace_enable
Enable trace output during read/write operations.
A reference to a data buffer.
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.
void CBS_FUNC() fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
AVBufferRef * data_ref
A reference to the buffer containing data.
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 CBS_FUNC() write_packet(CodedBitstreamContext *ctx, AVPacket *pkt, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to a packet.
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.
void CBS_FUNC() delete_unit(CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
int CBS_FUNC() 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.