69 err = ff_cbs_read_packet_side_data(
ctx->input, frag,
pkt);
72 "Failed to read extradata from packet side data.\n");
76 err =
ctx->type->update_fragment(bsf,
NULL, frag);
80 err = ff_cbs_write_fragment_data(
ctx->output, frag);
83 "Failed to write extradata into packet side data.\n");
93 ff_cbs_fragment_reset(frag);
111 err = ff_cbs_read_packet(
ctx->input, frag,
pkt);
114 ctx->type->fragment_name);
120 ctx->type->unit_name);
125 err =
ctx->type->update_fragment(bsf,
pkt, frag);
129 err = ff_cbs_write_packet(
ctx->output,
pkt, frag);
132 ctx->type->fragment_name);
138 ff_cbs_fragment_reset(frag);
154 err = ff_cbs_init(&
ctx->input,
type->codec_id, bsf);
158 err = ff_cbs_init(&
ctx->output,
type->codec_id, bsf);
162 ctx->output->trace_enable = 1;
164 ctx->output->trace_context =
ctx->output;
165 ctx->output->trace_write_callback = ff_cbs_trace_write_log;
168 err = ff_cbs_read_extradata(
ctx->input, frag, bsf->
par_in);
174 err =
type->update_fragment(bsf,
NULL, frag);
178 err = ff_cbs_write_extradata(
ctx->output, bsf->
par_out, frag);
187 ff_cbs_fragment_reset(frag);
195 ff_cbs_fragment_free(&
ctx->fragment);
196 ff_cbs_close(&
ctx->input);
197 ff_cbs_close(&
ctx->output);
static AVFormatContext * ctx
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
enum AVCodecID ff_cbs_all_codec_ids[]
Table of all supported codec IDs.
av_cold int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
Initialise generic CBS BSF setup.
static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt)
AVCodecID
Identify the syntax and semantics of the bitstream.
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Macro definitions for various function/variable attributes.
The bitstream filter state.
void * priv_data
Opaque filter-specific private data.
AVCodecParameters * par_in
Parameters of the input stream.
AVCodecParameters * par_out
Parameters of the output stream.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
This structure stores compressed data.
Coded bitstream fragment structure, combining one or more units.
int nb_units
Number of units in this fragment.
size_t data_size
The number of bytes in the bitstream.
uint8_t * data
Pointer to the bitstream form of this fragment.