Go to the documentation of this file.
35 err = ff_cbs_read_packet_side_data(
ctx->input, frag,
pkt);
38 "Failed to read extradata from packet side data.\n");
42 err =
ctx->type->update_fragment(bsf,
NULL, frag);
46 err = ff_cbs_write_fragment_data(
ctx->output, frag);
49 "Failed to write extradata into packet side data.\n");
59 ff_cbs_fragment_reset(frag);
77 err = ff_cbs_read_packet(
ctx->input, frag,
pkt);
80 ctx->type->fragment_name);
86 ctx->type->unit_name);
91 err =
ctx->type->update_fragment(bsf,
pkt, frag);
95 err = ff_cbs_write_packet(
ctx->output,
pkt, frag);
98 ctx->type->fragment_name);
104 ff_cbs_fragment_reset(frag);
120 err = ff_cbs_init(&
ctx->input,
type->codec_id, bsf);
124 err = ff_cbs_init(&
ctx->output,
type->codec_id, bsf);
128 ctx->output->trace_enable = 1;
130 ctx->output->trace_context =
ctx->output;
131 ctx->output->trace_write_callback = ff_cbs_trace_write_log;
134 err = ff_cbs_read_extradata(
ctx->input, frag, bsf->
par_in);
140 err =
type->update_fragment(bsf,
NULL, frag);
144 err = ff_cbs_write_extradata(
ctx->output, bsf->
par_out, frag);
153 ff_cbs_fragment_reset(frag);
161 ff_cbs_fragment_free(&
ctx->fragment);
162 ff_cbs_close(&
ctx->input);
163 ff_cbs_close(&
ctx->output);
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVCodecParameters * par_in
Parameters of the input stream.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int cbs_bsf_update_side_data(AVBSFContext *bsf, AVPacket *pkt)
@ 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...
av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
The bitstream filter state.
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
AVCodecParameters * par_out
Parameters of the output stream.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Coded bitstream fragment structure, combining one or more units.
size_t data_size
The number of bytes in the bitstream.
uint8_t * data
Pointer to the bitstream form of this fragment.
av_cold int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
Initialise generic CBS BSF setup.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
void * priv_data
Opaque filter-specific private data.
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
This structure stores compressed data.
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int nb_units
Number of units in this fragment.