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,
461 uint8_t *
data,
size_t data_size,
527 const char *str,
const int *subscripts,
538 const char *str,
const int *subscripts,
static AVFormatContext * ctx
static av_cold void close(AVCodecParserContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
static uint32_t BS_FUNC read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.
refcounted data buffer API
#define flags(name, subs,...)
Misc types and constants that do not belong anywhere else.
void(* flush)(AVBSFContext *ctx)
int(* init)(AVBSFContext *ctx)
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
AVCodecID
Identify the syntax and semantics of the bitstream.
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.
void CBS_FUNC trace_read_log(void *trace_context, 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.
void CBS_FUNC discard_units(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, enum AVDiscard skip, int flags)
Discard units according to 'skip'.
av_cold void CBS_FUNC fragment_free(CodedBitstreamFragment *frag)
Free the units array of a fragment in addition to what ff_cbs_fragment_reset does.
void CBS_FUNC delete_unit(CodedBitstreamFragment *frag, int position)
Delete a unit from a fragment and free all memory it uses.
int CBS_FUNC alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Allocate a new internal content buffer matching the type of the unit.
int CBS_FUNC make_unit_writable(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit writable so that internal fields can be modified.
void CBS_FUNC trace_write_log(void *trace_context, 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.
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.
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...
int CBS_FUNC make_unit_refcounted(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Make the content of a unit refcounted.
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...
int CBS_FUNC write_fragment_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Write the content of the fragment to its own internal buffer.
int CBS_FUNC read_packet_side_data(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, const AVPacket *pkt)
@ DISCARD_FLAG_KEEP_NON_VCL
keep non-vcl units even if the picture has been dropped.
int CBS_FUNC write_extradata(CodedBitstreamContext *ctx, AVCodecParameters *par, CodedBitstreamFragment *frag)
Write the bitstream of a fragment to the extradata in codec parameters.
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...
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
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.
A reference to a data buffer.
main external API structure.
This struct describes the properties of an encoded stream.
This structure stores compressed data.
Context structure for coded bitstream operations.
int trace_enable
Enable trace output during read/write operations.
CBSTraceReadCallback trace_read_callback
Callback for read tracing.
const CodedBitstreamUnitType * decompose_unit_types
Array of unit types which should be decomposed when reading.
uint8_t * write_buffer
Write buffer.
void * trace_context
User context pointer to pass to trace callbacks.
int trace_level
Log level to use for default trace output.
const struct CodedBitstreamType * codec
Internal codec-specific hooks.
void * log_ctx
Logging context to be passed to all av_log() calls associated with this context.
void * priv_data
Internal codec-specific data.
int nb_decompose_unit_types
Length of the decompose_unit_types array.
CBSTraceWriteCallback trace_write_callback
Callback for write tracing.
Coded bitstream fragment structure, combining one or more units.
CodedBitstreamUnit * units
Pointer to an array of units of length nb_units_allocated.
int nb_units
Number of units in this fragment.
int nb_units_allocated
Number of allocated units.
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
size_t data_size
The number of bytes in the bitstream.
uint8_t * data
Pointer to the bitstream form of this fragment.
AVBufferRef * data_ref
A reference to the buffer containing data.
Coded bitstream unit structure.
void * content
Pointer to the decomposed form of this unit.
void * content_ref
If content is reference counted, a RefStruct reference backing content.
uint8_t * data
Pointer to the directly-parsable bitstream form of this unit.
size_t data_bit_padding
The number of bits which should be ignored in the final byte.
CodedBitstreamUnitType type
Codec-specific type of this unit.
size_t data_size
The number of bytes in the bitstream (including any padding bits in the final byte).
AVBufferRef * data_ref
A reference to the buffer containing data.